pixel-react 1.2.7 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/Drawer/Types.d.ts +23 -12
  3. package/lib/components/{ExcelFile → Excel}/ExcelFile/ExcelFile.d.ts +1 -0
  4. package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.d.ts +39 -10
  5. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducer.d.ts +4 -0
  6. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +40 -0
  7. package/lib/components/{ExcelFile → Excel}/ExcelToolBar/ExcelToolBar.d.ts +7 -3
  8. package/lib/components/MenuOption/MenuOption.d.ts +1 -1
  9. package/lib/components/MenuOption/types.d.ts +4 -0
  10. package/lib/components/Select/Select.stories.d.ts +1 -0
  11. package/lib/components/Toastify/Toastify.d.ts +5 -4
  12. package/lib/components/Toastify/types.d.ts +1 -0
  13. package/lib/index.d.ts +68 -18
  14. package/lib/index.esm.js +1512 -1089
  15. package/lib/index.esm.js.map +1 -1
  16. package/lib/index.js +1513 -1089
  17. package/lib/index.js.map +1 -1
  18. package/lib/tsconfig.tsbuildinfo +1 -1
  19. package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
  20. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
  21. package/lib/utils/getSequentialPayload/types.d.ts +30 -0
  22. package/package.json +3 -3
  23. package/src/assets/Themes/BaseTheme.scss +4 -0
  24. package/src/assets/icons/maximize_icon.svg +5 -0
  25. package/src/assets/styles/_fonts.scss +1 -1
  26. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
  27. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
  28. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
  29. package/src/components/Drawer/Drawer.scss +1 -0
  30. package/src/components/Drawer/Types.ts +24 -13
  31. package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
  32. package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
  33. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
  34. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
  35. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
  36. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
  37. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
  38. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
  39. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
  40. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
  41. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
  42. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
  43. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
  44. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
  45. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
  46. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
  47. package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
  48. package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
  49. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
  50. package/src/components/Form/Form.scss +54 -35
  51. package/src/components/Form/Form.stories.tsx +264 -225
  52. package/src/components/Icon/iconList.ts +2 -1
  53. package/src/components/Input/Input.tsx +0 -1
  54. package/src/components/MenuOption/MenuOption.scss +0 -1
  55. package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
  56. package/src/components/MenuOption/MenuOption.tsx +5 -4
  57. package/src/components/MenuOption/types.ts +4 -0
  58. package/src/components/MultiSelect/MultiSelect.scss +5 -1
  59. package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
  60. package/src/components/MultiSelect/MultiSelect.tsx +27 -14
  61. package/src/components/Select/Select.stories.tsx +161 -18
  62. package/src/components/Select/Select.tsx +41 -33
  63. package/src/components/Table/Table.scss +6 -5
  64. package/src/components/Table/Table.stories.tsx +0 -9
  65. package/src/components/Table/Table.tsx +2 -2
  66. package/src/components/TableTree/TableTree.scss +1 -1
  67. package/src/components/TableTree/TableTree.tsx +3 -1
  68. package/src/components/Toastify/Toastify.stories.tsx +29 -10
  69. package/src/components/Toastify/Toastify.tsx +42 -16
  70. package/src/components/Toastify/types.ts +2 -0
  71. package/src/index.ts +4 -2
  72. package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
  73. package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
  74. package/src/utils/getSequentialPayload/types.ts +35 -0
  75. package/lib/components/AddButton/AddButton.d.ts +0 -5
  76. package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
  77. package/lib/components/AddButton/index.d.ts +0 -1
  78. package/lib/components/AddButton/types.d.ts +0 -4
  79. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
  80. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
  81. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -12
  82. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
  83. package/lib/utils/find/findAndInsert.d.ts +0 -7
  84. package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
  85. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
  86. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
  87. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
  88. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
  89. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
  90. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
  91. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
  92. package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
  93. package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  94. package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  95. package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
  96. package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
  97. package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  98. package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  99. package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  100. package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  101. package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  102. package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
  103. package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
  104. package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  105. package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  106. package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  107. package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
  108. package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  109. /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
  110. /package/lib/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.d.ts +0 -0
  111. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.d.ts +0 -0
  112. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.d.ts +0 -0
  113. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.d.ts +0 -0
  114. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.d.ts +0 -0
  115. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.d.ts +0 -0
  116. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.d.ts +0 -0
  117. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.d.ts +0 -0
  118. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.d.ts +0 -0
  119. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.d.ts +0 -0
  120. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.d.ts +0 -0
  121. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.d.ts +0 -0
  122. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.d.ts +0 -0
  123. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.d.ts +0 -0
  124. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.d.ts +0 -0
  125. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.d.ts +0 -0
  126. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.d.ts +0 -0
  127. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.d.ts +0 -0
  128. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.d.ts +0 -0
  129. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.d.ts +0 -0
  130. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.d.ts +0 -0
  131. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.d.ts +0 -0
  132. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.d.ts +0 -0
  133. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.d.ts +0 -0
  134. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.d.ts +0 -0
  135. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.d.ts +0 -0
  136. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.d.ts +0 -0
  137. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.d.ts +0 -0
  138. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.d.ts +0 -0
  139. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.d.ts +0 -0
  140. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.d.ts +0 -0
  141. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.d.ts +0 -0
  142. /package/lib/components/{ExcelFile → Excel}/ExcelFile.stories.d.ts +0 -0
  143. /package/lib/components/{ExcelFile → Excel}/Types.d.ts +0 -0
  144. /package/lib/components/{ExcelFile → Excel}/index.d.ts +0 -0
  145. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
  146. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
  147. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
  148. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
  149. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
  150. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
  151. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
  152. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
  153. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
  154. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
  155. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
  156. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
  157. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
  158. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
  159. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
  160. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
  161. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
  162. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
  163. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
  164. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
  165. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
  166. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
  167. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
  168. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
  169. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
  170. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
  171. /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
  172. /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import MultiSelect from './MultiSelect';
3
- import { useState } from 'react';
3
+ import { useEffect, useState } from 'react';
4
+ import { Option } from './MultiSelectTypes';
4
5
 
5
6
  const meta: Meta<typeof MultiSelect> = {
6
7
  title: 'Components/MultiSelect',
@@ -93,24 +94,27 @@ export const EmailGroup: Story = {
93
94
 
94
95
  export const Controlled: Story = {
95
96
  render: () => {
96
- const [options] = useState([
97
- { label: 'Apple', value: 'apple' },
98
- { label: 'Banana', value: 'banana' },
99
- { label: 'Cherry', value: 'cherry' },
100
- { label: 'Date', value: 'date' },
101
- { label: 'Grape', value: 'grape' },
102
- { label: 'Kiwi', value: 'kiwi' },
103
- { label: 'Mango', value: 'mango' },
104
- { label: 'Orange', value: 'orange' },
105
- { label: 'Peach', value: 'peach' },
106
- { label: 'Strawberry', value: 'strawberry' },
107
- ]);
97
+ const [options, setOptions] = useState<Option[]>([]);
108
98
  const [selectedOptions, setSelectedOptions] = useState<
109
99
  { label?: string; value?: string }[]
110
100
  >([{ label: 'Apple', value: 'apple' }]);
111
101
  const onChange = (options: { label?: string; value?: string }[]) => {
112
102
  setSelectedOptions(options);
113
103
  };
104
+ useEffect(() => {
105
+ setOptions([
106
+ { label: 'Apple', value: 'apple' },
107
+ { label: 'Banana', value: 'banana' },
108
+ { label: 'Cherry', value: 'cherry' },
109
+ { label: 'Date', value: 'date' },
110
+ { label: 'Grape', value: 'grape' },
111
+ { label: 'Kiwi', value: 'kiwi' },
112
+ { label: 'Mango', value: 'mango' },
113
+ { label: 'Orange', value: 'orange' },
114
+ { label: 'Peach', value: 'peach' },
115
+ { label: 'Strawberry', value: 'strawberry' },
116
+ ]);
117
+ }, []);
114
118
  return (
115
119
  <MultiSelect
116
120
  label={'Fruits'}
@@ -20,7 +20,11 @@ const ChipElement = ({
20
20
  if (label) {
21
21
  return (
22
22
  <div className="ff-multiselect-chip">
23
- <span className={`ff-multiselect-chip-label ${disableChip && 'label-padding'}`}>
23
+ <span
24
+ className={`ff-multiselect-chip-label ${
25
+ disableChip && 'label-padding'
26
+ }`}
27
+ >
24
28
  <Tooltip
25
29
  placement="bottom"
26
30
  title={label?.length > 25 ? label : ''}
@@ -60,9 +64,6 @@ const MultiSelect = ({
60
64
  }: MultiSelectProps) => {
61
65
  const [isOpen, setIsOpen] = useState<boolean>(false);
62
66
  const [allOptions, setAllOptions] = useState(options);
63
- useEffect(() => {
64
- setAllOptions(options);
65
- }, [options]);
66
67
 
67
68
  const [searchedKeyword, setSearchedKeyword] = useState('');
68
69
  const [isSelectFocusedOnce, setIsSelectFocusedOnce] =
@@ -186,12 +187,20 @@ const MultiSelect = ({
186
187
  calculatePosition();
187
188
  }
188
189
  }, [isOpen, allOptions]);
190
+ function getScrollbarWidth(): number {
191
+ const div = document.createElement('div');
192
+ div.style.visibility = 'hidden';
193
+ div.style.overflow = 'scroll';
194
+ document.body.appendChild(div);
195
+ const scrollbarWidth = div.offsetWidth - div.clientWidth;
196
+ document.body.removeChild(div);
197
+ return scrollbarWidth;
198
+ }
189
199
  const onSelectToggleScroll = (isEnabled: boolean) => {
190
- const bodyScrollWidth = window.innerWidth - document.body.clientWidth;
200
+ const bodyScrollWidth = getScrollbarWidth();
191
201
  document.body.style.paddingRight = isEnabled ? '' : `${bodyScrollWidth}px`;
192
202
  document.body.style.overflow = isEnabled ? '' : 'hidden';
193
203
  };
194
-
195
204
  useEffect(() => {
196
205
  if (isOpen) {
197
206
  onSelectToggleScroll(!isOpen);
@@ -215,6 +224,8 @@ const MultiSelect = ({
215
224
  }));
216
225
  setAllOptions(initializeOptions);
217
226
  }
227
+ }, [options]);
228
+ useEffect(() => {
218
229
  const handleClickAnywhere = (event: MouseEvent) => {
219
230
  if (
220
231
  dropdownWrapper.current &&
@@ -240,6 +251,7 @@ const MultiSelect = ({
240
251
  document.body.style.overflow = 'auto';
241
252
  };
242
253
  }, []);
254
+
243
255
  return (
244
256
  <div
245
257
  ref={selectWrapper}
@@ -261,9 +273,10 @@ const MultiSelect = ({
261
273
  selectedOptions?.length ||
262
274
  (isFieldSkipped && required),
263
275
  'default-label': !isOpen && !selectedOptions?.length,
264
- })}
265
- children={label}
266
- />
276
+ })}>
277
+ {required && <span className="ff-required-asterisk">*</span>}
278
+ {label}
279
+ </Typography>
267
280
 
268
281
  <div className="ff-multiselect-chip-container">
269
282
  {displayCount ? (
@@ -306,11 +319,11 @@ const MultiSelect = ({
306
319
  </div>
307
320
  </div>
308
321
  </div>
309
- {hiddenCount > 0 && displayCount && (
310
- <div className="ff-multiselect-more-chip" onClick={toggleDropdown}>
311
- +{hiddenCount}
312
- </div>
313
- )}
322
+ {hiddenCount > 0 && displayCount && (
323
+ <div className="ff-multiselect-more-chip" onClick={toggleDropdown}>
324
+ +{hiddenCount}
325
+ </div>
326
+ )}
314
327
  <div onClick={toggleDropdown} className="ff-multiselect__toggle">
315
328
  <Icon
316
329
  name="arrow_down"
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
2
2
  import Select from './Select';
3
3
  import { useState } from 'react';
4
4
  import { Option } from './types';
5
+ import RadioGroup from '../RadioGroup';
5
6
 
6
7
  const meta: Meta<typeof Select> = {
7
8
  title: 'Components/Select',
@@ -20,9 +21,26 @@ export const Primary: Story = {
20
21
  labelAccessor: 'name',
21
22
  valueAccessor: 'value',
22
23
  optionsList: [
23
- { label: 'Option 1', value: '1', name: 'abcd' },
24
- { label: 'Option 2', value: '2', name: '123' },
25
- { label: 'Option 3', value: '3', name: '456' },
24
+ {
25
+ label: 'fire-flink-LIC4900-onPrem',
26
+ value: 'fire-flink-LIC4900-onPrem',
27
+ name: 'fireflink',
28
+ },
29
+ {
30
+ label: 'fire-flink-LIC3179',
31
+ value: 'fire-flink-LIC3179',
32
+ name: 'local',
33
+ },
34
+ {
35
+ label: 'fire-flink-LIC4937',
36
+ value: 'fire-flink-LIC4937',
37
+ name: 'browser stack',
38
+ },
39
+ {
40
+ label: 'fire-flink-LIC4999',
41
+ value: 'fire-flink-LIC4999',
42
+ name: 'lambda test',
43
+ },
26
44
  ],
27
45
  },
28
46
  };
@@ -31,9 +49,22 @@ export const WithError: Story = {
31
49
  args: {
32
50
  label: 'Select',
33
51
  optionsList: [
34
- { label: 'Option 1', value: '1' },
35
- { label: 'Option 2', value: '2' },
36
- { label: 'Option 3', value: '3' },
52
+ {
53
+ label: 'fire-flink-LIC4900-onPrem',
54
+ value: 'fire-flink-LIC4900-onPrem',
55
+ },
56
+ {
57
+ label: 'fire-flink-LIC3179',
58
+ value: 'fire-flink-LIC3179',
59
+ },
60
+ {
61
+ label: 'fire-flink-LIC4937',
62
+ value: 'fire-flink-LIC4937',
63
+ },
64
+ {
65
+ label: 'fire-flink-LIC4999',
66
+ value: 'fire-flink-LIC4999',
67
+ },
37
68
  ],
38
69
  errorMsg: 'Please select a option',
39
70
  },
@@ -43,9 +74,22 @@ export const WithoutLabel: Story = {
43
74
  args: {
44
75
  showLabel: false,
45
76
  optionsList: [
46
- { label: 'Option 1', value: '1' },
47
- { label: 'Option 2', value: '2' },
48
- { label: 'Option 3', value: '3' },
77
+ {
78
+ label: 'fire-flink-LIC4900-onPrem',
79
+ value: 'fire-flink-LIC4900-onPrem',
80
+ },
81
+ {
82
+ label: 'fire-flink-LIC3179',
83
+ value: 'fire-flink-LIC3179',
84
+ },
85
+ {
86
+ label: 'fire-flink-LIC4937',
87
+ value: 'fire-flink-LIC4937',
88
+ },
89
+ {
90
+ label: 'fire-flink-LIC4999',
91
+ value: 'fire-flink-LIC4999',
92
+ },
49
93
  ],
50
94
  },
51
95
  };
@@ -69,11 +113,24 @@ export const Disable: Story = {
69
113
  export const WithInitialValue: Story = {
70
114
  args: {
71
115
  label: 'Select',
72
- selectedOption: { label: 'Option 2', value: '2' },
116
+ selectedOption: { label: 'Option 2', value: 'Option 2' },
73
117
  optionsList: [
74
- { label: 'Option 1', value: 'Option 1' },
75
- { label: 'Option 2', value: 'Option 2' },
76
- { label: 'Option 3', value: 'Option 3' },
118
+ {
119
+ label: 'fire-flink-LIC4900-onPrem',
120
+ value: 'fire-flink-LIC4900-onPrem',
121
+ },
122
+ {
123
+ label: 'fire-flink-LIC3179',
124
+ value: 'fire-flink-LIC3179',
125
+ },
126
+ {
127
+ label: 'fire-flink-LIC4937',
128
+ value: 'fire-flink-LIC4937',
129
+ },
130
+ {
131
+ label: 'fire-flink-LIC4999',
132
+ value: 'fire-flink-LIC4999',
133
+ },
77
134
  ],
78
135
  },
79
136
  };
@@ -81,14 +138,27 @@ export const WithInitialValue: Story = {
81
138
  export const OptionSelection: Story = {
82
139
  render: () => {
83
140
  const optionsList = [
84
- { label: 'Option 1', value: 'Option 1' },
85
- { label: 'Option 2', value: 'Option 2' },
86
- { label: 'Option 3', value: 'Option 3' },
141
+ {
142
+ label: 'fire-flink-LIC4900-onPrem',
143
+ value: 'fire-flink-LIC4900-onPrem',
144
+ },
145
+ {
146
+ label: 'fire-flink-LIC3179',
147
+ value: 'fire-flink-LIC3179',
148
+ },
149
+ {
150
+ label: 'fire-flink-LIC4937',
151
+ value: 'fire-flink-LIC4937',
152
+ },
153
+ {
154
+ label: 'fire-flink-LIC4999',
155
+ value: 'fire-flink-LIC4999',
156
+ },
87
157
  ];
88
158
 
89
159
  const [selectedOption, setSelectedOption] = useState<Option>({
90
- label: 'Option 2',
91
- value: '2',
160
+ label: 'fire-flink-LIC3179',
161
+ value: 'fire-flink-LIC3179',
92
162
  });
93
163
 
94
164
  const handleChange = (option: Option) => {
@@ -155,4 +225,77 @@ export const CustomJSX: Story = {
155
225
  },
156
226
  };
157
227
 
228
+ export const updateOptionFromOutside: Story = {
229
+ render: () => {
230
+ const [selectedOption, setSelectedOption] = useState<Option>({
231
+ label: 'fire-flink-LIC4900-onPrem',
232
+ value: 'fire-flink-LIC4900-onPrem',
233
+ });
234
+
235
+ const optionsList = [
236
+ {
237
+ label: 'fire-flink-LIC4900-onPrem',
238
+ value: 'fire-flink-LIC4900-onPrem',
239
+ },
240
+ {
241
+ label: 'fire-flink-LIC3179',
242
+ value: 'fire-flink-LIC3179',
243
+ },
244
+ {
245
+ label: 'fire-flink-LIC4937',
246
+ value: 'fire-flink-LIC4937',
247
+ },
248
+ {
249
+ label: 'fire-flink-LIC4999',
250
+ value: 'fire-flink-LIC4999',
251
+ },
252
+ ];
253
+
254
+ const handleChange = (option: Option) => {
255
+ setSelectedOption(option);
256
+ };
257
+
258
+ const radioOptions = [
259
+ {
260
+ label: 'fire-flink-LIC4900-onPrem',
261
+ value: 'fire-flink-LIC4900-onPrem',
262
+ },
263
+ {
264
+ label: 'fire-flink-LIC3179',
265
+ value: 'fire-flink-LIC3179',
266
+ },
267
+ {
268
+ label: 'fire-flink-LIC4937',
269
+ value: 'fire-flink-LIC4937',
270
+ },
271
+ {
272
+ label: 'fire-flink-LIC4999',
273
+ value: 'fire-flink-LIC4999',
274
+ },
275
+ ];
276
+ const [selectedRadioOption, setSelectedRadioOption] = useState('option2');
277
+ const handleOptionChange = (option: Option) => {
278
+ setSelectedRadioOption(option.value);
279
+ setSelectedOption(option);
280
+ };
281
+
282
+ return (
283
+ <div>
284
+ <Select
285
+ optionsList={optionsList}
286
+ selectedOption={selectedOption}
287
+ onChange={handleChange}
288
+ showLabel={false}
289
+ />
290
+ <RadioGroup
291
+ selectedValue={selectedRadioOption}
292
+ onChange={handleOptionChange}
293
+ name="option"
294
+ options={radioOptions}
295
+ />
296
+ </div>
297
+ );
298
+ },
299
+ };
300
+
158
301
  export default meta;
@@ -251,6 +251,12 @@ const Select = ({
251
251
  }
252
252
  }, []);
253
253
 
254
+ useEffect(() => {
255
+ if (!checkEmpty(selectedOption.label)) {
256
+ onSelectOptionSelector(selectedOption);
257
+ }
258
+ }, [selectedOption]);
259
+
254
260
  const applyActiveOptionClasses = !isInputFocused && Boolean(option);
255
261
 
256
262
  return (
@@ -312,39 +318,41 @@ const Select = ({
312
318
  color={iconColor}
313
319
  />
314
320
  )}
315
- <fieldset
316
- className={classNames('ff-select-fieldset', {
317
- 'ff-select-fieldset--no-label': !showLabel,
318
- 'ff-select-fieldset--default': !isInputFocused,
319
- 'ff-select-fieldset--active': isInputFocused,
320
- 'ff-select-fieldset--option': applyActiveOptionClasses,
321
- 'ff-select-fieldset--error': errorMsg,
322
- 'ff-select-fieldset--border-radius': !borderRadius,
323
- 'ff-select-fieldset--no-border': !showBorder,
324
- })}
325
- >
326
- {showLabel && (
327
- <legend
328
- className={classNames('ff-select-legend', {
329
- 'ff-select-legend--default': !isInputFocused,
330
- 'ff-select-legend--active': isInputFocused,
331
- 'ff-select-legend--option': applyActiveOptionClasses,
332
- 'ff-select-legend--error': errorMsg,
333
- })}
334
- >
335
- {required && (
336
- <Typography
337
- fontSize={8}
338
- color={'var(--error-light)'}
339
- className="ff-select-legend--required"
340
- >
341
- *
342
- </Typography>
343
- )}
344
- {label}
345
- </legend>
346
- )}
347
- </fieldset>
321
+ {(!checkEmpty(option) || showOptions) && (
322
+ <fieldset
323
+ className={classNames('ff-select-fieldset', {
324
+ 'ff-select-fieldset--no-label': !showLabel,
325
+ 'ff-select-fieldset--default': !isInputFocused,
326
+ 'ff-select-fieldset--active': isInputFocused,
327
+ 'ff-select-fieldset--option': applyActiveOptionClasses,
328
+ 'ff-select-fieldset--error': errorMsg,
329
+ 'ff-select-fieldset--border-radius': !borderRadius,
330
+ 'ff-select-fieldset--no-border': !showBorder,
331
+ })}
332
+ >
333
+ {showLabel && (
334
+ <legend
335
+ className={classNames('ff-select-legend', {
336
+ 'ff-select-legend--default': !isInputFocused,
337
+ 'ff-select-legend--active': isInputFocused,
338
+ 'ff-select-legend--option': applyActiveOptionClasses,
339
+ 'ff-select-legend--error': errorMsg,
340
+ })}
341
+ >
342
+ {required && (
343
+ <Typography
344
+ fontSize={8}
345
+ color={'var(--error-light)'}
346
+ className="ff-select-legend--required"
347
+ >
348
+ *
349
+ </Typography>
350
+ )}
351
+ {label}
352
+ </legend>
353
+ )}
354
+ </fieldset>
355
+ )}
348
356
  </div>
349
357
 
350
358
  {errorMsg && (
@@ -24,10 +24,10 @@
24
24
  th {
25
25
  @extend .fontMd;
26
26
  border-bottom: 1px solid var(--slider-table-color);
27
- text-transform: uppercase;
28
27
  }
29
- th:first-child {
30
- div {
28
+ th{
29
+ .ff-label-checkbox-container{
30
+ display: flex;
31
31
  align-items: center;
32
32
  .ff-table-checkbox {
33
33
  padding-right: 8px;
@@ -66,8 +66,9 @@
66
66
  cursor: pointer;
67
67
  }
68
68
  }
69
- td:first-child {
70
- div {
69
+ td{
70
+ .ff-data-checkbox-container {
71
+ display: flex;
71
72
  align-items: center;
72
73
  .ff-table-checkbox {
73
74
  padding-right: 8px;
@@ -1,7 +1,6 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { StoryObj, Meta } from '@storybook/react';
3
3
  import Table from './Table';
4
- import Icon from '../Icon';
5
4
 
6
5
  const meta: Meta<typeof Table> = {
7
6
  title: 'Components/Table',
@@ -160,14 +159,6 @@ const columnsData = [
160
159
  return (
161
160
  <div title={e.value} style={{ color: 'blue' }}>
162
161
  {e.value}
163
- <div style={{ textAlign: 'right' }} className="icon-container">
164
- <span>
165
- <Icon name="edit_icon" height={12} width={12} />
166
- </span>
167
- <span>
168
- <Icon name="delete" height={12} width={12} />
169
- </span>
170
- </div>
171
162
  </div>
172
163
  );
173
164
  },
@@ -89,7 +89,7 @@ const Table = ({
89
89
  key={column.header}
90
90
  style={{ width: column?.width }}
91
91
  >
92
- <div>
92
+ <div className='ff-label-checkbox-container'>
93
93
  {index === 0 && withCheckbox && (
94
94
  <span className="ff-table-checkbox">
95
95
  <Checkbox
@@ -129,7 +129,7 @@ const Table = ({
129
129
  'clickable-cell': column.onClick,
130
130
  })}
131
131
  >
132
- <Typography as="div" color={tableDataTextColor}>
132
+ <Typography as="div" color={tableDataTextColor} className='ff-data-checkbox-container'>
133
133
  {i === 0 && withCheckbox && (
134
134
  <span className="ff-table-checkbox">
135
135
  <Checkbox
@@ -107,7 +107,7 @@
107
107
 
108
108
  .ff-node-li {
109
109
  position: relative;
110
- --indent-size: 16px;
110
+ --indent-size: 18px;
111
111
  --total-children-height: var(--node-height);
112
112
 
113
113
  td:first-child {
@@ -10,6 +10,8 @@ import './TableTree.scss';
10
10
  import RadioButton from '../RadioButton';
11
11
  import Typography from '../Typography';
12
12
 
13
+ import Arrow from '../../assets/icons/arrows_down_icon.svg?react';
14
+
13
15
  interface ColumnDataProps {
14
16
  name: string;
15
17
  accessor: string;
@@ -146,7 +148,7 @@ const TableTree = ({
146
148
  isExpanded ? 'ff-expanded' : 'ff-collapsed'
147
149
  }`}
148
150
  >
149
- <Icon name="arrows_down_icon" height={12} width={12} />
151
+ <Arrow />
150
152
  </span>
151
153
  )}
152
154
  </span>
@@ -25,27 +25,46 @@ export const Controlled: Story = {
25
25
  args: {
26
26
  ...defaultArgs,
27
27
  },
28
- // import { Toastify, toast } from 'pixel-react';
29
28
  render: () => (
30
- <>
29
+
30
+ /*
31
+ Note:-
32
+ import { Toastify, toast } from 'pixel-react';
33
+ */
34
+
35
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
31
36
  {/* Render Toastify to allow toast notifications */}
32
37
  <Toastify />
33
38
 
34
39
  {/* Button to trigger a toast notification */}
35
40
  <Button
36
41
  variant="primary"
42
+ label="Show Success Toast"
37
43
  onClick={() => toast.success('Your request was successful!')}
38
- >
39
- Show Success Toast
40
- </Button>
41
- <br/>
44
+ />
42
45
  <Button
43
46
  variant="delete"
47
+ label="Show Error Toast"
44
48
  onClick={() => toast.error('Something went wrong!')}
45
- >
46
- Show Error Toast
47
- </Button>
48
- </>
49
+ />
50
+ <Button
51
+ variant="warning"
52
+ label="Show Object Toast"
53
+ onClick={() =>
54
+ toast.warning('Something went wrong!', { a: 'hi', b: '5', c: 10 })
55
+ }
56
+ />
57
+ <Button
58
+ variant="warning"
59
+ label="Show Array Toast"
60
+ onClick={() => toast.warning('Something went wrong!', ['1', 4, 'hi'])}
61
+ />
62
+ <Button
63
+ variant="warning"
64
+ label="Show function Toast"
65
+ onClick={() => toast.warning('Something went wrong!', () => {})}
66
+ />
67
+ </div>
49
68
  ),
50
69
  };
51
70