pixel-react 1.2.1 → 1.2.3
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/lib/components/AppHeader/types.d.ts +11 -2
- package/lib/components/Avatar/Avatar.d.ts +5 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Avatar/index.d.ts +1 -0
- package/lib/components/Avatar/types.d.ts +26 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +6 -7
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +11 -48
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +11 -12
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
- package/lib/components/ExcelFile/Types.d.ts +2 -49
- package/lib/components/Form/Form.d.ts +1 -15
- package/lib/components/Form/Form.stories.d.ts +6 -5
- package/lib/components/Form/Forms.d.ts +8 -0
- package/lib/components/Form/index.d.ts +1 -1
- package/lib/components/Icon/types.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +7 -7
- package/lib/components/MiniModal/MiniModal.stories.d.ts +1 -0
- package/lib/components/MiniModal/types.d.ts +6 -6
- package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
- package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
- package/lib/components/ModulesChip/index.d.ts +1 -0
- package/lib/components/ModulesChip/types.d.ts +14 -0
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
- package/lib/components/Toastify/Toastify.d.ts +8 -0
- package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
- package/lib/components/Toastify/index.d.ts +1 -0
- package/lib/components/Toastify/types.d.ts +7 -0
- package/lib/components/Tooltip/types.d.ts +6 -0
- package/lib/components/Typography/types.d.ts +1 -0
- package/lib/index.d.ts +84 -31
- package/lib/index.esm.js +26720 -881
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +26718 -875
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
- package/src/assets/Themes/BaseTheme.scss +2 -0
- package/src/assets/Themes/DarkTheme.scss +2 -0
- package/src/assets/icons/add_testcase.svg +3 -0
- package/src/assets/icons/add_variable_icon.svg +3 -4
- package/src/assets/icons/attachment_icon.svg +3 -0
- package/src/assets/icons/authorization_icon.svg +3 -0
- package/src/assets/icons/automation_testcase.svg +4 -0
- package/src/assets/icons/back_icon.svg +3 -0
- package/src/assets/icons/client_profile.svg +4 -0
- package/src/assets/icons/fireflink_finder_logo.svg +7 -0
- package/src/assets/icons/fireflink_platform.svg +4 -0
- package/src/assets/icons/license_expired.svg +20 -0
- package/src/assets/icons/manual_testcase.svg +3 -0
- package/src/assets/icons/variable_icon.svg +4 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +1 -1
- package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
- package/src/components/AppHeader/AppHeader.tsx +29 -11
- package/src/components/AppHeader/types.ts +11 -3
- package/src/components/Avatar/Avatar.scss +24 -0
- package/src/components/Avatar/Avatar.stories.tsx +56 -0
- package/src/components/Avatar/Avatar.tsx +25 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Avatar/types.ts +27 -0
- package/src/components/Button/types.ts +1 -1
- package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
- package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
- package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
- package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
- package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
- package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
- package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
- package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
- package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
- package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
- package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
- package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
- package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
- package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
- package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
- package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
- package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
- package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
- package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
- package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
- package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
- package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
- package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
- package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
- package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
- package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
- package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
- package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
- package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
- package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
- package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
- package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
- package/src/components/ExcelFile/Types.ts +3 -70
- package/src/components/ExcelFile/index.ts +1 -1
- package/src/components/Form/Form.d.ts +3 -0
- package/src/components/Form/Form.scss +48 -4
- package/src/components/Form/Form.stories.tsx +244 -137
- package/src/components/Form/Form.ts +2 -0
- package/src/components/Form/Forms.tsx +25 -0
- package/src/components/Form/index.ts +1 -1
- package/src/components/Icon/iconList.ts +23 -0
- package/src/components/Icon/types.ts +1 -1
- package/src/components/IconButton/IconButton.scss +1 -1
- package/src/components/MenuOption/types.ts +7 -6
- package/src/components/MiniModal/MiniModal.scss +5 -0
- package/src/components/MiniModal/MiniModal.stories.tsx +95 -0
- package/src/components/MiniModal/MiniModal.tsx +11 -6
- package/src/components/MiniModal/types.ts +6 -6
- package/src/components/ModulesChip/ModuleChip.scss +20 -0
- package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
- package/src/components/ModulesChip/ModuleChip.tsx +31 -0
- package/src/components/ModulesChip/index.ts +1 -0
- package/src/components/ModulesChip/types.ts +14 -0
- package/src/components/MultiSelect/Dropdown.tsx +6 -1
- package/src/components/MultiSelect/MultiSelect.scss +17 -10
- package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
- package/src/components/MultiSelect/MultiSelect.tsx +11 -4
- package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Select/Select.tsx +2 -2
- package/src/components/Toastify/Toastify.stories.tsx +52 -0
- package/src/components/Toastify/Toastify.tsx +66 -0
- package/src/components/Toastify/index.ts +1 -0
- package/src/components/Toastify/types.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/Tooltip/types.ts +6 -0
- package/src/components/Typography/Typography.scss +12 -4
- package/src/components/Typography/Typography.stories.tsx +2 -0
- package/src/components/Typography/Typography.tsx +2 -0
- package/src/components/Typography/types.ts +1 -0
- package/src/index.ts +9 -1
- package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
- package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
- package/src/components/Form/Form.tsx +0 -57
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import Forms from './Forms';
|
|
2
|
+
import Input from '../Input';
|
|
3
|
+
import RadioGroup from '../RadioGroup';
|
|
4
|
+
import Select from '../Select';
|
|
5
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
|
6
6
|
import Typography from '../Typography';
|
|
7
|
+
import './Form.scss';
|
|
8
|
+
import Checkbox from '../Checkbox';
|
|
9
|
+
import TextArea from '../TextArea';
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
type FormValues = {
|
|
12
|
+
username: string;
|
|
13
|
+
email: string;
|
|
14
|
+
password: string;
|
|
15
|
+
gender: string;
|
|
16
|
+
language: string;
|
|
17
|
+
check: boolean;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const meta: Meta<typeof Forms> = {
|
|
22
|
+
title: 'Components/Forms',
|
|
23
|
+
component: Forms,
|
|
11
24
|
parameters: {
|
|
12
25
|
layout: 'centered',
|
|
13
26
|
},
|
|
14
27
|
tags: ['autodocs'],
|
|
15
28
|
};
|
|
16
29
|
|
|
17
|
-
type Story = StoryObj<typeof
|
|
30
|
+
type Story = StoryObj<typeof Forms>;
|
|
18
31
|
|
|
19
|
-
export const
|
|
32
|
+
export const WithDefaultValues: Story = {
|
|
20
33
|
render: () => {
|
|
21
34
|
const initialFormState: FormValues = {
|
|
22
35
|
username: '',
|
|
@@ -24,154 +37,248 @@ export const WithControlledState: Story = {
|
|
|
24
37
|
password: '',
|
|
25
38
|
gender: '',
|
|
26
39
|
language: '',
|
|
40
|
+
check: false,
|
|
41
|
+
description: '',
|
|
27
42
|
};
|
|
28
43
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const handleSubmit = (data: FormValues) => {
|
|
32
|
-
setFormData(data);
|
|
44
|
+
const onSubmit = (data: FormValues) => {
|
|
33
45
|
alert('Form submitted with: ' + JSON.stringify(data));
|
|
34
46
|
};
|
|
35
47
|
|
|
36
|
-
const handleReset = (
|
|
37
|
-
setValue: (field: keyof FormValues, value: any) => void
|
|
38
|
-
) => {
|
|
39
|
-
Object.keys(initialFormState).forEach((field) => {
|
|
40
|
-
setValue(
|
|
41
|
-
field as keyof FormValues,
|
|
42
|
-
initialFormState[field as keyof FormValues]
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
setFormData(initialFormState);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
48
|
return (
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
<Forms<FormValues> onSubmit={onSubmit} defaultValues={initialFormState}>
|
|
50
|
+
{({
|
|
51
|
+
register,
|
|
52
|
+
formState: { errors },
|
|
53
|
+
setValue,
|
|
54
|
+
watch,
|
|
55
|
+
reset,
|
|
56
|
+
trigger,
|
|
57
|
+
}) => {
|
|
58
|
+
return (
|
|
59
|
+
<div className="ff-main">
|
|
60
|
+
{/* Username Field */}
|
|
61
|
+
<div>
|
|
62
|
+
<Typography as="label">username</Typography>
|
|
63
|
+
<Input
|
|
64
|
+
type="text"
|
|
65
|
+
disabled={false}
|
|
66
|
+
{...register('username', {
|
|
67
|
+
required: {
|
|
68
|
+
value: true,
|
|
69
|
+
message: 'Username is required',
|
|
70
|
+
},
|
|
71
|
+
minLength: {
|
|
72
|
+
value: 3,
|
|
73
|
+
message: 'Username must be at least 3 characters',
|
|
74
|
+
},
|
|
75
|
+
maxLength: {
|
|
76
|
+
value: 15,
|
|
77
|
+
message: 'Username must not exceed 15 characters',
|
|
78
|
+
},
|
|
79
|
+
})}
|
|
80
|
+
error={!!errors.username?.message}
|
|
81
|
+
helperText={errors.username?.message}
|
|
82
|
+
value={watch('username')}
|
|
83
|
+
onChange={(e) =>
|
|
84
|
+
setValue('username', e.target.value, {
|
|
85
|
+
shouldValidate: true,
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
onBlur={() => {
|
|
89
|
+
trigger('username');
|
|
90
|
+
}}
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
{/* Email Field */}
|
|
95
|
+
<div>
|
|
96
|
+
<Typography as="label">Email</Typography>
|
|
97
|
+
|
|
98
|
+
<Input
|
|
99
|
+
type="email"
|
|
100
|
+
disabled={false}
|
|
101
|
+
{...register('email', {
|
|
102
|
+
required: { value: true, message: 'Email is required' },
|
|
103
|
+
pattern: {
|
|
104
|
+
value: /^\S+@\S+\.\S+$/,
|
|
105
|
+
message: 'Please enter a valid email',
|
|
106
|
+
},
|
|
107
|
+
})}
|
|
108
|
+
error={!!errors.email?.message}
|
|
109
|
+
helperText={errors.email?.message}
|
|
110
|
+
value={watch('email')}
|
|
111
|
+
onChange={(e) =>
|
|
112
|
+
setValue('email', e.target.value, { shouldValidate: true })
|
|
113
|
+
}
|
|
114
|
+
onBlur={() => {
|
|
115
|
+
trigger('email');
|
|
116
|
+
}}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
{/* Password Field */}
|
|
121
|
+
<div>
|
|
122
|
+
<Typography as="label">Password</Typography>
|
|
123
|
+
<Input
|
|
124
|
+
disabled={false}
|
|
125
|
+
type="password"
|
|
126
|
+
{...register('password', {
|
|
127
|
+
required: {
|
|
128
|
+
value: true,
|
|
129
|
+
message: 'Password is required',
|
|
130
|
+
},
|
|
131
|
+
minLength: {
|
|
132
|
+
value: 6,
|
|
133
|
+
message: 'Password must be at least 6 characters',
|
|
134
|
+
},
|
|
135
|
+
})}
|
|
136
|
+
error={!!errors.password?.message}
|
|
137
|
+
helperText={errors.password?.message}
|
|
138
|
+
value={watch('password')}
|
|
139
|
+
onChange={(e) =>
|
|
140
|
+
setValue('password', e.target.value, {
|
|
141
|
+
shouldValidate: true,
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
onBlur={() => {
|
|
145
|
+
trigger('password');
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
{/* Gender Field */}
|
|
151
|
+
<div className="ff-radio">
|
|
152
|
+
<Typography as="label">Gender</Typography>
|
|
153
|
+
<RadioGroup
|
|
154
|
+
options={[
|
|
155
|
+
{
|
|
156
|
+
label: 'Male',
|
|
157
|
+
value: 'male',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: 'Female',
|
|
161
|
+
value: 'female',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: 'Other',
|
|
165
|
+
value: 'other',
|
|
166
|
+
},
|
|
167
|
+
]}
|
|
168
|
+
{...register('gender', {
|
|
169
|
+
required: {
|
|
170
|
+
value: true,
|
|
171
|
+
message: 'select the Gender',
|
|
172
|
+
},
|
|
173
|
+
})}
|
|
174
|
+
selectedValue={watch('gender')}
|
|
175
|
+
onChange={(option) => {
|
|
176
|
+
setValue('gender', option.value, {
|
|
177
|
+
shouldValidate: true,
|
|
178
|
+
});
|
|
179
|
+
}}
|
|
180
|
+
/>
|
|
181
|
+
{errors?.gender && (
|
|
182
|
+
<Typography className="ff-error">
|
|
183
|
+
{errors.gender.message}
|
|
59
184
|
</Typography>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
type={
|
|
63
|
-
field === 'email'
|
|
64
|
-
? 'email'
|
|
65
|
-
: field === 'password'
|
|
66
|
-
? 'password'
|
|
67
|
-
: 'text'
|
|
68
|
-
}
|
|
69
|
-
{...register(field as keyof FormValues, {
|
|
70
|
-
...validationRules[field as keyof typeof validationRules],
|
|
71
|
-
onChange: (e: any) => {
|
|
72
|
-
const value = e.target.value;
|
|
73
|
-
setFormData((prev) => ({
|
|
74
|
-
...prev,
|
|
75
|
-
[field]: value,
|
|
76
|
-
}));
|
|
77
|
-
if (errors[field as keyof FormValues]?.message) {
|
|
78
|
-
handleBlur(field as keyof FormValues);
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
})}
|
|
82
|
-
className={
|
|
83
|
-
errors[field as keyof FormValues] ? 'ff-error' : ''
|
|
84
|
-
}
|
|
85
|
-
onBlur={() => handleBlur(field as keyof FormValues)}
|
|
86
|
-
/>
|
|
87
|
-
{errors[field as keyof FormValues]?.message && (
|
|
88
|
-
<span className="ff-error">
|
|
89
|
-
{String(errors[field as keyof FormValues]?.message)}
|
|
90
|
-
</span>
|
|
91
|
-
)}
|
|
92
|
-
</div>
|
|
93
|
-
))}
|
|
185
|
+
)}
|
|
186
|
+
</div>
|
|
94
187
|
|
|
95
|
-
{/*
|
|
96
|
-
<div className="ff-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
188
|
+
{/* Language Field */}
|
|
189
|
+
<div className="ff-select">
|
|
190
|
+
<Typography as="label">Programming Language</Typography>
|
|
191
|
+
<Select
|
|
192
|
+
optionsList={[
|
|
193
|
+
{ label: 'Java', value: 'Java' },
|
|
194
|
+
{ label: 'Rust', value: 'Rust' },
|
|
195
|
+
{ label: 'Dart', value: 'Dart' },
|
|
196
|
+
]}
|
|
197
|
+
selectedOption={{
|
|
198
|
+
label: watch('language') || 'Select a language',
|
|
199
|
+
value: watch('language') || '',
|
|
200
|
+
}}
|
|
201
|
+
{...register('language', {
|
|
202
|
+
required: {
|
|
203
|
+
value: true,
|
|
204
|
+
message: 'language is required',
|
|
205
|
+
},
|
|
206
|
+
})}
|
|
207
|
+
onChange={(option) =>
|
|
208
|
+
setValue('language', option.value, { shouldValidate: true })
|
|
209
|
+
}
|
|
210
|
+
/>
|
|
211
|
+
{errors?.gender && (
|
|
212
|
+
<Typography className="ff-error">
|
|
213
|
+
{errors?.language?.message}
|
|
214
|
+
</Typography>
|
|
120
215
|
)}
|
|
121
|
-
</div>
|
|
122
216
|
</div>
|
|
123
217
|
|
|
124
|
-
{/*
|
|
125
|
-
<div className="ff-
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
{...register('
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
218
|
+
{/* TextArea Field */}
|
|
219
|
+
<div className="ff-textarea">
|
|
220
|
+
<TextArea
|
|
221
|
+
label="Description"
|
|
222
|
+
value={watch('description')}
|
|
223
|
+
{...register('description', {
|
|
224
|
+
required: 'Description is required',
|
|
225
|
+
maxLength: {
|
|
226
|
+
value: 30,
|
|
227
|
+
message: 'Maximum length is 200 characters',
|
|
228
|
+
},
|
|
229
|
+
})}
|
|
230
|
+
error={!!errors?.description?.message}
|
|
133
231
|
onChange={(e) => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
language: value,
|
|
138
|
-
}));
|
|
139
|
-
if (value) {
|
|
140
|
-
setValue('language', value);
|
|
141
|
-
}
|
|
232
|
+
setValue('description', e.target.value, {
|
|
233
|
+
shouldValidate: true,
|
|
234
|
+
});
|
|
142
235
|
}}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
236
|
+
onBlur={() => {
|
|
237
|
+
trigger('description');
|
|
238
|
+
}}
|
|
239
|
+
/>
|
|
240
|
+
</div>
|
|
241
|
+
{/* check box Field */}
|
|
242
|
+
<div className="ff-check">
|
|
243
|
+
<Checkbox
|
|
244
|
+
label="terms condition"
|
|
245
|
+
disabled={false}
|
|
246
|
+
{...register('check', {
|
|
247
|
+
required: {
|
|
248
|
+
value: true,
|
|
249
|
+
message: 'Please select the checkbox',
|
|
250
|
+
},
|
|
251
|
+
})}
|
|
252
|
+
onChange={(e) => {
|
|
253
|
+
setValue('check', e.target.checked, {
|
|
254
|
+
shouldValidate: true,
|
|
255
|
+
});
|
|
256
|
+
}}
|
|
257
|
+
/>
|
|
258
|
+
{errors?.check && (
|
|
259
|
+
<Typography className="ff-error">
|
|
260
|
+
{errors.check.message}
|
|
261
|
+
</Typography>
|
|
155
262
|
)}
|
|
156
263
|
</div>
|
|
157
|
-
|
|
264
|
+
{/* Buttons */}
|
|
158
265
|
<div className="ff-button-layout">
|
|
159
266
|
<button type="submit">Submit</button>
|
|
160
|
-
<button
|
|
267
|
+
<button
|
|
268
|
+
type="button"
|
|
269
|
+
onClick={() => {
|
|
270
|
+
reset(initialFormState);
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
161
273
|
Reset
|
|
162
274
|
</button>
|
|
163
275
|
</div>
|
|
164
|
-
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
<pre>
|
|
169
|
-
<span>Payload Data:</span>
|
|
170
|
-
</pre>
|
|
171
|
-
<pre>{JSON.stringify(formData, null, 2)}</pre>
|
|
172
|
-
</div>
|
|
276
|
+
</div>
|
|
277
|
+
);
|
|
278
|
+
}}
|
|
279
|
+
</Forms>
|
|
173
280
|
);
|
|
174
281
|
},
|
|
175
282
|
};
|
|
176
283
|
|
|
177
|
-
export default meta;
|
|
284
|
+
export default meta;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Form from './Form';
|
|
3
|
+
|
|
4
|
+
interface FormProps<T extends Form.FieldValues> extends Form.UseFormProps<T> {
|
|
5
|
+
onSubmit: Form.SubmitHandler<T>;
|
|
6
|
+
children: (methods: ReturnType<typeof Form.useForm<T>>) => React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Forms = <T extends Form.FieldValues>({
|
|
10
|
+
onSubmit,
|
|
11
|
+
children,
|
|
12
|
+
...rest
|
|
13
|
+
}: FormProps<T>) => {
|
|
14
|
+
const methods = Form.useForm<T>(rest);
|
|
15
|
+
|
|
16
|
+
const { handleSubmit } = methods;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<form onSubmit={handleSubmit(onSubmit)}>
|
|
20
|
+
{children(methods)}
|
|
21
|
+
</form>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default Forms;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './Form';
|
|
@@ -114,12 +114,23 @@ import NLPHelpIcon from '../../assets/icons/nlp_help_icon.svg?react';
|
|
|
114
114
|
import UpdateIcon from '../../assets/icons/update_icon.svg?react';
|
|
115
115
|
import AddFile from '../../assets/icons/add_file.svg?react';
|
|
116
116
|
import EyeClosed from '../../assets/icons/eye_closed.svg?react';
|
|
117
|
+
import AttachmentIcon from '../../assets/icons/attachment_icon.svg?react';
|
|
118
|
+
import VariableIcon from '../../assets/icons/variable_icon.svg?react';
|
|
119
|
+
import AuthorizationIcon from '../../assets/icons/authorization_icon.svg?react';
|
|
117
120
|
|
|
118
121
|
import CloneIcon from '../../assets/icons/clone_icon.svg?react';
|
|
119
122
|
import MoveIcon from '../../assets/icons/move_icon.svg?react';
|
|
120
123
|
import Jira from '../../assets/icons/jira.svg?react';
|
|
121
124
|
import HistoryIcon from '../../assets//icons/history_icon.svg?react';
|
|
122
125
|
import LinkedDefects from '../../assets//icons/linked_defects.svg?react';
|
|
126
|
+
import FireflinkPlatform from '../../assets//icons/fireflink_platform.svg?react';
|
|
127
|
+
import FireflinkFinder from '../../assets//icons/fireflink_finder_logo.svg?react';
|
|
128
|
+
import ClientProfile from '../../assets//icons/client_profile.svg?react';
|
|
129
|
+
import LicenseExpired from '../../assets//icons/license_expired.svg?react';
|
|
130
|
+
import AddTestCaseIcon from '../../assets/icons/add_testcase.svg?react';
|
|
131
|
+
import AutomationTestCaseIcon from '../../assets/icons/automation_testcase.svg?react';
|
|
132
|
+
import ManualTestCaseIcon from '../../assets/icons/manual_testcase.svg?react';
|
|
133
|
+
import BackIcon from '../../assets/icons/back_icon.svg?react';
|
|
123
134
|
|
|
124
135
|
Components['delete_info'] = DeleteInfoIcon;
|
|
125
136
|
Components['success'] = ToastSuccessIcon;
|
|
@@ -238,5 +249,17 @@ Components['no_access_icon'] = NoAccessIcon;
|
|
|
238
249
|
Components['full_access_icon'] = FullAccessIcon;
|
|
239
250
|
Components['view_access_icon'] = ViewAccessIcon;
|
|
240
251
|
Components['eye_closed'] = EyeClosed;
|
|
252
|
+
Components['attachment_icon'] = AttachmentIcon;
|
|
253
|
+
Components['variable_icon'] = VariableIcon;
|
|
254
|
+
Components['authorization_icon'] = AuthorizationIcon;
|
|
255
|
+
|
|
256
|
+
Components['fireflink_platform_logo'] = FireflinkPlatform;
|
|
257
|
+
Components['fireflink_finder_logo'] = FireflinkFinder;
|
|
258
|
+
Components['client_profile'] = ClientProfile;
|
|
259
|
+
Components['license_expired'] = LicenseExpired;
|
|
260
|
+
Components['add_testcase'] = AddTestCaseIcon;
|
|
261
|
+
Components['automation_testcase'] = AutomationTestCaseIcon;
|
|
262
|
+
Components['manual_testcass'] = ManualTestCaseIcon;
|
|
263
|
+
Components['back_icon'] = BackIcon;
|
|
241
264
|
|
|
242
265
|
export default Components;
|
|
@@ -105,17 +105,18 @@ interface MenuOptionProps {
|
|
|
105
105
|
*/
|
|
106
106
|
dropdownPlacement?: string | 'top' | 'left' | 'right' | 'down';
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
*
|
|
110
|
-
* @type {
|
|
108
|
+
/**
|
|
109
|
+
* The variant of the menu option, either 'dark' or 'light'.
|
|
110
|
+
* @type {'dark' | 'light'}
|
|
111
|
+
* @default 'light'
|
|
111
112
|
* @optional
|
|
112
113
|
*/
|
|
113
114
|
|
|
114
115
|
variant?: 'dark' | 'light';
|
|
116
|
+
|
|
115
117
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @type {
|
|
118
|
-
* @default 'light'
|
|
118
|
+
* Callback function triggered when the icon is clicked.
|
|
119
|
+
* @type {function}
|
|
119
120
|
* @optional
|
|
120
121
|
*/
|
|
121
122
|
|
|
@@ -4,6 +4,7 @@ import MiniModal from './MiniModal';
|
|
|
4
4
|
import Button from '../Button/Button';
|
|
5
5
|
import './MiniModal.scss';
|
|
6
6
|
import Typography from '../Typography';
|
|
7
|
+
import Icon from '../Icon';
|
|
7
8
|
|
|
8
9
|
const meta: Meta<typeof MiniModal> = {
|
|
9
10
|
title: 'Components/MiniModal',
|
|
@@ -595,5 +596,99 @@ export const CustomModalWithWrapper = () => {
|
|
|
595
596
|
</div>
|
|
596
597
|
);
|
|
597
598
|
};
|
|
599
|
+
export const normalModalFollowedByIcon = () => {
|
|
600
|
+
const iconRef1 = useRef<HTMLButtonElement>(null);
|
|
601
|
+
const iconRef2 = useRef<HTMLButtonElement>(null);
|
|
602
|
+
const iconRef3 = useRef<HTMLButtonElement>(null);
|
|
603
|
+
const { currentModal, openModal } = useModal();
|
|
604
|
+
|
|
605
|
+
return (
|
|
606
|
+
<div className="ff-mini-modal-buttons-flex ff-mini-modal-gap-10">
|
|
607
|
+
<Icon
|
|
608
|
+
className="ff-mini-edit-model-icon"
|
|
609
|
+
width={16}
|
|
610
|
+
height={16}
|
|
611
|
+
onClick={() => openModal(1)}
|
|
612
|
+
ref={iconRef1}
|
|
613
|
+
name="user_profile"
|
|
614
|
+
/>
|
|
615
|
+
|
|
616
|
+
{currentModal === 1 && (
|
|
617
|
+
<MiniModal
|
|
618
|
+
anchorRef={iconRef1}
|
|
619
|
+
modalProperties={{ width: 168, height: 108 }}
|
|
620
|
+
childContent={
|
|
621
|
+
<>
|
|
622
|
+
<Typography as="p">
|
|
623
|
+
This is some content inside the first modal.
|
|
624
|
+
</Typography>
|
|
625
|
+
</>
|
|
626
|
+
}
|
|
627
|
+
isIconModel={true}
|
|
628
|
+
isAnimated={true}
|
|
629
|
+
firstAnchorRef={iconRef1}
|
|
630
|
+
anchorLeftDistanceForWrapper={0}
|
|
631
|
+
extraTopSpace={{ normalModal: 5 }}
|
|
632
|
+
/>
|
|
633
|
+
)}
|
|
634
|
+
|
|
635
|
+
<Icon
|
|
636
|
+
className="ff-mini-edit-model-icon"
|
|
637
|
+
width={16}
|
|
638
|
+
height={16}
|
|
639
|
+
onClick={() => openModal(2)}
|
|
640
|
+
ref={iconRef2}
|
|
641
|
+
name="user_profile"
|
|
642
|
+
/>
|
|
643
|
+
|
|
644
|
+
{currentModal === 2 && (
|
|
645
|
+
<MiniModal
|
|
646
|
+
anchorRef={iconRef2}
|
|
647
|
+
modalProperties={{ width: 193, height: 128 }}
|
|
648
|
+
childContent={
|
|
649
|
+
<>
|
|
650
|
+
<Typography as="p">
|
|
651
|
+
This is some content inside the Second modal.
|
|
652
|
+
</Typography>
|
|
653
|
+
</>
|
|
654
|
+
}
|
|
655
|
+
isIconModel={true}
|
|
656
|
+
isAnimated={true}
|
|
657
|
+
firstAnchorRef={iconRef2}
|
|
658
|
+
anchorLeftDistanceForWrapper={20}
|
|
659
|
+
extraTopSpace={{ normalModal: 15 }}
|
|
660
|
+
/>
|
|
661
|
+
)}
|
|
662
|
+
|
|
663
|
+
<Icon
|
|
664
|
+
className="ff-mini-edit-model-icon"
|
|
665
|
+
width={16}
|
|
666
|
+
height={16}
|
|
667
|
+
onClick={() => openModal(3)}
|
|
668
|
+
ref={iconRef3}
|
|
669
|
+
name="user_profile"
|
|
670
|
+
/>
|
|
671
|
+
|
|
672
|
+
{currentModal === 3 && (
|
|
673
|
+
<MiniModal
|
|
674
|
+
anchorRef={iconRef3}
|
|
675
|
+
modalProperties={{ width: 168, height: 108 }}
|
|
676
|
+
childContent={
|
|
677
|
+
<>
|
|
678
|
+
<Typography as="p">
|
|
679
|
+
This is some content inside the third modal.
|
|
680
|
+
</Typography>
|
|
681
|
+
</>
|
|
682
|
+
}
|
|
683
|
+
isIconModel={true}
|
|
684
|
+
isAnimated={true}
|
|
685
|
+
firstAnchorRef={iconRef3}
|
|
686
|
+
anchorLeftDistanceForWrapper={10}
|
|
687
|
+
extraTopSpace={{ normalModal: 10 }}
|
|
688
|
+
/>
|
|
689
|
+
)}
|
|
690
|
+
</div>
|
|
691
|
+
);
|
|
692
|
+
};
|
|
598
693
|
|
|
599
694
|
export default meta;
|