pixel-react 1.2.1 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. package/lib/components/AppHeader/types.d.ts +11 -2
  2. package/lib/components/Avatar/Avatar.d.ts +5 -0
  3. package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
  4. package/lib/components/Avatar/index.d.ts +1 -0
  5. package/lib/components/Avatar/types.d.ts +26 -0
  6. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
  7. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
  8. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
  9. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
  10. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
  11. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
  12. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
  13. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
  14. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
  15. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
  16. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
  17. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +6 -7
  18. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
  19. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
  20. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
  21. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
  22. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
  23. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
  24. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
  25. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
  26. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
  27. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
  28. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
  29. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
  30. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
  31. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
  32. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +11 -48
  33. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
  34. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
  35. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +11 -12
  36. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
  37. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
  38. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
  39. package/lib/components/ExcelFile/Types.d.ts +2 -49
  40. package/lib/components/Form/Form.d.ts +1 -15
  41. package/lib/components/Form/Form.stories.d.ts +6 -5
  42. package/lib/components/Form/Forms.d.ts +8 -0
  43. package/lib/components/Form/index.d.ts +1 -1
  44. package/lib/components/Icon/types.d.ts +1 -1
  45. package/lib/components/MenuOption/types.d.ts +7 -7
  46. package/lib/components/MiniModal/MiniModal.stories.d.ts +1 -0
  47. package/lib/components/MiniModal/types.d.ts +6 -6
  48. package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
  49. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
  50. package/lib/components/ModulesChip/index.d.ts +1 -0
  51. package/lib/components/ModulesChip/types.d.ts +14 -0
  52. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
  53. package/lib/components/Toastify/Toastify.d.ts +8 -0
  54. package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
  55. package/lib/components/Toastify/index.d.ts +1 -0
  56. package/lib/components/Toastify/types.d.ts +7 -0
  57. package/lib/components/Tooltip/types.d.ts +6 -0
  58. package/lib/components/Typography/types.d.ts +1 -0
  59. package/lib/index.d.ts +84 -31
  60. package/lib/index.esm.js +26720 -881
  61. package/lib/index.esm.js.map +1 -1
  62. package/lib/index.js +26718 -875
  63. package/lib/index.js.map +1 -1
  64. package/lib/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +1 -1
  66. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  67. package/src/assets/Themes/BaseTheme.scss +2 -0
  68. package/src/assets/Themes/DarkTheme.scss +2 -0
  69. package/src/assets/icons/add_testcase.svg +3 -0
  70. package/src/assets/icons/add_variable_icon.svg +3 -4
  71. package/src/assets/icons/attachment_icon.svg +3 -0
  72. package/src/assets/icons/authorization_icon.svg +3 -0
  73. package/src/assets/icons/automation_testcase.svg +4 -0
  74. package/src/assets/icons/back_icon.svg +3 -0
  75. package/src/assets/icons/client_profile.svg +4 -0
  76. package/src/assets/icons/fireflink_finder_logo.svg +7 -0
  77. package/src/assets/icons/fireflink_platform.svg +4 -0
  78. package/src/assets/icons/license_expired.svg +20 -0
  79. package/src/assets/icons/manual_testcase.svg +3 -0
  80. package/src/assets/icons/variable_icon.svg +4 -0
  81. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
  82. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +1 -1
  83. package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
  84. package/src/components/AppHeader/AppHeader.tsx +29 -11
  85. package/src/components/AppHeader/types.ts +11 -3
  86. package/src/components/Avatar/Avatar.scss +24 -0
  87. package/src/components/Avatar/Avatar.stories.tsx +56 -0
  88. package/src/components/Avatar/Avatar.tsx +25 -0
  89. package/src/components/Avatar/index.ts +1 -0
  90. package/src/components/Avatar/types.ts +27 -0
  91. package/src/components/Button/types.ts +1 -1
  92. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
  93. package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
  94. package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
  95. package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
  96. package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
  97. package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
  98. package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
  99. package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
  100. package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
  101. package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
  102. package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
  103. package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
  104. package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
  105. package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
  106. package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
  107. package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
  108. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
  109. package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
  110. package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
  111. package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
  112. package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
  113. package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
  114. package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
  115. package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
  116. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
  117. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
  118. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
  119. package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
  120. package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
  121. package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
  122. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
  123. package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
  124. package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
  125. package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
  126. package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
  127. package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
  128. package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
  129. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
  130. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
  131. package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
  132. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
  133. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
  134. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
  135. package/src/components/ExcelFile/Types.ts +3 -70
  136. package/src/components/ExcelFile/index.ts +1 -1
  137. package/src/components/Form/Form.d.ts +3 -0
  138. package/src/components/Form/Form.scss +48 -4
  139. package/src/components/Form/Form.stories.tsx +244 -137
  140. package/src/components/Form/Form.ts +2 -0
  141. package/src/components/Form/Forms.tsx +25 -0
  142. package/src/components/Form/index.ts +1 -1
  143. package/src/components/Icon/iconList.ts +23 -0
  144. package/src/components/Icon/types.ts +1 -1
  145. package/src/components/IconButton/IconButton.scss +1 -1
  146. package/src/components/MenuOption/types.ts +7 -6
  147. package/src/components/MiniModal/MiniModal.scss +5 -0
  148. package/src/components/MiniModal/MiniModal.stories.tsx +95 -0
  149. package/src/components/MiniModal/MiniModal.tsx +11 -6
  150. package/src/components/MiniModal/types.ts +6 -6
  151. package/src/components/ModulesChip/ModuleChip.scss +20 -0
  152. package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
  153. package/src/components/ModulesChip/ModuleChip.tsx +31 -0
  154. package/src/components/ModulesChip/index.ts +1 -0
  155. package/src/components/ModulesChip/types.ts +14 -0
  156. package/src/components/MultiSelect/Dropdown.tsx +6 -1
  157. package/src/components/MultiSelect/MultiSelect.scss +17 -10
  158. package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
  159. package/src/components/MultiSelect/MultiSelect.tsx +11 -4
  160. package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
  161. package/src/components/Select/Select.scss +4 -0
  162. package/src/components/Select/Select.tsx +2 -2
  163. package/src/components/Toastify/Toastify.stories.tsx +52 -0
  164. package/src/components/Toastify/Toastify.tsx +66 -0
  165. package/src/components/Toastify/index.ts +1 -0
  166. package/src/components/Toastify/types.ts +8 -0
  167. package/src/components/Tooltip/Tooltip.tsx +2 -1
  168. package/src/components/Tooltip/types.ts +6 -0
  169. package/src/components/Typography/Typography.scss +12 -4
  170. package/src/components/Typography/Typography.stories.tsx +2 -0
  171. package/src/components/Typography/Typography.tsx +2 -0
  172. package/src/components/Typography/types.ts +1 -0
  173. package/src/index.ts +9 -1
  174. package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
  175. package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
  176. package/src/components/Form/Form.tsx +0 -57
@@ -1,22 +1,35 @@
1
- import { useState } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import Form from './Form';
4
- import validationRules from './validation.json';
5
- import { FormValues } from './types';
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
- const meta: Meta<typeof Form> = {
9
- title: 'Components/Form',
10
- component: Form,
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 Form>;
30
+ type Story = StoryObj<typeof Forms>;
18
31
 
19
- export const WithControlledState: Story = {
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 [formData, setFormData] = useState<FormValues>(initialFormState);
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
- <div className="ff-form-container">
50
- <Form<FormValues> onSubmit={handleSubmit}>
51
- {(
52
- { register, errors, handleBlur, setValue } // Include setValue here
53
- ) => (
54
- <>
55
- {['username', 'email', 'password'].map((field) => (
56
- <div className="ff-form-group" key={field}>
57
- <Typography as="label">
58
- {field.charAt(0).toUpperCase() + field.slice(1)}
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
- <input
61
- id={field}
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
- {/* Gender Radio Input */}
96
- <div className="ff-form-radio-group">
97
- <Typography as="label"> Gender </Typography>
98
- <div className='ff-radio-group-wrapper'>
99
- {['Male', 'Female', 'Other'].map((gender) => (
100
- <div className="ff-radio-gender" key={gender}>
101
- <Typography as="label">
102
- <input
103
- type="radio"
104
- value={gender}
105
- {...register('gender', validationRules.gender)}
106
- checked={formData.gender === gender}
107
- onChange={() =>
108
- setFormData((prev) => ({ ...prev, gender }))
109
- }
110
- onBlur={() => handleBlur('gender')}
111
- />
112
- {gender}
113
- </Typography>
114
- </div>
115
- ))}
116
- {errors.gender?.message && (
117
- <span className="ff-error">
118
- {String(errors.gender.message)}
119
- </span>
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
- {/* Language Select Dropdown */}
125
- <div className="ff-form-group">
126
- <Typography as='label'>Programming Language</Typography>
127
- <select
128
- id="language"
129
- {...register('language', validationRules.language)}
130
- onBlur={() => handleBlur('language')}
131
- className={errors.language ? 'ff-error' : ''}
132
- value={formData.language}
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
- const value = e.target.value;
135
- setFormData((prev) => ({
136
- ...prev,
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
- <option value="">Select a language</option>
145
- {['Java', 'Rust', 'Dart'].map((lang) => (
146
- <option key={lang} value={lang}>
147
- {lang}
148
- </option>
149
- ))}
150
- </select>
151
- {errors.language?.message && (
152
- <span className="ff-error">
153
- {String(errors.language.message)}
154
- </span>
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 type="button" onClick={() => handleReset(setValue)}>
267
+ <button
268
+ type="button"
269
+ onClick={() => {
270
+ reset(initialFormState);
271
+ }}
272
+ >
161
273
  Reset
162
274
  </button>
163
275
  </div>
164
- </>
165
- )}
166
- </Form>
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,2 @@
1
+ import * as Form from 'react-hook-form';
2
+ export default Form;
@@ -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 {default} from './Form';
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;
@@ -7,5 +7,5 @@ export interface IconProps {
7
7
  onClick?: (data?: any) => void;
8
8
  hoverEffect?: boolean;
9
9
  disabled?: boolean;
10
- variant?: "dark" | "light";
10
+ variant?: 'dark' | 'light';
11
11
  }
@@ -33,7 +33,7 @@
33
33
  border: 1px solid var(--secondary-icon-color);
34
34
  background-color: var(--hover-color);
35
35
  .icon-name {
36
- font-weight: 600;
36
+ font-weight: 400;
37
37
  color: var(--secondary-icon-color);
38
38
  @include mixins.center-content();
39
39
  }
@@ -105,17 +105,18 @@ interface MenuOptionProps {
105
105
  */
106
106
  dropdownPlacement?: string | 'top' | 'left' | 'right' | 'down';
107
107
 
108
- /**
109
- * Callback function triggered when the icon is clicked.
110
- * @type {function}
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
- * The variant of the menu option, either 'dark' or 'light'.
117
- * @type {'dark' | 'light'}
118
- * @default 'light'
118
+ * Callback function triggered when the icon is clicked.
119
+ * @type {function}
119
120
  * @optional
120
121
  */
121
122
 
@@ -168,3 +168,8 @@
168
168
  .ff-mini-modal-gap-10 {
169
169
  gap: 10px;
170
170
  }
171
+ .ff-mini-edit-model-icon {
172
+ color: var(--ff-mini-modal-box-shadow);
173
+ border: 2px solid var(--ff-mini-modal-box-shadow);
174
+ border-radius: 4px;
175
+ }
@@ -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;