pixel-react 1.4.5 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
  2. package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
  3. package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
  4. package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
  5. package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +1 -1
  6. package/lib/components/AllProjectsDropdown/types.d.ts +2 -0
  7. package/lib/components/AppHeader/types.d.ts +1 -0
  8. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
  9. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
  10. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
  11. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
  12. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
  13. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
  14. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
  15. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
  16. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
  17. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
  18. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
  19. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +6 -7
  20. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
  21. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
  22. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
  23. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
  24. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
  25. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
  26. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
  27. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
  28. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
  29. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
  30. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
  31. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
  32. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
  33. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
  34. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +11 -48
  35. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
  36. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
  37. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +11 -12
  38. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
  39. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
  40. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
  41. package/lib/components/ExcelFile/Types.d.ts +2 -49
  42. package/lib/components/MachineInputField/types.d.ts +1 -0
  43. package/lib/components/MenuOption/types.d.ts +1 -1
  44. package/lib/components/Modal/types.d.ts +4 -2
  45. package/lib/components/MultiSelect/MultiSelect.stories.d.ts +0 -1
  46. package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.d.ts +1 -1
  47. package/lib/components/SequentialConnectingBranch/types.d.ts +7 -4
  48. package/lib/index.d.ts +19 -12
  49. package/lib/index.esm.js +266 -464
  50. package/lib/index.esm.js.map +1 -1
  51. package/lib/index.js +266 -464
  52. package/lib/index.js.map +1 -1
  53. package/lib/tsconfig.tsbuildinfo +1 -1
  54. package/lib/utils/capitalize/capitalize.d.ts +1 -0
  55. package/lib/utils/getSequentialPayload/getSequentialPayload.d.ts +2 -2
  56. package/lib/utils/getSequentialPayload/types.d.ts +2 -4
  57. package/package.json +1 -1
  58. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +82 -12
  59. package/src/assets/Themes/BaseTheme.scss +36 -15
  60. package/src/assets/Themes/DarkTheme.scss +15 -1
  61. package/src/assets/icons/add_file.svg +4 -13
  62. package/src/assets/icons/eye_open_icon.svg +10 -0
  63. package/src/assets/icons/hide_access_icon.svg +3 -0
  64. package/src/assets/icons/windows.svg +8 -4
  65. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +58 -8
  66. package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +83 -75
  67. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +31 -18
  68. package/src/components/AllProjectsDropdown/types.ts +2 -0
  69. package/src/components/AppHeader/AppHeader.scss +2 -2
  70. package/src/components/AppHeader/AppHeader.stories.tsx +5 -1
  71. package/src/components/AppHeader/AppHeader.tsx +107 -101
  72. package/src/components/AppHeader/types.ts +1 -0
  73. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
  74. package/src/components/Checkbox/Checkbox.scss +1 -1
  75. package/src/components/EditTextField/EditTextField.tsx +3 -5
  76. package/src/components/Icon/iconList.ts +4 -2
  77. package/src/components/MachineInputField/MachineInputField.scss +4 -2
  78. package/src/components/MachineInputField/MachineInputField.tsx +2 -0
  79. package/src/components/MachineInputField/types.ts +1 -0
  80. package/src/components/MenuOption/MenuOption.scss +24 -27
  81. package/src/components/MenuOption/MenuOption.stories.tsx +90 -35
  82. package/src/components/MenuOption/MenuOption.tsx +19 -18
  83. package/src/components/MenuOption/types.ts +1 -1
  84. package/src/components/Modal/Modal.stories.tsx +2 -2
  85. package/src/components/Modal/Modal.tsx +6 -2
  86. package/src/components/Modal/modal.scss +2 -3
  87. package/src/components/Modal/types.ts +4 -2
  88. package/src/components/MultiSelect/MultiSelect.scss +50 -45
  89. package/src/components/MultiSelect/MultiSelect.tsx +1 -1
  90. package/src/components/Select/components/Dropdown.tsx +22 -8
  91. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.scss +34 -32
  92. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.tsx +34 -40
  93. package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +27 -100
  94. package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +5 -5
  95. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +5 -3
  96. package/src/components/SequentialConnectingBranch/types.ts +7 -4
  97. package/src/components/Tooltip/Tooltip.scss +1 -0
  98. package/src/components/Tooltip/Tooltip.tsx +1 -2
  99. package/src/utils/capitalize/capitalize.stories.tsx +44 -0
  100. package/src/utils/capitalize/capitalize.tsx +4 -0
  101. package/src/utils/getSequentialPayload/getSequentialPayload.stories.tsx +2 -5
  102. package/src/utils/getSequentialPayload/getSequentialPayload.ts +11 -24
  103. package/src/utils/getSequentialPayload/types.ts +3 -6
  104. /package/lib/components/ExcelFile/{ColorBarselector → ColorBarSelector}/ColorBarSelector.d.ts +0 -0
@@ -9,6 +9,7 @@
9
9
  height: 100%;
10
10
  width: 100%;
11
11
  border: 1px solid var(--ff-machine-input-field-border-color);
12
+ padding: 0 8px 0 0;
12
13
  border-radius: 4px;
13
14
  display: flex;
14
15
  align-items: center;
@@ -17,9 +18,10 @@
17
18
  .ff-machine-icon-text-wrapper,
18
19
  .ff-machine-icon-text-wrapper-reverse {
19
20
  display: flex;
21
+ align-items: center;
20
22
 
21
23
  .ff-machine-icon {
22
- margin-right: 8px;
24
+ margin-left: 4px;
23
25
  }
24
26
  }
25
27
 
@@ -39,6 +41,6 @@
39
41
  background-color: var(--ff-machine-input-field-border-color);
40
42
  border-radius: 4px;
41
43
  padding: 1px 2px;
42
- height: 10px;
44
+ height: 12px;
43
45
  }
44
46
  }
@@ -13,6 +13,7 @@ const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
13
13
  runCount = 0,
14
14
  className = '',
15
15
  contentReverse = false,
16
+ onClick = () => {},
16
17
  },
17
18
  ref
18
19
  ) => {
@@ -28,6 +29,7 @@ const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
28
29
  ref={ref}
29
30
  style={{ width: width }}
30
31
  className={classNames('ff-machine-input-field-wrapper', className)}
32
+ onClick={onClick}
31
33
  >
32
34
  <Typography
33
35
  as="span"
@@ -9,4 +9,5 @@ export interface MachineInputFieldProps {
9
9
  runCount: number;
10
10
  className?: string;
11
11
  contentReverse?: boolean;
12
+ onClick?: () => void;
12
13
  }
@@ -47,37 +47,34 @@
47
47
  .ff-option-card {
48
48
  position: fixed;
49
49
  margin: 4px;
50
-
51
- .ff-option-wrapper {
52
- border: 1px solid var(--option-card-border-color);
53
- background: var(--option-card-bg-color);
54
- overflow: hidden;
55
- min-height: 32px;
56
- min-width: 112px;
57
- width: max-content;
58
- border-radius: 4px;
59
- .ff-options {
60
- @extend .fontSm;
50
+ border: 1px solid var(--option-card-border-color);
51
+ background: var(--option-card-bg-color);
52
+ overflow: hidden;
53
+ min-height: 32px;
54
+ min-width: 112px;
55
+ width: max-content;
56
+ border-radius: 4px;
57
+ .ff-options {
58
+ @extend .fontSm;
59
+ cursor: pointer;
60
+ border-radius: 3px;
61
+ display: flex;
62
+ align-items: center;
63
+ padding: 8px;
64
+ gap: 8px;
65
+ &:hover {
66
+ background-color: var(--hover-color);
67
+ }
68
+ label {
61
69
  cursor: pointer;
62
- border-radius: 3px;
63
- display: flex;
64
- align-items: center;
65
- padding: 8px;
66
- gap: 8px;
67
- &:hover {
68
- background-color: var(--hover-color);
69
- }
70
- label {
71
- cursor: pointer;
72
- }
73
70
  }
71
+ }
74
72
 
75
- .ff-disable-option {
76
- opacity: 0.5;
73
+ .ff-disable-option {
74
+ opacity: 0.5;
75
+ cursor: no-drop;
76
+ label {
77
77
  cursor: no-drop;
78
- label {
79
- cursor: no-drop;
80
- }
81
78
  }
82
79
  }
83
80
  }
@@ -13,28 +13,33 @@ const meta: Meta<typeof MenuOption> = {
13
13
  argTypes: {
14
14
  iconName: {
15
15
  control: 'text',
16
+ description: 'Name of the icon to display in the button.',
16
17
  defaultValue: 'more',
17
18
  },
18
19
  labelName: {
19
20
  control: 'text',
20
- defaultValue: 'Controlled Menu',
21
+ description: 'Label text displayed beside the icon.',
22
+ defaultValue: 'Menu',
21
23
  },
22
24
  tooltipTitle: {
23
25
  control: 'text',
26
+ description: 'Tooltip text displayed on hover.',
24
27
  defaultValue: 'Select an option',
25
28
  },
26
29
  tooltipPlacement: {
27
30
  control: {
28
- type: 'select',
29
- options: ['top', 'down', 'left', 'right'],
31
+ type: 'text',
32
+ options: ['top', 'down', 'left', 'right'],
30
33
  },
34
+ description: 'Placement of the tooltip relative to the button.',
31
35
  defaultValue: 'top',
32
36
  },
33
37
  dropdownPlacement: {
34
38
  control: {
35
- type: 'select',
36
- options: ['top', 'down', 'left', 'right'],
39
+ type: 'text',
40
+ options: ['top', 'down', 'left', 'right'],
37
41
  },
42
+ description: 'Placement of the dropdown menu relative to the button.',
38
43
  defaultValue: 'down',
39
44
  },
40
45
  },
@@ -57,46 +62,96 @@ const handleOptionClick = (option: { label: string }) => {
57
62
  alert(`Option clicked: ${option.label}`);
58
63
  };
59
64
 
60
- export const ControlledMenuOptionTop: Story = {
65
+
66
+ export const ControlledMenuOption: Story = {
67
+ args: {
68
+ iconName: 'more',
69
+ labelName: 'Controlled Menu',
70
+ tooltipTitle: 'Select an option',
71
+ dropdownPlacement: "top",
72
+ },
61
73
  render: (args) => (
62
- <MenuOption
63
- iconName="more"
64
- labelName={args.labelName}
65
- options={options}
66
- tooltipTitle={args.tooltipTitle}
67
- tooltipPlacement={args.tooltipPlacement}
68
- dropdownPlacement="top" // Override dropdown position to top
69
- onOptionClick={handleOptionClick}
70
- />
74
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
71
75
  ),
76
+ parameters: {
77
+ docs: {
78
+ description: {
79
+ story:
80
+ 'A controlled `MenuOption` with customizable tooltip and dropdown placement.',
81
+ },
82
+ },
83
+ },
72
84
  };
73
85
 
74
- export const ControlledMenuOptionBottom: Story = {
86
+
87
+ export const MenuOptionTop: Story = {
88
+ args: {
89
+ ...ControlledMenuOption.args,
90
+ dropdownPlacement: 'top',
91
+ },
75
92
  render: (args) => (
76
- <MenuOption
77
- iconName="more"
78
- labelName={args.labelName}
79
- options={options}
80
- tooltipTitle={args.tooltipTitle}
81
- tooltipPlacement={args.tooltipPlacement}
82
- dropdownPlacement="down"
83
- onOptionClick={handleOptionClick}
84
- />
93
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
85
94
  ),
95
+ parameters: {
96
+ docs: {
97
+ description: {
98
+ story: 'Dropdown menu positioned above the button.',
99
+ },
100
+ },
101
+ },
86
102
  };
87
103
 
88
- export const ControlledMenuOptionRight: Story = {
104
+
105
+ export const MenuOptionBottom: Story = {
106
+ args: {
107
+ ...ControlledMenuOption.args,
108
+ dropdownPlacement: 'down',
109
+ },
89
110
  render: (args) => (
90
- <MenuOption
91
- iconName="more"
92
- labelName={args.labelName}
93
- options={options}
94
- tooltipTitle={args.tooltipTitle}
95
- tooltipPlacement={args.tooltipPlacement}
96
- dropdownPlacement="right"
97
- onOptionClick={handleOptionClick}
98
- />
111
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
99
112
  ),
113
+ parameters: {
114
+ docs: {
115
+ description: {
116
+ story: 'Dropdown menu positioned below the button.',
117
+ },
118
+ },
119
+ },
120
+ };
121
+
122
+
123
+ export const MenuOptionLeft: Story = {
124
+ args: {
125
+ ...ControlledMenuOption.args,
126
+ dropdownPlacement: 'left',
127
+ },
128
+ render: (args) => (
129
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
130
+ ),
131
+ parameters: {
132
+ docs: {
133
+ description: {
134
+ story: 'Dropdown menu positioned to the left of the button.',
135
+ },
136
+ },
137
+ },
138
+ };
139
+
140
+ export const MenuOptionRight: Story = {
141
+ args: {
142
+ ...ControlledMenuOption.args,
143
+ dropdownPlacement: 'right',
144
+ },
145
+ render: (args) => (
146
+ <MenuOption {...args} options={options} onOptionClick={handleOptionClick} />
147
+ ),
148
+ parameters: {
149
+ docs: {
150
+ description: {
151
+ story: 'Dropdown menu positioned to the right of the button.',
152
+ },
153
+ },
154
+ },
100
155
  };
101
156
 
102
157
  export default meta;
@@ -45,24 +45,26 @@ const OptionCard = ({
45
45
  menuRef,
46
46
  closeDropdown,
47
47
  zIndex,
48
- dropdownPosition,
48
+ dropdownPlacement,
49
49
  }: OptionCardProps) => {
50
50
  const themeContext = useContext(ThemeContext);
51
51
  const currentTheme = themeContext?.currentTheme;
52
52
  const [optionsHeight, setOptionsHeight] = useState(0);
53
+ const [optionsWidth, setOptionsWidth] = useState(0);
53
54
  const optionCardRef = useRef<HTMLDivElement>(null);
54
55
 
55
56
  useEffect(() => {
56
57
  if (optionCardRef?.current) {
57
58
  const rect = optionCardRef?.current?.getBoundingClientRect();
58
59
  setOptionsHeight(rect?.height);
60
+ setOptionsWidth(rect?.width);
59
61
  }
60
62
  }, []);
61
63
 
62
64
  useClickOutside(menuRef, closeDropdown, [optionCardRef]);
63
65
 
64
66
  const style = (() => {
65
- switch (dropdownPosition) {
67
+ switch (dropdownPlacement) {
66
68
  case 'top':
67
69
  return {
68
70
  top: menuPosition.top - optionsHeight - 7,
@@ -76,12 +78,12 @@ const OptionCard = ({
76
78
  case 'left':
77
79
  return {
78
80
  top: menuPosition.top,
79
- right: menuPosition.rightSpaceAvailable + 35,
81
+ left: menuPosition.left - optionsWidth - 7,
80
82
  };
81
83
  case 'right':
82
84
  return {
83
85
  top: menuPosition.top,
84
- left: menuPosition.rightSpaceAvailable + 35,
86
+ left: menuPosition.left + 20,
85
87
  };
86
88
  default:
87
89
  return {
@@ -94,14 +96,12 @@ const OptionCard = ({
94
96
  return createPortal(
95
97
  <div
96
98
  className={classNames('ff-option-card', currentTheme)}
97
- ref={optionCardRef}
98
99
  style={{ ...style, zIndex }}
100
+ ref={optionCardRef}
99
101
  >
100
- <div className="ff-option-wrapper">
101
- {options.map((opt) => (
102
- <Option key={opt.label} option={opt} onClick={onClick} />
103
- ))}
104
- </div>
102
+ {options.map((opt) => (
103
+ <Option key={opt.label} option={opt} onClick={onClick} />
104
+ ))}
105
105
  </div>,
106
106
  document.body
107
107
  );
@@ -126,18 +126,18 @@ const MenuOption = ({
126
126
  const menuRef = useRef<HTMLDivElement>(null);
127
127
  const [menuPosition, setMenuPosition] = useState({
128
128
  top: 0,
129
- bottom: 0,
129
+ left: 0,
130
130
  height: 0,
131
- fromBottom: 0,
131
+ right: 0,
132
132
  rightSpaceAvailable: 0,
133
+ bottomSpaceAvailable: 0,
133
134
  });
134
- useEffect(() => {
135
- calculateDims();
136
- });
135
+
137
136
  const closeDropDown = () => setIsClicked(false);
138
137
 
139
138
  const onIconClickHandler = () => {
140
139
  onClick();
140
+ calculateDims();
141
141
  setIsClicked((prev) => !prev);
142
142
  };
143
143
 
@@ -152,10 +152,11 @@ const MenuOption = ({
152
152
 
153
153
  setMenuPosition({
154
154
  top: rect.top,
155
+ left: rect.left,
155
156
  height: rect.height,
157
+ right: rect.right,
156
158
  rightSpaceAvailable: document.body.clientWidth - rect.right,
157
- bottom: rect.bottom,
158
- fromBottom: window.innerHeight - rect.bottom,
159
+ bottomSpaceAvailable: window.innerHeight - menuRef.current.offsetTop,
159
160
  });
160
161
  }
161
162
  };
@@ -200,7 +201,7 @@ const MenuOption = ({
200
201
  menuRef={menuRef}
201
202
  closeDropdown={closeDropDown}
202
203
  zIndex={zIndex}
203
- dropdownPosition={dropdownPlacement}
204
+ dropdownPlacement={dropdownPlacement}
204
205
  />
205
206
  )}
206
207
  </div>
@@ -90,7 +90,7 @@ interface OptionCardProps {
90
90
  * @type {dropdownPosition}
91
91
  * @optional
92
92
  */
93
- dropdownPosition?: 'top' | 'down' | 'left' | 'right';
93
+ dropdownPlacement?: 'top' | 'down' | 'left' | 'right';
94
94
  }
95
95
 
96
96
  interface MenuOptionProps {
@@ -26,7 +26,7 @@ export const DefaultModalStory: Story = {
26
26
  footerContent: <Button variant="primary" label="continue" />,
27
27
  customWidth: '660px',
28
28
  customHeight: 'auto',
29
- boxShadow:'0px 1px 4px 0px #FFC600'
29
+ border: '1px solid #E79B0866',
30
30
  },
31
31
  };
32
32
 
@@ -58,7 +58,7 @@ export const Controlled: Story = {
58
58
  footerContent={<Button variant="primary" label="continue" />}
59
59
  customWidth="660px"
60
60
  customHeight="auto"
61
- boxShadow='0px 1px 4px 0px #FFC600'
61
+ border="1px solid #E79B0866"
62
62
  />
63
63
  )}
64
64
  </>
@@ -22,7 +22,9 @@ const Modal: React.FC<ModalProps> = ({
22
22
  customHeight = 'auto',
23
23
  children,
24
24
  zIndex = 999,
25
- boxShadow = '0px 1px 4px 0px #FFC600',
25
+ boxShadow = '',
26
+ border = '',
27
+ background='',
26
28
  }) => {
27
29
  useEffect(() => {
28
30
  const handleKeyDown = (e: KeyboardEvent) => {
@@ -58,7 +60,9 @@ const Modal: React.FC<ModalProps> = ({
58
60
  <div
59
61
  style={{
60
62
  boxShadow: boxShadow,
61
- borderRadius: '12px' ,
63
+ border: border,
64
+ borderRadius: '12px',
65
+ background: background,
62
66
  }}
63
67
  className="ff-modal-container"
64
68
  >
@@ -12,9 +12,8 @@
12
12
  }
13
13
 
14
14
  .ff-modal-container {
15
- box-shadow: 0px 1px 4px 0px #ffc600;
16
- border-radius: 12px; // Ensures box-shadow respects the rounded corners
17
- overflow: hidden; // Prevents content overflow
15
+ border-radius: 12px;
16
+ overflow: hidden;
18
17
  }
19
18
 
20
19
  .ff-modal-content {
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode } from 'react';
2
2
 
3
3
  export interface ModalProps {
4
4
  isOpen: boolean;
@@ -37,5 +37,7 @@ export interface ModalProps {
37
37
  customWidth: string;
38
38
  customHeight?: string;
39
39
  zIndex?: number;
40
- boxShadow:string;
40
+ boxShadow?: string;
41
+ border?: string;
42
+ background?: string;
41
43
  }
@@ -79,59 +79,64 @@
79
79
  top: -6px;
80
80
  pointer-events: none;
81
81
  }
82
- .ff-multiselect-chip-container {
82
+ .ff-multiselect-chip-parent-container{
83
+ width: 100%;
83
84
  display: flex;
84
- flex-wrap: wrap;
85
- align-items: center;
86
- gap: 5px;
87
- .ff-multiselect-chip {
88
- @include flex-center;
89
- box-sizing: border-box;
90
- border: 0.5px solid #f1ebf2;
91
- padding: 0 1px 0 4px;
92
- gap: 4px;
93
- height: 16px;
94
- border-radius: 15px;
95
- .ff-multiselect-chip-label {
96
- @extend .fontXs;
97
- line-height: 14px;
98
- color: var(--tooltip-bg-color);
99
- &.label-padding {
100
- padding: 5px 2px;
85
+ justify-content: space-between;
86
+ .ff-multiselect-chip-container {
87
+ display: flex;
88
+ flex-wrap: wrap;
89
+ align-items: center;
90
+ gap: 5px;
91
+ .ff-multiselect-chip {
92
+ @include flex-center;
93
+ box-sizing: border-box;
94
+ border: 0.5px solid #f1ebf2;
95
+ padding: 0 1px 0 4px;
96
+ gap: 4px;
97
+ height: 16px;
98
+ border-radius: 15px;
99
+ .ff-multiselect-chip-label {
100
+ @extend .fontXs;
101
+ line-height: 14px;
102
+ color: var(--tooltip-bg-color);
103
+ &.label-padding {
104
+ padding: 5px 2px;
105
+ }
106
+ }
107
+ .ff-multiselect-chip-close-icon {
108
+ color: var(--brand-color);
109
+ cursor: pointer;
101
110
  }
102
111
  }
103
- .ff-multiselect-chip-close-icon {
104
- color: var(--brand-color);
105
- cursor: pointer;
106
- }
107
- }
108
- .ff-multiselect-input-container {
109
- flex: 1;
110
- min-width: 20px;
111
- input {
112
- width: 100%;
113
- min-width: 30px;
114
- max-width: calc(100% - 0px);
115
- padding: 2px;
116
- box-sizing: border-box;
117
- border: none;
118
- font-size: 12px;
119
- &:focus {
120
- outline: none;
112
+ .ff-multiselect-input-container {
113
+ flex: 1;
114
+ min-width: 20px;
115
+ input {
116
+ width: 100%;
117
+ min-width: 30px;
118
+ max-width: calc(100% - 0px);
119
+ padding: 2px;
120
+ box-sizing: border-box;
121
+ border: none;
122
+ font-size: 12px;
123
+ &:focus {
124
+ outline: none;
125
+ }
121
126
  }
122
127
  }
123
128
  }
129
+ .ff-multiselect-more-chip {
130
+ display: flex;
131
+ align-items: center;
132
+ width: 16px;
133
+ @extend .fontSm;
134
+ font-weight: 600;
135
+ line-height: 16px;
136
+ color: var(--brand-color);
137
+ }
124
138
  }
125
139
  }
126
- .ff-multiselect-more-chip {
127
- display: flex;
128
- align-items: center;
129
- width: 16px;
130
- @extend .fontSm;
131
- font-weight: 600;
132
- line-height: 16px;
133
- color: var(--brand-color);
134
- }
135
140
  &__toggle {
136
141
  display: flex;
137
142
  align-items: center;
@@ -355,7 +355,7 @@ const MultiSelect = ({
355
355
  )}
356
356
 
357
357
  {!withSelectButton && (
358
- <div>
358
+ <div className='ff-multiselect-chip-parent-container'>
359
359
  <div className="ff-multiselect-chip-container">
360
360
  {displayCount ? (
361
361
  <>
@@ -1,4 +1,4 @@
1
- import { type FC, useContext, useRef } from 'react';
1
+ import React, { type FC, useContext, useRef } from 'react';
2
2
  import { dropdownDefaultCSSData, DropdownProps } from './types';
3
3
  import './Dropdown.scss';
4
4
  import { checkEmpty } from '../../../utils/checkEmpty/checkEmpty';
@@ -65,6 +65,23 @@ const Dropdown: FC<DropdownProps> = ({
65
65
  };
66
66
  };
67
67
 
68
+ const getOptionLabel = (label: any) => {
69
+ if (React.isValidElement(label)) {
70
+ console.log('test');
71
+ return label;
72
+ }
73
+ console.log('test112');
74
+ return (
75
+ <Typography
76
+ as="div"
77
+ lineHeight="30px"
78
+ color="var(--ff-select-text-color)"
79
+ >
80
+ {label}
81
+ </Typography>
82
+ );
83
+ };
84
+
68
85
  return (
69
86
  <div
70
87
  className={classNames('ff-select-dropdown-wrapper', currentTheme)}
@@ -73,10 +90,7 @@ const Dropdown: FC<DropdownProps> = ({
73
90
  >
74
91
  {!checkEmpty(options) ? (
75
92
  options.map((option) => (
76
- <Typography
77
- key={ffid()}
78
- as="div"
79
- lineHeight="30px"
93
+ <div
80
94
  className={classNames(
81
95
  'ff-select-dropdown-option',
82
96
  {
@@ -85,14 +99,14 @@ const Dropdown: FC<DropdownProps> = ({
85
99
  },
86
100
  currentTheme
87
101
  )}
88
- color="var(--ff-select-text-color)"
102
+ key={ffid()}
89
103
  onClick={() => {
90
104
  if ('disable' in option && option['disable']) return;
91
105
  onSelectOptionSelector(option);
92
106
  }}
93
107
  >
94
- {getLabel(option, labelAccessor)}
95
- </Typography>
108
+ {getOptionLabel(getLabel(option, labelAccessor))}
109
+ </div>
96
110
  ))
97
111
  ) : (
98
112
  <Typography