@xqmsg/ui-core 0.23.2 → 0.24.0
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/LICENSE +20 -20
- package/README.md +40 -40
- package/dist/{78c9d6fd7766410f.svg → 89793640b494d7ea.svg} +9 -9
- package/dist/components/input/InputTypes.d.ts +1 -1
- package/dist/components/input/index.d.ts +3 -3
- package/dist/components/select/index.d.ts +6 -5
- package/dist/components/text/index.d.ts +2 -2
- package/dist/ui-core.cjs.development.js +12 -19
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +12 -19
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +118 -118
- package/src/components/banner/Banner.stories.tsx +100 -100
- package/src/components/banner/index.tsx +75 -73
- package/src/components/breadcrumbs/Breadcrumbs.stories.tsx +66 -66
- package/src/components/breadcrumbs/components/icon/index.tsx +38 -38
- package/src/components/breadcrumbs/components/label/index.tsx +20 -20
- package/src/components/breadcrumbs/index.tsx +48 -48
- package/src/components/button/Button.stories.tsx +140 -140
- package/src/components/button/google/GoogleButton.stories.tsx +23 -23
- package/src/components/button/google/index.tsx +29 -29
- package/src/components/button/index.tsx +51 -51
- package/src/components/button/microsoft/MicrosoftButton.stories.tsx +25 -25
- package/src/components/button/microsoft/index.tsx +29 -29
- package/src/components/button/spinner/SpinnerButton.stories.tsx +60 -60
- package/src/components/button/spinner/index.tsx +36 -36
- package/src/components/card/Card.stories.tsx +56 -56
- package/src/components/card/index.tsx +78 -78
- package/src/components/form/Form.stories.tsx +62 -62
- package/src/components/form/FormTypes.ts +20 -20
- package/src/components/form/hooks/useFormHandler.tsx +74 -74
- package/src/components/form/index.tsx +25 -25
- package/src/components/form/section/FormSection.stories.tsx +109 -109
- package/src/components/form/section/index.tsx +87 -87
- package/src/components/form/utils/formErrors.ts +34 -34
- package/src/components/icons/checkmark/checkmark.svg +3 -3
- package/src/components/icons/checkmark/index.tsx +13 -13
- package/src/components/icons/chevron/down/chevron-down.svg +3 -3
- package/src/components/icons/chevron/down/index.tsx +14 -14
- package/src/components/icons/chevron/right/chevron-right.svg +3 -3
- package/src/components/icons/chevron/right/index.tsx +13 -13
- package/src/components/icons/clock/clock.svg +3 -3
- package/src/components/icons/clock/index.tsx +13 -13
- package/src/components/icons/close/close.svg +3 -3
- package/src/components/icons/close/index.tsx +21 -21
- package/src/components/icons/dropdown/dropdown.svg +3 -3
- package/src/components/icons/dropdown/index.tsx +16 -16
- package/src/components/icons/error/error.svg +3 -3
- package/src/components/icons/error/index.tsx +13 -13
- package/src/components/icons/file/fill/file-fill.svg +4 -4
- package/src/components/icons/file/fill/index.tsx +13 -13
- package/src/components/icons/file/outline/file-outline.svg +3 -3
- package/src/components/icons/file/outline/index.tsx +13 -13
- package/src/components/icons/folder/add/fill/folder-add-fill.svg +3 -3
- package/src/components/icons/folder/add/fill/index.tsx +13 -13
- package/src/components/icons/folder/add/outline/folder-add-outline.svg +3 -3
- package/src/components/icons/folder/add/outline/index.tsx +15 -15
- package/src/components/icons/folder/fill/folder-fill-gradient.svg +33 -33
- package/src/components/icons/folder/fill/folder-fill.svg +4 -4
- package/src/components/icons/folder/fill/index.tsx +21 -21
- package/src/components/icons/folder/outline/folder-outline.svg +3 -3
- package/src/components/icons/folder/outline/index.tsx +13 -13
- package/src/components/icons/gear/GearIcon.tsx +36 -36
- package/src/components/icons/google/drive/index.tsx +13 -13
- package/src/components/icons/google/google.svg +13 -13
- package/src/components/icons/google/index.tsx +13 -13
- package/src/components/icons/group/group.svg +3 -3
- package/src/components/icons/group/index.tsx +13 -13
- package/src/components/icons/home/home.svg +3 -3
- package/src/components/icons/home/index.tsx +13 -13
- package/src/components/icons/image/image.svg +3 -3
- package/src/components/icons/image/index.tsx +13 -13
- package/src/components/icons/index.tsx +101 -101
- package/src/components/icons/link/index.tsx +13 -13
- package/src/components/icons/link/link.svg +4 -4
- package/src/components/icons/menu/index.tsx +13 -13
- package/src/components/icons/menu/menu.svg +3 -3
- package/src/components/icons/microsoft/index.tsx +13 -13
- package/src/components/icons/microsoft/microsoft.svg +9 -9
- package/src/components/icons/microsoft/onedrive/index.tsx +16 -16
- package/src/components/icons/neutral/index.tsx +14 -14
- package/src/components/icons/neutral/neutral.svg +3 -3
- package/src/components/icons/page/index.tsx +13 -13
- package/src/components/icons/page/page.svg +3 -3
- package/src/components/icons/positive/index.tsx +13 -13
- package/src/components/icons/positive/positive.svg +3 -3
- package/src/components/icons/question/index.tsx +13 -13
- package/src/components/icons/question/question.svg +3 -3
- package/src/components/icons/search/index.tsx +13 -13
- package/src/components/icons/search/search.svg +3 -3
- package/src/components/icons/services/index.tsx +13 -13
- package/src/components/icons/services/services.svg +3 -3
- package/src/components/icons/settings/index.tsx +14 -14
- package/src/components/icons/settings/settings.svg +6 -6
- package/src/components/icons/table/fill/index.tsx +13 -13
- package/src/components/icons/table/fill/table-fill.svg +3 -3
- package/src/components/icons/table/outline/index.tsx +13 -13
- package/src/components/icons/table/outline/table-outline.svg +3 -3
- package/src/components/icons/task/index.tsx +10 -10
- package/src/components/icons/task/task.svg +11 -11
- package/src/components/icons/trash/index.tsx +13 -13
- package/src/components/icons/trash/trash.svg +3 -3
- package/src/components/icons/vault/index.tsx +14 -14
- package/src/components/icons/video/index.tsx +13 -13
- package/src/components/icons/video/video.svg +3 -3
- package/src/components/icons/warning/index.tsx +13 -13
- package/src/components/icons/warning/warning.svg +3 -3
- package/src/components/icons/workspace/index.tsx +14 -14
- package/src/components/input/Input.stories.tsx +287 -287
- package/src/components/input/InputTypes.ts +83 -77
- package/src/components/input/StackedCheckbox/StackedCheckbox.tsx +44 -44
- package/src/components/input/StackedInput/StackedInput.tsx +60 -60
- package/src/components/input/StackedMultiSelect/index.tsx +349 -349
- package/src/components/input/StackedPilledInput/index.tsx +386 -386
- package/src/components/input/StackedRadio/StackedRadioGroup.tsx +38 -38
- package/src/components/input/StackedSelect/index.tsx +232 -232
- package/src/components/input/StackedSwitch/index.tsx +33 -33
- package/src/components/input/StackedTextarea/StackedTextarea.tsx +55 -55
- package/src/components/input/components/dropdown/index.tsx +111 -111
- package/src/components/input/components/label/index.tsx +35 -35
- package/src/components/input/components/token/Token.stories.tsx +25 -25
- package/src/components/input/components/token/index.tsx +45 -45
- package/src/components/input/index.tsx +299 -298
- package/src/components/layout/BorderedBox/index.tsx +30 -30
- package/src/components/layout/Layout.stories.tsx +40 -40
- package/src/components/layout/index.tsx +100 -100
- package/src/components/link/Link.stories.tsx +23 -23
- package/src/components/link/index.tsx +34 -34
- package/src/components/loading/LoadingIndicator.stories.tsx +45 -45
- package/src/components/loading/index.tsx +45 -45
- package/src/components/modal/Modal.stories.tsx +36 -36
- package/src/components/modal/components/action/index.tsx +37 -37
- package/src/components/modal/index.tsx +41 -41
- package/src/components/navigation/NavigationMenu.stories.tsx +85 -85
- package/src/components/navigation/components/header/index.tsx +27 -27
- package/src/components/navigation/components/items/index.tsx +76 -76
- package/src/components/navigation/index.tsx +87 -87
- package/src/components/select/index.tsx +139 -140
- package/src/components/table/Table.stories.tsx +63 -63
- package/src/components/table/TableTypes.ts +15 -15
- package/src/components/table/components/loading/index.tsx +45 -45
- package/src/components/table/components/text/index.tsx +23 -23
- package/src/components/table/empty/index.tsx +47 -47
- package/src/components/table/index.tsx +84 -84
- package/src/components/table/utils/generateTableColumns.ts +9 -9
- package/src/components/tabs/TabsWrapper.stories.tsx +85 -85
- package/src/components/tabs/index.tsx +39 -39
- package/src/components/text/Text.stories.tsx +59 -59
- package/src/components/text/index.tsx +16 -16
- package/src/components/toast/Toast.stories.tsx +52 -52
- package/src/components/toast/index.tsx +78 -78
- package/src/components/toolbar/Toolbar.stories.tsx +59 -59
- package/src/components/toolbar/components/actions/add/index.tsx +18 -18
- package/src/components/toolbar/components/actions/search/index.tsx +38 -38
- package/src/components/toolbar/components/actions/sort/index.tsx +49 -49
- package/src/components/toolbar/components/breadcrumbs/index.tsx +63 -63
- package/src/components/toolbar/components/breadcrumbs/item/index.tsx +72 -72
- package/src/components/toolbar/components/dropdown/index.tsx +107 -107
- package/src/components/toolbar/components/navigation/components/button/left/index.tsx +28 -28
- package/src/components/toolbar/components/navigation/components/button/left/left-arrow.svg +3 -3
- package/src/components/toolbar/components/navigation/components/button/right/index.tsx +27 -27
- package/src/components/toolbar/components/navigation/components/button/right/right-arrow.svg +3 -3
- package/src/components/toolbar/components/navigation/index.tsx +36 -36
- package/src/components/toolbar/index.tsx +55 -55
- package/src/hooks/useDeepEffect.tsx +22 -22
- package/src/hooks/useDidMountEffect.tsx +13 -13
- package/src/hooks/useOnOutsideClick.tsx +31 -31
- package/src/hooks/useToast.tsx +16 -16
- package/src/index.tsx +78 -78
- package/src/theme/components/alert.ts +60 -60
- package/src/theme/components/badge.ts +59 -59
- package/src/theme/components/button.ts +163 -163
- package/src/theme/components/checkbox.ts +28 -28
- package/src/theme/components/code.ts +16 -16
- package/src/theme/components/form-error.ts +31 -31
- package/src/theme/components/form-label.ts +17 -17
- package/src/theme/components/form.ts +29 -29
- package/src/theme/components/input.ts +65 -65
- package/src/theme/components/link.ts +118 -118
- package/src/theme/components/modal.ts +45 -45
- package/src/theme/components/select.ts +36 -36
- package/src/theme/components/switch.ts +89 -89
- package/src/theme/components/table.ts +42 -42
- package/src/theme/components/tabs.ts +255 -255
- package/src/theme/components/text.ts +93 -93
- package/src/theme/components/textarea.ts +42 -42
- package/src/theme/customXQChakraTheme.ts +54 -54
- package/src/theme/foundations/breakpoints.ts +18 -18
- package/src/theme/foundations/colors.ts +165 -165
- package/src/theme/foundations/shadows.ts +23 -23
- package/src/theme/foundations/typography.ts +62 -62
- package/src/theme/provider/index.tsx +21 -21
- package/src/theme/styles.ts +19 -19
- package/CHANGELOG.md +0 -468
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, Story } from '@storybook/react';
|
|
3
|
-
import * as Yup from 'yup';
|
|
4
|
-
|
|
5
|
-
import { useFormHandler } from '../../../../src/components/form/hooks/useFormHandler';
|
|
6
|
-
|
|
7
|
-
import { FormSection, FormSectionProps } from '.';
|
|
8
|
-
import { FormStructure } from '../FormTypes';
|
|
9
|
-
|
|
10
|
-
type FormSectionStoryValues = {
|
|
11
|
-
[k: string]: any;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const meta: Meta<FormSectionProps<'story', FormSectionStoryValues>> = {
|
|
15
|
-
title: 'Form section example',
|
|
16
|
-
component: FormSection,
|
|
17
|
-
argTypes: {
|
|
18
|
-
formStructure: {
|
|
19
|
-
control: null,
|
|
20
|
-
description: 'The form generated from `useFormHandler` hook.',
|
|
21
|
-
},
|
|
22
|
-
section: {
|
|
23
|
-
description: 'The section of the `FormStructure` to generate.',
|
|
24
|
-
},
|
|
25
|
-
form: {
|
|
26
|
-
description: 'The form object of `FormStructure<T>`.',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
parameters: {
|
|
31
|
-
controls: { expanded: true },
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
interface StoryFormSchema {
|
|
36
|
-
prop?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const onStubbedSubmit = () => null;
|
|
40
|
-
|
|
41
|
-
const storyFormDefaultValues: StoryFormSchema = {
|
|
42
|
-
prop: '',
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const storyFormSchema: Yup.SchemaOf<StoryFormSchema> = Yup.object().shape({
|
|
46
|
-
prop: Yup.string().required(),
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export default meta;
|
|
50
|
-
const Template: Story<FormSectionProps<
|
|
51
|
-
'story',
|
|
52
|
-
FormSectionStoryValues
|
|
53
|
-
>> = args => {
|
|
54
|
-
const formHandler = useFormHandler<StoryFormSchema>(
|
|
55
|
-
onStubbedSubmit,
|
|
56
|
-
storyFormDefaultValues,
|
|
57
|
-
storyFormSchema,
|
|
58
|
-
false,
|
|
59
|
-
'all'
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const { form } = formHandler;
|
|
63
|
-
|
|
64
|
-
const section = args.section as 'story';
|
|
65
|
-
const formStructure = args.formStructure as FormStructure<'story'>;
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<>
|
|
69
|
-
<FormSection
|
|
70
|
-
form={form}
|
|
71
|
-
formStructure={formStructure}
|
|
72
|
-
section={section}
|
|
73
|
-
/>
|
|
74
|
-
</>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const Default = Template.bind({});
|
|
79
|
-
|
|
80
|
-
export const formSectionStoryArgs: Partial<FormSectionProps<
|
|
81
|
-
'story',
|
|
82
|
-
FormSectionStoryValues
|
|
83
|
-
>> = {
|
|
84
|
-
formStructure: {
|
|
85
|
-
story: [
|
|
86
|
-
{
|
|
87
|
-
label: 'Encryption Algorithm',
|
|
88
|
-
name: 'algorithm',
|
|
89
|
-
inputType: 'select',
|
|
90
|
-
isRequired: true,
|
|
91
|
-
ariaLabel: 'encryption algorithm input',
|
|
92
|
-
options: [
|
|
93
|
-
{ value: 'aes', label: 'AES - Advanced Encryption Standard' },
|
|
94
|
-
{ value: 'otp', label: 'OTP - One Time Pad' },
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
label: 'Allow Team Members to Change Settings',
|
|
99
|
-
name: 'allow',
|
|
100
|
-
ariaLabel: 'allow team members input',
|
|
101
|
-
inputType: 'text',
|
|
102
|
-
isRequired: true,
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
section: 'story',
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
Default.args = formSectionStoryArgs;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import * as Yup from 'yup';
|
|
4
|
+
|
|
5
|
+
import { useFormHandler } from '../../../../src/components/form/hooks/useFormHandler';
|
|
6
|
+
|
|
7
|
+
import { FormSection, FormSectionProps } from '.';
|
|
8
|
+
import { FormStructure } from '../FormTypes';
|
|
9
|
+
|
|
10
|
+
type FormSectionStoryValues = {
|
|
11
|
+
[k: string]: any;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const meta: Meta<FormSectionProps<'story', FormSectionStoryValues>> = {
|
|
15
|
+
title: 'Form section example',
|
|
16
|
+
component: FormSection,
|
|
17
|
+
argTypes: {
|
|
18
|
+
formStructure: {
|
|
19
|
+
control: null,
|
|
20
|
+
description: 'The form generated from `useFormHandler` hook.',
|
|
21
|
+
},
|
|
22
|
+
section: {
|
|
23
|
+
description: 'The section of the `FormStructure` to generate.',
|
|
24
|
+
},
|
|
25
|
+
form: {
|
|
26
|
+
description: 'The form object of `FormStructure<T>`.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
parameters: {
|
|
31
|
+
controls: { expanded: true },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
interface StoryFormSchema {
|
|
36
|
+
prop?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const onStubbedSubmit = () => null;
|
|
40
|
+
|
|
41
|
+
const storyFormDefaultValues: StoryFormSchema = {
|
|
42
|
+
prop: '',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const storyFormSchema: Yup.SchemaOf<StoryFormSchema> = Yup.object().shape({
|
|
46
|
+
prop: Yup.string().required(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default meta;
|
|
50
|
+
const Template: Story<FormSectionProps<
|
|
51
|
+
'story',
|
|
52
|
+
FormSectionStoryValues
|
|
53
|
+
>> = args => {
|
|
54
|
+
const formHandler = useFormHandler<StoryFormSchema>(
|
|
55
|
+
onStubbedSubmit,
|
|
56
|
+
storyFormDefaultValues,
|
|
57
|
+
storyFormSchema,
|
|
58
|
+
false,
|
|
59
|
+
'all'
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const { form } = formHandler;
|
|
63
|
+
|
|
64
|
+
const section = args.section as 'story';
|
|
65
|
+
const formStructure = args.formStructure as FormStructure<'story'>;
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<>
|
|
69
|
+
<FormSection
|
|
70
|
+
form={form}
|
|
71
|
+
formStructure={formStructure}
|
|
72
|
+
section={section}
|
|
73
|
+
/>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Default = Template.bind({});
|
|
79
|
+
|
|
80
|
+
export const formSectionStoryArgs: Partial<FormSectionProps<
|
|
81
|
+
'story',
|
|
82
|
+
FormSectionStoryValues
|
|
83
|
+
>> = {
|
|
84
|
+
formStructure: {
|
|
85
|
+
story: [
|
|
86
|
+
{
|
|
87
|
+
label: 'Encryption Algorithm',
|
|
88
|
+
name: 'algorithm',
|
|
89
|
+
inputType: 'select',
|
|
90
|
+
isRequired: true,
|
|
91
|
+
ariaLabel: 'encryption algorithm input',
|
|
92
|
+
options: [
|
|
93
|
+
{ value: 'aes', label: 'AES - Advanced Encryption Standard' },
|
|
94
|
+
{ value: 'otp', label: 'OTP - One Time Pad' },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: 'Allow Team Members to Change Settings',
|
|
99
|
+
name: 'allow',
|
|
100
|
+
ariaLabel: 'allow team members input',
|
|
101
|
+
inputType: 'text',
|
|
102
|
+
isRequired: true,
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
section: 'story',
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
Default.args = formSectionStoryArgs;
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { SimpleGrid } from '@chakra-ui/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
-
import { Input } from '../../input';
|
|
5
|
-
import { FormInput, FormStructure } from '../FormTypes';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param T - represents the key/section in the `FormStructure`.
|
|
9
|
-
* @param U - is the form value types for the `useFormHandler` hook.
|
|
10
|
-
*
|
|
11
|
-
* @param formStructure - the form of type form structure with their respective `FormSteps`.
|
|
12
|
-
* @param section - the section (`FormStep`) we want to generate a section for.
|
|
13
|
-
* @param form - the overall form containing methods (generated by `useFormHandler` hook).
|
|
14
|
-
*/
|
|
15
|
-
export interface FormSectionProps<
|
|
16
|
-
T extends string | number | symbol,
|
|
17
|
-
U extends FieldValues
|
|
18
|
-
> {
|
|
19
|
-
formStructure: FormStructure<T>;
|
|
20
|
-
section: T;
|
|
21
|
-
form: UseFormReturn<U>;
|
|
22
|
-
className?: string;
|
|
23
|
-
columns?: number;
|
|
24
|
-
spacing?: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param props - of type `FormSectionProps<T, U>` where `T` represents the key in `FormSteps`,
|
|
30
|
-
* can be generic key but is represented by value in `FormSteps` and `U` is the form value types for the
|
|
31
|
-
* `useFormHandler` hook.
|
|
32
|
-
*
|
|
33
|
-
* @returns a list of input's for a specific form section.
|
|
34
|
-
*/
|
|
35
|
-
export function FormSection<
|
|
36
|
-
T extends string | number | symbol,
|
|
37
|
-
U extends FieldValues
|
|
38
|
-
>({
|
|
39
|
-
formStructure,
|
|
40
|
-
section,
|
|
41
|
-
form,
|
|
42
|
-
className,
|
|
43
|
-
columns = 1,
|
|
44
|
-
spacing = 0,
|
|
45
|
-
}: FormSectionProps<T, U>) {
|
|
46
|
-
return (
|
|
47
|
-
<SimpleGrid
|
|
48
|
-
columns={columns}
|
|
49
|
-
spacing={spacing}
|
|
50
|
-
className={`form-section ${className ?? ''}`}
|
|
51
|
-
>
|
|
52
|
-
{formStructure[section].map(
|
|
53
|
-
({
|
|
54
|
-
label,
|
|
55
|
-
inputType,
|
|
56
|
-
name,
|
|
57
|
-
options,
|
|
58
|
-
isRequired,
|
|
59
|
-
maxLength,
|
|
60
|
-
ariaLabel,
|
|
61
|
-
disabled,
|
|
62
|
-
defaultValue,
|
|
63
|
-
variant,
|
|
64
|
-
}: FormInput) => (
|
|
65
|
-
<Input<U>
|
|
66
|
-
key={name}
|
|
67
|
-
control={form.control}
|
|
68
|
-
label={label}
|
|
69
|
-
inputType={inputType}
|
|
70
|
-
name={name}
|
|
71
|
-
ariaLabel={ariaLabel}
|
|
72
|
-
disabled={disabled}
|
|
73
|
-
options={options}
|
|
74
|
-
isRequired={isRequired}
|
|
75
|
-
maxLength={maxLength}
|
|
76
|
-
isInvalid={!!form.formState.errors[name]}
|
|
77
|
-
defaultValue={defaultValue}
|
|
78
|
-
setValue={form.setValue}
|
|
79
|
-
setError={form.setError}
|
|
80
|
-
clearErrors={form.clearErrors}
|
|
81
|
-
variant={variant ? variant : ''}
|
|
82
|
-
/>
|
|
83
|
-
)
|
|
84
|
-
)}
|
|
85
|
-
</SimpleGrid>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
1
|
+
import { SimpleGrid } from '@chakra-ui/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
+
import { Input } from '../../input';
|
|
5
|
+
import { FormInput, FormStructure } from '../FormTypes';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param T - represents the key/section in the `FormStructure`.
|
|
9
|
+
* @param U - is the form value types for the `useFormHandler` hook.
|
|
10
|
+
*
|
|
11
|
+
* @param formStructure - the form of type form structure with their respective `FormSteps`.
|
|
12
|
+
* @param section - the section (`FormStep`) we want to generate a section for.
|
|
13
|
+
* @param form - the overall form containing methods (generated by `useFormHandler` hook).
|
|
14
|
+
*/
|
|
15
|
+
export interface FormSectionProps<
|
|
16
|
+
T extends string | number | symbol,
|
|
17
|
+
U extends FieldValues
|
|
18
|
+
> {
|
|
19
|
+
formStructure: FormStructure<T>;
|
|
20
|
+
section: T;
|
|
21
|
+
form: UseFormReturn<U>;
|
|
22
|
+
className?: string;
|
|
23
|
+
columns?: number;
|
|
24
|
+
spacing?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param props - of type `FormSectionProps<T, U>` where `T` represents the key in `FormSteps`,
|
|
30
|
+
* can be generic key but is represented by value in `FormSteps` and `U` is the form value types for the
|
|
31
|
+
* `useFormHandler` hook.
|
|
32
|
+
*
|
|
33
|
+
* @returns a list of input's for a specific form section.
|
|
34
|
+
*/
|
|
35
|
+
export function FormSection<
|
|
36
|
+
T extends string | number | symbol,
|
|
37
|
+
U extends FieldValues
|
|
38
|
+
>({
|
|
39
|
+
formStructure,
|
|
40
|
+
section,
|
|
41
|
+
form,
|
|
42
|
+
className,
|
|
43
|
+
columns = 1,
|
|
44
|
+
spacing = 0,
|
|
45
|
+
}: FormSectionProps<T, U>) {
|
|
46
|
+
return (
|
|
47
|
+
<SimpleGrid
|
|
48
|
+
columns={columns}
|
|
49
|
+
spacing={spacing}
|
|
50
|
+
className={`form-section ${className ?? ''}`}
|
|
51
|
+
>
|
|
52
|
+
{formStructure[section].map(
|
|
53
|
+
({
|
|
54
|
+
label,
|
|
55
|
+
inputType,
|
|
56
|
+
name,
|
|
57
|
+
options,
|
|
58
|
+
isRequired,
|
|
59
|
+
maxLength,
|
|
60
|
+
ariaLabel,
|
|
61
|
+
disabled,
|
|
62
|
+
defaultValue,
|
|
63
|
+
variant,
|
|
64
|
+
}: FormInput) => (
|
|
65
|
+
<Input<U>
|
|
66
|
+
key={name}
|
|
67
|
+
control={form.control}
|
|
68
|
+
label={label}
|
|
69
|
+
inputType={inputType}
|
|
70
|
+
name={name}
|
|
71
|
+
ariaLabel={ariaLabel}
|
|
72
|
+
disabled={disabled}
|
|
73
|
+
options={options}
|
|
74
|
+
isRequired={isRequired}
|
|
75
|
+
maxLength={maxLength}
|
|
76
|
+
isInvalid={!!form.formState.errors[name]}
|
|
77
|
+
defaultValue={defaultValue}
|
|
78
|
+
setValue={form.setValue}
|
|
79
|
+
setError={form.setError}
|
|
80
|
+
clearErrors={form.clearErrors}
|
|
81
|
+
variant={variant ? variant : ''}
|
|
82
|
+
/>
|
|
83
|
+
)
|
|
84
|
+
)}
|
|
85
|
+
</SimpleGrid>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/* eslint-disable no-redeclare */
|
|
2
|
-
import { AxiosError } from 'axios';
|
|
3
|
-
|
|
4
|
-
export type ErrorResponse = {
|
|
5
|
-
message: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export function formatErrorResponse(error: AxiosError): ErrorResponse;
|
|
9
|
-
export function formatErrorResponse(error: Error): ErrorResponse;
|
|
10
|
-
export function formatErrorResponse(error: any): ErrorResponse {
|
|
11
|
-
// This is an error returned from the backend
|
|
12
|
-
if (error.response?.data?.status) {
|
|
13
|
-
return {
|
|
14
|
-
message: error.response?.data?.status,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// This is any generic error
|
|
19
|
-
if (error instanceof Error) {
|
|
20
|
-
return {
|
|
21
|
-
message: error.message,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// This would happen if a developer threw an error that isn't actually an error class. Don't do that...
|
|
26
|
-
console.error(
|
|
27
|
-
'Caught an error that is not an instance of an error! Replacing with a proper error but please fix this.',
|
|
28
|
-
error
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
message: 'An unknown error has occurred',
|
|
33
|
-
};
|
|
34
|
-
}
|
|
1
|
+
/* eslint-disable no-redeclare */
|
|
2
|
+
import { AxiosError } from 'axios';
|
|
3
|
+
|
|
4
|
+
export type ErrorResponse = {
|
|
5
|
+
message: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function formatErrorResponse(error: AxiosError): ErrorResponse;
|
|
9
|
+
export function formatErrorResponse(error: Error): ErrorResponse;
|
|
10
|
+
export function formatErrorResponse(error: any): ErrorResponse {
|
|
11
|
+
// This is an error returned from the backend
|
|
12
|
+
if (error.response?.data?.status) {
|
|
13
|
+
return {
|
|
14
|
+
message: error.response?.data?.status,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// This is any generic error
|
|
19
|
+
if (error instanceof Error) {
|
|
20
|
+
return {
|
|
21
|
+
message: error.message,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// This would happen if a developer threw an error that isn't actually an error class. Don't do that...
|
|
26
|
+
console.error(
|
|
27
|
+
'Caught an error that is not an instance of an error! Replacing with a proper error but please fix this.',
|
|
28
|
+
error
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
message: 'An unknown error has occurred',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.7467 0.127888C12.0291 0.33708 12.0836 0.729242 11.8685 1.00381L5.01133 9.75378C4.89891 9.89724 4.72822 9.98649 4.54313 9.99859C4.35804 10.0107 4.17659 9.94447 4.04542 9.81694L0.188288 6.06695C-0.0627627 5.82288 -0.0627627 5.42715 0.188288 5.18307C0.439339 4.939 0.846372 4.939 1.09742 5.18307L4.43443 8.42738L10.8458 0.246255C11.0609 -0.0283092 11.4643 -0.0813041 11.7467 0.127888Z" fill="black"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.7467 0.127888C12.0291 0.33708 12.0836 0.729242 11.8685 1.00381L5.01133 9.75378C4.89891 9.89724 4.72822 9.98649 4.54313 9.99859C4.35804 10.0107 4.17659 9.94447 4.04542 9.81694L0.188288 6.06695C-0.0627627 5.82288 -0.0627627 5.42715 0.188288 5.18307C0.439339 4.939 0.846372 4.939 1.09742 5.18307L4.43443 8.42738L10.8458 0.246255C11.0609 -0.0283092 11.4643 -0.0813041 11.7467 0.127888Z" fill="black"/>
|
|
3
|
+
</svg>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ReactComponent as CheckmarkIcon } from './checkmark.svg';
|
|
3
|
-
|
|
4
|
-
export interface CheckmarkProps {
|
|
5
|
-
boxSize: number | string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A functional React component utilized to render the `Checkmark` icon component
|
|
10
|
-
*/
|
|
11
|
-
export const Checkmark: React.FC<CheckmarkProps> = ({ boxSize }) => {
|
|
12
|
-
return <CheckmarkIcon boxSize={boxSize} />;
|
|
13
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactComponent as CheckmarkIcon } from './checkmark.svg';
|
|
3
|
+
|
|
4
|
+
export interface CheckmarkProps {
|
|
5
|
+
boxSize: number | string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A functional React component utilized to render the `Checkmark` icon component
|
|
10
|
+
*/
|
|
11
|
+
export const Checkmark: React.FC<CheckmarkProps> = ({ boxSize }) => {
|
|
12
|
+
return <CheckmarkIcon boxSize={boxSize} />;
|
|
13
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.184136 0.767507C0.422999 0.537831 0.802824 0.545278 1.0325 0.784142L4 3.93434L6.9675 0.784142C7.19718 0.545279 7.577 0.537831 7.81587 0.767507C8.05473 0.997183 8.06218 1.37701 7.8325 1.61587L4.4325 5.21587C4.31938 5.33352 4.16321 5.40001 4 5.40001C3.83679 5.40001 3.68062 5.33352 3.5675 5.21587L0.167501 1.61587C-0.0621751 1.37701 -0.0547276 0.997183 0.184136 0.767507Z" fill="#3C3C432E"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.184136 0.767507C0.422999 0.537831 0.802824 0.545278 1.0325 0.784142L4 3.93434L6.9675 0.784142C7.19718 0.545279 7.577 0.537831 7.81587 0.767507C8.05473 0.997183 8.06218 1.37701 7.8325 1.61587L4.4325 5.21587C4.31938 5.33352 4.16321 5.40001 4 5.40001C3.83679 5.40001 3.68062 5.33352 3.5675 5.21587L0.167501 1.61587C-0.0621751 1.37701 -0.0547276 0.997183 0.184136 0.767507Z" fill="#3C3C432E"/>
|
|
3
|
+
</svg>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import colors from '../../../../theme/foundations/colors';
|
|
3
|
-
import { ReactComponent as ChevronDownIcon } from './chevron-down.svg';
|
|
4
|
-
|
|
5
|
-
export interface ChevronDownProps {
|
|
6
|
-
boxSize: number | string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A functional React component utilized to render the `ChevronDown` icon component
|
|
11
|
-
*/
|
|
12
|
-
export const ChevronDown: React.FC<ChevronDownProps> = ({ boxSize }) => {
|
|
13
|
-
return <ChevronDownIcon boxSize={boxSize} fill={colors.fill.action} />;
|
|
14
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import colors from '../../../../theme/foundations/colors';
|
|
3
|
+
import { ReactComponent as ChevronDownIcon } from './chevron-down.svg';
|
|
4
|
+
|
|
5
|
+
export interface ChevronDownProps {
|
|
6
|
+
boxSize: number | string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A functional React component utilized to render the `ChevronDown` icon component
|
|
11
|
+
*/
|
|
12
|
+
export const ChevronDown: React.FC<ChevronDownProps> = ({ boxSize }) => {
|
|
13
|
+
return <ChevronDownIcon boxSize={boxSize} fill={colors.fill.action} />;
|
|
14
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="6" height="8" viewBox="0 0 6 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.767599 7.81586C0.537923 7.577 0.54537 7.19718 0.784233 6.9675L3.93443 4L0.784233 1.0325C0.54537 0.802823 0.537922 0.422997 0.767598 0.184134C0.997274 -0.0547285 1.3771 -0.0621767 1.61596 0.167499L5.21596 3.5675C5.33361 3.68062 5.4001 3.83679 5.4001 4C5.4001 4.16321 5.33361 4.31938 5.21596 4.4325L1.61596 7.8325C1.3771 8.06218 0.997275 8.05473 0.767599 7.81586Z" fill="#3C3C432E"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="6" height="8" viewBox="0 0 6 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.767599 7.81586C0.537923 7.577 0.54537 7.19718 0.784233 6.9675L3.93443 4L0.784233 1.0325C0.54537 0.802823 0.537922 0.422997 0.767598 0.184134C0.997274 -0.0547285 1.3771 -0.0621767 1.61596 0.167499L5.21596 3.5675C5.33361 3.68062 5.4001 3.83679 5.4001 4C5.4001 4.16321 5.33361 4.31938 5.21596 4.4325L1.61596 7.8325C1.3771 8.06218 0.997275 8.05473 0.767599 7.81586Z" fill="#3C3C432E"/>
|
|
3
|
+
</svg>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ReactComponent as ChevronRightIcon } from './chevron-right.svg';
|
|
3
|
-
|
|
4
|
-
export interface ChevronRightProps {
|
|
5
|
-
boxSize: number | string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A functional React component utilized to render the `ChevronRight` icon component
|
|
10
|
-
*/
|
|
11
|
-
export const ChevronRight: React.FC<ChevronRightProps> = ({ boxSize }) => {
|
|
12
|
-
return <ChevronRightIcon boxSize={boxSize} />;
|
|
13
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactComponent as ChevronRightIcon } from './chevron-right.svg';
|
|
3
|
+
|
|
4
|
+
export interface ChevronRightProps {
|
|
5
|
+
boxSize: number | string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A functional React component utilized to render the `ChevronRight` icon component
|
|
10
|
+
*/
|
|
11
|
+
export const ChevronRight: React.FC<ChevronRightProps> = ({ boxSize }) => {
|
|
12
|
+
return <ChevronRightIcon boxSize={boxSize} />;
|
|
13
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M7 3V7H10M13 7C13 10.3137 10.3137 13 7 13C3.68629 13 1 10.3137 1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7Z" stroke="#0082ff" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M7 3V7H10M13 7C13 10.3137 10.3137 13 7 13C3.68629 13 1 10.3137 1 7C1 3.68629 3.68629 1 7 1C10.3137 1 13 3.68629 13 7Z" stroke="#0082ff" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ReactComponent as ClockIcon } from './clock.svg';
|
|
3
|
-
|
|
4
|
-
export interface ClockProps {
|
|
5
|
-
boxSize: number | string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A functional React component utilized to render the `Clock` icon component
|
|
10
|
-
*/
|
|
11
|
-
export const Clock: React.FC<ClockProps> = ({ boxSize }) => {
|
|
12
|
-
return <ClockIcon boxSize={boxSize} />;
|
|
13
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactComponent as ClockIcon } from './clock.svg';
|
|
3
|
+
|
|
4
|
+
export interface ClockProps {
|
|
5
|
+
boxSize: number | string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A functional React component utilized to render the `Clock` icon component
|
|
10
|
+
*/
|
|
11
|
+
export const Clock: React.FC<ClockProps> = ({ boxSize }) => {
|
|
12
|
+
return <ClockIcon boxSize={boxSize} />;
|
|
13
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.9995 56C43.4635 56 55.9995 43.464 55.9995 28C55.9995 12.536 43.4635 0 27.9995 0C12.5355 0 -0.000488281 12.536 -0.000488281 28C-0.000488281 43.464 12.5355 56 27.9995 56ZM21.9807 18.2688C20.9555 17.2437 19.2935 17.2437 18.2684 18.2688C17.2432 19.294 17.2432 20.956 18.2684 21.9812L24.2872 28L18.2684 34.0188C17.2432 35.044 17.2432 36.706 18.2684 37.7312C19.2935 38.7563 20.9555 38.7563 21.9807 37.7312L27.9995 31.7123L34.0184 37.7312C35.0435 38.7563 36.7055 38.7563 37.7307 37.7312C38.7558 36.706 38.7558 35.044 37.7307 34.0188L31.7118 28L37.7307 21.9812C38.7558 20.956 38.7558 19.294 37.7307 18.2688C36.7055 17.2437 35.0435 17.2437 34.0184 18.2688L27.9995 24.2877L21.9807 18.2688Z" fill="#3C3C43" fill-opacity="0.6"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.9995 56C43.4635 56 55.9995 43.464 55.9995 28C55.9995 12.536 43.4635 0 27.9995 0C12.5355 0 -0.000488281 12.536 -0.000488281 28C-0.000488281 43.464 12.5355 56 27.9995 56ZM21.9807 18.2688C20.9555 17.2437 19.2935 17.2437 18.2684 18.2688C17.2432 19.294 17.2432 20.956 18.2684 21.9812L24.2872 28L18.2684 34.0188C17.2432 35.044 17.2432 36.706 18.2684 37.7312C19.2935 38.7563 20.9555 38.7563 21.9807 37.7312L27.9995 31.7123L34.0184 37.7312C35.0435 38.7563 36.7055 38.7563 37.7307 37.7312C38.7558 36.706 38.7558 35.044 37.7307 34.0188L31.7118 28L37.7307 21.9812C38.7558 20.956 38.7558 19.294 37.7307 18.2688C36.7055 17.2437 35.0435 17.2437 34.0184 18.2688L27.9995 24.2877L21.9807 18.2688Z" fill="#3C3C43" fill-opacity="0.6"/>
|
|
3
|
+
</svg>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ReactComponent as CloseIcon } from './close.svg';
|
|
3
|
-
|
|
4
|
-
export interface CloseProps {
|
|
5
|
-
boxSize: number | string;
|
|
6
|
-
onClick: () => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* A functional React component utilized to render the `Close` icon component
|
|
11
|
-
*/
|
|
12
|
-
export const Close: React.FC<CloseProps> = ({ boxSize, onClick }) => {
|
|
13
|
-
return (
|
|
14
|
-
<CloseIcon
|
|
15
|
-
width={boxSize}
|
|
16
|
-
height={boxSize}
|
|
17
|
-
onClick={onClick}
|
|
18
|
-
cursor="pointer"
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReactComponent as CloseIcon } from './close.svg';
|
|
3
|
+
|
|
4
|
+
export interface CloseProps {
|
|
5
|
+
boxSize: number | string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A functional React component utilized to render the `Close` icon component
|
|
11
|
+
*/
|
|
12
|
+
export const Close: React.FC<CloseProps> = ({ boxSize, onClick }) => {
|
|
13
|
+
return (
|
|
14
|
+
<CloseIcon
|
|
15
|
+
width={boxSize}
|
|
16
|
+
height={boxSize}
|
|
17
|
+
onClick={onClick}
|
|
18
|
+
cursor="pointer"
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|