pixel-react 1.1.7 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/AttachmentButton/AttachmentButton.d.ts +5 -0
  3. package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +9 -0
  4. package/lib/components/AttachmentButton/index.d.ts +1 -0
  5. package/lib/components/AttachmentButton/types.d.ts +8 -0
  6. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
  7. package/lib/components/ExcelFile/ColorBarSelector/ColorBarSelector.d.ts +8 -0
  8. package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
  9. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
  10. package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
  11. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
  12. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
  13. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
  14. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
  15. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
  16. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
  17. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
  18. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
  19. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
  20. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
  21. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +81 -0
  22. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
  23. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +130 -0
  24. package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
  25. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
  26. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
  27. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
  28. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
  29. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
  30. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
  31. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
  32. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
  33. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
  34. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
  35. package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
  36. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
  37. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
  38. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +215 -0
  39. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
  40. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
  41. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +45 -0
  42. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +3 -0
  43. package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
  44. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +15 -0
  45. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +3 -0
  46. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
  47. package/lib/components/ExcelFile/Types.d.ts +176 -0
  48. package/lib/components/ExcelFile/index.d.ts +1 -0
  49. package/lib/components/IconRadioGroup/IconRadioGroup.d.ts +5 -0
  50. package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
  51. package/lib/components/IconRadioGroup/index.d.ts +1 -0
  52. package/lib/components/IconRadioGroup/type.d.ts +41 -0
  53. package/lib/components/RadioButton/radioButtonTypes.d.ts +15 -0
  54. package/lib/components/RadioGroup/RadioGroup.stories.d.ts +2 -1
  55. package/lib/components/RadioGroup/radioGroupTypes.d.ts +15 -0
  56. package/lib/components/Select/Select.d.ts +1 -1
  57. package/lib/components/Select/types.d.ts +4 -0
  58. package/lib/components/Table/Table.d.ts +1 -1
  59. package/lib/components/Table/Types.d.ts +8 -0
  60. package/lib/components/TableTree/TableTree.d.ts +1 -0
  61. package/lib/index.d.ts +71 -3
  62. package/lib/index.esm.js +408 -151
  63. package/lib/index.esm.js.map +1 -1
  64. package/lib/index.js +409 -150
  65. package/lib/index.js.map +1 -1
  66. package/lib/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +4 -2
  68. package/src/assets/Themes/BaseTheme.scss +11 -0
  69. package/src/assets/Themes/DarkTheme.scss +10 -0
  70. package/src/assets/icons/add_file.svg +14 -0
  71. package/src/assets/icons/all_borders.svg +3 -0
  72. package/src/assets/icons/bold.svg +3 -0
  73. package/src/assets/icons/border_bottom.svg +3 -0
  74. package/src/assets/icons/border_left.svg +3 -0
  75. package/src/assets/icons/border_right.svg +3 -0
  76. package/src/assets/icons/border_top.svg +3 -0
  77. package/src/assets/icons/clone_icon.svg +3 -0
  78. package/src/assets/icons/double_underline.svg +5 -0
  79. package/src/assets/icons/fill_color.svg +7 -0
  80. package/src/assets/icons/formate_painter.svg +5 -0
  81. package/src/assets/icons/full_access_icon.svg +4 -0
  82. package/src/assets/icons/history_icon.svg +19 -0
  83. package/src/assets/icons/italic.svg +3 -0
  84. package/src/assets/icons/jira.svg +3 -0
  85. package/src/assets/icons/linked_defects.svg +11 -0
  86. package/src/assets/icons/move_icon.svg +5 -0
  87. package/src/assets/icons/nlp_help_icon.svg +3 -0
  88. package/src/assets/icons/no_access_icon.svg +4 -0
  89. package/src/assets/icons/no_border.svg +3 -0
  90. package/src/assets/icons/notification_icon.svg +3 -0
  91. package/src/assets/icons/strike_through.svg +3 -0
  92. package/src/assets/icons/text_align_center.svg +3 -0
  93. package/src/assets/icons/text_align_left.svg +3 -0
  94. package/src/assets/icons/text_align_right.svg +3 -0
  95. package/src/assets/icons/text_color.svg +3 -0
  96. package/src/assets/icons/underline.svg +4 -0
  97. package/src/assets/icons/update_icon.svg +3 -0
  98. package/src/assets/icons/view_access_icon.svg +4 -0
  99. package/src/components/AppHeader/AppHeader.scss +65 -4
  100. package/src/components/AppHeader/AppHeader.stories.tsx +1 -0
  101. package/src/components/AppHeader/AppHeader.tsx +7 -5
  102. package/src/components/AttachmentButton/AttachmentButton.scss +9 -0
  103. package/src/components/AttachmentButton/AttachmentButton.stories.tsx +76 -0
  104. package/src/components/AttachmentButton/AttachmentButton.tsx +113 -0
  105. package/src/components/AttachmentButton/index.ts +1 -0
  106. package/src/components/AttachmentButton/types.ts +8 -0
  107. package/src/components/Drawer/Drawer.scss +0 -1
  108. package/src/components/ExcelFile/ChangeExcelStyles.tsx +78 -0
  109. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +13 -0
  110. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.tsx +43 -0
  111. package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +102 -0
  112. package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +104 -0
  113. package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +131 -0
  114. package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +201 -0
  115. package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +123 -0
  116. package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +25 -0
  117. package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +49 -0
  118. package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +37 -0
  119. package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +46 -0
  120. package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +31 -0
  121. package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +5 -0
  122. package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +5 -0
  123. package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +102 -0
  124. package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +32 -0
  125. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.css +144 -0
  126. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +494 -0
  127. package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +19 -0
  128. package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +302 -0
  129. package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +18 -0
  130. package/src/components/ExcelFile/ExcelFile/Excel/context.ts +12 -0
  131. package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +200 -0
  132. package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +137 -0
  133. package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -0
  134. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +154 -0
  135. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +10 -0
  136. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +69 -0
  137. package/src/components/ExcelFile/ExcelFile/Excel/index.ts +48 -0
  138. package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +388 -0
  139. package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +82 -0
  140. package/src/components/ExcelFile/ExcelFile/Excel/point.ts +15 -0
  141. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +682 -0
  142. package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +257 -0
  143. package/src/components/ExcelFile/ExcelFile/Excel/types.ts +269 -0
  144. package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +58 -0
  145. package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +8 -0
  146. package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +9 -0
  147. package/src/components/ExcelFile/ExcelFile/Excel/util.ts +173 -0
  148. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +27 -0
  149. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +520 -0
  150. package/src/components/ExcelFile/ExcelFile.stories.tsx +132 -0
  151. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.scss +16 -0
  152. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +79 -0
  153. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +22 -0
  154. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +271 -0
  155. package/src/components/ExcelFile/ImportExcelStyles.tsx +86 -0
  156. package/src/components/ExcelFile/Types.ts +241 -0
  157. package/src/components/ExcelFile/index.ts +1 -0
  158. package/src/components/Icon/Icons.scss +2 -3
  159. package/src/components/Icon/iconList.ts +59 -1
  160. package/src/components/IconRadioGroup/IconRadioGroup.scss +60 -0
  161. package/src/components/IconRadioGroup/IconRadioGroup.stories.tsx +108 -0
  162. package/src/components/IconRadioGroup/IconRadioGroup.tsx +72 -0
  163. package/src/components/IconRadioGroup/index.ts +1 -0
  164. package/src/components/IconRadioGroup/type.ts +50 -0
  165. package/src/components/Modal/modal.scss +1 -1
  166. package/src/components/MultiSelect/MultiSelect.scss +2 -2
  167. package/src/components/RadioButton/RadioButton.scss +74 -68
  168. package/src/components/RadioButton/RadioButton.tsx +22 -15
  169. package/src/components/RadioButton/radioButtonTypes.tsx +18 -0
  170. package/src/components/RadioGroup/RadioGroup.stories.tsx +42 -1
  171. package/src/components/RadioGroup/RadioGroup.tsx +3 -0
  172. package/src/components/RadioGroup/radioGroupTypes.tsx +18 -0
  173. package/src/components/Select/Select.scss +1 -2
  174. package/src/components/Select/Select.tsx +3 -2
  175. package/src/components/Select/types.ts +5 -0
  176. package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +5 -5
  177. package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +1 -1
  178. package/src/components/Table/Table.scss +1 -0
  179. package/src/components/Table/Table.tsx +28 -13
  180. package/src/components/Table/Types.ts +8 -0
  181. package/src/components/TableTree/TableTree.scss +18 -2
  182. package/src/components/TableTree/TableTree.stories.tsx +9 -51
  183. package/src/components/TableTree/TableTree.tsx +15 -2
  184. package/src/index.ts +4 -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
 
@@ -89,8 +109,17 @@ import AppSwitchIcon from '../../assets/icons/app_switch.svg?react';
89
109
  import UserProfile from '../../assets/icons/user_profile.svg?react';
90
110
  import ContinueSignIn from '../../assets/icons/continue_without_sign.svg?react';
91
111
  import CloudServerHost from '../../assets/icons/cloud_server_host_icon.svg?react';
112
+ import NotificationIcon from '../../assets/icons/notification_icon.svg?react';
113
+ import NLPHelpIcon from '../../assets/icons/nlp_help_icon.svg?react';
114
+ import UpdateIcon from '../../assets/icons/update_icon.svg?react';
115
+ import AddFile from '../../assets/icons/add_file.svg?react';
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';
92
122
 
93
- //icons
94
123
  Components['delete_info'] = DeleteInfoIcon;
95
124
  Components['success'] = ToastSuccessIcon;
96
125
  Components['warning'] = WarningIcon;
@@ -133,6 +162,23 @@ Components['delete'] = DeleteIcon;
133
162
  Components['details'] = DetailsIcon;
134
163
  Components['impactList'] = ImpactListIcon;
135
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;
136
182
  Components['info'] = InfoIcon;
137
183
  Components['calendar_icon'] = CalendarIcon;
138
184
  Components['hide_icon'] = HideIcon;
@@ -178,5 +224,17 @@ Components['app_switch'] = AppSwitchIcon;
178
224
  Components['user_profile'] = UserProfile;
179
225
  Components['continue_without_signin'] = ContinueSignIn;
180
226
  Components['cloud_server_host'] = CloudServerHost;
227
+ Components['notification_icon'] = NotificationIcon;
228
+ Components['nlp_help_icon'] = NLPHelpIcon;
229
+ Components['update_icon'] = UpdateIcon;
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;
181
239
 
182
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
+
@@ -15,7 +15,7 @@
15
15
  background: var(--ff-mini-modal-border);
16
16
  position: relative;
17
17
  max-width: 100%;
18
- border-radius: 12px 12px 0 0;
18
+ border-radius: 12px;
19
19
  padding: 8px;
20
20
 
21
21
  .ff-modal-header {
@@ -109,8 +109,8 @@
109
109
  }
110
110
  }
111
111
  .ff-multiselect-more-chip{
112
- width: 1rem;
113
- @extend .fontXs;
112
+ width: 1.2rem;
113
+ @extend .fontSm;
114
114
  font-weight: 600;
115
115
  line-height: 16px;
116
116
  color: var(--brand-color);
@@ -12,87 +12,93 @@
12
12
  transition: $properties $duration;
13
13
  }
14
14
 
15
- .ff-radio {
16
- @extend .fontSm;
17
- position: relative;
18
- color: var(--text-color);
15
+ .ff-radio-wrapper {
19
16
  display: flex;
20
17
  align-items: center;
21
- cursor: pointer;
22
- .ff-radio-input {
23
- display: none;
24
- }
25
- .ff-radio-custom {
26
- box-sizing: content-box;
27
- @include circle(14px, 1px solid var(--radio-button-border)); //todo
28
- position: relative;
29
- margin-right: 8px;
30
- @include transition(border-color, background-color);
18
+ gap: 4px;
31
19
 
32
- &::before {
33
- content: '';
34
- @include circle(12px);
35
- background: #fbfdff; //todo
36
- position: absolute;
37
- top: 50%;
38
- left: 50%;
39
- transform: translate(-50%, -50%);
40
- @include transition(background-color);
20
+ .ff-radio {
21
+ @extend .fontSm;
22
+ position: relative;
23
+ color: var(--text-color);
24
+ display: flex;
25
+ align-items: center;
26
+ cursor: pointer;
27
+ .ff-radio-input {
28
+ display: none;
41
29
  }
30
+ .ff-radio-custom {
31
+ box-sizing: content-box;
32
+ @include circle(14px, 1px solid var(--radio-button-border)); //todo
33
+ position: relative;
34
+ margin-right: 8px;
35
+ @include transition(border-color, background-color);
42
36
 
43
- &::after {
44
- content: '';
45
- @include circle(16px, 4px solid #f7edff); //todo
46
- position: absolute;
47
- top: 50%;
48
- left: 50%;
49
- transform: translate(-50%, -50%);
50
- opacity: 0;
51
- @include transition(opacity);
52
- }
53
- }
37
+ &::before {
38
+ content: '';
39
+ @include circle(12px);
40
+ background: #fbfdff; //todo
41
+ position: absolute;
42
+ top: 50%;
43
+ left: 50%;
44
+ transform: translate(-50%, -50%);
45
+ @include transition(background-color);
46
+ }
54
47
 
55
- &:hover .ff-radio-custom {
56
- border: 1px solid var(--brand-color);
57
- &::before {
58
- background-color: var(--drawer-footer-bg);
59
- }
60
- &::after {
61
- opacity: 1;
62
- @include transition(opacity);
48
+ &::after {
49
+ content: '';
50
+ @include circle(16px, 4px solid #f7edff); //todo
51
+ position: absolute;
52
+ top: 50%;
53
+ left: 50%;
54
+ transform: translate(-50%, -50%);
55
+ opacity: 0;
56
+ @include transition(opacity);
57
+ }
63
58
  }
64
- }
65
- .ff-radio-input:checked + .ff-radio-custom {
66
- border-color: var(--brand-color);
67
59
 
68
- &::before {
69
- background: var(--brand-color);
70
- height: 12px;
71
- width: 12px;
60
+ &:hover .ff-radio-custom {
61
+ border: 1px solid var(--brand-color);
62
+ &::before {
63
+ background-color: var(--drawer-footer-bg);
64
+ }
65
+ &::after {
66
+ opacity: 1;
67
+ @include transition(opacity);
68
+ }
72
69
  }
73
- }
74
- .ff-radio-input:disabled + .ff-radio-custom {
75
- border: 1px solid var(--radio-button-border);
76
- &::before {
77
- background: var(--drawer-footer-bg);
70
+ .ff-radio-input:checked + .ff-radio-custom {
71
+ border-color: var(--brand-color);
72
+
73
+ &::before {
74
+ background: var(--brand-color);
75
+ height: 12px;
76
+ width: 12px;
77
+ }
78
78
  }
79
+ .ff-radio-input:disabled + .ff-radio-custom {
80
+ border: 1px solid var(--radio-button-border);
81
+ &::before {
82
+ background: var(--drawer-footer-bg);
83
+ }
79
84
 
80
- &::after {
81
- border: 4px solid var(--radio-button-hover);
82
- opacity: 0;
83
- @include transition(opacity);
85
+ &::after {
86
+ border: 4px solid var(--radio-button-hover);
87
+ opacity: 0;
88
+ @include transition(opacity);
89
+ }
84
90
  }
85
- }
86
91
 
87
- .ff-radio-input:checked:disabled + .ff-radio-custom {
88
- border-color: var(--brand-color);
89
- background-color: var(--drawer-footer-bg);
90
- &::before {
91
- background: var(--brand-color);
92
+ .ff-radio-input:checked:disabled + .ff-radio-custom {
93
+ border-color: var(--brand-color);
94
+ background-color: var(--drawer-footer-bg);
95
+ &::before {
96
+ background: var(--brand-color);
97
+ }
98
+ }
99
+ &--disabled {
100
+ cursor: default;
101
+ opacity: 0.5;
92
102
  }
93
- }
94
- &--disabled {
95
- cursor: default;
96
- opacity: 0.5;
97
103
  }
98
104
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import './RadioButton.scss';
3
3
  import classNames from 'classnames';
4
+ import Tooltip from '../Tooltip';
4
5
 
5
6
  const RadioButton: React.FC<RadioButtonProps> = ({
6
7
  label,
@@ -9,23 +10,29 @@ const RadioButton: React.FC<RadioButtonProps> = ({
9
10
  onChange,
10
11
  value,
11
12
  disabled = false,
13
+ showTooltip = false,
14
+ tooltipChildren = 'Custom JSX',
15
+ tooltipTitle = 'Custom JSX',
12
16
  }) => {
13
17
  return (
14
- <label
15
- className={classNames('ff-radio', { 'ff-radio--disabled': disabled })}
16
- >
17
- <input
18
- disabled={disabled}
19
- type="radio"
20
- name={name}
21
- value={value}
22
- checked={checked}
23
- onChange={onChange}
24
- className="ff-radio-input"
25
- />
26
- <span className="ff-radio-custom" />
27
- {label}
28
- </label>
18
+ <div className="ff-radio-wrapper">
19
+ <label
20
+ className={classNames('ff-radio', { 'ff-radio--disabled': disabled })}
21
+ >
22
+ <input
23
+ disabled={disabled}
24
+ type="radio"
25
+ name={name}
26
+ value={value}
27
+ checked={checked}
28
+ onChange={onChange}
29
+ className="ff-radio-input"
30
+ />
31
+ <span className="ff-radio-custom" />
32
+ {label}
33
+ </label>
34
+ {showTooltip && <Tooltip title={tooltipTitle}>{tooltipChildren}</Tooltip>}
35
+ </div>
29
36
  );
30
37
  };
31
38
 
@@ -37,4 +37,22 @@ interface RadioButtonProps {
37
37
  * Optional.
38
38
  */
39
39
  disabled?: boolean;
40
+
41
+ /**
42
+ * Indicates whether the radio button show the tooltip.
43
+ * Optional.
44
+ */
45
+ showTooltip?: boolean;
46
+
47
+ /**
48
+ * The content of the tooltip.
49
+ * Optional.
50
+ */
51
+ tooltipChildren?: React.ReactNode;
52
+
53
+ /**
54
+ * The content of the tooltip.
55
+ * Optional.
56
+ */
57
+ tooltipTitle?: React.ReactNode;
40
58
  }