pixel-react 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) 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/InputWithDropdown/types.d.ts +1 -1
  45. package/lib/components/LabelEditTextField/LabelEditTextField.d.ts +5 -0
  46. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +11 -0
  47. package/lib/components/LabelEditTextField/index.d.ts +1 -0
  48. package/lib/components/LabelEditTextField/types.d.ts +38 -0
  49. package/lib/components/MenuOption/types.d.ts +7 -7
  50. package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
  51. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
  52. package/lib/components/ModulesChip/index.d.ts +1 -0
  53. package/lib/components/ModulesChip/types.d.ts +14 -0
  54. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
  55. package/lib/components/Select/Select.d.ts +1 -1
  56. package/lib/components/Select/components/Dropdown/Dropdown.d.ts +1 -1
  57. package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +2 -0
  58. package/lib/components/Select/types.d.ts +11 -4
  59. package/lib/components/Toastify/Toastify.d.ts +8 -0
  60. package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
  61. package/lib/components/Toastify/index.d.ts +1 -0
  62. package/lib/components/Toastify/types.d.ts +7 -0
  63. package/lib/components/Tooltip/types.d.ts +6 -0
  64. package/lib/components/Typography/types.d.ts +1 -0
  65. package/lib/index.d.ts +130 -29
  66. package/lib/index.esm.js +26882 -872
  67. package/lib/index.esm.js.map +1 -1
  68. package/lib/index.js +26881 -866
  69. package/lib/index.js.map +1 -1
  70. package/lib/tsconfig.tsbuildinfo +1 -1
  71. package/lib/utils/getSelectOptionValue/getSelectOptionValue.d.ts +8 -0
  72. package/package.json +1 -1
  73. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  74. package/src/assets/Themes/BaseTheme.scss +10 -1
  75. package/src/assets/Themes/DarkTheme.scss +19 -8
  76. package/src/assets/icons/client_profile.svg +4 -0
  77. package/src/assets/icons/fireflink_finder_logo.svg +7 -0
  78. package/src/assets/icons/fireflink_platform.svg +4 -0
  79. package/src/assets/icons/license_expired.svg +20 -0
  80. package/src/components/AppHeader/AppHeader.scss +5 -2
  81. package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
  82. package/src/components/AppHeader/AppHeader.tsx +29 -11
  83. package/src/components/AppHeader/types.ts +11 -3
  84. package/src/components/Avatar/Avatar.scss +24 -0
  85. package/src/components/Avatar/Avatar.stories.tsx +56 -0
  86. package/src/components/Avatar/Avatar.tsx +25 -0
  87. package/src/components/Avatar/index.ts +1 -0
  88. package/src/components/Avatar/types.ts +27 -0
  89. package/src/components/Drawer/Drawer.scss +0 -1
  90. package/src/components/Drawer/Drawer.tsx +1 -1
  91. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
  92. package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
  93. package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
  94. package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
  95. package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
  96. package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
  97. package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
  98. package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
  99. package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
  100. package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
  101. package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
  102. package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
  103. package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
  104. package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
  105. package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
  106. package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
  107. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
  108. package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
  109. package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
  110. package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
  111. package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
  112. package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
  113. package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
  114. package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
  115. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
  116. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
  117. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
  118. package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
  119. package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
  120. package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
  121. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
  122. package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
  123. package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
  124. package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
  125. package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
  126. package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
  127. package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
  128. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
  129. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
  130. package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
  131. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
  132. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
  133. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
  134. package/src/components/ExcelFile/Types.ts +3 -70
  135. package/src/components/ExcelFile/index.ts +1 -1
  136. package/src/components/Form/Form.d.ts +3 -0
  137. package/src/components/Form/Form.scss +31 -4
  138. package/src/components/Form/Form.stories.tsx +172 -138
  139. package/src/components/Form/Form.ts +2 -0
  140. package/src/components/Form/Forms.tsx +25 -0
  141. package/src/components/Form/index.ts +1 -1
  142. package/src/components/Icon/Icons.scss +1 -0
  143. package/src/components/Icon/iconList.ts +8 -0
  144. package/src/components/IconButton/IconButton.scss +1 -1
  145. package/src/components/InputWithDropdown/types.ts +1 -1
  146. package/src/components/LabelEditTextField/LabelEditTextField.scss +85 -0
  147. package/src/components/LabelEditTextField/LabelEditTextField.stories.tsx +136 -0
  148. package/src/components/LabelEditTextField/LabelEditTextField.tsx +207 -0
  149. package/src/components/LabelEditTextField/index.ts +1 -0
  150. package/src/components/LabelEditTextField/types.ts +38 -0
  151. package/src/components/MenuOption/types.ts +7 -6
  152. package/src/components/ModulesChip/ModuleChip.scss +20 -0
  153. package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
  154. package/src/components/ModulesChip/ModuleChip.tsx +31 -0
  155. package/src/components/ModulesChip/index.ts +1 -0
  156. package/src/components/ModulesChip/types.ts +14 -0
  157. package/src/components/MultiSelect/Dropdown.tsx +6 -1
  158. package/src/components/MultiSelect/MultiSelect.scss +17 -10
  159. package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
  160. package/src/components/MultiSelect/MultiSelect.tsx +11 -4
  161. package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
  162. package/src/components/Select/Select.scss +4 -0
  163. package/src/components/Select/Select.stories.tsx +5 -3
  164. package/src/components/Select/Select.tsx +15 -7
  165. package/src/components/Select/components/Dropdown/Dropdown.tsx +3 -1
  166. package/src/components/Select/components/Dropdown/dropdownTypes.ts +3 -0
  167. package/src/components/Select/types.ts +12 -5
  168. package/src/components/Toastify/Toastify.stories.tsx +52 -0
  169. package/src/components/Toastify/Toastify.tsx +66 -0
  170. package/src/components/Toastify/index.ts +1 -0
  171. package/src/components/Toastify/types.ts +8 -0
  172. package/src/components/Tooltip/Tooltip.tsx +2 -1
  173. package/src/components/Tooltip/types.ts +6 -0
  174. package/src/components/Typography/Typography.scss +12 -4
  175. package/src/components/Typography/Typography.stories.tsx +2 -0
  176. package/src/components/Typography/Typography.tsx +2 -0
  177. package/src/components/Typography/types.ts +1 -0
  178. package/src/index.ts +12 -2
  179. package/src/utils/getSelectOptionValue/getSelectOptionValue.ts +31 -0
  180. package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
  181. package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
  182. package/src/components/Form/Form.tsx +0 -57
@@ -1,22 +1,31 @@
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';
7
8
 
8
- const meta: Meta<typeof Form> = {
9
- title: 'Components/Form',
10
- component: Form,
9
+ type FormValues = {
10
+ username: string;
11
+ email: string;
12
+ password: string;
13
+ gender: string;
14
+ language: string;
15
+ };
16
+
17
+ const meta: Meta<typeof Forms> = {
18
+ title: 'Components/Forms',
19
+ component: Forms,
11
20
  parameters: {
12
21
  layout: 'centered',
13
22
  },
14
23
  tags: ['autodocs'],
15
24
  };
16
25
 
17
- type Story = StoryObj<typeof Form>;
26
+ type Story = StoryObj<typeof Forms>;
18
27
 
19
- export const WithControlledState: Story = {
28
+ export const WithDefaultValues: Story = {
20
29
  render: () => {
21
30
  const initialFormState: FormValues = {
22
31
  username: '',
@@ -26,152 +35,177 @@ export const WithControlledState: Story = {
26
35
  language: '',
27
36
  };
28
37
 
29
- const [formData, setFormData] = useState<FormValues>(initialFormState);
30
-
31
- const handleSubmit = (data: FormValues) => {
32
- setFormData(data);
38
+ const onSubmit = (data: FormValues) => {
33
39
  alert('Form submitted with: ' + JSON.stringify(data));
34
40
  };
35
41
 
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
42
  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)}
59
- </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
- ))}
43
+ <Forms<FormValues> onSubmit={onSubmit} defaultValues={initialFormState}>
44
+ {({
45
+ register,
46
+ formState: { errors },
47
+ setValue,
48
+ watch,
49
+ reset,
50
+ trigger,
51
+ }) => {
52
+ return (
53
+ <div className="ff-main">
54
+ {/* Username Field */}
55
+ <div>
56
+ <Typography as="label">username</Typography>
57
+ <Input
58
+ type="text"
59
+ {...register('username', {
60
+ required: 'Username is required',
61
+ minLength: {
62
+ value: 3,
63
+ message: 'Username must be at least 3 characters',
64
+ },
65
+ maxLength: {
66
+ value: 15,
67
+ message: 'Username must not exceed 15 characters',
68
+ },
69
+ })}
70
+ error={!!errors.username?.message}
71
+ helperText={errors.username?.message}
72
+ value={watch('username')}
73
+ onChange={(e) =>
74
+ setValue('username', e.target.value, {
75
+ shouldValidate: false,
76
+ })
77
+ }
78
+ onBlur={() => {
79
+ trigger('username');
80
+ }}
81
+ />
82
+ </div>
83
+
84
+ {/* Email Field */}
85
+ <div>
86
+ <Typography as="label">Email</Typography>
87
+
88
+ <Input
89
+ type="email"
90
+ {...register('email', {
91
+ required: 'Email is required',
92
+ pattern: {
93
+ value: /^\S+@\S+\.\S+$/,
94
+ message: 'Please enter a valid email',
95
+ },
96
+ })}
97
+ error={!!errors.email?.message}
98
+ helperText={errors.email?.message}
99
+ value={watch('email')}
100
+ onChange={(e) =>
101
+ setValue('email', e.target.value, { shouldValidate: false })
102
+ }
103
+ onBlur={() => {
104
+ trigger('email');
105
+ }}
106
+ />
107
+ </div>
94
108
 
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>
109
+ {/* Password Field */}
110
+ <div>
111
+ <Typography as="label">Password</Typography>
112
+
113
+ <Input
114
+ type="password"
115
+ {...register('password', {
116
+ required: 'Password is required',
117
+ minLength: {
118
+ value: 6,
119
+ message: 'Password must be at least 6 characters',
120
+ },
121
+ })}
122
+ error={!!errors.password?.message}
123
+ helperText={errors.password?.message}
124
+ value={watch('password')}
125
+ onChange={(e) =>
126
+ setValue('password', e.target.value, {
127
+ shouldValidate: true,
128
+ })
129
+ }
130
+ onBlur={() => {
131
+ trigger('password');
132
+ }}
133
+ />
134
+ </div>
135
+
136
+ {/* Gender Field */}
137
+ <div>
138
+ <Typography as="label">Gender</Typography>
139
+
140
+ <RadioGroup
141
+ options={[
142
+ {
143
+ label: 'Male',
144
+ value: 'male',
145
+ },
146
+ {
147
+ label: 'Female',
148
+ value: 'female',
149
+ },
150
+ {
151
+ label: 'Other',
152
+ value: 'other',
153
+ },
154
+ ]}
155
+ selectedValue={watch('gender')}
156
+ onChange={(option) => {
157
+ setValue('gender', option.value);
158
+ }}
159
+ name="gender"
160
+ />
161
+ {errors?.gender && (
162
+ <span className="ff-error">{errors.gender.message}</span>
120
163
  )}
121
- </div>
122
164
  </div>
123
165
 
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}
133
- 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
- }
166
+ {/* Language Field */}
167
+ <div className="ff-select">
168
+ <Typography as="label">Programming Language</Typography>
169
+ <Select
170
+ optionsList={[
171
+ { label: 'Java', value: 'Java' },
172
+ { label: 'Rust', value: 'Rust' },
173
+ { label: 'Dart', value: 'Dart' },
174
+ ]}
175
+ selectedOption={{
176
+ label: watch('language') || 'Select a language',
177
+ value: watch('language') || '',
142
178
  }}
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>
179
+ {...register('language', {
180
+ required: 'Programming language is required',
181
+ })}
182
+ onChange={(option) =>
183
+ setValue('language', option.value, { shouldValidate: true })
184
+ }
185
+ />
186
+ {errors?.gender && (
187
+ <span className="ff-error">{errors?.language?.message}</span>
155
188
  )}
156
189
  </div>
157
190
 
191
+ {/* Buttons */}
158
192
  <div className="ff-button-layout">
159
193
  <button type="submit">Submit</button>
160
- <button type="button" onClick={() => handleReset(setValue)}>
194
+ <button
195
+ type="button"
196
+ onClick={() => {
197
+ reset(initialFormState);
198
+ }}
199
+ >
161
200
  Reset
162
201
  </button>
163
202
  </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>
203
+ </div>
204
+ );
205
+ }}
206
+ </Forms>
173
207
  );
174
208
  },
175
209
  };
176
210
 
177
- export default meta;
211
+ 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';
@@ -3,6 +3,7 @@
3
3
  justify-content: center;
4
4
  align-items: center;
5
5
  padding: 4px;
6
+ box-sizing: content-box;
6
7
  &.ff-icon-dark {
7
8
  background-color: var(--brand-color);
8
9
  &.ff-icon-click {
@@ -120,6 +120,10 @@ import MoveIcon from '../../assets/icons/move_icon.svg?react';
120
120
  import Jira from '../../assets/icons/jira.svg?react';
121
121
  import HistoryIcon from '../../assets//icons/history_icon.svg?react';
122
122
  import LinkedDefects from '../../assets//icons/linked_defects.svg?react';
123
+ import FireflinkPlatform from '../../assets//icons/fireflink_platform.svg?react';
124
+ import FireflinkFinder from '../../assets//icons/fireflink_finder_logo.svg?react';
125
+ import ClientProfile from '../../assets//icons/client_profile.svg?react'
126
+ import LicenseExpired from '../../assets//icons/license_expired.svg?react';
123
127
 
124
128
  Components['delete_info'] = DeleteInfoIcon;
125
129
  Components['success'] = ToastSuccessIcon;
@@ -238,5 +242,9 @@ Components['no_access_icon'] = NoAccessIcon;
238
242
  Components['full_access_icon'] = FullAccessIcon;
239
243
  Components['view_access_icon'] = ViewAccessIcon;
240
244
  Components['eye_closed'] = EyeClosed;
245
+ Components['fireflink_platform_logo'] = FireflinkPlatform;
246
+ Components['fireflink_finder_logo'] = FireflinkFinder;
247
+ Components['client_profile'] = ClientProfile;
248
+ Components['license_expired'] = LicenseExpired;
241
249
 
242
250
  export default Components;
@@ -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
  }
@@ -74,7 +74,7 @@ export interface InputWithDropdownProps {
74
74
  /**
75
75
  * onChange handler for dropdown changes
76
76
  */
77
- onDropdownChangeHandler?: (option: Option) => void;
77
+ onDropdownChangeHandler?: (option: any) => void;
78
78
 
79
79
  /**
80
80
  * onInputBlurHandler action for input field
@@ -0,0 +1,85 @@
1
+ @use '../../assets/styles/fonts' as *;
2
+
3
+ .ff-label-edit-text-field {
4
+ display: flex;
5
+ flex-direction: column;
6
+ position: relative;
7
+ width: 100%;
8
+ .ff-label-text-field {
9
+ display: flex;
10
+ gap: 10px;
11
+ }
12
+ .ff-label-text-field-with-dropdown,
13
+ .ff-label-text-field-without-dropdown {
14
+ position: relative;
15
+ display: flex;
16
+ align-items: center;
17
+ }
18
+ .ff-label {
19
+ position: absolute;
20
+ top: 0;
21
+ left: 10px;
22
+ transform: translateY(-50%);
23
+ transition: all 0.2s ease;
24
+ color: var(--label-edit-text-label-color);
25
+ background: var(--label-edit-text-background-color);
26
+ padding: 0 4px;
27
+ @extend .font-size-8;
28
+ }
29
+ .ff-textfield-label {
30
+ @extend .ff-label;
31
+ top: 5px;
32
+ }
33
+
34
+ .display-text {
35
+ padding: 4px;
36
+ border-radius: 4px;
37
+ cursor: pointer;
38
+ display: flex;
39
+ align-items: center;
40
+ }
41
+
42
+ .ff-text-field,
43
+ .dropdown {
44
+ border: 1px solid var(--label-edit-text-label-color);
45
+ outline: none;
46
+ width: fit-content;
47
+ @extend .fontSm;
48
+ }
49
+ .ff-text-field {
50
+ padding: 0 4px;
51
+ border-radius: 4px;
52
+ }
53
+ .ff-text-dropdown-field {
54
+ flex: 2;
55
+ border: 1px solid var(--label-edit-text-label-color);
56
+ border-radius: 4px 0 0 4px;
57
+ border-right: none;
58
+ border-width: thin;
59
+ padding-left: 5px;
60
+ @extend .fontSm;
61
+ &:focus-visible {
62
+ outline: none;
63
+ }
64
+ }
65
+ .dropdown {
66
+ border-radius: 0 4px 4px 0;
67
+ flex: 1;
68
+ height: inherit;
69
+ }
70
+
71
+ .ff-icon-container {
72
+ display: flex;
73
+ gap: 8px;
74
+ align-items: center;
75
+ .confirm-icon,
76
+ .cancel-icon {
77
+ cursor: pointer;
78
+ }
79
+ }
80
+
81
+ .error-text {
82
+ margin: 0;
83
+ color: var(--label-edit-error-text);
84
+ }
85
+ }
@@ -0,0 +1,136 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import LabelEditTextField from './LabelEditTextField';
3
+ import '../../assets/styles/_colors.scss';
4
+ import './LabelEditTextField.scss';
5
+
6
+ const meta: Meta<typeof LabelEditTextField> = {
7
+ title: 'Components/LabelEditTextField',
8
+ component: LabelEditTextField,
9
+ parameters: {
10
+ layout: 'centered',
11
+ },
12
+ tags: ['autodocs'],
13
+ };
14
+
15
+ type Story = StoryObj<typeof LabelEditTextField>;
16
+ export const textField: Story = {
17
+ render: () => {
18
+ const handleConfirmAction = (inputValue: string) => {
19
+ //DEMO: we are getting that value from LabelEditTextField
20
+ console.log('Confirmed input value:', inputValue);
21
+ };
22
+ return (
23
+ <LabelEditTextField
24
+ label="Add Module"
25
+ text="Verify The Function Of Categories For" //it might be state
26
+ confirmIcon={{
27
+ name: 'update_icon',
28
+ onClick: () => {},
29
+ }}
30
+ cancelIcon={{
31
+ name: 'close',
32
+ onClick: () => {},
33
+ }}
34
+ width="300px"
35
+ height="22px"
36
+ confirmAction={handleConfirmAction}
37
+ />
38
+ );
39
+ },
40
+ };
41
+ export const textFieldWithOutLabel: Story = {
42
+ render: () => {
43
+ const handleConfirmAction = (inputValue: string) => {
44
+ //DEMO: we are getting that value from LabelEditTextField
45
+ console.log('Confirmed input value:', inputValue);
46
+ };
47
+ return (
48
+ <LabelEditTextField
49
+ text="Verify The Function Of Categories For" //it might be state
50
+ confirmIcon={{
51
+ name: 'update_icon',
52
+ onClick: () => {},
53
+ }}
54
+ cancelIcon={{
55
+ name: 'close',
56
+ onClick: () => {},
57
+ }}
58
+ width="300px"
59
+ height="22px"
60
+ confirmAction={handleConfirmAction}
61
+ />
62
+ );
63
+ },
64
+ };
65
+ export const textFieldWithDropdown: Story = {
66
+ render: () => {
67
+ const handleConfirmAction = (inputValue: string, dropdownValue: string) => {
68
+ //DEMO: we are getting that value from LabelEditTextField
69
+ console.log(
70
+ 'Confirmed input value and dropdown value:',
71
+ inputValue,
72
+ dropdownValue
73
+ );
74
+ };
75
+ return (
76
+ <LabelEditTextField
77
+ label="Add Module"
78
+ text="Verify The Function Of Categories For"
79
+ confirmIcon={{
80
+ name: 'update_icon',
81
+ onClick: () => {},
82
+ }}
83
+ cancelIcon={{
84
+ name: 'close',
85
+ onClick: () => {},
86
+ }}
87
+ variant="textFieldWithDropdown"
88
+ dropdownData={[
89
+ { id: 1, value: 'web', label: 'Web & Mobile' },
90
+ { id: 2, value: 'desktop', label: 'Desktop' },
91
+ ]}
92
+ width="300px"
93
+ height="22px"
94
+ confirmAction={handleConfirmAction}
95
+ />
96
+ );
97
+ },
98
+ };
99
+ export const textFieldWithHighlight: Story = {
100
+ render: () => {
101
+ const handleConfirmAction = (inputValue: string, dropdownValue: string) => {
102
+ //DEMO: we are getting that value from LabelEditTextField
103
+
104
+ console.log(
105
+ 'Confirmed input value and dropdown value:',
106
+ inputValue,
107
+ dropdownValue
108
+ );
109
+ };
110
+ return (
111
+ <LabelEditTextField
112
+ label="Add Module"
113
+ text="Verify The Function Of Categories For"
114
+ highlightText="The Function"
115
+ confirmIcon={{
116
+ name: 'update_icon',
117
+ onClick: () => {},
118
+ }}
119
+ cancelIcon={{
120
+ name: 'close',
121
+ onClick: () => {},
122
+ }}
123
+ variant="textFieldWithDropdown"
124
+ dropdownData={[
125
+ { id: 1, value: 'web', label: 'Web & Mobile' },
126
+ { id: 2, value: 'desktop', label: 'Desktop' },
127
+ ]}
128
+ width="400px"
129
+ height="22px"
130
+ confirmAction={handleConfirmAction}
131
+ />
132
+ );
133
+ },
134
+ };
135
+
136
+ export default meta;