magneto365.ui 2.75.10 → 2.75.11

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 (47) hide show
  1. package/dist/assets/fd3c5f6d7a977109.svg +12 -0
  2. package/dist/cjs/css/magneto.ui.lib.min.css +1 -1
  3. package/dist/cjs/index.js +1087 -890
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/types/components/UI/atoms/Button/Button.interface.d.ts +9 -1
  6. package/dist/cjs/types/components/UI/atoms/HorizontalBar/HorizontalBar.component.d.ts +3 -0
  7. package/dist/cjs/types/components/UI/atoms/HorizontalBar/HorizontalBar.interfaces.d.ts +40 -0
  8. package/dist/cjs/types/components/UI/atoms/HorizontalBar/index.d.ts +1 -0
  9. package/dist/cjs/types/components/UI/atoms/index.d.ts +1 -0
  10. package/dist/cjs/types/components/UI/template/TestsFormHandler/TestsFormHandler.component.d.ts +4 -0
  11. package/dist/cjs/types/components/UI/template/TestsFormHandler/TestsFormHandler.context.d.ts +7 -0
  12. package/dist/cjs/types/components/UI/template/TestsFormHandler/TestsFormHandler.interface.d.ts +56 -0
  13. package/dist/cjs/types/components/UI/template/TestsFormHandler/TestsFormHandlerContext.interface.d.ts +14 -0
  14. package/dist/cjs/types/components/UI/template/TestsFormHandler/children/GlobalQuestion/GlobalQuestion.component.d.ts +4 -0
  15. package/dist/cjs/types/components/UI/template/TestsFormHandler/children/GlobalQuestion/GlobalQuestion.interface.d.ts +46 -0
  16. package/dist/cjs/types/components/UI/template/TestsFormHandler/children/GlobalQuestion/index.d.ts +1 -0
  17. package/dist/cjs/types/components/UI/template/TestsFormHandler/children/GlobalQuestionError/GlobalQuestionError.component.d.ts +4 -0
  18. package/dist/cjs/types/components/UI/template/TestsFormHandler/children/GlobalQuestionError/GlobalQuestionError.interface.d.ts +6 -0
  19. package/dist/cjs/types/components/UI/template/TestsFormHandler/index.d.ts +5 -0
  20. package/dist/cjs/types/components/UI/template/index.d.ts +1 -0
  21. package/dist/cjs/types/constants/icons.constants.d.ts +1 -0
  22. package/dist/cjs/types/utils/colors/getContrastColor.d.ts +1 -0
  23. package/dist/cjs/types/utils/validateAnswers/validateStepAnswers.d.ts +12 -0
  24. package/dist/esm/css/magneto.ui.lib.min.css +1 -1
  25. package/dist/esm/index.js +1083 -891
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/types/components/UI/atoms/Button/Button.interface.d.ts +9 -1
  28. package/dist/esm/types/components/UI/atoms/HorizontalBar/HorizontalBar.component.d.ts +3 -0
  29. package/dist/esm/types/components/UI/atoms/HorizontalBar/HorizontalBar.interfaces.d.ts +40 -0
  30. package/dist/esm/types/components/UI/atoms/HorizontalBar/index.d.ts +1 -0
  31. package/dist/esm/types/components/UI/atoms/index.d.ts +1 -0
  32. package/dist/esm/types/components/UI/template/TestsFormHandler/TestsFormHandler.component.d.ts +4 -0
  33. package/dist/esm/types/components/UI/template/TestsFormHandler/TestsFormHandler.context.d.ts +7 -0
  34. package/dist/esm/types/components/UI/template/TestsFormHandler/TestsFormHandler.interface.d.ts +56 -0
  35. package/dist/esm/types/components/UI/template/TestsFormHandler/TestsFormHandlerContext.interface.d.ts +14 -0
  36. package/dist/esm/types/components/UI/template/TestsFormHandler/children/GlobalQuestion/GlobalQuestion.component.d.ts +4 -0
  37. package/dist/esm/types/components/UI/template/TestsFormHandler/children/GlobalQuestion/GlobalQuestion.interface.d.ts +46 -0
  38. package/dist/esm/types/components/UI/template/TestsFormHandler/children/GlobalQuestion/index.d.ts +1 -0
  39. package/dist/esm/types/components/UI/template/TestsFormHandler/children/GlobalQuestionError/GlobalQuestionError.component.d.ts +4 -0
  40. package/dist/esm/types/components/UI/template/TestsFormHandler/children/GlobalQuestionError/GlobalQuestionError.interface.d.ts +6 -0
  41. package/dist/esm/types/components/UI/template/TestsFormHandler/index.d.ts +5 -0
  42. package/dist/esm/types/components/UI/template/index.d.ts +1 -0
  43. package/dist/esm/types/constants/icons.constants.d.ts +1 -0
  44. package/dist/esm/types/utils/colors/getContrastColor.d.ts +1 -0
  45. package/dist/esm/types/utils/validateAnswers/validateStepAnswers.d.ts +12 -0
  46. package/dist/index.d.ts +178 -2
  47. package/package.json +1 -1
@@ -8,7 +8,7 @@ export interface IButton {
8
8
  /**
9
9
  * Callback function to be executed when the save button is clicked.
10
10
  */
11
- onClick: () => void;
11
+ onClick?: () => void;
12
12
  /**
13
13
  * Button classname
14
14
  */
@@ -34,4 +34,12 @@ export interface IButton {
34
34
  * Icon size
35
35
  */
36
36
  iconSize?: number;
37
+ /**
38
+ * Button type
39
+ */
40
+ type?: 'button' | 'submit' | 'reset';
41
+ /**
42
+ * Disable the button
43
+ */
44
+ disabled?: boolean;
37
45
  }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { IHorizontalBarProps } from './HorizontalBar.interfaces';
3
+ export declare const HorizontalBar: React.FC<IHorizontalBarProps>;
@@ -0,0 +1,40 @@
1
+ export interface IClassNames {
2
+ /**
3
+ * Custom styles for the bar
4
+ */
5
+ bar?: string;
6
+ /**
7
+ * Custom styles for the fill container
8
+ */
9
+ container?: string;
10
+ /**
11
+ * Custom styles for the text description
12
+ */
13
+ text?: string;
14
+ /**
15
+ * Custom styles for the fill value within the bar
16
+ */
17
+ value?: string;
18
+ /**
19
+ * Custom styles for the fill
20
+ */
21
+ fill?: string;
22
+ }
23
+ export interface IHorizontalBarProps {
24
+ /**
25
+ * Sets the value to show within the bar
26
+ */
27
+ value: number;
28
+ /**
29
+ * Sets the text of the bar
30
+ */
31
+ text?: string;
32
+ /**
33
+ * Sets the range of the bar
34
+ */
35
+ maxPercentage?: number;
36
+ /**
37
+ * Sets custom classnames
38
+ */
39
+ classNames?: IClassNames;
40
+ }
@@ -0,0 +1 @@
1
+ export { HorizontalBar } from './HorizontalBar.component';
@@ -43,3 +43,4 @@ export * from './ToggleButton';
43
43
  export * from './Typography';
44
44
  export * from './UserMenuButtonAnalyst';
45
45
  export * from './InlineDetails';
46
+ export * from './HorizontalBar';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IFormHandler } from './TestsFormHandler.interface';
3
+ declare const TestFormHandler: React.FC<IFormHandler>;
4
+ export default TestFormHandler;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { IFormHandlerContext } from './TestsFormHandlerContext.interface';
3
+ export declare const FormHandlerProvider: React.FC<{
4
+ children: ReactNode;
5
+ }>;
6
+ export declare const useFormHandler: () => IFormHandlerContext;
7
+ export default FormHandlerProvider;
@@ -0,0 +1,56 @@
1
+ import { AnswerType } from './children/GlobalQuestion/GlobalQuestion.interface';
2
+ import { ReactNode } from 'react';
3
+ export interface ICustomButtonText {
4
+ /**
5
+ * The text to display on the previous button
6
+ */
7
+ previous: string;
8
+ /**
9
+ * The text to display on the next button
10
+ */
11
+ next: string;
12
+ /**
13
+ * The text to display on the submit button
14
+ */
15
+ finish: string;
16
+ }
17
+ export interface IFormHandler {
18
+ /**
19
+ * Determines if the form should be displayed as multiple steps
20
+ */
21
+ multiStep?: boolean;
22
+ /**
23
+ * Function to customize the submit action
24
+ */
25
+ onSubmit: (answers: {
26
+ [key: string]: AnswerType;
27
+ }) => void;
28
+ /**
29
+ * Custom classname for the form container
30
+ */
31
+ className?: string;
32
+ /**
33
+ * Enable resend the test
34
+ */
35
+ isDisabled?: boolean;
36
+ /**
37
+ * Children components to render (questions)
38
+ */
39
+ children: ReactNode;
40
+ /**
41
+ * Total number of steps for multi-step forms
42
+ */
43
+ totalSteps?: number;
44
+ /**
45
+ * Current step for multi-step forms
46
+ */
47
+ currentStep?: number;
48
+ /**
49
+ * Callback for step changes
50
+ */
51
+ onStepChange?: (step: number) => void;
52
+ /**
53
+ * Object with custom texts for the form buttons
54
+ */
55
+ customButtonText: ICustomButtonText;
56
+ }
@@ -0,0 +1,14 @@
1
+ import { AnswerType } from './children/GlobalQuestion';
2
+ export interface IFormHandlerContext {
3
+ answers: {
4
+ [key: string]: AnswerType;
5
+ };
6
+ submitted: boolean;
7
+ handleChange: (questionId: string, value: AnswerType) => void;
8
+ setSubmitted: (value: boolean) => void;
9
+ currentStepQuestions: {
10
+ [key: string]: 'single' | 'multiple' | 'text';
11
+ };
12
+ registerQuestion: (questionId: string, questionType: 'single' | 'multiple' | 'text') => void;
13
+ unregisterQuestion: (questionId: string) => void;
14
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IGlobalQuestionProps } from './GlobalQuestion.interface';
3
+ declare const GlobalQuestion: React.FC<IGlobalQuestionProps>;
4
+ export default GlobalQuestion;
@@ -0,0 +1,46 @@
1
+ export interface IGlobalQuestionProps {
2
+ /**
3
+ * The question to be displayed
4
+ */
5
+ question: IQuestion;
6
+ /**
7
+ * The text to be displayed in the error message
8
+ */
9
+ errorText: string;
10
+ /**
11
+ * Index of the question (optional, will use context if not provided)
12
+ */
13
+ idx?: number;
14
+ }
15
+ export interface IQuestion {
16
+ /**
17
+ * Unique identifier for the question
18
+ */
19
+ id: string;
20
+ /**
21
+ * The text of the question
22
+ */
23
+ text: string;
24
+ /**
25
+ * The type of the question: single, multiple, or text
26
+ */
27
+ type: 'single' | 'multiple' | 'text';
28
+ /**
29
+ * Array of options for the question, if any
30
+ */
31
+ options?: IQuestionOptions[];
32
+ }
33
+ export interface IQuestionOptions {
34
+ /**
35
+ * Unique identifier for the option
36
+ */
37
+ id: number;
38
+ /**
39
+ * The text of the option
40
+ */
41
+ label: string;
42
+ }
43
+ export declare type AnswerType = string | IQuestionOptions | IQuestionOptions[];
44
+ export interface QuestionTypeValidators {
45
+ [key: string]: (answer: AnswerType) => boolean;
46
+ }
@@ -0,0 +1 @@
1
+ export * from './GlobalQuestion.interface';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IGlobalQuestionErrorProps } from './GlobalQuestionError.interface';
3
+ declare const GlobalQuestionError: React.FC<IGlobalQuestionErrorProps>;
4
+ export default GlobalQuestionError;
@@ -0,0 +1,6 @@
1
+ export interface IGlobalQuestionErrorProps {
2
+ /**
3
+ * The text to be displayed in the error message
4
+ */
5
+ errorText: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ export * from './TestsFormHandler.interface';
2
+ export * from './children/GlobalQuestion/GlobalQuestion.interface';
3
+ export * from './TestsFormHandler.context';
4
+ export { default as TestFormHandler } from './TestsFormHandler.component';
5
+ export { default as GlobalQuestion } from './children/GlobalQuestion/GlobalQuestion.component';
@@ -10,3 +10,4 @@ export * from './MegaMenu';
10
10
  export * from './SideFilter';
11
11
  export * from './SortBar';
12
12
  export * from './VacantPositionsTemplate';
13
+ export * from './TestsFormHandler';
@@ -192,5 +192,6 @@ export { default as WhatsAppDark } from '../assets/Whatsapp.svg';
192
192
  export { default as X } from '../assets/X.svg';
193
193
  export { default as Youtube } from '../assets/Youtube.svg';
194
194
  export { default as YoutubeSolid } from '../assets/YoutubeSolid.svg';
195
+ export { default as InfoRed } from '../assets/info-circle-red.svg';
195
196
  export { default as AdvertisementOutline } from '../assets/advertisement.svg';
196
197
  export { default as AdvertisementBold } from '../assets/advertisementBold.svg';
@@ -0,0 +1 @@
1
+ export declare const getContrastColor: (hexColor: string) => "#000000" | "#ffffff";
@@ -0,0 +1,12 @@
1
+ import { AnswerType, IQuestion } from '@components/UI/template';
2
+ export declare const validateCurrentStepAnswers: (currentStepQuestions: {
3
+ [key: string]: "text" | "multiple" | "single";
4
+ }, answers: {
5
+ [key: string]: AnswerType;
6
+ }) => boolean;
7
+ export declare const questionTypeValidators: {
8
+ multiple: (answer: AnswerType) => boolean;
9
+ single: (answer: AnswerType) => boolean;
10
+ text: (answer: AnswerType) => boolean;
11
+ };
12
+ export declare const isMissingValidator: (answer: AnswerType, question: IQuestion) => boolean;