pixel-react 1.2.1 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. package/lib/components/AppHeader/types.d.ts +11 -2
  2. package/lib/components/Avatar/Avatar.d.ts +5 -0
  3. package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
  4. package/lib/components/Avatar/index.d.ts +1 -0
  5. package/lib/components/Avatar/types.d.ts +26 -0
  6. package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +2 -2
  7. package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +2 -2
  8. package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +1 -1
  9. package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +2 -2
  10. package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +2 -2
  11. package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +2 -2
  12. package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +2 -2
  13. package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +1 -1
  14. package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +1 -1
  15. package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +2 -2
  16. package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +1 -1
  17. package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +6 -7
  18. package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +1 -1
  19. package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +49 -5
  20. package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +3 -3
  21. package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +5 -5
  22. package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +6 -6
  23. package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -2
  24. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +2 -2
  25. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +1 -1
  26. package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +1 -1
  27. package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +11 -11
  28. package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +1 -1
  29. package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +1 -1
  30. package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +5 -5
  31. package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +3 -3
  32. package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +11 -48
  33. package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +1 -1
  34. package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +1 -1
  35. package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +11 -12
  36. package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +16 -0
  37. package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +0 -3
  38. package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +12 -0
  39. package/lib/components/ExcelFile/Types.d.ts +2 -49
  40. package/lib/components/Form/Form.d.ts +1 -15
  41. package/lib/components/Form/Form.stories.d.ts +6 -5
  42. package/lib/components/Form/Forms.d.ts +8 -0
  43. package/lib/components/Form/index.d.ts +1 -1
  44. package/lib/components/Icon/types.d.ts +1 -1
  45. package/lib/components/MenuOption/types.d.ts +7 -7
  46. package/lib/components/MiniModal/MiniModal.stories.d.ts +1 -0
  47. package/lib/components/MiniModal/types.d.ts +6 -6
  48. package/lib/components/ModulesChip/ModuleChip.d.ts +4 -0
  49. package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
  50. package/lib/components/ModulesChip/index.d.ts +1 -0
  51. package/lib/components/ModulesChip/types.d.ts +14 -0
  52. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +1 -0
  53. package/lib/components/Toastify/Toastify.d.ts +8 -0
  54. package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
  55. package/lib/components/Toastify/index.d.ts +1 -0
  56. package/lib/components/Toastify/types.d.ts +7 -0
  57. package/lib/components/Tooltip/types.d.ts +6 -0
  58. package/lib/components/Typography/types.d.ts +1 -0
  59. package/lib/index.d.ts +84 -31
  60. package/lib/index.esm.js +26720 -881
  61. package/lib/index.esm.js.map +1 -1
  62. package/lib/index.js +26718 -875
  63. package/lib/index.js.map +1 -1
  64. package/lib/tsconfig.tsbuildinfo +1 -1
  65. package/package.json +1 -1
  66. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  67. package/src/assets/Themes/BaseTheme.scss +2 -0
  68. package/src/assets/Themes/DarkTheme.scss +2 -0
  69. package/src/assets/icons/add_testcase.svg +3 -0
  70. package/src/assets/icons/add_variable_icon.svg +3 -4
  71. package/src/assets/icons/attachment_icon.svg +3 -0
  72. package/src/assets/icons/authorization_icon.svg +3 -0
  73. package/src/assets/icons/automation_testcase.svg +4 -0
  74. package/src/assets/icons/back_icon.svg +3 -0
  75. package/src/assets/icons/client_profile.svg +4 -0
  76. package/src/assets/icons/fireflink_finder_logo.svg +7 -0
  77. package/src/assets/icons/fireflink_platform.svg +4 -0
  78. package/src/assets/icons/license_expired.svg +20 -0
  79. package/src/assets/icons/manual_testcase.svg +3 -0
  80. package/src/assets/icons/variable_icon.svg +4 -0
  81. package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
  82. package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +1 -1
  83. package/src/components/AppHeader/AppHeader.stories.tsx +24 -3
  84. package/src/components/AppHeader/AppHeader.tsx +29 -11
  85. package/src/components/AppHeader/types.ts +11 -3
  86. package/src/components/Avatar/Avatar.scss +24 -0
  87. package/src/components/Avatar/Avatar.stories.tsx +56 -0
  88. package/src/components/Avatar/Avatar.tsx +25 -0
  89. package/src/components/Avatar/index.ts +1 -0
  90. package/src/components/Avatar/types.ts +27 -0
  91. package/src/components/Button/types.ts +1 -1
  92. package/src/components/ExcelFile/ColorBarselector/ColorBarSelector.scss +0 -2
  93. package/src/components/ExcelFile/ContextMenu/ContextMenu.scss +1 -4
  94. package/src/components/ExcelFile/ContextMenu/ContextMenu.tsx +0 -1
  95. package/src/components/ExcelFile/ExcelFile/Excel/ActiveCell.tsx +13 -13
  96. package/src/components/ExcelFile/ExcelFile/Excel/Cell.tsx +13 -12
  97. package/src/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.tsx +40 -32
  98. package/src/components/ExcelFile/ExcelFile/Excel/Copied.tsx +4 -4
  99. package/src/components/ExcelFile/ExcelFile/Excel/CornerIndicator.tsx +10 -10
  100. package/src/components/ExcelFile/ExcelFile/Excel/DataEditor.tsx +5 -5
  101. package/src/components/ExcelFile/ExcelFile/Excel/DataViewer.tsx +10 -10
  102. package/src/components/ExcelFile/ExcelFile/Excel/FloatingRect.tsx +6 -6
  103. package/src/components/ExcelFile/ExcelFile/Excel/HeaderRow.tsx +1 -1
  104. package/src/components/ExcelFile/ExcelFile/Excel/Row.tsx +1 -1
  105. package/src/components/ExcelFile/ExcelFile/Excel/RowIndicator.tsx +34 -27
  106. package/src/components/ExcelFile/ExcelFile/Excel/Selected.tsx +5 -5
  107. package/src/components/ExcelFile/ExcelFile/Excel/{Spreadsheet.css → Spreadsheet.scss} +21 -37
  108. package/src/components/ExcelFile/ExcelFile/Excel/Spreadsheet.tsx +87 -78
  109. package/src/components/ExcelFile/ExcelFile/Excel/Table.tsx +2 -2
  110. package/src/components/ExcelFile/ExcelFile/Excel/actions.ts +121 -31
  111. package/src/components/ExcelFile/ExcelFile/Excel/areModelsEqual.ts +1 -1
  112. package/src/components/ExcelFile/ExcelFile/Excel/context.ts +4 -4
  113. package/src/components/ExcelFile/ExcelFile/Excel/engine/engine.ts +7 -7
  114. package/src/components/ExcelFile/ExcelFile/Excel/engine/formula.ts +11 -11
  115. package/src/components/ExcelFile/ExcelFile/Excel/engine/index.ts +2 -2
  116. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-graph.ts +3 -3
  117. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-hash.ts +2 -2
  118. package/src/components/ExcelFile/ExcelFile/Excel/engine/point-set.ts +2 -2
  119. package/src/components/ExcelFile/ExcelFile/Excel/index.ts +12 -11
  120. package/src/components/ExcelFile/ExcelFile/Excel/matrix.ts +18 -24
  121. package/src/components/ExcelFile/ExcelFile/Excel/point-range.ts +1 -1
  122. package/src/components/ExcelFile/ExcelFile/Excel/reducer.ts +311 -41
  123. package/src/components/ExcelFile/ExcelFile/Excel/selection.ts +5 -5
  124. package/src/components/ExcelFile/ExcelFile/Excel/types.ts +14 -66
  125. package/src/components/ExcelFile/ExcelFile/Excel/typings/fast-formula-parser.d.ts +8 -8
  126. package/src/components/ExcelFile/ExcelFile/Excel/use-dispatch.ts +2 -2
  127. package/src/components/ExcelFile/ExcelFile/Excel/use-selector.ts +3 -3
  128. package/src/components/ExcelFile/ExcelFile/Excel/util.ts +21 -22
  129. package/src/components/ExcelFile/ExcelFile/ExcelFile.scss +0 -3
  130. package/src/components/ExcelFile/ExcelFile/ExcelFile.tsx +45 -403
  131. package/src/components/ExcelFile/ExcelFile.stories.tsx +10 -29
  132. package/src/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.tsx +1 -12
  133. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.scss +0 -3
  134. package/src/components/ExcelFile/ExcelToolBar/ExcelToolBar.tsx +147 -127
  135. package/src/components/ExcelFile/Types.ts +3 -70
  136. package/src/components/ExcelFile/index.ts +1 -1
  137. package/src/components/Form/Form.d.ts +3 -0
  138. package/src/components/Form/Form.scss +48 -4
  139. package/src/components/Form/Form.stories.tsx +244 -137
  140. package/src/components/Form/Form.ts +2 -0
  141. package/src/components/Form/Forms.tsx +25 -0
  142. package/src/components/Form/index.ts +1 -1
  143. package/src/components/Icon/iconList.ts +23 -0
  144. package/src/components/Icon/types.ts +1 -1
  145. package/src/components/IconButton/IconButton.scss +1 -1
  146. package/src/components/MenuOption/types.ts +7 -6
  147. package/src/components/MiniModal/MiniModal.scss +5 -0
  148. package/src/components/MiniModal/MiniModal.stories.tsx +95 -0
  149. package/src/components/MiniModal/MiniModal.tsx +11 -6
  150. package/src/components/MiniModal/types.ts +6 -6
  151. package/src/components/ModulesChip/ModuleChip.scss +20 -0
  152. package/src/components/ModulesChip/ModuleChip.stories.tsx +41 -0
  153. package/src/components/ModulesChip/ModuleChip.tsx +31 -0
  154. package/src/components/ModulesChip/index.ts +1 -0
  155. package/src/components/ModulesChip/types.ts +14 -0
  156. package/src/components/MultiSelect/Dropdown.tsx +6 -1
  157. package/src/components/MultiSelect/MultiSelect.scss +17 -10
  158. package/src/components/MultiSelect/MultiSelect.stories.tsx +16 -4
  159. package/src/components/MultiSelect/MultiSelect.tsx +11 -4
  160. package/src/components/MultiSelect/MultiSelectTypes.ts +4 -3
  161. package/src/components/Select/Select.scss +4 -0
  162. package/src/components/Select/Select.tsx +2 -2
  163. package/src/components/Toastify/Toastify.stories.tsx +52 -0
  164. package/src/components/Toastify/Toastify.tsx +66 -0
  165. package/src/components/Toastify/index.ts +1 -0
  166. package/src/components/Toastify/types.ts +8 -0
  167. package/src/components/Tooltip/Tooltip.tsx +2 -1
  168. package/src/components/Tooltip/types.ts +6 -0
  169. package/src/components/Typography/Typography.scss +12 -4
  170. package/src/components/Typography/Typography.stories.tsx +2 -0
  171. package/src/components/Typography/Typography.tsx +2 -0
  172. package/src/components/Typography/types.ts +1 -0
  173. package/src/index.ts +9 -1
  174. package/src/components/ExcelFile/ChangeExcelStyles.tsx +0 -78
  175. package/src/components/ExcelFile/ImportExcelStyles.tsx +0 -86
  176. package/src/components/Form/Form.tsx +0 -57
@@ -14,8 +14,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
14
14
  anchorRef,
15
15
  headerProps,
16
16
  childContent,
17
- cancelButtonProps,
18
- proceedButtonProps,
17
+ cancelButtonProps = () => {},
18
+ proceedButtonProps = () => {},
19
19
  footerContent,
20
20
  isWrapped = false,
21
21
  isAnimated = false,
@@ -29,6 +29,7 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
29
29
  extraTopSpace,
30
30
  extraRightSpace,
31
31
  extraLeftSpace,
32
+ isIconModel,
32
33
  },
33
34
  ref
34
35
  ) => {
@@ -144,8 +145,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
144
145
  //specifying the modal's escape and enter functionality
145
146
  const handleEsc = useEscapeKey('Escape');
146
147
  const handleEnter = useEscapeKey('Enter');
147
- handleEsc(cancelButtonProps.onClick);
148
- handleEnter(proceedButtonProps.onClick);
148
+ handleEsc(cancelButtonProps?.onClick);
149
+ handleEnter(proceedButtonProps?.onClick);
149
150
  useClickOutside(modalRef, cancelButtonProps.onClick);
150
151
 
151
152
  //calculate the modal position
@@ -227,6 +228,8 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
227
228
  >
228
229
  {headerProps ? (
229
230
  <Typography as="div">{headerProps}</Typography>
231
+ ) : isIconModel ? (
232
+ <></>
230
233
  ) : (
231
234
  <Typography as="header">
232
235
  <Typography as="h2">Header text</Typography>
@@ -236,13 +239,15 @@ const MiniModal = forwardRef<HTMLDivElement, MiniEditModalProps>(
236
239
  <div className="modal-content">{childContent}</div>
237
240
  {footerContent ? (
238
241
  <Typography as="footer">{footerContent}</Typography>
242
+ ) : isIconModel ? (
243
+ <></>
239
244
  ) : (
240
245
  <footer className="modal-footer">
241
246
  <Button
242
247
  variant="primary"
243
248
  className="btn-cancel"
244
- onClick={cancelButtonProps.onClick}
245
- label={cancelButtonProps.text}
249
+ onClick={cancelButtonProps?.onClick}
250
+ label={cancelButtonProps?.text}
246
251
  />
247
252
  <Button
248
253
  variant="secondary"
@@ -1,8 +1,4 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
- interface ButtonProps {
3
- text: string;
4
- onClick: () => void;
5
- }
6
2
  interface ModalDimensions {
7
3
  width?: number;
8
4
  height?: number;
@@ -23,11 +19,11 @@ export interface MiniEditModalProps {
23
19
  /**
24
20
  * Props for the cancel button inside the modal
25
21
  */
26
- cancelButtonProps: ButtonProps;
22
+ cancelButtonProps?: any;
27
23
  /**
28
24
  * Props for the proceed button inside the modal.
29
25
  */
30
- proceedButtonProps: ButtonProps;
26
+ proceedButtonProps?: any;
31
27
  /**
32
28
  * Optional content for the footer of the modal.
33
29
  */
@@ -44,6 +40,10 @@ export interface MiniEditModalProps {
44
40
  * Specifies if the modal should behave as a popover with an arrow.
45
41
  */
46
42
  isPopOver?: boolean;
43
+ /**
44
+ * Specifies if the modal should behave as a popover with an arrow.
45
+ */
46
+ isIconModel?: boolean;
47
47
  /**
48
48
  * Sets the position of the modal relative to its anchor.
49
49
  * bottom: The modal appears below the anchor.
@@ -0,0 +1,20 @@
1
+ @use '../../assets/styles/fonts';
2
+ @use '../../assets/styles/mixins';
3
+
4
+ .ff-expandable-chip-menu {
5
+ width: 75px;
6
+ height: 32px;
7
+ border: 0.5px solid;
8
+ border-radius: 16px;
9
+ color: var(--brand-color);
10
+ cursor: pointer;
11
+ @include mixins.center-content();
12
+ .ff-label-chip {
13
+ &--active {
14
+ color: var(--ff-header-text-color);
15
+ }
16
+ }
17
+ &--active {
18
+ background: var(--brand-color);
19
+ }
20
+ }
@@ -0,0 +1,41 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import ModuleChip from './ModuleChip';
3
+ import { useState } from 'react';
4
+
5
+ const meta: Meta<typeof ModuleChip> = {
6
+ title: 'Components/ModuleChip',
7
+ component: ModuleChip,
8
+ parameters: {
9
+ layout: 'center',
10
+ },
11
+ argTypes: {
12
+ isActive: Boolean,
13
+ },
14
+ tags: ['autodocs'],
15
+ };
16
+
17
+ type Story = StoryObj<typeof ModuleChip>;
18
+
19
+ const defaultArgs = {
20
+ label: 'Modules',
21
+ isActive: false,
22
+ };
23
+
24
+ export const Controlled: Story = {
25
+ render: () => {
26
+ const [selectedMenu, setSelectedMenu] = useState<boolean>(true);
27
+ const handleChipClick = () => {
28
+ setSelectedMenu(!selectedMenu);
29
+ };
30
+
31
+ return (
32
+ <ModuleChip
33
+ {...defaultArgs}
34
+ isActive={selectedMenu}
35
+ onClick={handleChipClick}
36
+ />
37
+ );
38
+ },
39
+ };
40
+
41
+ export default meta;
@@ -0,0 +1,31 @@
1
+ import './ModuleChip.scss';
2
+ import classNames from 'classnames';
3
+ import { ModuleChipProps } from './types';
4
+ import Typography from '../Typography';
5
+
6
+ const ModuleChip: React.FC<ModuleChipProps> = ({
7
+ label = '',
8
+ isActive = true,
9
+ onClick = () => {},
10
+ }) => {
11
+ return (
12
+ <div
13
+ className={classNames('ff-expandable-chip-menu', {
14
+ 'ff-expandable-chip-menu--active': isActive,
15
+ })}
16
+ onClick={onClick}
17
+ >
18
+ <div
19
+ className={classNames(`ff-label-chip `, {
20
+ 'ff-label-chip--active': isActive,
21
+ })}
22
+ >
23
+ <Typography fontSize={'14px'} fontWeight="regular" lineHeight="21px">
24
+ {label}
25
+ </Typography>
26
+ </div>
27
+ </div>
28
+ );
29
+ };
30
+
31
+ export default ModuleChip;
@@ -0,0 +1 @@
1
+ export { default } from './ModuleChip';
@@ -0,0 +1,14 @@
1
+ export interface ModuleChipProps {
2
+ /**
3
+ * mandatory | label for the ModuleChip component
4
+ */
5
+ label: string;
6
+ /**
7
+ * mandatory | isActive for the ModuleChip component
8
+ */
9
+ isActive: boolean;
10
+ /**
11
+ * mandatory | onClick for the ModuleChip component
12
+ */
13
+ onClick: () => void;
14
+ }
@@ -5,6 +5,7 @@ import './Dropdown.scss';
5
5
  import { ThemeContext } from '../ThemeProvider/ThemeProvider';
6
6
  import classNames from 'classnames';
7
7
  import Button from '../Button';
8
+ import Typography from '../Typography';
8
9
 
9
10
  const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
10
11
  (
@@ -82,7 +83,11 @@ const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(
82
83
  onClick={() => handleOptionChange(info, !info.isChecked)}
83
84
  >
84
85
  <input type="checkbox" checked={info.isChecked} readOnly />
85
- <span className="dropdown-option-label">{info.label}</span>
86
+ <Typography
87
+ as="span"
88
+ className="dropdown-option-label"
89
+ children={info.label}
90
+ />
86
91
  </div>
87
92
  ))
88
93
  )}
@@ -38,16 +38,16 @@
38
38
  cursor: pointer;
39
39
  position: relative;
40
40
  border: 1px solid var(--default-icon-color);
41
- border-radius: 8px;
41
+ border-radius: 4px;
42
42
  background: var(--drawer-footer-bg);
43
43
  min-width: 150px;
44
44
  width: 100%;
45
45
  height: 32px;
46
46
  .ff-multiselect {
47
47
  position: relative;
48
- padding: 6px;
48
+ padding: 3px;
49
49
  border: none;
50
- border-radius: 8px;
50
+ border-radius: 4px;
51
51
  @include flex-center;
52
52
  &__main {
53
53
  display: flex;
@@ -61,6 +61,8 @@
61
61
 
62
62
  .active-default-label {
63
63
  @extend .font-size-8;
64
+ font-size: 8px !important;
65
+ height: 8px;
64
66
  @include label-styles;
65
67
  background-color: var(--multi-select-label-bg);
66
68
  line-height: 12px;
@@ -87,6 +89,9 @@
87
89
  @extend .fontXs;
88
90
  line-height: 14px;
89
91
  color: var(--tooltip-bg-color);
92
+ &.pr-2 {
93
+ padding: 5px 2px;
94
+ }
90
95
  }
91
96
  .ff-multiselect-chip-close-icon {
92
97
  cursor: pointer;
@@ -108,13 +113,15 @@
108
113
  }
109
114
  }
110
115
  }
111
- .ff-multiselect-more-chip{
112
- width: 1.2rem;
113
- @extend .fontSm;
114
- font-weight: 600;
115
- line-height: 16px;
116
- color: var(--brand-color);
117
- }
116
+ }
117
+ .ff-multiselect-more-chip {
118
+ display: flex;
119
+ align-items: center;
120
+ width: 1.2rem;
121
+ @extend .fontSm;
122
+ font-weight: 600;
123
+ line-height: 16px;
124
+ color: var(--brand-color);
118
125
  }
119
126
  }
120
127
  &__toggle {
@@ -55,13 +55,25 @@ export const Default3: Story = {
55
55
  export const EmailGroup: Story = {
56
56
  render: () => {
57
57
  const [options] = useState([
58
- { label: 'Sample1@gmail.com', value: 'sample1@gmail.com' },
58
+ {
59
+ label: 'Sample1@gmail.com',
60
+ value: 'sample1@gmail.com',
61
+ isDisabled: true,
62
+ },
59
63
  { label: 'Sample2@gmail.com', value: 'sample2@gmail.com' },
60
64
  ]);
61
65
  const [selectedOptions, setSelectedOptions] = useState<
62
- { label?: string; value?: string }[]
63
- >([{ label: 'Sample1@gmail.com', value: 'sample1@gmail.com' }]);
64
- const onChange = (options: { label?: string; value?: string }[]) => {
66
+ { label?: string; value?: string; isDisabled?: boolean }[]
67
+ >([
68
+ {
69
+ label: 'Sample1@gmail.com',
70
+ value: 'sample1@gmail.com',
71
+ isDisabled: true,
72
+ },
73
+ ]);
74
+ const onChange = (
75
+ options: { label?: string; value?: string; isDisabled?: boolean }[]
76
+ ) => {
65
77
  setSelectedOptions(options);
66
78
  };
67
79
  return (
@@ -5,6 +5,7 @@ import './MultiSelect.scss';
5
5
  import Dropdown from './Dropdown';
6
6
  import Icon from '../Icon';
7
7
  import { MultiSelectProps, Option } from './MultiSelectTypes';
8
+ import Typography from '../Typography';
8
9
 
9
10
  const ChipElement = ({
10
11
  label,
@@ -22,6 +23,8 @@ const ChipElement = ({
22
23
  className="ff-multiselect-chip-close-icon"
23
24
  onClick={onChipCloseClick}
24
25
  name="close_pill"
26
+ height={13} //as per the latest chnages in icon container we have to give this
27
+ width={13}
25
28
  />
26
29
  </div>
27
30
  );
@@ -46,6 +49,9 @@ const MultiSelect = ({
46
49
  }: MultiSelectProps) => {
47
50
  const [isOpen, setIsOpen] = useState<boolean>(false);
48
51
  const [allOptions, setAllOptions] = useState(options);
52
+ useEffect(() => {
53
+ setAllOptions(options);
54
+ }, [options]);
49
55
 
50
56
  const [searchedKeyword, setSearchedKeyword] = useState('');
51
57
  const [isSelectFocusedOnce, setIsSelectFocusedOnce] =
@@ -236,7 +242,8 @@ const MultiSelect = ({
236
242
  >
237
243
  <div className="ff-multiselect" onClick={handleClick}>
238
244
  <div className="ff-multiselect__main">
239
- <span
245
+ <Typography
246
+ as="span"
240
247
  className={classNames({
241
248
  'active-default-label':
242
249
  isOpen ||
@@ -244,9 +251,9 @@ const MultiSelect = ({
244
251
  (isFieldSkipped && required),
245
252
  'default-label': !isOpen && !selectedOptions?.length,
246
253
  })}
247
- >
248
- {label}
249
- </span>
254
+ children={label}
255
+ />
256
+
250
257
  <div className="ff-multiselect-chip-container">
251
258
  {displayCount ? (
252
259
  <>
@@ -3,10 +3,11 @@ interface Option {
3
3
  value?: string;
4
4
  accessor?: string;
5
5
  isChecked?: boolean;
6
+ isDisabled?: boolean;
6
7
  }
7
8
  interface MultiSelectProps {
8
9
  options: Option[];
9
- type? : 'email' | 'text';
10
+ type?: 'email' | 'text';
10
11
  label: string;
11
12
  selectedOptions?: Option[];
12
13
  disabled?: boolean;
@@ -18,7 +19,7 @@ interface MultiSelectProps {
18
19
  errorMessage?: string;
19
20
  withSelectButton?: boolean;
20
21
  onSelect?: () => void;
21
- displayCount?:boolean;
22
+ displayCount?: boolean;
22
23
  }
23
24
 
24
- export { Option, MultiSelectProps };
25
+ export { Option, MultiSelectProps };
@@ -28,6 +28,10 @@
28
28
 
29
29
  .ff-select-wrapper {
30
30
  position: relative;
31
+
32
+ .ff-select-input {
33
+ cursor: pointer;
34
+ }
31
35
 
32
36
  .ff-select {
33
37
  @extend .fontSm;
@@ -254,8 +254,8 @@ const Select = ({
254
254
  const applyActiveOptionClasses = !isInputFocused && Boolean(option);
255
255
 
256
256
  return (
257
- <div className={classNames(`ff-select-wrapper ${className}`)}>
258
- <div className="ff-select">
257
+ <div className={classNames(`ff-select-wrapper`)}>
258
+ <div className={`ff-select ${className}`}>
259
259
  <input
260
260
  type="text"
261
261
  className={classNames('ff-select-input', {
@@ -0,0 +1,52 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Toastify, toast } from './Toastify';
3
+ import Button from '../Button';
4
+
5
+ const meta: Meta<typeof Toastify> = {
6
+ title: 'Components/Toastify',
7
+ component: Toastify,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ tags: ['autodocs'],
12
+ };
13
+
14
+ type Story = StoryObj<typeof Toastify>;
15
+
16
+ const defaultArgs = {
17
+ isOpen: false,
18
+ toastTitle: 'Success',
19
+ toastMessage: 'Variable name Requested for Review successfully',
20
+ closeButtonLabel: 'x',
21
+ displayDuration: 3000,
22
+ };
23
+
24
+ export const Controlled: Story = {
25
+ args: {
26
+ ...defaultArgs,
27
+ },
28
+ // import { Toastify, toast } from 'pixel-react';
29
+ render: () => (
30
+ <>
31
+ {/* Render Toastify to allow toast notifications */}
32
+ <Toastify />
33
+
34
+ {/* Button to trigger a toast notification */}
35
+ <Button
36
+ variant="primary"
37
+ onClick={() => toast.success('Your request was successful!')}
38
+ >
39
+ Show Success Toast
40
+ </Button>
41
+ <br/>
42
+ <Button
43
+ variant="delete"
44
+ onClick={() => toast.error('Something went wrong!')}
45
+ >
46
+ Show Error Toast
47
+ </Button>
48
+ </>
49
+ ),
50
+ };
51
+
52
+ export default meta;
@@ -0,0 +1,66 @@
1
+ import { useState, useRef } from 'react';
2
+ import Toaster from '../Toast/Toast';
3
+ import { Variant, ToastProps } from './types';
4
+
5
+ let openToast: (variant: Variant, message: string) => void;
6
+
7
+ export const Toastify = () => {
8
+ const [toastProps, setToastProps] = useState<ToastProps>({
9
+ isOpen: false,
10
+ variant: 'info',
11
+ toastTitle: '',
12
+ toastMessage: '',
13
+ });
14
+
15
+ const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
16
+
17
+ openToast = (variant: Variant, message: string) => {
18
+ // Clear the previous timeout if it exists
19
+ if (timeoutRef.current) {
20
+ clearTimeout(timeoutRef.current);
21
+ timeoutRef.current = null;
22
+ }
23
+
24
+ const title =
25
+ variant === 'danger'
26
+ ? 'Error!'
27
+ : variant.charAt(0).toUpperCase() + variant.slice(1);
28
+ // Close the existing toast if open, and then immediately show the new one
29
+ setToastProps((prev) => ({
30
+ ...prev,
31
+ isOpen: false,
32
+ }));
33
+
34
+ setTimeout(() => {
35
+ setToastProps({
36
+ isOpen: true,
37
+ variant,
38
+ toastTitle: `${title}!`,
39
+ toastMessage: message,
40
+ });
41
+ }, 10);
42
+
43
+ timeoutRef.current = setTimeout(() => {
44
+ setToastProps((prev) => ({ ...prev, isOpen: false }));
45
+ }, 3000);
46
+ };
47
+
48
+ return (
49
+ <Toaster
50
+ isOpen={toastProps.isOpen}
51
+ variant={toastProps.variant}
52
+ toastTitle={toastProps.toastTitle}
53
+ toastMessage={toastProps.toastMessage}
54
+ />
55
+ );
56
+ };
57
+
58
+ export default Toastify;
59
+
60
+ // Utility to trigger toast messages outside of the Toastify component
61
+ export const toast = {
62
+ success: (message: string) => openToast('success', message),
63
+ error: (message: string) => openToast('danger', message),
64
+ warning: (message: string) => openToast('warning', message),
65
+ info: (message: string) => openToast('info', message),
66
+ };
@@ -0,0 +1 @@
1
+ export { default } from './Toastify';
@@ -0,0 +1,8 @@
1
+ export type Variant = 'success' | 'warning' | 'danger' | 'info' | 'confirm';
2
+
3
+ export interface ToastProps {
4
+ isOpen: boolean;
5
+ variant: Variant;
6
+ toastTitle: string;
7
+ toastMessage: string;
8
+ }
@@ -17,6 +17,7 @@ const Tooltip: React.FC<TooltipProps> = ({
17
17
  children,
18
18
  placement = 'bottom',
19
19
  disabled = false,
20
+ zIndex = 99,
20
21
  }) => {
21
22
  const [isVisible, setIsVisible] = useState(false);
22
23
  const titleRef: TitleRef = useRef(null);
@@ -178,7 +179,7 @@ const Tooltip: React.FC<TooltipProps> = ({
178
179
  createPortal(
179
180
  <div
180
181
  ref={titleRef}
181
- style={styles[placement]}
182
+ style={{ ...styles[placement], zIndex }}
182
183
  className={classNames('ff-tooltip', currentTheme, {
183
184
  'ff-tooltip--visible': isVisible,
184
185
  })}
@@ -46,6 +46,12 @@ interface TooltipProps {
46
46
  * @default false
47
47
  */
48
48
  disabled?: boolean;
49
+ /**.
50
+ * Z-Index is by default 99
51
+ *
52
+ * @default 99
53
+ */
54
+ zIndex?: number | string ;
49
55
  }
50
56
 
51
57
 
@@ -6,28 +6,32 @@
6
6
  @font-face {
7
7
  font-family: 'Poppins';
8
8
  font-weight: 400;
9
- src: local('Poppins-Regular'),
9
+ src:
10
+ local('Poppins-Regular'),
10
11
  url(../../fonts/Poppins/Poppins-Regular.ttf) format('truetype');
11
12
  }
12
13
 
13
14
  @font-face {
14
15
  font-family: 'Poppins';
15
16
  font-weight: 500;
16
- src: local('Poppins-Medium'),
17
+ src:
18
+ local('Poppins-Medium'),
17
19
  url(../../fonts/Poppins/Poppins-Medium.ttf) format('truetype');
18
20
  }
19
21
 
20
22
  @font-face {
21
23
  font-family: 'Poppins';
22
24
  font-weight: 600;
23
- src: local('Poppins-SemiBold'),
25
+ src:
26
+ local('Poppins-SemiBold'),
24
27
  url(../../fonts/Poppins/Poppins-SemiBold.ttf) format('truetype');
25
28
  }
26
29
 
27
30
  @font-face {
28
31
  font-family: 'Poppins';
29
32
  font-weight: 700;
30
- src: local('Poppins-Bold'),
33
+ src:
34
+ local('Poppins-Bold'),
31
35
  url(../../fonts/Poppins/Poppins-Bold.ttf) format('truetype');
32
36
  }
33
37
 
@@ -46,4 +50,8 @@
46
50
  &--bold {
47
51
  font-weight: 700;
48
52
  }
53
+ .required-asterisk {
54
+ color: var(--input-error-text-color);
55
+ padding-right: 4px;
56
+ }
49
57
  }
@@ -14,6 +14,7 @@ type Story = StoryObj<typeof Typography>;
14
14
 
15
15
  export const Docs: Story = {
16
16
  args: {
17
+ required: false,
17
18
  children: 'Typography',
18
19
  },
19
20
  };
@@ -51,6 +52,7 @@ export const Bold14px: Story = {
51
52
  fontSize: '16px',
52
53
  as: 'h2',
53
54
  children: 'This is Bold text with 700 font weight and 16px font size.',
55
+ required: true,
54
56
  },
55
57
  };
56
58
 
@@ -14,6 +14,7 @@ const Typography: React.FC<TypographyProps> = ({
14
14
  children,
15
15
  htmlFor = '',
16
16
  onClick = () => {},
17
+ required = false,
17
18
  }) => {
18
19
  const fontSizeValue =
19
20
  typeof fontSize === 'number' ? `${fontSize}px` : fontSize;
@@ -31,6 +32,7 @@ const Typography: React.FC<TypographyProps> = ({
31
32
  }}
32
33
  onClick={onClick}
33
34
  >
35
+ {required && <span className="required-asterisk">*</span>}
34
36
  {children}
35
37
  </Element>
36
38
  );
@@ -53,4 +53,5 @@ export interface TypographyProps {
53
53
  * To add onClick function
54
54
  */
55
55
  onClick?: () => void;
56
+ required?: boolean; // TO add * in the label
56
57
  }