pixel-react 1.2.6 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/Drawer/Types.d.ts +29 -17
  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/MultiSelect/MultiSelect.d.ts +1 -1
  11. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
  12. package/lib/components/Select/Select.stories.d.ts +1 -0
  13. package/lib/components/Toastify/Toastify.d.ts +5 -4
  14. package/lib/components/Toastify/types.d.ts +1 -0
  15. package/lib/index.d.ts +76 -24
  16. package/lib/index.esm.js +1467 -1038
  17. package/lib/index.esm.js.map +1 -1
  18. package/lib/index.js +1468 -1038
  19. package/lib/index.js.map +1 -1
  20. package/lib/tsconfig.tsbuildinfo +1 -1
  21. package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -0
  22. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
  23. package/lib/utils/getSequentialPayload/types.d.ts +30 -0
  24. package/package.json +3 -3
  25. package/src/assets/Themes/BaseTheme.scss +4 -0
  26. package/src/assets/icons/maximize_icon.svg +5 -0
  27. package/src/assets/styles/_fonts.scss +1 -1
  28. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +15 -6
  29. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +0 -5
  30. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +20 -10
  31. package/src/components/Drawer/Drawer.scss +1 -0
  32. package/src/components/Drawer/Drawer.stories.tsx +8 -9
  33. package/src/components/Drawer/Drawer.tsx +8 -5
  34. package/src/components/Drawer/Types.ts +27 -14
  35. package/src/components/Excel/ExcelFile/ExcelFile.scss +62 -0
  36. package/src/components/Excel/ExcelFile/ExcelFile.tsx +312 -0
  37. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.tsx +2 -2
  38. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.tsx +3 -3
  39. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.tsx +4 -4
  40. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.tsx +2 -2
  41. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.tsx +1 -1
  42. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.tsx +3 -3
  43. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.tsx +4 -4
  44. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.tsx +4 -4
  45. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.scss +26 -24
  46. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.tsx +13 -45
  47. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.tsx +1 -1
  48. package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/actions.ts +88 -20
  49. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +495 -0
  50. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +758 -0
  51. package/src/components/{ExcelFile → Excel}/ExcelFile.stories.tsx +45 -0
  52. package/src/components/Excel/ExcelToolBar/ExcelToolBar.scss +36 -0
  53. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +346 -0
  54. package/src/components/Form/Form.scss +54 -35
  55. package/src/components/Form/Form.stories.tsx +264 -225
  56. package/src/components/Form/Forms.tsx +5 -1
  57. package/src/components/Icon/iconList.ts +2 -1
  58. package/src/components/Input/Input.tsx +0 -1
  59. package/src/components/MenuOption/MenuOption.scss +0 -1
  60. package/src/components/MenuOption/MenuOption.stories.tsx +3 -0
  61. package/src/components/MenuOption/MenuOption.tsx +5 -4
  62. package/src/components/MenuOption/types.ts +4 -0
  63. package/src/components/ModulesChip/ModuleChip.scss +2 -2
  64. package/src/components/ModulesChip/ModuleChip.tsx +4 -4
  65. package/src/components/MultiSelect/Dropdown.tsx +5 -2
  66. package/src/components/MultiSelect/MultiSelect.scss +16 -11
  67. package/src/components/MultiSelect/MultiSelect.stories.tsx +17 -13
  68. package/src/components/MultiSelect/MultiSelect.tsx +49 -26
  69. package/src/components/MultiSelect/MultiSelectTypes.ts +2 -1
  70. package/src/components/Select/Select.stories.tsx +161 -18
  71. package/src/components/Select/Select.tsx +41 -33
  72. package/src/components/Table/Table.scss +6 -5
  73. package/src/components/Table/Table.stories.tsx +0 -9
  74. package/src/components/Table/Table.tsx +2 -2
  75. package/src/components/TableTree/TableTree.scss +1 -1
  76. package/src/components/TableTree/TableTree.tsx +3 -1
  77. package/src/components/Toastify/Toastify.stories.tsx +29 -10
  78. package/src/components/Toastify/Toastify.tsx +42 -16
  79. package/src/components/Toastify/types.ts +2 -0
  80. package/src/components/Tooltip/Tooltip.scss +1 -1
  81. package/src/index.ts +4 -2
  82. package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +75 -0
  83. package/src/utils/getSequentialPayload/getSequentialPayload.ts +29 -0
  84. package/src/utils/getSequentialPayload/types.ts +35 -0
  85. package/lib/components/AddButton/AddButton.d.ts +0 -5
  86. package/lib/components/AddButton/AddButton.stories.d.ts +0 -6
  87. package/lib/components/AddButton/index.d.ts +0 -1
  88. package/lib/components/AddButton/types.d.ts +0 -4
  89. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +0 -14
  90. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +0 -27
  91. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -12
  92. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +0 -24
  93. package/lib/utils/find/findAndInsert.d.ts +0 -7
  94. package/lib/utils/find/findAndInsert.stories.d.ts +0 -7
  95. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +0 -952
  96. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -24
  97. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +0 -162
  98. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +0 -16
  99. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +0 -68
  100. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -19
  101. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +0 -291
  102. package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
  103. package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  104. package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
  105. package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
  106. package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
  107. package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
  108. package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
  109. package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
  110. package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
  111. package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
  112. package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
  113. package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
  114. package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
  115. package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
  116. package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
  117. package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
  118. package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
  119. /package/lib/components/{ExcelFile → Excel}/ColorBarSelector/ColorBarSelector.d.ts +0 -0
  120. /package/lib/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.d.ts +0 -0
  121. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ActiveCell.d.ts +0 -0
  122. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Cell.d.ts +0 -0
  123. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/ColumnIndicator.d.ts +0 -0
  124. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.d.ts +0 -0
  125. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/CornerIndicator.d.ts +0 -0
  126. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataEditor.d.ts +0 -0
  127. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/DataViewer.d.ts +0 -0
  128. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/FloatingRect.d.ts +0 -0
  129. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.d.ts +0 -0
  130. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.d.ts +0 -0
  131. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/RowIndicator.d.ts +0 -0
  132. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.d.ts +0 -0
  133. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Spreadsheet.d.ts +0 -0
  134. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Table.d.ts +0 -0
  135. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.d.ts +0 -0
  136. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.d.ts +0 -0
  137. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.d.ts +0 -0
  138. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.d.ts +0 -0
  139. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.d.ts +0 -0
  140. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.d.ts +0 -0
  141. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.d.ts +0 -0
  142. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.d.ts +0 -0
  143. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.d.ts +0 -0
  144. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.d.ts +0 -0
  145. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.d.ts +0 -0
  146. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.d.ts +0 -0
  147. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.d.ts +0 -0
  148. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.d.ts +0 -0
  149. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.d.ts +0 -0
  150. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.d.ts +0 -0
  151. /package/lib/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.d.ts +0 -0
  152. /package/lib/components/{ExcelFile → Excel}/ExcelFile.stories.d.ts +0 -0
  153. /package/lib/components/{ExcelFile → Excel}/Types.d.ts +0 -0
  154. /package/lib/components/{ExcelFile → Excel}/index.d.ts +0 -0
  155. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.scss +0 -0
  156. /package/src/components/{ExcelFile/ColorBarselector → Excel/ColorBarSelector}/ColorBarSelector.tsx +0 -0
  157. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.scss +0 -0
  158. /package/src/components/{ExcelFile → Excel}/ContextMenu/ContextMenu.tsx +0 -0
  159. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Copied.tsx +0 -0
  160. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/HeaderRow.tsx +0 -0
  161. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Row.tsx +0 -0
  162. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/Selected.tsx +0 -0
  163. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/areModelsEqual.ts +0 -0
  164. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/context.ts +0 -0
  165. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/engine.ts +0 -0
  166. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/formula.ts +0 -0
  167. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/index.ts +0 -0
  168. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-graph.ts +0 -0
  169. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-hash.ts +0 -0
  170. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/engine/point-set.ts +0 -0
  171. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/index.ts +0 -0
  172. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/matrix.ts +0 -0
  173. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point-range.ts +0 -0
  174. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/point.ts +0 -0
  175. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/selection.ts +0 -0
  176. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/types.ts +0 -0
  177. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/typings/fast-formula-parser.d.ts +0 -0
  178. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-dispatch.ts +0 -0
  179. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/use-selector.ts +0 -0
  180. /package/src/components/{ExcelFile/ExcelFile/Excel → Excel/ExcelFile/ExcelFileComponents}/util.ts +0 -0
  181. /package/src/components/{ExcelFile → Excel}/Types.ts +0 -0
  182. /package/src/components/{ExcelFile → Excel}/index.ts +0 -0
@@ -10,14 +10,14 @@ const ModuleChip: React.FC<ModuleChipProps> = ({
10
10
  }) => {
11
11
  return (
12
12
  <div
13
- className={classNames('ff-expandable-chip-menu', {
14
- 'ff-expandable-chip-menu--active': isActive,
13
+ className={classNames('ff-Module-chip', {
14
+ 'ff-Module-chip--active': isActive,
15
15
  })}
16
16
  onClick={onClick}
17
17
  >
18
18
  <div
19
- className={classNames(`ff-label-chip `, {
20
- 'ff-label-chip--active': isActive,
19
+ className={classNames(`ff-Module-label-chip `, {
20
+ 'ff-Module-label-chip--active': isActive,
21
21
  })}
22
22
  >
23
23
  <Typography fontSize={'14px'} fontWeight="regular" lineHeight="21px">
@@ -6,6 +6,7 @@ import { ThemeContext } from '../ThemeProvider/ThemeProvider';
6
6
  import classNames from 'classnames';
7
7
  import Button from '../Button';
8
8
  import Typography from '../Typography';
9
+ import Checkbox from '../Checkbox';
9
10
 
10
11
  const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
11
12
  (
@@ -80,9 +81,11 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
80
81
  role="option"
81
82
  className={`dropdown-option-container`}
82
83
  key={info.label}
83
- onClick={() => handleOptionChange(info, !info.isChecked)}
84
+ onClick={() =>
85
+ !info?.isDisabled && handleOptionChange(info, !info.isChecked)
86
+ }
84
87
  >
85
- <input type="checkbox" checked={info.isChecked} readOnly />
88
+ <Checkbox checked={info.isChecked} disabled={info?.isDisabled}/>
86
89
  <Typography
87
90
  as="span"
88
91
  className="dropdown-option-label"
@@ -58,7 +58,9 @@
58
58
  color: var(--default-icon-color);
59
59
  line-height: 18px;
60
60
  }
61
-
61
+ .ff-required-asterisk {
62
+ color: var(--error-light);
63
+ }
62
64
  .active-default-label {
63
65
  @extend .font-size-8;
64
66
  font-size: 8px !important;
@@ -89,12 +91,15 @@
89
91
  @extend .fontXs;
90
92
  line-height: 14px;
91
93
  color: var(--tooltip-bg-color);
92
- &.pr-2 {
94
+ &.label-padding {
93
95
  padding: 5px 2px;
94
96
  }
95
97
  }
96
98
  .ff-multiselect-chip-close-icon {
99
+ color: var(--brand-color);
97
100
  cursor: pointer;
101
+ padding-right: 0px;
102
+ padding-left: 0px;
98
103
  }
99
104
  }
100
105
  .ff-multiselect-input-container {
@@ -114,15 +119,15 @@
114
119
  }
115
120
  }
116
121
  }
117
- .ff-multiselect-more-chip {
118
- display: flex;
119
- align-items: center;
120
- width: 1.2rem;
121
- @extend .fontSm;
122
- font-weight: 600;
123
- line-height: 16px;
124
- color: var(--brand-color);
125
- }
122
+ }
123
+ .ff-multiselect-more-chip {
124
+ display: flex;
125
+ align-items: center;
126
+ width: 1rem;
127
+ @extend .fontSm;
128
+ font-weight: 600;
129
+ line-height: 16px;
130
+ color: var(--brand-color);
126
131
  }
127
132
  &__toggle {
128
133
  display: flex;
@@ -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'}
@@ -6,26 +6,40 @@ import Dropdown from './Dropdown';
6
6
  import Icon from '../Icon';
7
7
  import { MultiSelectProps, Option } from './MultiSelectTypes';
8
8
  import Typography from '../Typography';
9
+ import Tooltip from '../Tooltip';
9
10
 
10
11
  const ChipElement = ({
11
12
  label,
12
13
  onChipCloseClick,
14
+ disableChip,
13
15
  }: {
14
16
  label: string;
15
17
  onChipCloseClick: (e: React.MouseEvent<HTMLDivElement>) => void;
18
+ disableChip: boolean;
16
19
  }) => {
17
20
  if (label) {
18
21
  return (
19
22
  <div className="ff-multiselect-chip">
20
- <span className="ff-multiselect-chip-label"> {label}</span>
21
- <Icon
22
- color="#71347b"
23
- className="ff-multiselect-chip-close-icon"
24
- onClick={onChipCloseClick}
25
- name="close_pill"
26
- height={13} //as per the latest chnages in icon container we have to give this
27
- width={13}
28
- />
23
+ <span
24
+ className={`ff-multiselect-chip-label ${
25
+ disableChip && 'label-padding'
26
+ }`}
27
+ >
28
+ <Tooltip
29
+ placement="bottom"
30
+ title={label?.length > 25 ? label : ''}
31
+ zIndex={101}
32
+ >
33
+ {label?.length > 25 ? label?.slice(0, 25) + '...' : label}
34
+ </Tooltip>
35
+ </span>
36
+ {!disableChip && (
37
+ <Icon
38
+ className="ff-multiselect-chip-close-icon"
39
+ onClick={onChipCloseClick}
40
+ name="close_pill"
41
+ />
42
+ )}
29
43
  </div>
30
44
  );
31
45
  }
@@ -46,12 +60,10 @@ const MultiSelect = ({
46
60
  withSelectButton = false,
47
61
  onSelect = () => {},
48
62
  displayCount = false,
63
+ placeholderForSearching = 'Search',
49
64
  }: MultiSelectProps) => {
50
65
  const [isOpen, setIsOpen] = useState<boolean>(false);
51
66
  const [allOptions, setAllOptions] = useState(options);
52
- useEffect(() => {
53
- setAllOptions(options);
54
- }, [options]);
55
67
 
56
68
  const [searchedKeyword, setSearchedKeyword] = useState('');
57
69
  const [isSelectFocusedOnce, setIsSelectFocusedOnce] =
@@ -175,12 +187,20 @@ const MultiSelect = ({
175
187
  calculatePosition();
176
188
  }
177
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
+ }
178
199
  const onSelectToggleScroll = (isEnabled: boolean) => {
179
- const bodyScrollWidth = window.innerWidth - document.body.clientWidth;
200
+ const bodyScrollWidth = getScrollbarWidth();
180
201
  document.body.style.paddingRight = isEnabled ? '' : `${bodyScrollWidth}px`;
181
202
  document.body.style.overflow = isEnabled ? '' : 'hidden';
182
203
  };
183
-
184
204
  useEffect(() => {
185
205
  if (isOpen) {
186
206
  onSelectToggleScroll(!isOpen);
@@ -204,6 +224,8 @@ const MultiSelect = ({
204
224
  }));
205
225
  setAllOptions(initializeOptions);
206
226
  }
227
+ }, [options]);
228
+ useEffect(() => {
207
229
  const handleClickAnywhere = (event: MouseEvent) => {
208
230
  if (
209
231
  dropdownWrapper.current &&
@@ -229,6 +251,7 @@ const MultiSelect = ({
229
251
  document.body.style.overflow = 'auto';
230
252
  };
231
253
  }, []);
254
+
232
255
  return (
233
256
  <div
234
257
  ref={selectWrapper}
@@ -250,9 +273,10 @@ const MultiSelect = ({
250
273
  selectedOptions?.length ||
251
274
  (isFieldSkipped && required),
252
275
  'default-label': !isOpen && !selectedOptions?.length,
253
- })}
254
- children={label}
255
- />
276
+ })}>
277
+ {required && <span className="ff-required-asterisk">*</span>}
278
+ {label}
279
+ </Typography>
256
280
 
257
281
  <div className="ff-multiselect-chip-container">
258
282
  {displayCount ? (
@@ -262,6 +286,7 @@ const MultiSelect = ({
262
286
  key={option?.label}
263
287
  label={option?.label || ''}
264
288
  onChipCloseClick={(e) => handleChipCloseClick(option, e)}
289
+ disableChip={option?.isDisabled || false}
265
290
  />
266
291
  ))}
267
292
  </>
@@ -271,6 +296,7 @@ const MultiSelect = ({
271
296
  key={option?.label}
272
297
  label={option?.label || ''}
273
298
  onChipCloseClick={(e) => handleChipCloseClick(option, e)}
299
+ disableChip={option?.isDisabled || false}
274
300
  />
275
301
  ))
276
302
  )}
@@ -279,7 +305,7 @@ const MultiSelect = ({
279
305
  value={searchedKeyword}
280
306
  type={type}
281
307
  autoComplete="off"
282
- placeholder="search..."
308
+ placeholder={placeholderForSearching}
283
309
  ref={inputRef}
284
310
  onChange={handleSearch}
285
311
  onKeyDown={handleKeyEnter}
@@ -291,16 +317,13 @@ const MultiSelect = ({
291
317
  }}
292
318
  />
293
319
  </div>
294
- {hiddenCount > 0 && (
295
- <div
296
- className="ff-multiselect-more-chip"
297
- onClick={toggleDropdown}
298
- >
299
- +{hiddenCount}
300
- </div>
301
- )}
302
320
  </div>
303
321
  </div>
322
+ {hiddenCount > 0 && displayCount && (
323
+ <div className="ff-multiselect-more-chip" onClick={toggleDropdown}>
324
+ +{hiddenCount}
325
+ </div>
326
+ )}
304
327
  <div onClick={toggleDropdown} className="ff-multiselect__toggle">
305
328
  <Icon
306
329
  name="arrow_down"
@@ -20,6 +20,7 @@ interface MultiSelectProps {
20
20
  withSelectButton?: boolean;
21
21
  onSelect?: () => void;
22
22
  displayCount?: boolean;
23
+ placeholderForSearching?: string;
23
24
  }
24
25
 
25
- export { Option, MultiSelectProps };
26
+ export { Option, MultiSelectProps };
@@ -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
  },