pixel-react 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/lib/components/AddButton/AddButton.d.ts +5 -0
  2. package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
  3. package/lib/components/AddButton/index.d.ts +1 -0
  4. package/lib/components/AddButton/types.d.ts +4 -0
  5. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
  6. package/lib/components/ExcelFile/ColorBarSelector/ColorBarSelector.d.ts +8 -0
  7. package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
  8. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
  9. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
  10. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
  11. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
  12. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
  13. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
  14. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
  15. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
  16. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
  17. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
  18. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
  19. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
  20. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +81 -0
  21. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
  22. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +130 -0
  23. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
  24. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
  25. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
  26. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
  27. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
  28. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
  29. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
  30. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
  31. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
  32. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
  33. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
  34. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
  35. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
  36. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
  37. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +215 -0
  38. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
  39. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
  40. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +45 -0
  41. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +3 -0
  42. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
  43. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +15 -0
  44. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +3 -0
  45. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
  46. package/lib/components/ExcelFile/Types.d.ts +176 -0
  47. package/lib/components/ExcelFile/index.d.ts +1 -0
  48. package/lib/components/IconRadioGroup/IconRadioGroup.d.ts +5 -0
  49. package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
  50. package/lib/components/IconRadioGroup/index.d.ts +1 -0
  51. package/lib/components/IconRadioGroup/type.d.ts +41 -0
  52. package/lib/index.d.ts +45 -1
  53. package/lib/index.esm.js +682 -244
  54. package/lib/index.esm.js.map +1 -1
  55. package/lib/index.js +682 -243
  56. package/lib/index.js.map +1 -1
  57. package/lib/tsconfig.tsbuildinfo +1 -1
  58. package/lib/utils/find/findAndInsert.d.ts +7 -0
  59. package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
  60. package/package.json +4 -2
  61. package/src/assets/Themes/BaseTheme.scss +1 -0
  62. package/src/assets/Themes/DarkTheme.scss +1 -0
  63. package/src/assets/icons/all_borders.svg +3 -0
  64. package/src/assets/icons/bold.svg +3 -0
  65. package/src/assets/icons/border_bottom.svg +3 -0
  66. package/src/assets/icons/border_left.svg +3 -0
  67. package/src/assets/icons/border_right.svg +3 -0
  68. package/src/assets/icons/border_top.svg +3 -0
  69. package/src/assets/icons/clone_icon.svg +3 -0
  70. package/src/assets/icons/double_underline.svg +5 -0
  71. package/src/assets/icons/fill_color.svg +7 -0
  72. package/src/assets/icons/formate_painter.svg +5 -0
  73. package/src/assets/icons/full_access_icon.svg +4 -0
  74. package/src/assets/icons/history_icon.svg +19 -0
  75. package/src/assets/icons/italic.svg +3 -0
  76. package/src/assets/icons/jira.svg +3 -0
  77. package/src/assets/icons/linked_defects.svg +11 -0
  78. package/src/assets/icons/move_icon.svg +5 -0
  79. package/src/assets/icons/no_access_icon.svg +4 -0
  80. package/src/assets/icons/no_border.svg +3 -0
  81. package/src/assets/icons/strike_through.svg +3 -0
  82. package/src/assets/icons/text_align_center.svg +3 -0
  83. package/src/assets/icons/text_align_left.svg +3 -0
  84. package/src/assets/icons/text_align_right.svg +3 -0
  85. package/src/assets/icons/text_color.svg +3 -0
  86. package/src/assets/icons/underline.svg +4 -0
  87. package/src/assets/icons/view_access_icon.svg +4 -0
  88. package/src/components/AppHeader/AppHeader.scss +14 -9
  89. package/src/components/AppHeader/AppHeader.stories.tsx +1 -0
  90. package/src/components/AppHeader/AppHeader.tsx +7 -5
  91. package/src/components/ExcelFile/ChangeExcelStyles.tsx +78 -0
  92. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +13 -0
  93. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.tsx +43 -0
  94. package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +102 -0
  95. package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +104 -0
  96. package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +131 -0
  97. package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +201 -0
  98. package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +123 -0
  99. package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +25 -0
  100. package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +49 -0
  101. package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +37 -0
  102. package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +46 -0
  103. package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +31 -0
  104. package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +5 -0
  105. package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +5 -0
  106. package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +102 -0
  107. package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +32 -0
  108. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.css +144 -0
  109. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +494 -0
  110. package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +19 -0
  111. package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +302 -0
  112. package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +18 -0
  113. package/src/components/ExcelFile/ExcelFile/Excel/context.ts +12 -0
  114. package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +200 -0
  115. package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +137 -0
  116. package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -0
  117. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +154 -0
  118. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +10 -0
  119. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +69 -0
  120. package/src/components/ExcelFile/ExcelFile/Excel/index.ts +48 -0
  121. package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +388 -0
  122. package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +82 -0
  123. package/src/components/ExcelFile/ExcelFile/Excel/point.ts +15 -0
  124. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +682 -0
  125. package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +257 -0
  126. package/src/components/ExcelFile/ExcelFile/Excel/types.ts +269 -0
  127. package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +58 -0
  128. package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +8 -0
  129. package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +9 -0
  130. package/src/components/ExcelFile/ExcelFile/Excel/util.ts +173 -0
  131. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +27 -0
  132. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +520 -0
  133. package/src/components/ExcelFile/ExcelFile.stories.tsx +132 -0
  134. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +16 -0
  135. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +79 -0
  136. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +22 -0
  137. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +271 -0
  138. package/src/components/ExcelFile/ImportExcelStyles.tsx +86 -0
  139. package/src/components/ExcelFile/Types.ts +241 -0
  140. package/src/components/ExcelFile/index.ts +1 -0
  141. package/src/components/Icon/Icons.scss +2 -3
  142. package/src/components/Icon/iconList.ts +50 -1
  143. package/src/components/IconRadioGroup/IconRadioGroup.scss +60 -0
  144. package/src/components/IconRadioGroup/IconRadioGroup.stories.tsx +108 -0
  145. package/src/components/IconRadioGroup/IconRadioGroup.tsx +72 -0
  146. package/src/components/IconRadioGroup/index.ts +1 -0
  147. package/src/components/IconRadioGroup/type.ts +50 -0
  148. package/src/index.ts +2 -0
@@ -10,9 +10,8 @@
10
10
  padding: 4px;
11
11
  box-sizing: content-box;
12
12
  &:hover {
13
- border-radius: 50%;
14
- background-color: var(--drawer-footer-bg);
15
- box-shadow: 0px 0px 16px var(--toggle-strip-shadow);
13
+ border-radius: 4px;
14
+ background-color: var(--ff-icon-hover-fill-color);
16
15
  & > svg {
17
16
  color: var(--brand-color);
18
17
  }
@@ -43,6 +43,23 @@ import LicenseIcon from '../../assets/icons/active_license_icon.svg?react';
43
43
  import DeleteIcon from '../../assets/icons/delete.svg?react';
44
44
  import DetailsIcon from '../../assets/icons/details.svg?react';
45
45
  import ImpactListIcon from '../../assets/icons/impactList.svg?react';
46
+ import FormatePainter from '../../assets/icons/formate_painter.svg?react';
47
+ import Bold from '../../assets/icons/bold.svg?react';
48
+ import Italic from '../../assets/icons/italic.svg?react';
49
+ import StrikeThrough from '../../assets/icons/strike_through.svg?react';
50
+ import Underline from '../../assets/icons/underline.svg?react';
51
+ import DoubleUnderline from '../../assets/icons/double_underline.svg?react';
52
+ import AllBorders from '../../assets/icons/all_borders.svg?react';
53
+ import BorderBottom from '../../assets/icons/border_bottom.svg?react';
54
+ import BorderLeft from '../../assets/icons/border_left.svg?react';
55
+ import BorderRight from '../../assets/icons/border_right.svg?react';
56
+ import BorderTop from '../../assets/icons/border_top.svg?react';
57
+ import NoBorder from '../../assets/icons/no_border.svg?react';
58
+ import TextAlignCenter from '../../assets/icons/text_align_center.svg?react';
59
+ import TextAlignLeft from '../../assets/icons/text_align_left.svg?react';
60
+ import TextAlignRight from '../../assets/icons/text_align_right.svg?react';
61
+ import TextColor from '../../assets/icons/text_color.svg?react';
62
+ import FillColor from '../../assets/icons/fill_color.svg?react';
46
63
  import InfoIcon from '../../assets/icons/info_icon.svg?react';
47
64
  import CalendarIcon from '../../assets/icons/calendar_icon.svg?react';
48
65
  import HideIcon from '../../assets/icons/hide_icon.svg?react';
@@ -70,6 +87,9 @@ import SalesForceIcon from '../../assets/icons/sales_force.svg?react';
70
87
  import MSDynamicIcon from '../../assets/icons/ms_dynamic.svg?react';
71
88
  import AllProjectsIcon from '../../assets/icons/all_projects.svg?react';
72
89
  import AndroidIcon from '../../assets/icons/android_icon.svg?react';
90
+ import NoAccessIcon from '../../assets/icons/no_access_icon.svg?react';
91
+ import FullAccessIcon from '../../assets/icons/full_access_icon.svg?react';
92
+ import ViewAccessIcon from '../../assets/icons/view_access_icon.svg?react';
73
93
  import AddLocator from '../../assets/icons/add_locator.svg?react';
74
94
  import PlusUserIcon from '../../assets/icons/plus_user_icon.svg?react';
75
95
 
@@ -94,8 +114,12 @@ import NLPHelpIcon from '../../assets/icons/nlp_help_icon.svg?react';
94
114
  import UpdateIcon from '../../assets/icons/update_icon.svg?react';
95
115
  import AddFile from '../../assets/icons/add_file.svg?react';
96
116
 
117
+ import CloneIcon from '../../assets/icons/clone_icon.svg?react';
118
+ import MoveIcon from '../../assets/icons/move_icon.svg?react';
119
+ import Jira from '../../assets/icons/jira.svg?react';
120
+ import HistoryIcon from '../../assets//icons/history_icon.svg?react';
121
+ import LinkedDefects from '../../assets//icons/linked_defects.svg?react';
97
122
 
98
- //icons
99
123
  Components['delete_info'] = DeleteInfoIcon;
100
124
  Components['success'] = ToastSuccessIcon;
101
125
  Components['warning'] = WarningIcon;
@@ -138,6 +162,23 @@ Components['delete'] = DeleteIcon;
138
162
  Components['details'] = DetailsIcon;
139
163
  Components['impactList'] = ImpactListIcon;
140
164
  Components['add_variable'] = AddVariable;
165
+ Components['formate_painter'] = FormatePainter;
166
+ Components['bold'] = Bold;
167
+ Components['italic'] = Italic;
168
+ Components['strike_through'] = StrikeThrough;
169
+ Components['underline'] = Underline;
170
+ Components['double_underline'] = DoubleUnderline;
171
+ Components['border_left'] = BorderLeft;
172
+ Components['border_right'] = BorderRight;
173
+ Components['border_bottom'] = BorderBottom;
174
+ Components['border_top'] = BorderTop;
175
+ Components['all_borders'] = AllBorders;
176
+ Components['no_border'] = NoBorder;
177
+ Components['text_align_center'] = TextAlignCenter;
178
+ Components['text_align_left'] = TextAlignLeft;
179
+ Components['text_align_right'] = TextAlignRight;
180
+ Components['text_color'] = TextColor;
181
+ Components['fill_color'] = FillColor;
141
182
  Components['info'] = InfoIcon;
142
183
  Components['calendar_icon'] = CalendarIcon;
143
184
  Components['hide_icon'] = HideIcon;
@@ -187,5 +228,13 @@ Components['notification_icon'] = NotificationIcon;
187
228
  Components['nlp_help_icon'] = NLPHelpIcon;
188
229
  Components['update_icon'] = UpdateIcon;
189
230
  Components['add_file'] = AddFile;
231
+ Components['clone_icon'] = CloneIcon;
232
+ Components['move_icon'] = MoveIcon;
233
+ Components['jira'] = Jira;
234
+ Components['history'] = HistoryIcon;
235
+ Components['linked_defects'] = LinkedDefects;
236
+ Components['no_access_icon'] = NoAccessIcon;
237
+ Components['full_access_icon'] = FullAccessIcon;
238
+ Components['view_access_icon'] = ViewAccessIcon;
190
239
 
191
240
  export default Components;
@@ -0,0 +1,60 @@
1
+ .ff-icon-radio-group {
2
+ width: 237px;
3
+ height: 24px;
4
+ display: flex;
5
+ align-items: center;
6
+ gap: 47px;
7
+ position: relative;
8
+ }
9
+
10
+ .ff-icon-radio-button {
11
+ width: 24px;
12
+ height: 24px;
13
+ border-radius: 4px;
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ cursor: pointer;
18
+ position: relative;
19
+
20
+ &.selected {
21
+ background-color: var(--brand-color);
22
+ }
23
+
24
+ &.disabled {
25
+ opacity: 50%;
26
+ cursor: not-allowed;
27
+ }
28
+
29
+ .icon-container {
30
+ width: 24px;
31
+ height: 24px;
32
+ border-radius: 4px;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ border: 1px solid var(--border-color);
37
+ background: var(--drawer-footer-bg);
38
+
39
+ &.selected {
40
+ background-color: var(--brand-color);
41
+ }
42
+
43
+ .icon {
44
+ width: 14px;
45
+ height: 14px;
46
+ }
47
+ }
48
+ }
49
+
50
+ .line-connector {
51
+ position: absolute;
52
+ top: 50%;
53
+ left: 0;
54
+ right: 0;
55
+ height: 1px;
56
+ background-color: var(--border-color);
57
+ z-index: -1;
58
+ border-radius: 2px 0px 0px 0px;
59
+ opacity: 0px;
60
+ }
@@ -0,0 +1,108 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import IconRadioGroup from './IconRadioGroup';
3
+ import { useState } from 'react';
4
+
5
+ const meta: Meta<typeof IconRadioGroup> = {
6
+ title: 'Components/IconRadioGroup',
7
+ component: IconRadioGroup,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ tags: ['autodocs'],
12
+ };
13
+
14
+ type Story = StoryObj<typeof IconRadioGroup>;
15
+
16
+ export const Default: Story = {
17
+ render: () => {
18
+ const radioOptions = [
19
+ {
20
+ iconName: 'no_access_icon',
21
+ iconLabel: 'No Access',
22
+ disabled: false,
23
+ disableMessage: '',
24
+ },
25
+ {
26
+ iconName: 'view_access_icon',
27
+ iconLabel: 'View',
28
+ disabled: false,
29
+ disableMessage: '',
30
+ },
31
+ {
32
+ iconName: 'edit',
33
+ iconLabel: 'Edit',
34
+ disabled: false,
35
+ disableMessage: '',
36
+ },
37
+ {
38
+ iconName: 'full_access_icon',
39
+ iconLabel: 'Full Access',
40
+ disabled: false,
41
+ disableMessage: '',
42
+ },
43
+ ];
44
+
45
+ const [selectedOption, setSelectedOption] = useState<string | null>(null);
46
+
47
+ const handleOptionChange = (selected: string | null) => {
48
+ setSelectedOption(selected);
49
+ };
50
+
51
+ return (
52
+ <IconRadioGroup
53
+ items={radioOptions}
54
+ onButtonClick={(selectedItem) => console.log('Selected:', selectedItem)}
55
+ onChange={handleOptionChange}
56
+ selectedValue={selectedOption}
57
+ />
58
+ );
59
+ },
60
+ };
61
+
62
+ export const WithDisabledOption: Story = {
63
+ render: () => {
64
+ const radioOptions = [
65
+ {
66
+ iconName: 'no_access_icon',
67
+ iconLabel: 'No Access',
68
+ disabled: true,
69
+ disableMessage: 'user dont have access',
70
+ },
71
+ {
72
+ iconName: 'view_access_icon',
73
+ iconLabel: 'View',
74
+ disabled: false,
75
+ disableMessage: '',
76
+ },
77
+ {
78
+ iconName: 'edit',
79
+ iconLabel: 'Edit',
80
+ disabled: false,
81
+ disableMessage: '',
82
+ },
83
+ {
84
+ iconName: 'full_access_icon',
85
+ iconLabel: 'Full Access',
86
+ disabled: false,
87
+ disableMessage: '',
88
+ },
89
+ ];
90
+
91
+ const [selectedOption, setSelectedOption] = useState<string | null>(null);
92
+
93
+ const handleOptionChange = (selected: string | null) => {
94
+ setSelectedOption(selected);
95
+ };
96
+
97
+ return (
98
+ <IconRadioGroup
99
+ items={radioOptions}
100
+ onButtonClick={() => {}}
101
+ onChange={handleOptionChange}
102
+ selectedValue={selectedOption}
103
+ />
104
+ );
105
+ },
106
+ };
107
+
108
+ export default meta;
@@ -0,0 +1,72 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import classNames from 'classnames';
3
+ import './IconRadioGroup.scss';
4
+ import Icon from '../Icon/Icon';
5
+ import { IconRadioItem, IconRadioGroupProps } from './type';
6
+
7
+ const IconRadioGroup: React.FC<IconRadioGroupProps> = ({
8
+ items,
9
+ onButtonClick,
10
+ selectedValue: initialSelectedValue = null,
11
+ onChange,
12
+ className = '',
13
+ }) => {
14
+ const [selectedValue, setSelectedValue] = useState<string | null>(
15
+ initialSelectedValue
16
+ );
17
+
18
+ useEffect(() => {
19
+ if (initialSelectedValue !== selectedValue) {
20
+ setSelectedValue(initialSelectedValue);
21
+ }
22
+ }, [initialSelectedValue, selectedValue]);
23
+
24
+ const handleButtonClick = (item: IconRadioItem) => {
25
+ if (item.disabled) return;
26
+
27
+ const newSelectedValue = item.iconName;
28
+ setSelectedValue(newSelectedValue);
29
+
30
+ if (onChange) {
31
+ onChange(newSelectedValue);
32
+ }
33
+
34
+ onButtonClick(item);
35
+ };
36
+
37
+ return (
38
+ <div className={classNames('ff-icon-radio-group', className)}>
39
+ {items.map((item) => (
40
+ <div
41
+ key={item.iconName}
42
+ className={classNames('ff-icon-radio-button', {
43
+ selected: selectedValue === item.iconName,
44
+ disabled: item.disabled,
45
+ })}
46
+ onClick={() => handleButtonClick(item)}
47
+ >
48
+ <div
49
+ className={classNames('icon-container', {
50
+ selected: selectedValue === item.iconName,
51
+ })}
52
+ >
53
+ <Icon
54
+ name={item.iconName}
55
+ height={14}
56
+ width={14}
57
+ hoverEffect={false}
58
+ color={
59
+ selectedValue === item.iconName
60
+ ? 'var(--drawer-footer-bg)'
61
+ : 'var(--brand-color)'
62
+ }
63
+ />
64
+ </div>
65
+ </div>
66
+ ))}
67
+ <div className="line-connector"></div>
68
+ </div>
69
+ );
70
+ };
71
+
72
+ export default IconRadioGroup;
@@ -0,0 +1 @@
1
+ export { default } from './IconRadioGroup';
@@ -0,0 +1,50 @@
1
+ export interface IconRadioItem {
2
+ /**
3
+ * The unique name for the icon, used to load the corresponding icon.
4
+ */
5
+ iconName: string;
6
+
7
+ /**
8
+ * The display label for the icon. This can be used for accessibility purposes.
9
+ */
10
+ iconLabel: string;
11
+
12
+ /**
13
+ * Flag to determine if the icon option is disabled.
14
+ */
15
+ disabled?: boolean;
16
+
17
+ /**
18
+ * Message to display when the option is disabled.
19
+ */
20
+ disableMessage?: string;
21
+ }
22
+
23
+ export interface IconRadioGroupProps {
24
+ /**
25
+ * Array of icon items that make up the radio button group.
26
+ */
27
+ items: IconRadioItem[];
28
+
29
+ /**
30
+ * Callback function called when a button/icon is clicked.
31
+ * It returns the selected item.
32
+ */
33
+ onButtonClick: (selectedItem: IconRadioItem) => void;
34
+
35
+ /**
36
+ * The currently selected icon value
37
+ */
38
+ selectedValue?: string | null;
39
+
40
+ /**
41
+ * Callback function to notify parent of selection change.
42
+ */
43
+ onChange?: (selected: string | null) => void;
44
+
45
+ /**
46
+ * Optional className for custom styling
47
+ */
48
+ className?: string;
49
+ }
50
+
package/src/index.ts CHANGED
@@ -46,6 +46,7 @@ import Paper from './components/Paper';
46
46
  import DashboardDonutChart from './components/Charts/DashboardDonutChart';
47
47
  import Recaptcha from './components/FF_Captcha/Recaptcha';
48
48
  import NLPInput from './components/NLPInput';
49
+ import IconRadioGroup from './components/IconRadioGroup';
49
50
  import MachineInputField from './components/MachineInputField';
50
51
  import SequentialConnectingBranch from './components/SequentialConnectingBranch';
51
52
  import AttachmentButton from './components/AttachmentButton';
@@ -119,6 +120,7 @@ export {
119
120
  MachineInputField,
120
121
  SequentialConnectingBranch,
121
122
  AttachmentButton,
123
+ IconRadioGroup,
122
124
 
123
125
  // utils exports
124
126
  checkEmpty,