pixel-react-excel-sheet 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/lib/components/Charts/BarChart/BarChart.d.ts +1 -0
  2. package/lib/components/Charts/DashboardDonutChart/types.d.ts +1 -0
  3. package/lib/components/ConditionalDropdown/types.d.ts +1 -1
  4. package/lib/components/ConnectingBranch/ConnectingBranch.d.ts +2 -1
  5. package/lib/components/ConnectingBranch/data.d.ts +19 -33
  6. package/lib/components/ConnectingBranch/types.d.ts +10 -0
  7. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +7 -1
  8. package/lib/components/FileDropzone/types.d.ts +12 -4
  9. package/lib/components/MachineInputField/MachineInputField.d.ts +4 -1
  10. package/lib/components/MenuOption/types.d.ts +1 -1
  11. package/lib/components/PopUpModal/types.d.ts +2 -1
  12. package/lib/components/Select/types.d.ts +1 -1
  13. package/lib/components/StatusCard/types.d.ts +7 -1
  14. package/lib/components/TextArea/Textarea.d.ts +1 -1
  15. package/lib/components/TextArea/Types.d.ts +1 -0
  16. package/lib/components/ThemeProvider/types.d.ts +1 -1
  17. package/lib/index.d.ts +99 -69
  18. package/lib/index.esm.js +241 -137
  19. package/lib/index.esm.js.map +1 -1
  20. package/lib/index.js +241 -137
  21. package/lib/index.js.map +1 -1
  22. package/lib/tsconfig.tsbuildinfo +1 -1
  23. package/lib/utils/validateFile/validateFile.d.ts +2 -0
  24. package/package.json +2 -2
  25. package/src/assets/Themes/BaseTheme.scss +1 -0
  26. package/src/assets/Themes/BlueTheme.scss +279 -0
  27. package/src/assets/Themes/DarkTheme.scss +1 -0
  28. package/src/assets/Themes/Theme.scss +5 -0
  29. package/src/components/AppHeader/AppHeader.tsx +4 -2
  30. package/src/components/Charts/BarChart/BarChart.stories.tsx +3 -0
  31. package/src/components/Charts/BarChart/BarChart.tsx +7 -0
  32. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +4 -0
  33. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +1 -0
  34. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +4 -2
  35. package/src/components/Charts/DashboardDonutChart/types.ts +1 -0
  36. package/src/components/ConditionalDropdown/ConditionalDropdown.stories.tsx +1 -1
  37. package/src/components/ConditionalDropdown/types.ts +1 -1
  38. package/src/components/ConnectingBranch/BranchComponents/MachineInstances.tsx +94 -79
  39. package/src/components/ConnectingBranch/ConnectingBranch.scss +31 -45
  40. package/src/components/ConnectingBranch/ConnectingBranch.stories.tsx +33 -1
  41. package/src/components/ConnectingBranch/ConnectingBranch.tsx +36 -23
  42. package/src/components/ConnectingBranch/{data.ts → data.tsx} +106 -17
  43. package/src/components/ConnectingBranch/types.ts +21 -0
  44. package/src/components/Excel/ExcelFile/ExcelFile.tsx +1 -1
  45. package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +7 -5
  46. package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +6 -1
  47. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +30 -11
  48. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +65 -19
  49. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +14 -0
  50. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +16 -0
  51. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +41 -32
  52. package/src/components/FileDropzone/Dropzone.tsx +3 -0
  53. package/src/components/FileDropzone/FileDropzone.scss +18 -0
  54. package/src/components/FileDropzone/FileDropzone.stories.tsx +75 -7
  55. package/src/components/FileDropzone/FileDropzone.tsx +2 -0
  56. package/src/components/FileDropzone/RadioFilePreview.tsx +7 -3
  57. package/src/components/FileDropzone/types.ts +13 -4
  58. package/src/components/Icon/iconList.ts +2 -2
  59. package/src/components/InputWithDropdown/InputWithDropdown.tsx +1 -1
  60. package/src/components/MachineInputField/MachineInputField.tsx +67 -70
  61. package/src/components/MenuOption/MenuOption.stories.tsx +2 -3
  62. package/src/components/MenuOption/MenuOption.tsx +9 -2
  63. package/src/components/MenuOption/types.ts +1 -1
  64. package/src/components/PopUpModal/types.ts +4 -3
  65. package/src/components/Search/Search.stories.tsx +1 -2
  66. package/src/components/Select/types.ts +1 -1
  67. package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +1 -0
  68. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +2 -8
  69. package/src/components/StatusCard/StatusCard.scss +47 -4
  70. package/src/components/StatusCard/StatusCard.stories.tsx +1 -0
  71. package/src/components/StatusCard/StatusCard.tsx +28 -5
  72. package/src/components/StatusCard/types.ts +15 -10
  73. package/src/components/TextArea/Textarea.tsx +2 -0
  74. package/src/components/TextArea/Types.ts +3 -0
  75. package/src/components/ThemeProvider/types.ts +1 -1
  76. package/src/components/Toastify/Toastify.tsx +1 -0
  77. package/src/utils/validateFile/validateFile.stories.tsx +49 -0
  78. package/src/utils/validateFile/validateFile.ts +39 -0
  79. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss +0 -51
  80. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx +0 -107
  81. package/src/components/SequentialConnectingBranch/components/AddBrowserModal/types.ts +0 -5
  82. package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss +0 -31
  83. package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx +0 -85
  84. package/src/components/SequentialConnectingBranch/components/DatasetListModal/types.ts +0 -4
  85. /package/src/assets/icons/{impactList.svg → impact_list.svg} +0 -0
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useEffect, useRef, useState } from 'react';
2
2
  import './ExcelToolBar.scss';
3
3
  import MenuOption from '../../MenuOption';
4
4
  import Tooltip from '../../Tooltip';
@@ -69,6 +69,8 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
69
69
  };
70
70
 
71
71
  const [cellStyle, setCellStyle] = useState(cell?.style || basicStyle);
72
+ const underLineMenuRef = useRef<HTMLSpanElement>(null);
73
+ const borderMenuRef = useRef<HTMLSpanElement>(null);
72
74
 
73
75
  useEffect(() => {
74
76
  setCellStyle(cell?.style || basicStyle);
@@ -121,8 +123,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
121
123
  value: 'double_border',
122
124
  label: 'Double Underline',
123
125
  icon: 'double_underline',
124
- },
125
- { value: 'line-through', label: 'Strikethrough', icon: 'strike_through' },
126
+ }
126
127
  ];
127
128
 
128
129
  const fontFamily = [
@@ -315,19 +316,22 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
315
316
  onClick={() => setUnderlineType(data, underLine, true)}
316
317
  name={getUnderlineIcon()}
317
318
  />
318
- <MenuOption
319
- iconName="arrow_down"
320
- zIndex={1000}
321
- iconSize={12}
322
- options={underlineTypeIcon}
323
- tooltipPlacement="top"
324
- variant="light"
325
- onOptionClick={(e) => {
326
- let selectedValue = e.value as string;
327
- setUnderlineType(data, selectedValue, true);
328
- setUnderLine(selectedValue);
329
- }}
330
- />
319
+ <span ref={underLineMenuRef}>
320
+ <MenuOption
321
+ targetRef={underLineMenuRef}
322
+ iconName="arrow_down"
323
+ zIndex={1000}
324
+ iconSize={12}
325
+ options={underlineTypeIcon}
326
+ tooltipPlacement="top"
327
+ variant="light"
328
+ onOptionClick={(e) => {
329
+ let selectedValue = e.value as string;
330
+ setUnderlineType(data, selectedValue, true);
331
+ setUnderLine(selectedValue);
332
+ }}
333
+ />
334
+ </span>
331
335
  </div>
332
336
  </Tooltip>
333
337
  </div>
@@ -391,24 +395,29 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
391
395
  onClick={() => setBorderType(data, border, 'black')}
392
396
  name={getBorderIcon()}
393
397
  />
394
- <MenuOption
395
- iconName="arrow_down"
396
- iconSize={12}
397
- zIndex={1000}
398
- options={borderTypeIcon}
399
- tooltipPlacement="top"
400
- variant="light"
401
- onOptionClick={(e) => {
402
- let selectedValue = e.value as string;
403
- setBorderType(data, selectedValue, 'black');
404
- setBorder(selectedValue);
405
- }}
406
- />
398
+ <span ref={borderMenuRef}>
399
+ <MenuOption
400
+ iconName="arrow_down"
401
+ targetRef={borderMenuRef}
402
+ iconSize={12}
403
+ zIndex={1000}
404
+ options={borderTypeIcon}
405
+ tooltipPlacement="top"
406
+ variant="light"
407
+ onOptionClick={(e) => {
408
+ let selectedValue = e.value as string;
409
+ setBorderType(data, selectedValue, 'black');
410
+ setBorder(selectedValue);
411
+ }}
412
+ />
413
+ </span>
407
414
  </div>
408
415
  </Tooltip>
409
416
  </div>
410
- <div className="ff-excel-toolbar-divider"></div>
411
- <div className="ff-excel-toolbar-menu">
417
+
418
+
419
+ {/* <div className="ff-excel-toolbar-divider"></div> TODO */}
420
+ {/* <div className="ff-excel-toolbar-menu">
412
421
  <Tooltip placement="top" title={'Formula'}>
413
422
  <Icon
414
423
  hoverEffect
@@ -417,7 +426,7 @@ const ExcelToolBar: React.FC<ExcelToolBarProps> = ({
417
426
  name="formula_icon"
418
427
  />
419
428
  </Tooltip>
420
- </div>
429
+ </div> TODO */}
421
430
  </div>
422
431
  );
423
432
  };
@@ -24,6 +24,7 @@ const Dropzone: FC<DroppableProps> = ({
24
24
  setSelectedFile,
25
25
  handleRemoveFile,
26
26
  isDisable,
27
+ setShowDrawer,
27
28
  }) => {
28
29
  const isWebServiceFile = selectedFile?.name && isWebServiceFileDropZone;
29
30
  return (
@@ -42,6 +43,8 @@ const Dropzone: FC<DroppableProps> = ({
42
43
  onFileRemoveClick={handleRemoveFile}
43
44
  onFileReplaceClick={setSelectedFile}
44
45
  setSelectedFile={setSelectedFile}
46
+ selectedRadioOption={selectedRadioOption}
47
+ setShowDrawer={setShowDrawer}
45
48
  />
46
49
  ) : (
47
50
  <>
@@ -4,6 +4,12 @@
4
4
  gap: $gap;
5
5
  }
6
6
 
7
+ @mixin flex-center {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ }
12
+
7
13
  @mixin center {
8
14
  display: grid;
9
15
  place-items: center;
@@ -160,4 +166,16 @@
160
166
  .ff-disable-file-dropzone-wrapper {
161
167
  opacity: 0.5;
162
168
  cursor: not-allowed;
169
+ }
170
+ .footer_basic_button {
171
+ width: 100%;
172
+ position: absolute;
173
+ bottom: 0;
174
+ right: 0;
175
+ @include flex-center;
176
+ justify-content: flex-end;
177
+ gap: 16px;
178
+ border-top: 1px solid var(--border-color);
179
+ padding: 4px 8px;
180
+ background-color: var(--primary-icon-color);
163
181
  }
@@ -5,8 +5,10 @@ import Toaster from '../Toast';
5
5
  import { useState } from 'react';
6
6
  import { RadioOption } from './types';
7
7
  import Drawer from '../Drawer/Drawer';
8
- import Typography from '../Typography';
8
+ import ConditionalDropdown from '../ConditionalDropdown/ConditionalDropdown';
9
9
  import './FileDropzone.scss';
10
+ import { DynamicObj } from '../CreateVariable/types';
11
+ import Button from '../Button';
10
12
 
11
13
  const meta: Meta<typeof FileDropzone> = {
12
14
  title: 'Components/FileDropzone',
@@ -107,8 +109,12 @@ export const WithRadioButton: Story = {
107
109
 
108
110
  const [selectedRadioOption, setSelectedRadioOption] =
109
111
  useState<RadioOption>();
110
- const [selectedFile, setSelectedFile] = useState<File | null>(null);
111
-
112
+ const [selectedFile, setSelectedFile] = useState<File | DynamicObj | null>(
113
+ null
114
+ );
115
+ const [testDataSelectedFile, setTestDataSelectedFile] = useState<
116
+ DynamicObj | File | null
117
+ >(null);
112
118
 
113
119
  const drawerArgs = {
114
120
  primaryButtonProps: {
@@ -156,6 +162,42 @@ export const WithRadioButton: Story = {
156
162
  }, 2000);
157
163
  };
158
164
 
165
+ const testData = [
166
+ {
167
+ _id: '1',
168
+ name: 'File1.txt',
169
+ actualPath: '/documents/File1.txt',
170
+ searchKey: 'file1',
171
+ parentId: 'root',
172
+ },
173
+ {
174
+ _id: '2',
175
+ name: 'File2.doc',
176
+ actualPath: '/documents/File2.doc',
177
+ searchKey: 'file2',
178
+ parentId: 'root',
179
+ },
180
+ {
181
+ _id: '3',
182
+ name: 'Image1.png',
183
+ actualPath: '/images/Image1.png',
184
+ searchKey: 'image1',
185
+ parentId: 'folder1',
186
+ },
187
+ {
188
+ _id: '4',
189
+ name: 'Presentation.ppt',
190
+ actualPath: '/presentations/Presentation.ppt',
191
+ searchKey: 'presentation',
192
+ parentId: 'folder2',
193
+ },
194
+ ];
195
+
196
+ const handleSaveButton = () => {
197
+ setSelectedFile(testDataSelectedFile);
198
+ setShowModal(false);
199
+ };
200
+
159
201
  return (
160
202
  <>
161
203
  <FileDropzone
@@ -176,6 +218,7 @@ export const WithRadioButton: Story = {
176
218
  selectedFile={selectedFile}
177
219
  handleFileChange={handleFileChange}
178
220
  handleRemoveFile={handleRemoveFile}
221
+ setShowDrawer={setShowModal}
179
222
  />
180
223
  {showToaster && (
181
224
  <Toaster
@@ -185,18 +228,43 @@ export const WithRadioButton: Story = {
185
228
  toastMessage={'Max 5 files can be uploaded'}
186
229
  />
187
230
  )}
188
- {selectedRadioOption?.value === 'Local File' &&
231
+ {selectedRadioOption?.value === 'Test Data' && (
189
232
  <Drawer
190
233
  {...drawerArgs}
191
234
  isOpen={showModal}
192
235
  onClose={() => setShowModal(false)}
193
- isFooterRequired={true}
236
+ isFooterRequired={false}
194
237
  _isExpanded={false}
195
238
  size="small"
239
+
196
240
  >
197
- <Typography>Upload TestData Files Here</Typography>
241
+ <ConditionalDropdown
242
+ label="Select Path Using #"
243
+ placeholder="Enter # to search files"
244
+ isHash
245
+ dataFiles={testData}
246
+ dropdownWidth="auto"
247
+ setHashInputValue={setTestDataSelectedFile}
248
+ />
249
+ <div className="footer_basic_button">
250
+ <Button
251
+ type="button"
252
+ variant="secondary"
253
+ size="small"
254
+ onClick={() => setShowModal(false)}
255
+ label={'Cancel'}
256
+ />
257
+
258
+ <Button
259
+ type={'button'}
260
+ variant="primary"
261
+ size="small"
262
+ label={'Save'}
263
+ onClick={handleSaveButton}
264
+ />
265
+ </div>
198
266
  </Drawer>
199
- }
267
+ )}
200
268
  </>
201
269
  );
202
270
  },
@@ -38,6 +38,7 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
38
38
  handleRemoveFile,
39
39
  isApiResponseError = false,
40
40
  isDisable = false,
41
+ setShowDrawer,
41
42
  }) => {
42
43
  const fileInputRef = useRef<HTMLInputElement | null>(null);
43
44
  const {
@@ -131,6 +132,7 @@ const FileDropzone: React.FC<FileDropzoneProps> = ({
131
132
  handleRemoveFile={handleRemoveFile}
132
133
  setSelectedFile={setSelectedFile}
133
134
  isDisable={isDisable}
135
+ setShowDrawer={setShowDrawer}
134
136
  />
135
137
 
136
138
  {isWebServiceFileDropZone && (
@@ -8,14 +8,18 @@ import { useRef } from 'react';
8
8
  const RadioFilePreview: React.FC<RadioFilePreviewProps> = ({
9
9
  selectedFile,
10
10
  onFileRemoveClick,
11
- onFileReplaceClick
11
+ onFileReplaceClick,
12
+ selectedRadioOption,
13
+ setShowDrawer,
12
14
  }) => {
13
15
  const fileInputRef = useRef<HTMLInputElement | null>(null);
14
16
 
15
17
  const handleReplaceClick = () => {
16
- if (fileInputRef.current) {
17
- fileInputRef.current.click();
18
+ if (selectedRadioOption?.value === 'Test Data') {
19
+ setShowDrawer?.(true);
20
+ return;
18
21
  }
22
+ fileInputRef.current?.click();
19
23
  };
20
24
 
21
25
  const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { DynamicObj } from '../CreateVariable/types';
2
3
  export interface RadioOption {
3
4
  label: string;
4
5
  value: string;
@@ -93,12 +94,12 @@ export interface FileDropzoneProps {
93
94
  /**
94
95
  * Its the File Name of File Selected from Local File.
95
96
  **/
96
- setSelectedFile?: (file: File | null) => void;
97
+ setSelectedFile?: (file: File | DynamicObj | null) => void;
97
98
 
98
99
  /**
99
100
  * Its the File Name of File Selected from Local File.
100
101
  **/
101
- selectedFile?: File | null;
102
+ selectedFile?: File | DynamicObj | null;
102
103
 
103
104
  /**
104
105
  * Its the function which updates the Selected file from Local Directory.
@@ -120,6 +121,11 @@ export interface FileDropzoneProps {
120
121
  **/
121
122
  isDisable?: boolean;
122
123
 
124
+ /**
125
+ * Its the boolean value setted when the replace is clicked for TestData radio option .
126
+ **/
127
+ setShowDrawer?: (value: boolean | ((prevState: boolean) => boolean)) => void;
128
+
123
129
  }
124
130
  export interface FileState {
125
131
  accepted: File[];
@@ -176,11 +182,12 @@ export interface DroppableProps {
176
182
  selectedRadioOption?: Option,
177
183
  radioOptions?: RadioOption[],
178
184
  handleOptionChange?: (option: RadioOption)=> void,
179
- selectedFile?: File | null,
180
- setSelectedFile?: (file: File | null) => void;
185
+ selectedFile?: File | DynamicObj | null,
186
+ setSelectedFile?: (file: File | DynamicObj | null) => void;
181
187
  handleFileChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
182
188
  handleRemoveFile?: () => void;
183
189
  isDisable?: boolean;
190
+ setShowDrawer?: (value: boolean | ((prevState: boolean) => boolean)) => void;
184
191
  }
185
192
 
186
193
  export interface FilePreviewProps {
@@ -196,4 +203,6 @@ export interface RadioFilePreviewProps {
196
203
  onFileRemoveClick?: () => void;
197
204
  onFileReplaceClick?: (file: File | null) => void;
198
205
  setSelectedFile?: (file: File | null) => void;
206
+ selectedRadioOption?: Option,
207
+ setShowDrawer?: (value: boolean | ((prevState: boolean) => boolean)) => void
199
208
  }
@@ -45,7 +45,7 @@ import ManualLocator from '../../assets/icons/manual_locator.svg?react';
45
45
  import LicenseIcon from '../../assets/icons/active_license_icon.svg?react';
46
46
  import DeleteIcon from '../../assets/icons/delete.svg?react';
47
47
  import DetailsIcon from '../../assets/icons/details.svg?react';
48
- import ImpactListIcon from '../../assets/icons/impactList.svg?react';
48
+ import ImpactListIcon from '../../assets/icons/impact_list.svg?react';
49
49
  import Export from '../../assets/icons/export.svg?react';
50
50
  import FormatePainter from '../../assets/icons/formate_painter.svg?react';
51
51
  import Bold from '../../assets/icons/bold.svg?react';
@@ -295,7 +295,7 @@ Components['run_icon'] = RunIcon;
295
295
  Components['license'] = LicenseIcon;
296
296
  Components['delete'] = DeleteIcon;
297
297
  Components['details'] = DetailsIcon;
298
- Components['impactList'] = ImpactListIcon;
298
+ Components['impact_list'] = ImpactListIcon;
299
299
  Components['beautify_icon'] = BeautifyIcon;
300
300
  Components['add_variable_icon'] = AddVariable;
301
301
  Components['replace_file'] = ReplaceFile;
@@ -18,7 +18,7 @@ const InputWithDropdown = forwardRef<HTMLInputElement, InputWithDropdownProps>(
18
18
  error,
19
19
  helperText,
20
20
  optionsList,
21
- selectedOption,
21
+ selectedOption = { label: '', value: '' },
22
22
  autoComplete = 'off',
23
23
  onDropdownChangeHandler = () => {},
24
24
  onInputChangeHandler,
@@ -1,4 +1,3 @@
1
- import { forwardRef } from 'react';
2
1
  import './MachineInputField.scss';
3
2
  import Typography from '../Typography';
4
3
  import Icon from '../Icon';
@@ -6,81 +5,79 @@ import { MachineInputFieldProps, MachineType } from './types';
6
5
  import classNames from 'classnames';
7
6
  import { truncateText } from '../../utils/truncateText/truncateText';
8
7
 
9
- const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
10
- ({
11
- width = '',
12
- options = [],
13
- runCount = 0,
14
- className = '',
15
- contentReverse = false,
16
- onClick = () => {},
17
- modalId = '',
18
- }) => {
19
- const getIcon: Record<MachineType['type'], string> = {
20
- Local: 'local',
21
- Browserstack: 'browserstack_icon',
22
- SauceLabs: 'sause_lab',
23
- LambdaTest: 'lambda_icon',
24
- mac: 'mac_icon',
25
- android: 'android_icon',
26
- linux: 'linux',
27
- 'Google Chrome': 'chrome_icon',
28
- 'Mozilla Firefox': 'fire_fox',
29
- 'Microsoft Edge': 'edge',
30
- 'Internet Explorer': 'internet_explorer',
31
- Safari: 'safari_icon',
32
- Opera: 'opera',
33
- windows: 'windows',
34
- };
8
+ const MachineInputField = ({
9
+ width = '',
10
+ options = [],
11
+ runCount = 0,
12
+ className = '',
13
+ contentReverse = false,
14
+ onClick = () => {},
15
+ modalId = '',
16
+ }: MachineInputFieldProps) => {
17
+ const getIcon: Record<MachineType['type'], string> = {
18
+ local: 'local',
19
+ browserstack: 'browserstack_icon',
20
+ sauceLabs: 'sause_lab',
21
+ lambdaTest: 'lambda_icon',
22
+ mac: 'mac_icon',
23
+ android: 'android_icon',
24
+ linux: 'linux',
25
+ 'google chrome': 'chrome_icon',
26
+ 'mozilla firefox': 'fire_fox',
27
+ 'microsoft edge': 'edge',
28
+ 'internet explorer': 'internet_explorer',
29
+ safari: 'safari_icon',
30
+ opera: 'opera',
31
+ windows: 'windows',
32
+ };
35
33
 
36
- return (
37
- <div
38
- ref={modalId}
39
- style={{ width: width }}
40
- className={classNames('ff-machine-input-field-wrapper', className)}
41
- onClick={() => onClick()}
34
+ return (
35
+ <div
36
+ id={modalId}
37
+ style={{ width: width }}
38
+ className={classNames('ff-machine-input-field-wrapper', className)}
39
+ onClick={() => onClick()}
40
+ >
41
+ <Typography
42
+ as="span"
43
+ color="var(--ff-machine-input-field-text-color)"
44
+ fontSize={8}
45
+ textAlign="center"
46
+ className="ff-machine-input-label"
42
47
  >
43
- <Typography
44
- as="span"
45
- color="var(--ff-machine-input-field-text-color)"
46
- fontSize={8}
47
- textAlign="center"
48
- className="ff-machine-input-label"
49
- >
50
- Run {runCount}
51
- </Typography>
48
+ Run {runCount}
49
+ </Typography>
52
50
 
53
- <div
54
- className={classNames('ff-machine-input-field', {
55
- 'ff-machine-input-field-reverse': contentReverse,
56
- })}
57
- >
58
- {options.map(({ label, type }) => (
59
- <div
60
- key={type}
61
- className={classNames('ff-machine-icon-text-wrapper', {
62
- 'ff-machine-icon-text-wrapper-reverse': contentReverse,
51
+ <div
52
+ className={classNames('ff-machine-input-field', {
53
+ 'ff-machine-input-field-reverse': contentReverse,
54
+ })}
55
+ >
56
+ {options.map(({ label, type }) => (
57
+ <div
58
+ key={type}
59
+ className={classNames('ff-machine-icon-text-wrapper', {
60
+ 'ff-machine-icon-text-wrapper-reverse': contentReverse,
61
+ })}
62
+ >
63
+ <Icon
64
+ name={getIcon[type.toLowerCase()] || 'local'}
65
+ className="ff-machine-icon"
66
+ />
67
+ <Typography
68
+ className={classNames('ff-machine-text', {
69
+ 'ff-machine-text-reverse': contentReverse,
63
70
  })}
71
+ color="var(--ff-machine-input-field-text-color)"
64
72
  >
65
- <Icon
66
- name={getIcon[type] || 'local'}
67
- className="ff-machine-icon"
68
- />
69
- <Typography
70
- className={classNames('ff-machine-text', {
71
- 'ff-machine-text-reverse': contentReverse,
72
- })}
73
- color="var(--ff-machine-input-field-text-color)"
74
- >
75
- {truncateText(label, 15)}
76
- </Typography>
77
- </div>
78
- ))}
79
- </div>
73
+ {truncateText(label, 15)}
74
+ </Typography>
75
+ </div>
76
+ ))}
80
77
  </div>
81
- );
82
- }
83
- );
78
+ </div>
79
+ );
80
+ };
84
81
 
85
82
  MachineInputField.displayName = 'MachineInputField';
86
83
 
@@ -135,13 +135,12 @@ export const MenuOptionBottom: Story = {
135
135
  dropdownPlacement: 'down',
136
136
  },
137
137
  render: (args) => {
138
- const moreRef = useRef<HTMLDivElement>(null);
139
138
  return (
140
- <div ref={moreRef}>
139
+ <div id="more">
141
140
  <MenuOption
142
141
  {...args}
143
142
  options={options}
144
- targetRef={moreRef}
143
+ targetRef={'more'}
145
144
  onOptionClick={handleOptionClick}
146
145
  />
147
146
  </div>
@@ -153,9 +153,15 @@ const MenuOption = ({
153
153
  };
154
154
 
155
155
  const calculateDims = () => {
156
- if (targetRef?.current) {
157
- const rect = targetRef.current.getBoundingClientRect();
156
+ let targetElement: HTMLElement | null = null;
157
+ if (typeof targetRef === 'string') {
158
+ targetElement = document.getElementById(targetRef);
159
+ } else if (targetRef && targetRef.current) {
160
+ targetElement = targetRef.current;
161
+ }
158
162
 
163
+ if (targetElement) {
164
+ const rect = targetElement.getBoundingClientRect();
159
165
  setMenuPosition({
160
166
  top: rect.top + window.scrollY,
161
167
  left: rect.left + window.scrollX,
@@ -164,6 +170,7 @@ const MenuOption = ({
164
170
  });
165
171
  }
166
172
  };
173
+
167
174
  return (
168
175
  <div className="ff-menu-option-container" ref={menuRef}>
169
176
  <Tooltip title={tooltipTitle} placement={tooltipPlacement}>
@@ -208,7 +208,7 @@ interface MenuOptionProps {
208
208
  * @optional
209
209
  */
210
210
  optionCardVariant?: 'primary';
211
- targetRef?: React.RefObject<HTMLElement>;
211
+ targetRef?: string | React.RefObject<HTMLElement>;
212
212
  }
213
213
 
214
214
  interface OptionProps {
@@ -5,12 +5,13 @@ export interface PopUpModalProps {
5
5
  titleMessage: string;
6
6
  subTitleMessage?: string;
7
7
  iconName: string;
8
- modalMessage: string;
8
+ modalMessage: string | React.ReactNode;
9
+ secondaryMessage?: string | React.ReactNode;
9
10
  firstButtonLabel?: string;
10
11
  secondButtonLabel: string;
11
12
  buttonVariant: any;
12
13
  border: string;
13
- popupWidth?:string,
14
+ popupWidth?: string;
14
15
  colorForTitleMessage?: string;
15
- footerContent?:React.ReactNode;
16
+ footerContent?: React.ReactNode;
16
17
  }
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import Search from './Search';
3
- import React,{ useState } from 'react';
3
+ import React, { useState } from 'react';
4
4
  const meta: Meta<typeof Search> = {
5
5
  title: 'Components/Search',
6
6
  component: Search,
@@ -17,7 +17,6 @@ export const Default: Story = {
17
17
  const [searchValue, setSearchValue] = useState('');
18
18
 
19
19
  const handleSearch = (value: string) => {
20
- alert(`Searching for: ${value}`);
21
20
  setSearchValue(value);
22
21
  };
23
22
 
@@ -17,7 +17,7 @@ export interface SelectProps {
17
17
  /*
18
18
  * Selected option for the select dropdown
19
19
  */
20
- selectedOption?: Option;
20
+ selectedOption: Option;
21
21
 
22
22
  /*
23
23
  * onChange callback function for handling selected option changes
@@ -74,6 +74,7 @@
74
74
 
75
75
  .ff-connecting-text {
76
76
  margin-right: 8px;
77
+ cursor: pointer;
77
78
  }
78
79
 
79
80
  .ff-connecting-delete-icon {