pixel-react-excel-sheet 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/1fb4472b34e4fe07.css +1 -0
  3. package/lib/components/Accordion/Accordion.d.ts +1 -1
  4. package/lib/components/Accordion/types.d.ts +12 -0
  5. package/lib/components/AddVariables/AddVariables.d.ts +5 -0
  6. package/lib/components/AddVariables/index.d.ts +1 -0
  7. package/lib/components/AddVariables/types.d.ts +35 -0
  8. package/lib/components/AppHeader/types.d.ts +2 -0
  9. package/lib/components/AttachImage/AttachImage.d.ts +1 -6
  10. package/lib/components/AttachImage/types.d.ts +8 -0
  11. package/lib/components/Avatar/types.d.ts +9 -1
  12. package/lib/components/Charts/BarChart/BarChart.d.ts +1 -0
  13. package/lib/components/Charts/DashboardDonutChart/types.d.ts +6 -0
  14. package/lib/components/Checkbox/types.d.ts +4 -0
  15. package/lib/components/Comment/Comments.d.ts +4 -0
  16. package/lib/components/Comment/comment/Comment.d.ts +11 -0
  17. package/lib/components/Comment/comment/useNode.d.ts +7 -0
  18. package/lib/components/Comment/index.d.ts +1 -0
  19. package/lib/components/Comment/type.d.ts +25 -0
  20. package/lib/components/CreateVariable/CreateVariableSlider.d.ts +5 -0
  21. package/lib/components/CreateVariable/index.d.ts +1 -0
  22. package/lib/components/CreateVariable/types.d.ts +56 -0
  23. package/lib/components/Drawer/Types.d.ts +13 -0
  24. package/lib/components/Editor/constants.d.ts +1 -1
  25. package/lib/components/Editor/types.d.ts +10 -2
  26. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +8 -1
  27. package/lib/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.d.ts +2 -0
  28. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +13 -6
  29. package/lib/components/FileDropzone/RadioFilePreview.d.ts +4 -0
  30. package/lib/components/FileDropzone/types.d.ts +61 -0
  31. package/lib/components/IconButton/IconButton.d.ts +1 -2
  32. package/lib/components/IconButton/types.d.ts +1 -0
  33. package/lib/components/Input/Input.d.ts +1 -1
  34. package/lib/components/MenuOption/types.d.ts +3 -2
  35. package/lib/components/MiniModal/types.d.ts +7 -0
  36. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  37. package/lib/components/PhoneInput/PhoneInput.d.ts +6 -0
  38. package/lib/components/PhoneInput/index.d.ts +1 -0
  39. package/lib/components/PhoneInput/types.d.ts +10 -0
  40. package/lib/components/PopUpModal/types.d.ts +1 -0
  41. package/lib/components/Search/Search.d.ts +1 -1
  42. package/lib/components/Search/types.d.ts +4 -0
  43. package/lib/components/Select/components/types.d.ts +1 -0
  44. package/lib/components/Select/types.d.ts +2 -0
  45. package/lib/components/Table/Types.d.ts +1 -1
  46. package/lib/components/TableTree/Components/TableBody.d.ts +4 -0
  47. package/lib/components/TableTree/Components/TableCell.d.ts +4 -0
  48. package/lib/components/TableTree/Components/TableHead.d.ts +4 -0
  49. package/lib/components/TableTree/Components/TableRow.d.ts +4 -0
  50. package/lib/components/TableTree/Utils/getAllChildIds.d.ts +1 -0
  51. package/lib/components/TableTree/types.d.ts +38 -5
  52. package/lib/components/TableWithAccordion/TableWithAccordion.d.ts +5 -0
  53. package/lib/components/TableWithAccordion/data.d.ts +8 -0
  54. package/lib/components/TableWithAccordion/index.d.ts +1 -0
  55. package/lib/components/TableWithAccordion/types.d.ts +67 -0
  56. package/lib/components/Tabs/types.d.ts +1 -0
  57. package/lib/index.d.ts +395 -39
  58. package/lib/index.esm.js +3859 -1017
  59. package/lib/index.esm.js.map +1 -1
  60. package/lib/index.js +3866 -1016
  61. package/lib/index.js.map +1 -1
  62. package/lib/tsconfig.tsbuildinfo +1 -1
  63. package/lib/utils/FormatString/FormatString.d.ts +1 -0
  64. package/lib/utils/checkDuplicates/checkDuplicates.d.ts +1 -0
  65. package/package.json +2 -1
  66. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +15 -0
  67. package/src/assets/Themes/BaseTheme.scss +16 -0
  68. package/src/assets/Themes/DarkTheme.scss +71 -42
  69. package/src/assets/icons/add_file.svg +4 -17
  70. package/src/assets/icons/add_variable.svg +11 -0
  71. package/src/assets/icons/authorization.svg +4 -0
  72. package/src/assets/icons/authorization_icon.svg +1 -0
  73. package/src/assets/icons/backward.svg +10 -0
  74. package/src/assets/icons/capture_icon.svg +3 -0
  75. package/src/assets/icons/depends_on_script.svg +7 -0
  76. package/src/assets/icons/download_file_icon.svg +2 -9
  77. package/src/assets/icons/email_group.svg +3 -0
  78. package/src/assets/icons/executions_icon.svg +3 -0
  79. package/src/assets/icons/forward.svg +3 -0
  80. package/src/assets/icons/labels.svg +8 -0
  81. package/src/assets/icons/machine_disable_icon.svg +18 -0
  82. package/src/assets/icons/machine_enable_icon.svg +10 -0
  83. package/src/assets/icons/parameters.svg +3 -0
  84. package/src/assets/icons/pre_post_condition.svg +8 -0
  85. package/src/assets/icons/program_element.svg +8 -0
  86. package/src/assets/icons/project_status_icon.svg +10 -0
  87. package/src/assets/icons/refresh_icon.svg +4 -0
  88. package/src/assets/icons/rotate_icon.svg +10 -0
  89. package/src/assets/icons/suites_icon.svg +3 -0
  90. package/src/assets/icons/swipe_icon.svg +9 -0
  91. package/src/assets/icons/tap_icon.svg +4 -0
  92. package/src/assets/icons/test_data.svg +5 -0
  93. package/src/assets/icons/test_data_set.svg +7 -0
  94. package/src/assets/icons/variable_set.svg +5 -0
  95. package/src/assets/icons/window_maximize.svg +1 -2
  96. package/src/assets/icons/window_restore.svg +4 -0
  97. package/src/assets/styles/_colors.scss +0 -1
  98. package/src/components/Accordion/Accordion.stories.tsx +4 -0
  99. package/src/components/Accordion/Accordion.tsx +7 -1
  100. package/src/components/Accordion/types.ts +12 -0
  101. package/src/components/AddVariables/AddVariables.scss +14 -0
  102. package/src/components/AddVariables/AddVariables.stories.tsx +44 -0
  103. package/src/components/AddVariables/AddVariables.tsx +113 -0
  104. package/src/components/AddVariables/index.ts +1 -0
  105. package/src/components/AddVariables/types.ts +36 -0
  106. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +1 -1
  107. package/src/components/AppHeader/AppHeader.scss +40 -1
  108. package/src/components/AppHeader/AppHeader.stories.tsx +133 -5
  109. package/src/components/AppHeader/AppHeader.tsx +111 -112
  110. package/src/components/AppHeader/types.ts +10 -9
  111. package/src/components/AttachImage/AttachImage.stories.tsx +2 -0
  112. package/src/components/AttachImage/AttachImage.tsx +5 -9
  113. package/src/components/AttachImage/types.ts +25 -18
  114. package/src/components/Avatar/Avatar.scss +4 -0
  115. package/src/components/Avatar/Avatar.stories.tsx +38 -18
  116. package/src/components/Avatar/Avatar.tsx +19 -3
  117. package/src/components/Avatar/types.ts +9 -1
  118. package/src/components/Charts/BarChart/BarChart.scss +4 -1
  119. package/src/components/Charts/BarChart/BarChart.tsx +23 -9
  120. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.scss +10 -3
  121. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +2 -1
  122. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +54 -25
  123. package/src/components/Charts/DashboardDonutChart/types.ts +7 -1
  124. package/src/components/Charts/DonutChart/DonutChart.tsx +8 -3
  125. package/src/components/Charts/LineChart/LineChart.scss +13 -9
  126. package/src/components/Charts/LineChart/LineChart.tsx +6 -2
  127. package/src/components/Charts/RadialChart/RadialChart.scss +4 -0
  128. package/src/components/Charts/RadialChart/RadialChart.tsx +51 -45
  129. package/src/components/Checkbox/Checkbox.scss +57 -0
  130. package/src/components/Checkbox/Checkbox.stories.tsx +91 -15
  131. package/src/components/Checkbox/Checkbox.tsx +4 -1
  132. package/src/components/Checkbox/types.ts +4 -0
  133. package/src/components/Comment/Comments.scss +166 -0
  134. package/src/components/Comment/Comments.stories.tsx +212 -0
  135. package/src/components/Comment/Comments.tsx +51 -0
  136. package/src/components/Comment/comment/Comment.tsx +206 -0
  137. package/src/components/Comment/comment/useNode.ts +51 -0
  138. package/src/components/Comment/index.ts +1 -0
  139. package/src/components/Comment/type.ts +36 -0
  140. package/src/components/CreateVariable/CreateVariableSlider.scss +18 -0
  141. package/src/components/CreateVariable/CreateVariableSlider.stories.tsx +66 -0
  142. package/src/components/CreateVariable/CreateVariableSlider.tsx +95 -0
  143. package/src/components/CreateVariable/index.ts +1 -0
  144. package/src/components/CreateVariable/types.ts +58 -0
  145. package/src/components/DatePicker/DatePicker.scss +11 -0
  146. package/src/components/DatePicker/DatePicker.stories.tsx +19 -0
  147. package/src/components/DatePicker/DatePicker.tsx +73 -22
  148. package/src/components/Drawer/Drawer.scss +3 -2
  149. package/src/components/Drawer/Drawer.stories.tsx +0 -1
  150. package/src/components/Drawer/Drawer.tsx +4 -1
  151. package/src/components/Drawer/Types.ts +13 -0
  152. package/src/components/Editor/Editor.stories.tsx +2 -2
  153. package/src/components/Editor/Editor.tsx +4 -2
  154. package/src/components/Editor/VariableDropdown.scss +8 -2
  155. package/src/components/Editor/VariableDropdown.tsx +15 -7
  156. package/src/components/Editor/constants.ts +1 -1
  157. package/src/components/Editor/types.ts +12 -2
  158. package/src/components/Excel/ExcelFile/ExcelFile.scss +0 -1
  159. package/src/components/Excel/ExcelFile/ExcelFile.tsx +41 -25
  160. package/src/components/Excel/ExcelFile/ExcelFileComponents/ActiveCell.tsx +12 -0
  161. package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +2 -34
  162. package/src/components/Excel/ExcelFile/ExcelFileComponents/FloatingRect.tsx +26 -1
  163. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +24 -22
  164. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +1 -3
  165. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +13 -0
  166. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +53 -26
  167. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +81 -14
  168. package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +17 -6
  169. package/src/components/Excel/ExcelFile.stories.tsx +4 -4
  170. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +36 -19
  171. package/src/components/Excel/dataConversion.ts +43 -20
  172. package/src/components/FieldSet/FieldSet.scss +2 -1
  173. package/src/components/FieldSet/FieldSet.stories.tsx +2 -1
  174. package/src/components/FileDropzone/Dropzone.tsx +76 -28
  175. package/src/components/FileDropzone/FileDropzone.scss +30 -3
  176. package/src/components/FileDropzone/FileDropzone.stories.tsx +125 -4
  177. package/src/components/FileDropzone/FileDropzone.tsx +46 -13
  178. package/src/components/FileDropzone/RadioFilePreview.tsx +76 -0
  179. package/src/components/FileDropzone/types.ts +73 -0
  180. package/src/components/Icon/iconList.ts +47 -2
  181. package/src/components/IconButton/IconButton.scss +11 -11
  182. package/src/components/IconButton/IconButton.stories.tsx +1 -0
  183. package/src/components/IconButton/IconButton.tsx +6 -8
  184. package/src/components/IconButton/types.ts +2 -1
  185. package/src/components/IconRadioGroup/IconRadioGroup.scss +2 -1
  186. package/src/components/Input/Input.scss +137 -125
  187. package/src/components/Input/Input.tsx +110 -93
  188. package/src/components/InputWithDropdown/InputWithDropdown.scss +9 -2
  189. package/src/components/InputWithDropdown/types.ts +3 -3
  190. package/src/components/LabelEditTextField/LabelEditTextField.tsx +1 -1
  191. package/src/components/MenuOption/MenuOption.stories.tsx +4 -3
  192. package/src/components/MenuOption/MenuOption.tsx +1 -1
  193. package/src/components/MenuOption/types.ts +4 -2
  194. package/src/components/MiniModal/MiniModal.scss +0 -4
  195. package/src/components/MiniModal/MiniModal.stories.tsx +3 -2
  196. package/src/components/MiniModal/MiniModal.tsx +28 -10
  197. package/src/components/MiniModal/types.ts +7 -0
  198. package/src/components/Modal/Modal.stories.tsx +2 -1
  199. package/src/components/ModulesChip/ModuleChip.scss +21 -8
  200. package/src/components/ModulesChip/ModuleChip.stories.tsx +2 -2
  201. package/src/components/ModulesChip/ModuleChip.tsx +6 -9
  202. package/src/components/MultiSelect/Dropdown.tsx +12 -5
  203. package/src/components/MultiSelect/MultiSelect.scss +29 -0
  204. package/src/components/MultiSelect/MultiSelect.stories.tsx +31 -14
  205. package/src/components/MultiSelect/MultiSelect.tsx +32 -21
  206. package/src/components/PhoneInput/PhoneInput.d.ts +3 -0
  207. package/src/components/PhoneInput/PhoneInput.stories.tsx +95 -0
  208. package/src/components/PhoneInput/PhoneInput.tsx +90 -0
  209. package/src/components/PhoneInput/index.ts +1 -0
  210. package/src/components/PhoneInput/phoneInput.scss +3 -0
  211. package/src/components/PhoneInput/types.ts +10 -0
  212. package/src/components/PopUpModal/PopUpModal.stories.tsx +14 -13
  213. package/src/components/PopUpModal/PopUpModal.tsx +2 -1
  214. package/src/components/PopUpModal/types.ts +14 -13
  215. package/src/components/Search/Search.stories.tsx +28 -9
  216. package/src/components/Search/Search.tsx +32 -29
  217. package/src/components/Search/types.ts +4 -0
  218. package/src/components/Select/Select.scss +20 -0
  219. package/src/components/Select/Select.stories.tsx +50 -1
  220. package/src/components/Select/Select.tsx +34 -7
  221. package/src/components/Select/components/Dropdown.scss +9 -0
  222. package/src/components/Select/components/Dropdown.tsx +20 -6
  223. package/src/components/Select/components/types.ts +1 -0
  224. package/src/components/Select/types.ts +12 -2
  225. package/src/components/Table/Table.scss +6 -5
  226. package/src/components/Table/Types.ts +1 -1
  227. package/src/components/TableTree/Components/TableBody.tsx +35 -0
  228. package/src/components/TableTree/Components/TableCell.tsx +59 -0
  229. package/src/components/TableTree/Components/TableHead.tsx +39 -0
  230. package/src/components/TableTree/Components/TableRow.tsx +37 -0
  231. package/src/components/TableTree/TableTree.scss +8 -5
  232. package/src/components/TableTree/TableTree.tsx +16 -46
  233. package/src/components/TableTree/Utils/getAllChildIds.ts +12 -0
  234. package/src/components/TableTree/Utils/renderSpaces.ts +0 -0
  235. package/src/components/TableTree/types.ts +43 -5
  236. package/src/components/TableWithAccordion/TableWithAccordion.scss +54 -0
  237. package/src/components/TableWithAccordion/TableWithAccordion.stories.tsx +94 -0
  238. package/src/components/TableWithAccordion/TableWithAccordion.tsx +174 -0
  239. package/src/components/TableWithAccordion/data.ts +37 -0
  240. package/src/components/TableWithAccordion/index.ts +1 -0
  241. package/src/components/TableWithAccordion/types.ts +70 -0
  242. package/src/components/Tabs/Tabs.scss +58 -5
  243. package/src/components/Tabs/Tabs.stories.tsx +31 -12
  244. package/src/components/Tabs/Tabs.tsx +27 -18
  245. package/src/components/Tabs/types.ts +1 -1
  246. package/src/components/TextArea/Textarea.stories.tsx +1 -1
  247. package/src/hooks/useFileDropzone.tsx +2 -1
  248. package/src/index.ts +18 -1
  249. package/src/utils/FormatString/FormatString.stories.tsx +58 -0
  250. package/src/utils/FormatString/FormatString.tsx +41 -0
  251. package/src/utils/checkDuplicates/CheckDuplicates.stories.tsx +40 -0
  252. package/src/utils/checkDuplicates/checkDuplicates.ts +13 -0
@@ -0,0 +1,70 @@
1
+ import { ReactNode } from "react";
2
+
3
+ export interface ColumnProps {
4
+ /**
5
+ * column name
6
+ */
7
+ header: string;
8
+ /**
9
+ * data key for particular column
10
+ */
11
+ accessor: string;
12
+ /**
13
+ * className for a column
14
+ */
15
+ className?: string;
16
+ /**
17
+ * width of a column
18
+ */
19
+ width?: number;
20
+ /**
21
+ * data for the column
22
+ */
23
+ cell?: (e: any) => JSX.Element | string | ReactNode;
24
+ }
25
+
26
+ export interface DataProps {
27
+ /**
28
+ * data for each row
29
+ */
30
+ [key: string]: any;
31
+ }
32
+
33
+ export interface TableProps {
34
+ /**
35
+ * Column details for table
36
+ */
37
+ tableMeta: Array<ColumnProps>;
38
+ /**
39
+ * Data for table
40
+ */
41
+ tableData: Array<DataProps>;
42
+ /**
43
+ * Table type
44
+ */
45
+ accordionType: 'row' | 'column';
46
+ /**
47
+ * Specific sentence to be displayed data not found
48
+ */
49
+ noDataContent?: string | ReactNode;
50
+ /**
51
+ * withFixedHeader prop to have non-scrollable fixed accordion table header
52
+ */
53
+ withFixedHeader?: boolean;
54
+ /**
55
+ * Height of the table in string
56
+ */
57
+ height?: string;
58
+ /**
59
+ * Header type to have different background color
60
+ */
61
+ headerType: 'default' | 'primary' | 'secondary';
62
+ /**
63
+ * Accordion collapse and expand Icon width
64
+ */
65
+ TableAccordionStateIconWidth:number,
66
+ /**
67
+ * Accordion collapse and expand Icon height
68
+ */
69
+ TableAccordionStateIconHeight:number,
70
+ }
@@ -8,9 +8,8 @@
8
8
  &--default {
9
9
  display: flex;
10
10
  gap: 8px;
11
- border: 1px solid var(--tabs-border-color);
12
11
  border-radius: 8px 8px 0 0;
13
- padding: 7px 8px 0;
12
+ padding: 6px 8px 0;
14
13
 
15
14
  .ff-tab-button {
16
15
  &--default {
@@ -19,21 +18,64 @@
19
18
  padding: 0 4px;
20
19
  display: flex;
21
20
  flex-direction: column;
21
+ gap: 4px;
22
22
  cursor: pointer;
23
23
 
24
- .ff-tab-label {
25
- padding-bottom: 4px;
26
- }
24
+ .label-count-section {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: 5px;
27
28
 
29
+ .tab-count {
30
+ background-color: var(--input-default-label-color);
31
+ color: var(--tab-bg-color);
32
+ height: 12px;
33
+ border-radius: 4px;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ font-size: 8px;
38
+ font-weight: 600;
39
+ padding: 0 2px;
40
+ &--active {
41
+ background-color: var(--tabs-label-active-color);
42
+ }
43
+ }
44
+ }
28
45
  .ff-tab-bar {
29
46
  width: 100%;
30
47
  border-radius: 2px 2px 0 0;
48
+ border-color: var(--input-default-label-color);
31
49
 
32
50
  &--active {
33
51
  border-top: 2px solid var(--tabs-label-active-color);
34
52
  }
35
53
  }
36
54
 
55
+ &:hover {
56
+ .ff-tab-bar {
57
+ border-top: 2px solid var(--input-hover-border-color);
58
+
59
+ &--active {
60
+ border-top: 2px solid var(--tabs-label-active-color);
61
+ }
62
+ }
63
+
64
+ .ff-tab-label {
65
+ color: var(--input-hover-border-color) !important;
66
+
67
+ &--active {
68
+ color: var(--tabs-label-active-color) !important;
69
+ }
70
+ }
71
+ .tab-count {
72
+ background-color: var(--input-hover-border-color);
73
+ &--active {
74
+ background-color: var(--tabs-label-active-color);
75
+ }
76
+ }
77
+ }
78
+
37
79
  &.disabled {
38
80
  opacity: 0.5;
39
81
  cursor: not-allowed;
@@ -58,6 +100,16 @@
58
100
  border-radius: 4px;
59
101
  cursor: pointer;
60
102
 
103
+ &:hover {
104
+ .ff-tab-label {
105
+ color: var(--input-hover-border-color) !important;
106
+
107
+ &--active {
108
+ color: var(--tabs-label-active-color) !important;
109
+ }
110
+ }
111
+ }
112
+
61
113
  &.active {
62
114
  background-color: var(--tab-bg-color);
63
115
  }
@@ -68,6 +120,7 @@
68
120
  }
69
121
  }
70
122
  }
123
+
71
124
  &--no-border {
72
125
  border: none;
73
126
  }
@@ -1,4 +1,4 @@
1
- import { useState } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import { Meta, StoryObj } from '@storybook/react';
3
3
  import Tabs from './Tabs';
4
4
  import Typography from '../Typography';
@@ -40,14 +40,15 @@ const TabContentFour = () => (
40
40
  );
41
41
 
42
42
  const tabsData = [
43
- { id: 'tab-1', label: 'Tab--1', component: <TabContentOne /> },
44
- { id: 'tab-2', label: 'Tab--2', component: <TabContentTwo /> },
45
- { id: 'tab-3', label: 'Tab--3', component: <TabContentThree /> },
43
+ { id: 'tab-1', label: 'Tab--1', component: <TabContentOne />, count: '02' },
44
+ { id: 'tab-2', label: 'Tab--2', component: <TabContentTwo />, count: 35 },
45
+ { id: 'tab-3', label: 'Tab--3', component: <TabContentThree />, count: 205 },
46
46
  ];
47
47
 
48
48
  export const DefaultTabs: Story = {
49
49
  render: () => {
50
- const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('tab-1');
50
+ const [activeTabIdDefault, setActiveTabIdDefault] =
51
+ useState<string>('tab-1');
51
52
 
52
53
  return (
53
54
  <Tabs
@@ -60,13 +61,30 @@ export const DefaultTabs: Story = {
60
61
  };
61
62
  export const CapsuleTabs: Story = {
62
63
  render: () => {
63
- const [activeTabIdCapsule, setActiveTabIdCapsule] = useState<string>('tab-1');
64
+ const [activeTabIdCapsule, setActiveTabIdCapsule] =
65
+ useState<string>('tab-1');
64
66
 
65
67
  const tabsDataForCapsule = [
66
- { id: 'tab-1', label: 'Loremipsum_1', component: <TabContentOne /> },
67
- { id: 'tab-2', label: 'Loremipsum_2', component: <TabContentTwo /> },
68
- { id: 'tab-3', label: 'Loremipsum_3', component: <TabContentThree /> },
69
- { id: 'tab-4', label: 'Loremipsum_4', component: <TabContentFour /> },
68
+ {
69
+ id: 'tab-1',
70
+ label: 'Loremipsum_1',
71
+ component: <TabContentOne />,
72
+ },
73
+ {
74
+ id: 'tab-2',
75
+ label: 'Loremipsum_2',
76
+ component: <TabContentTwo />,
77
+ },
78
+ {
79
+ id: 'tab-3',
80
+ label: 'Loremipsum_3',
81
+ component: <TabContentThree />,
82
+ },
83
+ {
84
+ id: 'tab-4',
85
+ label: 'Loremipsum_4',
86
+ component: <TabContentFour />,
87
+ },
70
88
  { id: 'tab-5', label: 'Loremipsum_5', component: <TabContentFour /> },
71
89
  ];
72
90
 
@@ -108,7 +126,8 @@ export const TabsWithDisabledTab: Story = {
108
126
 
109
127
  export const WithoutBorder: Story = {
110
128
  render: () => {
111
- const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('tab-1');
129
+ const [activeTabIdDefault, setActiveTabIdDefault] =
130
+ useState<string>('tab-1');
112
131
 
113
132
  return (
114
133
  <div style={{ display: 'flex', gap: '10px' }}>
@@ -131,4 +150,4 @@ export const WithoutBorder: Story = {
131
150
  },
132
151
  };
133
152
 
134
- export default meta;
153
+ export default meta;
@@ -28,27 +28,36 @@ const Tabs = ({
28
28
  active: activeTabId === tab.id,
29
29
  })}
30
30
  >
31
- <Typography
32
- children={tab.label}
33
- lineHeight="18px"
34
- fontWeight={activeTabId === tab.id ? 'semi-bold' : 'regular'}
35
- color={
36
- activeTabId === tab.id
37
- ? 'var(--tabs-label-active-color)'
38
- : 'var(--tabs-label-default-color)'
39
- }
40
- className={classNames('ff-tab-label', {
41
- 'ff-tab-label--active': activeTabId === tab.id,
42
- })}
43
- />
31
+ <div className="label-count-section">
32
+ <Typography
33
+ children={tab.label}
34
+ lineHeight="18px"
35
+ fontWeight={activeTabId === tab.id ? 'semi-bold' : 'regular'}
36
+ color={
37
+ activeTabId === tab.id
38
+ ? 'var(--tabs-label-active-color)'
39
+ : 'var(--tabs-label-default-color)'
40
+ }
41
+ className={classNames('ff-tab-label', {
42
+ 'ff-tab-label--active': activeTabId === tab.id,
43
+ })}
44
+ />
45
+ {variant === 'default' && tab.count && (
46
+ <span
47
+ className={classNames('tab-count', {
48
+ 'tab-count--active': activeTabId === tab.id,
49
+ })}
50
+ >
51
+ {tab.count}
52
+ </span>
53
+ )}
54
+ </div>
44
55
 
45
- <Typography
46
- children=""
47
- color=""
56
+ <div
48
57
  className={classNames('ff-tab-bar', {
49
58
  'ff-tab-bar--active': activeTabId === tab.id,
50
59
  })}
51
- />
60
+ ></div>
52
61
  </button>
53
62
  ))}
54
63
  </div>
@@ -59,4 +68,4 @@ const Tabs = ({
59
68
  );
60
69
  };
61
70
 
62
- export default Tabs;
71
+ export default Tabs;
@@ -26,6 +26,7 @@ export interface TabsProps {
26
26
  label: string;
27
27
  component?: JSX.Element;
28
28
  disabled?: boolean;
29
+ count?: number | string;
29
30
  }[];
30
31
  /**
31
32
  * Defines the styling variant of the tabs.
@@ -45,4 +46,3 @@ export interface TabsProps {
45
46
  */
46
47
  noBorder?: boolean;
47
48
  }
48
-
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import Textarea from './Textarea';
3
- import { ChangeEvent, useState } from 'react';
3
+ import React ,{ ChangeEvent, useState } from 'react';
4
4
  import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
5
5
  const meta: Meta<typeof Textarea> = {
6
6
  title: 'Components/Textarea',
@@ -21,6 +21,7 @@ const useFileDropzone = (options: DropzoneOptions): DropzoneState => {
21
21
  invalidFileMessage,
22
22
  fileExistMessage,
23
23
  validateMIMEType = false,
24
+ isApiResponseError,
24
25
  } = options;
25
26
 
26
27
  const [files, setFiles] = useState<FileState>({ accepted: [], rejected: [] });
@@ -56,7 +57,7 @@ const useFileDropzone = (options: DropzoneOptions): DropzoneState => {
56
57
  const extensionWithPeriod = getExtensionWithPeriod(file).toLowerCase();
57
58
 
58
59
  if (validateMIMEType) {
59
- if (!validateFileMIMEType(file, extensionWithPeriod)) {
60
+ if (!validateFileMIMEType(file, extensionWithPeriod) || isApiResponseError ) {
60
61
  errors.push({
61
62
  message: invalidFileMessage
62
63
  ? invalidFileMessage
package/src/index.ts CHANGED
@@ -54,7 +54,7 @@ import SequentialConnectingBranch from './components/SequentialConnectingBranch'
54
54
  import AttachmentButton from './components/AttachmentButton';
55
55
  import { Toastify, toast } from './components/Toastify/Toastify';
56
56
  import ToggleSwitch from './components/ToggleSwitch/ToggleSwitch';
57
- import Avatar from './components/Avatar/Avatar';
57
+ import Avatar from './components/Avatar';
58
58
 
59
59
  import LabelEditTextField from './components/LabelEditTextField';
60
60
  import EditTextField from './components/EditTextField';
@@ -68,6 +68,9 @@ import VariableDropdown from './components/Editor/VariableDropdown';
68
68
  import LineChart from './components/Charts/LineChart';
69
69
  import DownloadClient from './components/DownloadClient/DownloadClient';
70
70
  import FieldSet from './components/FieldSet';
71
+ import CreateVariableSlider from './components/CreateVariable/CreateVariableSlider';
72
+ import TableWithAccordion from './components/TableWithAccordion/TableWithAccordion';
73
+
71
74
  // Utils imports
72
75
  import { checkEmpty } from './utils/checkEmpty/checkEmpty';
73
76
  import {
@@ -88,8 +91,14 @@ import Editor from './components/Editor/Editor';
88
91
  import { getSequentialPayload } from './utils/getSequentialPayload/getSequentialPayload';
89
92
  import ConnectingBranch from './components/ConnectingBranch/ConnectingBranch';
90
93
  import { saveFileFromBlob } from './utils/downloadFile/saveFileFromBlob';
94
+ import { capitalize } from './utils/capitalize/capitalize';
95
+ import Comments from './components/Comment/Comments';
91
96
  import useFileDropzone from './hooks/useFileDropzone';
92
97
  import PopUpModal from './components/PopUpModal/PopUpModal';
98
+ import FormatString from './utils/FormatString/FormatString';
99
+ import AddVariables from './components/AddVariables/AddVariables';
100
+ import { hasDuplicateFile } from './utils/checkDuplicates/checkDuplicates';
101
+ import PhoneInputField from './components/PhoneInput';
93
102
 
94
103
  export {
95
104
  Button,
@@ -167,8 +176,13 @@ export {
167
176
  VariableDropdown,
168
177
  DownloadClient,
169
178
  FieldSet,
179
+ Comments,
170
180
  PopUpModal,
181
+ CreateVariableSlider,
182
+ AddVariables,
183
+ PhoneInputField,
171
184
 
185
+ TableWithAccordion,
172
186
  // utils exports
173
187
  checkEmpty,
174
188
  getExtension,
@@ -183,5 +197,8 @@ export {
183
197
  truncateText,
184
198
  getSequentialPayload,
185
199
  saveFileFromBlob,
200
+ capitalize,
186
201
  useFileDropzone,
202
+ FormatString,
203
+ hasDuplicateFile,
187
204
  };
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import formatString from './FormatString';
3
+
4
+ export default {
5
+ title: 'Utils/FormatString',
6
+ component: formatString,
7
+ };
8
+
9
+ export const Default = () => {
10
+ const examples = [
11
+ {
12
+ input: 'webserviceCount',
13
+ output: formatString('webserviceCount', ['count']),
14
+ removeSections: 'count',
15
+ },
16
+ { input: 'PARTIAL_PUBLIC', output: formatString('PARTIAL_PUBLIC') },
17
+ { input: 'assignedMemory', output: formatString('assignedMemory') },
18
+ {
19
+ input: 'webAndMobileCount',
20
+ output: formatString('webAndMobileCount', ['count']),
21
+ removeSections: 'count',
22
+ },
23
+ ];
24
+
25
+ return (
26
+ <div>
27
+ <h3>FormatString Function Examples</h3>
28
+ <table style={{ borderCollapse: 'collapse', width: '100%' }}>
29
+ <thead>
30
+ <tr>
31
+ <th style={{ border: '1px solid black', padding: '8px' }}>Input</th>
32
+ <th style={{ border: '1px solid black', padding: '8px' }}>
33
+ Remove Section
34
+ </th>
35
+ <th style={{ border: '1px solid black', padding: '8px' }}>
36
+ Output
37
+ </th>
38
+ </tr>
39
+ </thead>
40
+ <tbody>
41
+ {examples.map((example, index) => (
42
+ <tr key={index}>
43
+ <td style={{ border: '1px solid black', padding: '8px' }}>
44
+ {example.input}
45
+ </td>
46
+ <td style={{ border: '1px solid black', padding: '8px' }}>
47
+ {example?.removeSections}
48
+ </td>
49
+ <td style={{ border: '1px solid black', padding: '8px' }}>
50
+ {example.output}
51
+ </td>
52
+ </tr>
53
+ ))}
54
+ </tbody>
55
+ </table>
56
+ </div>
57
+ );
58
+ };
@@ -0,0 +1,41 @@
1
+ function formatCamelCaseString(
2
+ input: string,
3
+ removeSections: string[] = []
4
+ ): string {
5
+ // Removed specified sections from the string
6
+ const processedString = removeSections.reduce(
7
+ (str, section) => str.replace(new RegExp(section + '$', 'i'), ''),
8
+ input
9
+ );
10
+
11
+ // Add spaces before capital letters and capitalized the first letter
12
+ const formatted = processedString
13
+ .replace(/([A-Z])/g, ' $1')
14
+ .trim()
15
+ .replace(/^./, (str) => str.toUpperCase());
16
+
17
+ return formatted;
18
+ }
19
+ function formatSnakeOrUppercaseString(input: string): string {
20
+ return input
21
+ .toLowerCase()
22
+ .replace(/_/g, ' ')
23
+ .replace(/^./, (str) => str.toUpperCase());
24
+ }
25
+
26
+ export default function formatString(
27
+ input: string,
28
+ removeSections: string[] = []
29
+ ): string {
30
+ if (input.toUpperCase() === input) {
31
+ // Handled completely uppercase strings
32
+ input = input.toLowerCase();
33
+ }
34
+
35
+ if (input.includes('_')) {
36
+ // Handled snake case or uppercase strings
37
+ return formatSnakeOrUppercaseString(input);
38
+ }
39
+ // Handled camel case strings
40
+ return formatCamelCaseString(input, removeSections);
41
+ }
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import { hasDuplicateFile } from './checkDuplicates';
4
+
5
+ export default {
6
+ title: 'Utils/HasDuplicateFile',
7
+ argTypes: {
8
+ array: {
9
+ control: 'object',
10
+ description: 'Array of objects to check for duplicates.',
11
+ },
12
+ property: {
13
+ control: 'text',
14
+ description: 'Optional property to check for duplicates.',
15
+ },
16
+ },
17
+ } satisfies Meta;
18
+
19
+ export const Default: StoryObj = {
20
+ args: {
21
+ array: [
22
+ { id: 1, name: 'file1' },
23
+ { id: 2, name: 'file2' },
24
+ { id: 1, name: 'file1' },
25
+ ],
26
+ property: 'id',
27
+ },
28
+ render: (args) => {
29
+ const result = hasDuplicateFile(args.array, args.property);
30
+ return (
31
+ <div>
32
+ <h3>
33
+ Duplicate Check Result:{' '}
34
+ {result ? 'Duplicates Found' : 'No Duplicates'}
35
+ </h3>
36
+ <pre>{JSON.stringify(args.array, null, 2)}</pre>
37
+ </div>
38
+ );
39
+ },
40
+ };
@@ -0,0 +1,13 @@
1
+ // Will be used to find duplicate key-value pair in an array of objects.
2
+
3
+ export const hasDuplicateFile = (array: any[], property: string): boolean => {
4
+ const seen = new Set();
5
+ for (const obj of array) {
6
+ const key = property ? obj[property] : JSON.stringify(obj);
7
+ if (seen.has(key)) {
8
+ return true;
9
+ }
10
+ seen.add(key);
11
+ }
12
+ return false;
13
+ };