@arquimedes.co/eureka-forms 3.0.0-refactor → 3.0.1-refactor

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.
Files changed (188) hide show
  1. package/dist/@Types/@Types.d.ts +2 -0
  2. package/dist/@Types/AYFFormStep.d.ts +19 -0
  3. package/dist/@Types/Branding.d.ts +13 -0
  4. package/dist/@Types/CBRFormStep.d.ts +74 -0
  5. package/dist/@Types/Condition.d.ts +143 -0
  6. package/dist/@Types/Draft/Draft.d.ts +12 -0
  7. package/dist/@Types/Draft/DraftEntityData.d.ts +54 -0
  8. package/dist/@Types/Entity.d.ts +36 -0
  9. package/dist/@Types/Form.d.ts +75 -0
  10. package/dist/@Types/FormStep.d.ts +219 -0
  11. package/dist/@Types/GenericFormSteps.d.ts +84 -0
  12. package/dist/@Types/MapperElement.d.ts +8 -0
  13. package/dist/@Types/Organization.d.ts +11 -0
  14. package/dist/@Types/Time.d.ts +6 -0
  15. package/dist/@Types/index.d.ts +1 -0
  16. package/dist/App/App.d.ts +57 -0
  17. package/dist/App/AppFunctions.d.ts +23 -0
  18. package/dist/App/AppFunctions.test.d.ts +1 -0
  19. package/dist/App/AppHooks.d.ts +10 -0
  20. package/dist/App/AppHooks.test.d.ts +1 -0
  21. package/dist/Contexts/CustomContext.d.ts +11 -0
  22. package/dist/Contexts/FormContext.d.ts +6 -0
  23. package/dist/Contexts/SectionContext.d.ts +2 -0
  24. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +11 -0
  25. package/dist/Form/Form.d.ts +39 -0
  26. package/dist/Form/FormFunctions.d.ts +12 -0
  27. package/dist/Form/FormFunctions.test.d.ts +1 -0
  28. package/dist/Form/FormHooks.d.ts +2 -0
  29. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +3 -0
  30. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +3 -0
  31. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +3 -0
  32. package/dist/Form/Section/Section.d.ts +5 -0
  33. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +3 -0
  34. package/dist/Form/Terms/Term/Term.d.ts +7 -0
  35. package/dist/Form/Terms/Terms.d.ts +2 -0
  36. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +7 -0
  37. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +8 -0
  38. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +7 -0
  39. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +10 -0
  40. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +7 -0
  41. package/dist/FormSteps/AYFStepMapper.d.ts +11 -0
  42. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +14 -0
  43. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +3 -0
  44. package/dist/FormSteps/CBRStepMapper.d.ts +12 -0
  45. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +8 -0
  46. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +3 -0
  47. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +8 -0
  48. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +3 -0
  49. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +8 -0
  50. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +3 -0
  51. package/dist/FormSteps/CustomStep.d.ts +26 -0
  52. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +10 -0
  53. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +3 -0
  54. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +14 -0
  55. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +11 -0
  56. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +3 -0
  57. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +8 -0
  58. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +13 -0
  59. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
  60. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +16 -0
  61. package/dist/FormSteps/MapperStep/MapperStep.d.ts +17 -0
  62. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +4 -0
  63. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.d.ts +15 -0
  64. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +4 -0
  65. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +4 -0
  66. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +20 -0
  67. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +3 -0
  68. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +10 -0
  69. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +3 -0
  70. package/dist/FormSteps/RatingStep/RatingStep.d.ts +8 -0
  71. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +3 -0
  72. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +8 -0
  73. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +3 -0
  74. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +8 -0
  75. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +4 -0
  76. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +35 -0
  77. package/dist/FormSteps/Step.d.ts +7 -0
  78. package/dist/FormSteps/StepFunctions.d.ts +27 -0
  79. package/dist/FormSteps/StepFunctions.test.d.ts +1 -0
  80. package/dist/FormSteps/StepHooks.d.ts +109 -0
  81. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +9 -0
  82. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +7 -0
  83. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +9 -0
  84. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +3 -0
  85. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +16 -0
  86. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +3 -0
  87. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +11 -0
  88. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +3 -0
  89. package/dist/FormSteps/TitleStep/TitleStep.d.ts +8 -0
  90. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +9 -0
  91. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +11 -0
  92. package/dist/Icons/@IconTypes.d.ts +6 -0
  93. package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
  94. package/dist/Icons/ArrowRightIcon.d.ts +3 -0
  95. package/dist/Icons/CalendarIcon.d.ts +3 -0
  96. package/dist/Icons/CheckCircleIcon.d.ts +3 -0
  97. package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
  98. package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
  99. package/dist/Icons/ClockIcon.d.ts +3 -0
  100. package/dist/Icons/CloseIcon.d.ts +3 -0
  101. package/dist/Icons/Construction/LeakIcon.d.ts +3 -0
  102. package/dist/Icons/Construction/ProjectIcon.d.ts +3 -0
  103. package/dist/Icons/Construction/PropertyIcon.d.ts +3 -0
  104. package/dist/Icons/Construction/SpaceIcon.d.ts +3 -0
  105. package/dist/Icons/DeleteIcon.d.ts +3 -0
  106. package/dist/Icons/DocumentIcon.d.ts +3 -0
  107. package/dist/Icons/Entities/CheckListIcon.d.ts +3 -0
  108. package/dist/Icons/Entities/GenericEntityIcon.d.ts +3 -0
  109. package/dist/Icons/Entities/HandshakeIcon.d.ts +3 -0
  110. package/dist/Icons/Entities/SupplierIcon.d.ts +3 -0
  111. package/dist/Icons/ErrorIcon.d.ts +3 -0
  112. package/dist/Icons/ExpandLessIcon.d.ts +3 -0
  113. package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
  114. package/dist/Icons/FileIcon.d.ts +3 -0
  115. package/dist/Icons/InfoIcon.d.ts +3 -0
  116. package/dist/Icons/LocationIcon.d.ts +3 -0
  117. package/dist/Icons/PersonIcon.d.ts +3 -0
  118. package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
  119. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
  120. package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
  121. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
  122. package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
  123. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
  124. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
  125. package/dist/Icons/WarningIcon.d.ts +3 -0
  126. package/dist/Init.d.ts +1 -0
  127. package/dist/Services/FileService.d.ts +5 -0
  128. package/dist/Services/FormService.d.ts +5 -0
  129. package/dist/Services/OrganizationService.d.ts +2 -0
  130. package/dist/Shared/CustomBtn/CustomBtn.d.ts +17 -0
  131. package/dist/Shared/ErkButton/ErkButton.d.ts +31 -0
  132. package/dist/Shared/ErkButton/ErkButton.stories.d.ts +23 -0
  133. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
  134. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +16 -0
  135. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +16 -0
  136. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
  137. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +16 -0
  138. package/dist/Shared/ErkSelect/ErkSelect.d.ts +39 -0
  139. package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +18 -0
  140. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
  141. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.d.ts +26 -0
  142. package/dist/Shared/ErkTextField/ErkTextField.d.ts +26 -0
  143. package/dist/Shared/ErkTextField/ErkTextField.stories.d.ts +24 -0
  144. package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +31 -0
  145. package/dist/Shared/InputIcon/InputIcon.d.ts +7 -0
  146. package/dist/Shared/Loader/Loader.d.ts +17 -0
  147. package/dist/Shared/Navbar/Navbar.d.ts +8 -0
  148. package/dist/Shared/Navbar/Navbar.stories.d.ts +13 -0
  149. package/dist/Shared/Rating/Rating.d.ts +13 -0
  150. package/dist/Shared/Rating/Rating.stories.d.ts +15 -0
  151. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +3 -0
  152. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +3 -0
  153. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +3 -0
  154. package/dist/Shared/Toggle/Toggle.d.ts +8 -0
  155. package/dist/States/GlobalSlice.d.ts +46 -0
  156. package/dist/States/SiteSlice.d.ts +77 -0
  157. package/dist/States/WidthStatsSlice.d.ts +7 -0
  158. package/dist/Utils/AxiosAPI.d.ts +2 -0
  159. package/dist/Utils/AxiosWidget.d.ts +2 -0
  160. package/dist/Utils/CBRFunctions.d.ts +8 -0
  161. package/dist/Utils/DraftFunctions.d.ts +56 -0
  162. package/dist/Utils/FormStepFunctions.d.ts +15 -0
  163. package/dist/Utils/LocaleUtils.d.ts +2 -0
  164. package/dist/Utils/MaterialProviders.d.ts +25 -0
  165. package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
  166. package/dist/Utils/PhoneFunctions.d.ts +2 -0
  167. package/dist/Utils/TestUtils.d.ts +70 -0
  168. package/dist/Utils/store.d.ts +29 -0
  169. package/dist/Widget.d.ts +1 -0
  170. package/dist/__tests__/setup.d.ts +1 -0
  171. package/dist/constants/AYFFormStepTypes.d.ts +9 -0
  172. package/dist/constants/CBRFormStepTypes.d.ts +21 -0
  173. package/dist/constants/ConditionTypes.d.ts +27 -0
  174. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +11 -0
  175. package/dist/constants/Draft/DraftEntityTypes.d.ts +3 -0
  176. package/dist/constants/Draft/DraftStyleTypes.d.ts +7 -0
  177. package/dist/constants/EntityPropertyTypes.d.ts +10 -0
  178. package/dist/constants/Files/FileExtensions.d.ts +3 -0
  179. package/dist/constants/Files/FileMaxSize.d.ts +2 -0
  180. package/dist/constants/FormStepTypes.d.ts +64 -0
  181. package/dist/constants/IconTypes.d.ts +15 -0
  182. package/dist/constants/InternalFormStyle.d.ts +3 -0
  183. package/dist/constants/TicketPropertyTypes.d.ts +3 -0
  184. package/dist/hooks.d.ts +7 -0
  185. package/dist/index.lib.d.ts +7 -0
  186. package/dist/main.d.ts +2 -0
  187. package/dist/main.js +1 -1
  188. package/package.json +2 -2
package/dist/Init.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function getUploadUrls(files: File[], idOrganization?: string): Promise<(Record<string, any> | string)[]>;
2
+ export declare function postFile(file: File, postInfo: Record<string, any>): Promise<{
3
+ fileName: string;
4
+ S3Key: string;
5
+ }>;
@@ -0,0 +1,5 @@
1
+ import { Form } from '../@Types';
2
+ import { Branding } from '../@Types/Branding';
3
+ export declare function fetchForm(apiKey: string, idOrganization?: string): Promise<(Form & {
4
+ branding?: Branding;
5
+ }) | null>;
@@ -0,0 +1,2 @@
1
+ import { Organization } from '../@Types';
2
+ export declare function fetchOrganization(idOrganization?: string): Promise<Organization | null>;
@@ -0,0 +1,17 @@
1
+ interface CustomBtnProps {
2
+ label?: string;
3
+ 'data-testid'?: string;
4
+ onClick?: React.MouseEventHandler<HTMLButtonElement> | (() => Promise<void>);
5
+ backgroundColor?: string;
6
+ color?: string;
7
+ height?: string;
8
+ width?: string;
9
+ disabled?: boolean;
10
+ loading?: boolean;
11
+ children?: React.ReactNode;
12
+ padding?: string;
13
+ borderRadius?: string;
14
+ contentMargin?: string;
15
+ }
16
+ declare function CustomBtn({ label, onClick, backgroundColor, color, loading, disabled, height, width, padding, borderRadius, contentMargin, children, ...others }: CustomBtnProps): JSX.Element;
17
+ export default CustomBtn;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { ButtonProps as MuiButtonProps } from '@mui/material';
3
+ interface ButtonProps extends Omit<MuiButtonProps, 'color'> {
4
+ /** Button text */
5
+ text: string;
6
+ /** Background Color */
7
+ backgroundColor?: string;
8
+ /** Font Color */
9
+ color?: string;
10
+ /** Button Click Handle */
11
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
12
+ /** If button is disabled */
13
+ disabled?: boolean;
14
+ /** Text font size */
15
+ fontSize?: number | string;
16
+ /** Button padding '0 13px 0 13px' format */
17
+ padding?: string;
18
+ /** border radius */
19
+ borderRadius?: number;
20
+ /** Component height */
21
+ height?: number;
22
+ /** If text is bold */
23
+ bold?: boolean;
24
+ /** The width of the button */
25
+ width?: string;
26
+ }
27
+ /**
28
+ * Generic capta button
29
+ */
30
+ declare function ErkButton({ text, color, ...props }: ButtonProps): JSX.Element;
31
+ export default ErkButton;
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ErkButton from './ErkButton';
3
+ declare const meta: {
4
+ component: typeof ErkButton;
5
+ tags: string[];
6
+ args: {
7
+ text: string;
8
+ backgroundColor: string;
9
+ color: string;
10
+ disabled: false;
11
+ fontSize: string;
12
+ padding: string;
13
+ borderRadius: number;
14
+ height: number;
15
+ bold: false;
16
+ width: string;
17
+ };
18
+ };
19
+ export default meta;
20
+ type Story = StoryObj<typeof meta>;
21
+ export declare const Default: Story;
22
+ export declare const Disabled: Story;
23
+ export declare const DifferentColors: Story;
@@ -0,0 +1,19 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import { CheckboxProps as MuiCheckboxProps } from '@mui/material';
3
+ interface StyleProps {
4
+ size?: CSSProperties['fontSize'];
5
+ padding?: string;
6
+ error?: number;
7
+ }
8
+ interface ErkCheckboxProps extends Omit<StyleProps, 'error'>, Omit<MuiCheckboxProps, 'size' | 'onChange'> {
9
+ onChange?: (checked: boolean) => void;
10
+ checked: boolean;
11
+ error?: boolean;
12
+ }
13
+ /**
14
+ * Generic datepicker with apps designs. Is class due to the use in the react-hook-forms library
15
+ */
16
+ declare class ErkCheckbox extends React.Component<ErkCheckboxProps> {
17
+ render(): JSX.Element;
18
+ }
19
+ export default ErkCheckbox;
@@ -0,0 +1,16 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ErkCheckBox from './ErkCheckBox';
3
+ declare const meta: {
4
+ component: typeof ErkCheckBox;
5
+ tags: string[];
6
+ args: {
7
+ size: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Uncheked: Story;
13
+ export declare const Checked: Story;
14
+ export declare const Error: Story;
15
+ export declare const Disabled: Story;
16
+ export declare const ErrorColor: Story;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { MobileDatePickerProps as MuiDatePickerProps, PickerValidDate } from '@mui/x-date-pickers';
3
+ import { ErkTextFieldProps } from '../ErkTextField/ErkTextField';
4
+ interface ErkDatePickerProps extends Omit<MuiDatePickerProps<PickerValidDate>, 'ref' | 'onChange'>, Pick<ErkTextFieldProps, 'error' | 'required' | 'helperText'> {
5
+ onChange?: (date: Date | null) => void;
6
+ /** If it should display the timePicker */
7
+ pickTime?: boolean;
8
+ inputRef?: React.Ref<HTMLInputElement>;
9
+ }
10
+ /**
11
+ * Generic datepicker with apps designs. Is class due to the use in the react-hook-forms library
12
+ */
13
+ declare class ErkDatePicker extends React.Component<ErkDatePickerProps> {
14
+ render(): JSX.Element;
15
+ }
16
+ export default ErkDatePicker;
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ErkDatePicker from './ErkDatePicker';
3
+ declare const meta: {
4
+ component: typeof ErkDatePicker;
5
+ tags: string[];
6
+ args: {
7
+ readOnly: false;
8
+ };
9
+ parameters: {
10
+ date: Date;
11
+ };
12
+ };
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+ export declare const Empty: Story;
16
+ export declare const Default: Story;
17
+ export declare const ValueAndLabel: Story;
18
+ export declare const Full: Story;
19
+ export declare const FullDateTime: Story;
20
+ export declare const Error: Story;
21
+ export declare const Menu: Story;
22
+ export declare const DateTimeDateMenu: Story;
23
+ export declare const DateTimeTimeMenu: Story;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
3
+ interface ErkPhoneInputProps {
4
+ /** The value of the phoneinput */
5
+ value?: string;
6
+ onChange: (value: string) => void;
7
+ inputRef?: any;
8
+ readOnly?: boolean;
9
+ }
10
+ /**
11
+ * Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
12
+ */
13
+ declare class ErkPhoneInput extends React.Component<ErkPhoneInputProps & Omit<MuiTextFieldProps, 'onChange'>> {
14
+ render(): JSX.Element;
15
+ }
16
+ export default ErkPhoneInput;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { SelectProps as MuiSelectProps } from '@mui/material';
3
+ export interface SelectorStyleProps {
4
+ /** If input is readOnly */
5
+ readOnly?: boolean;
6
+ }
7
+ export declare const StyledSelect: import("@emotion/styled").StyledComponent<MuiSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const StyledInputLabel: import("@emotion/styled").StyledComponent<import("@mui/material").InputLabelOwnProps & Pick<import("@mui/material").FormLabelOwnProps, "color" | "filled"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
9
+ ref?: ((instance: HTMLLabelElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLLabelElement> | null | undefined;
10
+ }, "required" | "size" | "color" | "children" | "className" | "style" | "classes" | "disabled" | "error" | "margin" | "sx" | "filled" | "variant" | "focused" | "disableAnimation" | "shrink"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
+ component?: React.ElementType;
12
+ } & {
13
+ open: boolean;
14
+ }, {}, {}>;
15
+ export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("@mui/material").FormHelperTextOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
16
+ ref?: ((instance: HTMLParagraphElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLParagraphElement> | null | undefined;
17
+ }, "required" | "children" | "className" | "style" | "classes" | "disabled" | "error" | "margin" | "sx" | "filled" | "variant" | "focused"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
18
+ component?: React.ElementType;
19
+ }, {}, {}>;
20
+ interface ErkSelectProps extends Omit<MuiSelectProps, 'color' | 'onChange'>, SelectorStyleProps {
21
+ /** children to display in the options */
22
+ children?: React.ReactNode;
23
+ /** Currently selected value */
24
+ value?: any;
25
+ onChange?: (value: any) => void;
26
+ /** String to place in the label */
27
+ label?: string;
28
+ /** The helper Text to display */
29
+ helperText?: string;
30
+ /** the components ref */
31
+ ref?: React.Ref<HTMLInputElement>;
32
+ }
33
+ /**
34
+ * Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
35
+ */
36
+ declare class ErkSelect extends React.Component<ErkSelectProps> {
37
+ render(): JSX.Element;
38
+ }
39
+ export default ErkSelect;
@@ -0,0 +1,18 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ErkSelect from './ErkSelect';
3
+ declare const meta: {
4
+ component: typeof ErkSelect;
5
+ tags: string[];
6
+ args: {
7
+ readOnly: false;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Empty: Story;
13
+ export declare const Default: Story;
14
+ export declare const ValueAndLabel: Story;
15
+ export declare const Full: Story;
16
+ export declare const Error: Story;
17
+ export declare const ErrorColor: Story;
18
+ export declare const DifferentColors: Story;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { SelectProps as MuiSelectProps } from '@mui/material';
3
+ export interface ErkSmartSelectProps extends Omit<MuiSelectProps, 'ref' | 'onInvalid'> {
4
+ /** Currently selected value */
5
+ value?: any;
6
+ /** The array of options to display */
7
+ options?: any[];
8
+ /** If the input is loading */
9
+ loading?: boolean;
10
+ /** function called when value changes */
11
+ onChange?: (value: any) => void;
12
+ /** Strig to place in the label */
13
+ label: string;
14
+ /** The helper Text to display */
15
+ helperText?: string;
16
+ /** The icon to display */
17
+ IconComponent?: React.ElementType;
18
+ /** If the options are searchable */
19
+ searchable?: boolean;
20
+ /** Function to determine the currently selected option */
21
+ getOptionSelected?: (option: any, value: any) => boolean;
22
+ /** Function to determine the current value in string format */
23
+ getValueString?: (value: any) => string;
24
+ /** If input is readOnly */
25
+ readOnly?: boolean;
26
+ onFocus?: React.FocusEventHandler;
27
+ }
28
+ export default function ErkSmartSelect({ options, value, onChange, label, getValueString, loading, getOptionSelected, IconComponent, disabled, readOnly, searchable, inputRef, ...others }: ErkSmartSelectProps): JSX.Element;
@@ -0,0 +1,26 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ErkSmartSelect from './ErkSmartSelect';
3
+ declare const meta: {
4
+ component: typeof ErkSmartSelect;
5
+ tags: string[];
6
+ args: {
7
+ searchable: false;
8
+ readOnly: false;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Empty: Story;
14
+ export declare const Default: Story;
15
+ export declare const Focused: Story;
16
+ export declare const FocusedSearchable: Story;
17
+ export declare const SearchableWithOptions: Story;
18
+ export declare const SearchableWithSearchAndOptions: Story;
19
+ export declare const Loading: Story;
20
+ export declare const LoadingOpened: Story;
21
+ export declare const SearchableLoadingOpened: Story;
22
+ export declare const WithValueandLabel: Story;
23
+ export declare const Full: Story;
24
+ export declare const Error: Story;
25
+ export declare const ErrorColor: Story;
26
+ export declare const DifferentColors: Story;
@@ -0,0 +1,26 @@
1
+ import { OutlinedTextFieldProps as MuiTextFieldProps } from '@mui/material';
2
+ import React, { CSSProperties } from 'react';
3
+ interface StyleProps {
4
+ padding?: CSSProperties['padding'];
5
+ readOnly?: boolean;
6
+ }
7
+ export declare const StyledTextField: import("@emotion/styled").StyledComponent<{
8
+ variant?: import("@mui/material").TextFieldVariants | undefined;
9
+ } & Omit<import("@mui/material").FilledTextFieldProps | MuiTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & Omit<ErkTextFieldProps, "onChange"> & StyleProps, {}, {}>;
10
+ export type ErkTextFieldSlotProps = Omit<ErkTextFieldProps, 'value' | 'onChange'>;
11
+ export interface ErkTextFieldProps extends Omit<MuiTextFieldProps, 'variant' | 'onChange'>, StyleProps {
12
+ /** The value of the textfield */
13
+ value?: string;
14
+ onChange?: (value: string) => void;
15
+ /** The icon to display */
16
+ IconComponent?: React.ElementType;
17
+ /** The max length of the string */
18
+ maxLength?: number;
19
+ }
20
+ /**
21
+ * Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
22
+ */
23
+ declare class ErkTextField extends React.Component<ErkTextFieldProps> {
24
+ render(): JSX.Element;
25
+ }
26
+ export default ErkTextField;
@@ -0,0 +1,24 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import ErkTextField from './ErkTextField';
3
+ declare const meta: {
4
+ component: typeof ErkTextField;
5
+ tags: string[];
6
+ args: {
7
+ disabled: false;
8
+ multiline: false;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Empty: Story;
14
+ export declare const EmptyLabel: Story;
15
+ export declare const Default: Story;
16
+ export declare const Focused: Story;
17
+ export declare const FocusedNoLabel: Story;
18
+ export declare const WithValue: Story;
19
+ export declare const Multiline: Story;
20
+ export declare const WithHelperText: Story;
21
+ export declare const WithValueandLabel: Story;
22
+ export declare const WithMaxLength: Story;
23
+ export declare const Full: Story;
24
+ export declare const Error: Story;
@@ -0,0 +1,31 @@
1
+ import { SelectorStyleProps } from '../ErkSelect/ErkSelect';
2
+ import { Time } from '../../@Types/Time';
3
+ import { SelectProps as MuiSelectProps } from '@mui/material';
4
+ import React from 'react';
5
+ interface ErkTimePickerProps extends Omit<MuiSelectProps, 'color' | 'onChange'>, SelectorStyleProps {
6
+ /** Currently selected value */
7
+ value: Time | undefined;
8
+ /** function called when value changes */
9
+ onChange?: (time: Time) => void;
10
+ /** Strig to place in the label */
11
+ label: string;
12
+ /** The helper Text to display */
13
+ helperText?: string | null;
14
+ pickDays?: boolean;
15
+ minDays?: number;
16
+ maxDays?: number;
17
+ pickHours?: boolean;
18
+ minHours?: number;
19
+ maxHours?: number;
20
+ pickMinutes?: boolean;
21
+ minMinutes?: number;
22
+ maxMinutes?: number;
23
+ working?: boolean;
24
+ }
25
+ /**
26
+ * Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
27
+ */
28
+ declare class ErkTimePicker extends React.Component<ErkTimePickerProps> {
29
+ render(): JSX.Element;
30
+ }
31
+ export default ErkTimePicker;
@@ -0,0 +1,7 @@
1
+ import IconTypes from '../../constants/IconTypes';
2
+ export interface InputIconProps {
3
+ icon: IconTypes;
4
+ fill?: string;
5
+ }
6
+ declare function InputIcon({ icon, fill, ...others }: InputIconProps): JSX.Element;
7
+ export default InputIcon;
@@ -0,0 +1,17 @@
1
+ interface LoaderProps {
2
+ /** The color of the loader */
3
+ color?: string;
4
+ /** If the loader should show a curtain behind it */
5
+ curtain?: boolean;
6
+ /** The zIndex of the loader */
7
+ zIndex?: number;
8
+ /** The size of the loader */
9
+ size?: number;
10
+ /** The position of the loader */
11
+ position?: any;
12
+ }
13
+ /**
14
+ * Generic Loader Component with optional curtain.
15
+ */
16
+ declare function Loader({ color, curtain, zIndex, size, position, }: LoaderProps): JSX.Element;
17
+ export default Loader;
@@ -0,0 +1,8 @@
1
+ interface NavBarProps {
2
+ /** Url of the current logo of the current organization */
3
+ logo?: string;
4
+ /** The color of the navbar */
5
+ color?: string;
6
+ }
7
+ declare function Navbar({ logo, color }: NavBarProps): JSX.Element;
8
+ export default Navbar;
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import Navbar from './Navbar';
3
+ declare const meta: {
4
+ component: typeof Navbar;
5
+ tags: string[];
6
+ args: {
7
+ logo: string;
8
+ color: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
@@ -0,0 +1,13 @@
1
+ import { RefCallBack } from 'react-hook-form';
2
+ import { RatingTypes } from '../../constants/FormStepTypes';
3
+ export interface RatingProps {
4
+ disabled?: boolean;
5
+ isMobile?: boolean;
6
+ value?: number | null;
7
+ onChange: (value: number | null) => void;
8
+ inputRef?: React.RefObject<HTMLInputElement> | RefCallBack;
9
+ }
10
+ declare function Rating({ type, ...others }: RatingProps & {
11
+ type: RatingTypes;
12
+ }): JSX.Element;
13
+ export default Rating;
@@ -0,0 +1,15 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import Rating from './Rating';
3
+ declare const meta: {
4
+ component: typeof Rating;
5
+ tags: string[];
6
+ args: {};
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const ScaleRating: Story;
11
+ export declare const ScaleRatingWidthValue: Story;
12
+ export declare const LikeRating: Story;
13
+ export declare const LikeRatingWithValue: Story;
14
+ export declare const SatisfactionRating: Story;
15
+ export declare const SatisfactionRatingWidthValue: Story;
@@ -0,0 +1,3 @@
1
+ import { RatingProps } from '../Rating';
2
+ declare function LikeRating({ disabled, inputRef, value, onChange }: RatingProps): JSX.Element;
3
+ export default LikeRating;
@@ -0,0 +1,3 @@
1
+ import { RatingProps } from '../Rating';
2
+ declare function SatisfactionRating({ value, inputRef, disabled, onChange }: RatingProps): JSX.Element;
3
+ export default SatisfactionRating;
@@ -0,0 +1,3 @@
1
+ import { RatingProps } from '../Rating';
2
+ declare function ScaleRating({ value, inputRef, disabled, onChange, isMobile }: RatingProps): JSX.Element;
3
+ export default ScaleRating;
@@ -0,0 +1,8 @@
1
+ interface ToggleProps {
2
+ checked: boolean;
3
+ onChange: (checked: boolean) => void;
4
+ /** If the Toggle is disabled */
5
+ disabled?: boolean;
6
+ }
7
+ declare function Toggle({ checked, onChange }: ToggleProps): JSX.Element;
8
+ export default Toggle;
@@ -0,0 +1,46 @@
1
+ import { FormStyle } from '../@Types/Form';
2
+ import type { PayloadAction } from '@reduxjs/toolkit';
3
+ import { SiteState } from './SiteSlice';
4
+ import { EurekaDraft } from '../@Types/Draft/Draft';
5
+ import { CountryCode } from 'libphonenumber-js';
6
+ export interface GlobalState {
7
+ idOrganization: string;
8
+ countryCode: CountryCode;
9
+ formStyle: FormStyle;
10
+ confirmation: {
11
+ confirmationMessage: EurekaDraft;
12
+ showLink: boolean;
13
+ };
14
+ /** If the formsteps can be edited (For internal) */
15
+ editable: boolean;
16
+ preview: boolean;
17
+ postview: boolean;
18
+ partial: boolean;
19
+ internal: boolean;
20
+ loaded: boolean;
21
+ }
22
+ export declare const GlobalSlice: import("@reduxjs/toolkit").Slice<GlobalState, {
23
+ reset: (state: import("immer").WritableDraft<GlobalState>, action: PayloadAction<Omit<GlobalState, "loaded"> & SiteState>) => {
24
+ loaded: true;
25
+ editable: boolean;
26
+ partial: boolean;
27
+ formStyle: FormStyle;
28
+ postview: boolean;
29
+ preview: boolean;
30
+ idOrganization: string;
31
+ countryCode: CountryCode;
32
+ confirmation: {
33
+ confirmationMessage: EurekaDraft;
34
+ showLink: boolean;
35
+ };
36
+ internal: boolean;
37
+ dependencies: import("../Form/Form").DependencyStore;
38
+ values: import("./SiteSlice").ValuesStore;
39
+ idCurrentSection: string | null;
40
+ previousSections: string[];
41
+ nextSections: string[];
42
+ focusStep?: string;
43
+ };
44
+ }, "global", "global", import("@reduxjs/toolkit").SliceSelectors<GlobalState>>;
45
+ export declare const reset: import("@reduxjs/toolkit").ActionCreatorWithPayload<Omit<GlobalState, "loaded"> & SiteState, "global/reset">;
46
+ export default GlobalSlice;
@@ -0,0 +1,77 @@
1
+ import { DependencyStore, StepDependency } from '../Form/Form';
2
+ import { GBaseStep } from '../@Types/GenericFormSteps';
3
+ import { FormStep } from '../@Types/FormStep';
4
+ import { CustomStep } from '../FormSteps/CustomStep';
5
+ import { CBRFormStep } from '../@Types/CBRFormStep';
6
+ import type { PayloadAction } from '@reduxjs/toolkit';
7
+ import { FieldValues } from 'react-hook-form';
8
+ import { Form } from '../@Types';
9
+ export interface SiteState {
10
+ dependencies: DependencyStore;
11
+ values: ValuesStore;
12
+ idCurrentSection: string | null;
13
+ previousSections: string[];
14
+ nextSections: string[];
15
+ focusStep?: string;
16
+ }
17
+ export interface ValuesStore {
18
+ global: Record<string, any>;
19
+ sections: Record<string, Record<string, any>>;
20
+ }
21
+ export declare const SiteSlice: import("@reduxjs/toolkit").Slice<SiteState, {
22
+ setStepDependency: (state: import("immer").WritableDraft<SiteState>, { payload: { step: { id, type, idSection }, value, }, }: PayloadAction<{
23
+ step: GBaseStep;
24
+ value: StepDependency["value"];
25
+ }>) => void;
26
+ clearDependency: (state: import("immer").WritableDraft<SiteState>, { payload: { id, idSection } }: PayloadAction<GBaseStep>) => void;
27
+ setEmptyDependency: (state: import("immer").WritableDraft<SiteState>, { payload: { step: { id }, empty, }, }: PayloadAction<{
28
+ step: GBaseStep;
29
+ empty: StepDependency["empty"];
30
+ }>) => void;
31
+ addStepsDependencies: (state: import("immer").WritableDraft<SiteState>, { payload: { steps, customSteps, allSteps }, }: PayloadAction<{
32
+ steps: Record<string, FormStep | CBRFormStep>;
33
+ customSteps: Record<string, CustomStep>;
34
+ allSteps: Record<string, FormStep | CBRFormStep>;
35
+ }>) => void;
36
+ handlePrevious: (state: import("immer").WritableDraft<SiteState>, { payload: { values, form } }: PayloadAction<{
37
+ values: Record<string, any>;
38
+ form: Form;
39
+ }>) => void;
40
+ handleNext: (state: import("immer").WritableDraft<SiteState>, { payload: { values, form } }: PayloadAction<{
41
+ values: Record<string, any>;
42
+ form: Form;
43
+ }>) => void;
44
+ updateNestedValues: (state: import("immer").WritableDraft<SiteState>, { payload: { key, values } }: PayloadAction<{
45
+ key: string;
46
+ values: Record<string, any>;
47
+ }>) => void;
48
+ focusStep: (state: import("immer").WritableDraft<SiteState>, { payload }: PayloadAction<{
49
+ step: FormStep;
50
+ values: FieldValues;
51
+ } | undefined>) => void;
52
+ }, "site", "site", import("@reduxjs/toolkit").SliceSelectors<SiteState>>;
53
+ export declare const focusStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<{
54
+ step: FormStep;
55
+ values: FieldValues;
56
+ } | undefined, "site/focusStep">, clearDependency: import("@reduxjs/toolkit").ActionCreatorWithPayload<GBaseStep, "site/clearDependency">, setStepDependency: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
57
+ step: GBaseStep;
58
+ value: StepDependency["value"];
59
+ }, "site/setStepDependency">, addStepsDependencies: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
60
+ steps: Record<string, FormStep | CBRFormStep>;
61
+ customSteps: Record<string, CustomStep>;
62
+ allSteps: Record<string, FormStep | CBRFormStep>;
63
+ }, "site/addStepsDependencies">, setEmptyDependency: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
64
+ step: GBaseStep;
65
+ empty: StepDependency["empty"];
66
+ }, "site/setEmptyDependency">, handlePrevious: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
67
+ values: Record<string, any>;
68
+ form: Form;
69
+ }, "site/handlePrevious">, handleNext: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
70
+ values: Record<string, any>;
71
+ form: Form;
72
+ }, "site/handleNext">, updateNestedValues: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
73
+ key: string;
74
+ values: Record<string, any>;
75
+ }, "site/updateNestedValues">;
76
+ export default SiteSlice;
77
+ export declare function addPagedValues(steps: Record<string, FormStep>, values: Record<string, any>, original: Record<string, any>, path?: string): void;
@@ -0,0 +1,7 @@
1
+ import { WidthStats } from '../Form/Form';
2
+ import type { PayloadAction } from '@reduxjs/toolkit';
3
+ export declare const WidthStatsSlice: import("@reduxjs/toolkit").Slice<WidthStats, {
4
+ updateWidthStats: (state: import("immer").WritableDraft<WidthStats>, { payload }: PayloadAction<WidthStats>) => WidthStats;
5
+ }, "widthStats", "widthStats", import("@reduxjs/toolkit").SliceSelectors<WidthStats>>;
6
+ export declare const updateWidthStats: import("@reduxjs/toolkit").ActionCreatorWithPayload<WidthStats, "widthStats/updateWidthStats">;
7
+ export default WidthStatsSlice;
@@ -0,0 +1,2 @@
1
+ declare const axiosInstance: import("axios").AxiosInstance;
2
+ export default axiosInstance;
@@ -0,0 +1,2 @@
1
+ declare const widgetInstance: import("axios").AxiosInstance;
2
+ export default widgetInstance;