pixel-react 1.5.3 → 1.5.5

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 (92) hide show
  1. package/lib/assets/fonts/Poppins-Bold.ttf +0 -0
  2. package/lib/assets/fonts/Poppins-Medium.ttf +0 -0
  3. package/lib/assets/fonts/Poppins-Regular.ttf +0 -0
  4. package/lib/assets/fonts/Poppins-SemiBold.ttf +0 -0
  5. package/lib/assets/utils/functionUtils.d.ts +7 -0
  6. package/lib/components/AddButton/AddButton.d.ts +5 -0
  7. package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
  8. package/lib/components/AddButton/index.d.ts +1 -0
  9. package/lib/components/AddButton/types.d.ts +4 -0
  10. package/lib/components/AttachImage/AttachImage.stories.d.ts +7 -0
  11. package/lib/components/Charts/BarChart/BarChart.stories.d.ts +6 -0
  12. package/lib/components/Charts/DashboardDonutChart/types.d.ts +13 -3
  13. package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +8 -0
  14. package/lib/components/Charts/LineChart/LineChart.stories.d.ts +7 -0
  15. package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +8 -0
  16. package/lib/components/Chip/types.d.ts +1 -1
  17. package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +6 -0
  18. package/lib/components/DownloadClient/DownloadClient.d.ts +4 -0
  19. package/lib/components/DownloadClient/index.d.ts +1 -0
  20. package/lib/components/DownloadClient/type.d.ts +35 -0
  21. package/lib/components/EditTextField/EditTextField.stories.d.ts +10 -0
  22. package/lib/components/Editor/Editor.stories.d.ts +6 -0
  23. package/lib/components/Editor/types.d.ts +1 -1
  24. package/lib/components/Excel/ContextMenu/ContextMenu.d.ts +4 -0
  25. package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
  26. package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
  27. package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
  28. package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +2 -0
  29. package/lib/components/MultiSelect/MultiSelect.stories.d.ts +1 -0
  30. package/lib/components/Select/Select.stories.d.ts +1 -0
  31. package/lib/components/StatusCard/StatusCard.stories.d.ts +11 -0
  32. package/lib/components/Toast/types.d.ts +1 -1
  33. package/lib/components/Toastify/Toastify.d.ts +1 -0
  34. package/lib/components/Toastify/types.d.ts +1 -1
  35. package/lib/index.d.ts +73 -50
  36. package/lib/index.esm.js +255 -102
  37. package/lib/index.esm.js.map +1 -1
  38. package/lib/index.js +255 -101
  39. package/lib/index.js.map +1 -1
  40. package/lib/tsconfig.tsbuildinfo +1 -1
  41. package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
  42. package/package.json +1 -1
  43. package/src/assets/Themes/BaseTheme.scss +21 -4
  44. package/src/assets/Themes/DarkTheme.scss +18 -0
  45. package/src/assets/icons/Header_preset.svg +17 -12
  46. package/src/assets/icons/add_archive.svg +9 -0
  47. package/src/assets/icons/add_user.svg +9 -0
  48. package/src/assets/icons/alert.svg +17 -0
  49. package/src/assets/icons/approval_pending.svg +8 -8
  50. package/src/assets/icons/configuration.svg +3 -3
  51. package/src/assets/icons/defects.svg +8 -8
  52. package/src/assets/icons/element.svg +4 -4
  53. package/src/assets/icons/info_icon.svg +16 -3
  54. package/src/assets/icons/no_data.svg +13 -0
  55. package/src/assets/icons/project_element.svg +4 -4
  56. package/src/assets/icons/remove_user.svg +3 -0
  57. package/src/assets/icons/step_group.svg +10 -10
  58. package/src/assets/icons/variable.svg +3 -3
  59. package/src/assets/utils/functionUtils.ts +55 -1
  60. package/src/components/Accordion/Accordion.scss +3 -1
  61. package/src/components/Accordion/Accordion.tsx +17 -17
  62. package/src/components/AttachImage/AttachImage.scss +20 -17
  63. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.tsx +6 -7
  64. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +172 -29
  65. package/src/components/Charts/DashboardDonutChart/types.ts +14 -3
  66. package/src/components/Chip/Chip.scss +15 -1
  67. package/src/components/Chip/Chip.stories.tsx +30 -1
  68. package/src/components/Chip/types.ts +1 -1
  69. package/src/components/DownloadClient/DownloadClient.scss +80 -0
  70. package/src/components/DownloadClient/DownloadClient.stories.tsx +26 -0
  71. package/src/components/DownloadClient/DownloadClient.tsx +81 -0
  72. package/src/components/DownloadClient/index.ts +1 -0
  73. package/src/components/DownloadClient/type.ts +41 -0
  74. package/src/components/Editor/Editor.stories.tsx +17 -2
  75. package/src/components/Editor/VariableDropdown.scss +1 -0
  76. package/src/components/Editor/types.ts +1 -2
  77. package/src/components/FileDropzone/FileDropzone.scss +4 -3
  78. package/src/components/Form/Forms.tsx +1 -1
  79. package/src/components/Icon/iconList.ts +12 -2
  80. package/src/components/IconRadioGroup/IconRadioGroup.stories.tsx +2 -2
  81. package/src/components/IconRadioGroup/IconRadioGroup.tsx +0 -2
  82. package/src/components/StatusButton/StatusButton.scss +1 -1
  83. package/src/components/TableTree/TableTree.scss +44 -48
  84. package/src/components/TableTree/TableTree.tsx +17 -6
  85. package/src/components/Toast/Toast.stories.tsx +47 -83
  86. package/src/components/Toast/Toast.tsx +2 -1
  87. package/src/components/Toast/types.ts +1 -1
  88. package/src/components/Toastify/Toastify.stories.tsx +9 -9
  89. package/src/components/Toastify/Toastify.tsx +2 -0
  90. package/src/components/Toastify/types.ts +1 -1
  91. package/src/index.ts +2 -0
  92. /package/lib/components/ExcelFile/{ColorBarselector → ColorBarSelector}/ColorBarSelector.d.ts +0 -0
@@ -18,7 +18,6 @@ export interface EditorProps {
18
18
  */
19
19
  height: string;
20
20
 
21
-
22
21
  /**
23
22
  * read only
24
23
  */
@@ -45,7 +44,7 @@ export interface EditorProps {
45
44
  /**
46
45
  * onChange function to handle the input changes
47
46
  */
48
- handleChange: (value: string | undefined, _event: any) => {};
47
+ handleChange: (value: string | undefined, _event: any) => void;
49
48
 
50
49
  /**
51
50
  * Theme
@@ -30,8 +30,9 @@
30
30
  text-align: center;
31
31
  gap: 8px;
32
32
  transition: background-color 0.2s ease;
33
-
34
- &:hover, &--active {
33
+
34
+ &:hover,
35
+ &--active {
35
36
  background-color: var(--file-dropzone-selected-color);
36
37
  }
37
38
 
@@ -94,7 +95,7 @@
94
95
  display: flex;
95
96
  align-items: center;
96
97
  gap: 4px;
97
- width: 60%;
98
+ width: 90%;
98
99
 
99
100
  .ff-file-info__icon {
100
101
  @include center;
@@ -20,7 +20,7 @@ const Forms = <T extends Form.FieldValues>(
20
20
  const { handleSubmit } = methods;
21
21
  const extendedMethods = {
22
22
  ...methods,
23
- Form,
23
+ Form: Form,
24
24
  };
25
25
  useImperativeHandle(ref, () => ({
26
26
  submit: handleSubmit(onSubmit),
@@ -30,6 +30,7 @@ import FireflinkIcon from '../../assets/Icons/fireflink_icon.svg?react';
30
30
  import Tick from '../../assets/Icons/tick_icon.svg?react';
31
31
  import Search from '../../assets/icons/search.svg?react';
32
32
  import Filter from '../../assets/icons/filter.svg?react';
33
+ import Alert from '../../assets/icons/alert.svg?react';
33
34
 
34
35
  import RightArrow from '../../assets/icons/right_arrow_icon.svg?react';
35
36
  import LeftArrow from '../../assets/icons/left_arrow_icon.svg?react';
@@ -206,7 +207,7 @@ import RunManualTestcaseIcon from '../../assets/icons/run_manual_testcase_icon.s
206
207
  import RunAutomationScriptsIcon from '../../assets/icons/run_automation_scripts_icon.svg?react';
207
208
  import EyeOpenIcon from '../../assets/icons/eye_open_icon.svg?react';
208
209
  import ReplaceIcon from '../../assets/icons/replace_icon.svg?react';
209
- import HeaderPreset from '../../assets/icons/Header_preset.svg?react';
210
+ import HeaderPreset from '../../assets/icons/header_preset.svg?react';
210
211
  import ProjectElement from '../../assets/icons/project_element.svg?react';
211
212
  import Element from '../../assets/icons/element.svg?react';
212
213
  import StepGroup from '../../assets/icons/step_group.svg?react';
@@ -214,8 +215,13 @@ import Variable from '../../assets/icons/variable.svg?react';
214
215
  import Defects from '../../assets/icons/defects.svg?react';
215
216
  import ApprovalPending from '../../assets/icons/approval_pending.svg?react';
216
217
  import Configuration from '../../assets/icons/configuration.svg?react';
218
+ import NoData from '../../assets/icons/no_data.svg?react';
219
+ import AddUser from '../../assets/icons/add_user.svg?react';
220
+ import RemoveUser from '../../assets/icons/remove_user.svg?react';
221
+ import AddToArchive from '../../assets/icons/add_archive.svg?react';
217
222
 
218
223
  Components['success'] = ToastSuccessIcon;
224
+ Components['alert'] = Alert;
219
225
  Components['delete_info'] = DeleteInfoIcon;
220
226
  Components['warning'] = WarningIcon;
221
227
  Components['toast_info'] = ToastInfoIcon;
@@ -415,7 +421,7 @@ Components['quick_run_setting'] = QuickRunSettingIcon;
415
421
  Components['run_manual_testcase'] = RunManualTestcaseIcon;
416
422
  Components['run_automation_scripts'] = RunAutomationScriptsIcon;
417
423
  Components['eye_open_icon'] = EyeOpenIcon;
418
- Components['replace_icon']=ReplaceIcon;
424
+ Components['replace_icon'] = ReplaceIcon;
419
425
  Components['header_preset'] = HeaderPreset;
420
426
  Components['project_element'] = ProjectElement;
421
427
  Components['element'] = Element;
@@ -424,5 +430,9 @@ Components['variable'] = Variable;
424
430
  Components['defects'] = Defects;
425
431
  Components['approval_pending'] = ApprovalPending;
426
432
  Components['configuration'] = Configuration;
433
+ Components['no_data'] = NoData;
434
+ Components['add_user'] = AddUser;
435
+ Components['add_to_archive'] = AddToArchive;
436
+ Components['remove_user'] = RemoveUser;
427
437
 
428
438
  export default Components;
@@ -24,13 +24,13 @@ export const Default: Story = {
24
24
  },
25
25
  {
26
26
  iconName: 'view_access_icon',
27
- iconLabel: 'View',
27
+ iconLabel: 'View Access',
28
28
  disabled: false,
29
29
  disableMessage: '',
30
30
  },
31
31
  {
32
32
  iconName: 'edit',
33
- iconLabel: 'Edit',
33
+ iconLabel: 'Edit Access',
34
34
  disabled: false,
35
35
  disableMessage: '',
36
36
  },
@@ -54,8 +54,6 @@ const IconRadioGroup: React.FC<IconRadioGroupProps> = ({
54
54
  >
55
55
  <Icon
56
56
  name={item.iconName}
57
- height={14}
58
- width={14}
59
57
  hoverEffect={false}
60
58
  color={
61
59
  selectedValue === item.iconName
@@ -8,7 +8,7 @@
8
8
  border-radius: 4px;
9
9
  padding: 0 4px;
10
10
  cursor: pointer;
11
- width: 76px;
11
+ width: 80px;
12
12
  height: 16px;
13
13
 
14
14
  &__text {
@@ -11,6 +11,7 @@
11
11
  border-collapse: collapse;
12
12
  width: 100%;
13
13
  text-align: left;
14
+ position: relative; /* Ensure the table has a relative position for z-index to work */
14
15
  }
15
16
 
16
17
  .ff-toggle-arrow-icon {
@@ -36,14 +37,6 @@
36
37
  }
37
38
  }
38
39
 
39
- th,
40
- td {
41
- padding: 0 8px;
42
- white-space: nowrap;
43
- overflow: hidden;
44
- text-overflow: ellipsis;
45
- }
46
-
47
40
  th {
48
41
  vertical-align: middle;
49
42
  height: 32px;
@@ -108,42 +101,52 @@
108
101
  }
109
102
 
110
103
  .ff-node-li {
111
- position: relative;
112
104
  --indent-size: 18px;
113
105
  --total-children-height: var(--node-height);
114
106
 
115
- td:first-child {
116
- padding-left: calc(var(--level) * var(--indent-size));
117
- height: 32px;
118
- }
119
-
120
- // Vertical line connecting the node to the parent
121
- &::before {
122
- content: '';
123
- position: absolute;
124
- top: 0;
125
- left: calc(var(--level) * var(--indent-size) - 4px);
126
- width: 1px;
127
- height: calc(var(--total-children-height));
128
- background-color: var(--tree-connecting-lines-color);
129
- z-index: 1;
130
- }
131
-
132
- // Horizontal line connecting child node to parent
133
- &::after {
134
- content: '';
135
- position: absolute;
136
- top: 50%;
137
- left: calc(var(--level) * var(--indent-size) - 4px);
138
- width: 12px;
139
- height: 1px;
140
- background-color: var(--tree-connecting-lines-color);
141
- z-index: 1;
142
- }
107
+ td {
108
+ padding: 0 8px;
109
+ white-space: nowrap;
110
+ text-overflow: ellipsis;
143
111
 
144
- // For the last child node, limit the vertical line
145
- &.ff-is-last::before {
146
- height: calc(var(--node-height) / 2);
112
+ &:first-child {
113
+ position: sticky;
114
+
115
+ padding-left: calc(var(--level) * var(--indent-size));
116
+ height: 32px;
117
+ position: sticky; /* Make first td sticky */
118
+ left: 0;
119
+ z-index: 10; /* Ensure it stays on top of the other cells */
120
+ background-color: var(--slider-table-color);
121
+ // Vertical line connecting the node to the parent
122
+ &::before {
123
+ content: '';
124
+ position: absolute;
125
+ top: 0;
126
+ left: calc(var(--level) * var(--indent-size) - 4px);
127
+ width: 1px;
128
+ height: calc(var(--total-children-height));
129
+ // background-color: var(--tree-connecting-lines-color);
130
+ background-color: var(--tree-connecting-lines-color);
131
+ z-index: 9999;
132
+ }
133
+
134
+ // Horizontal line connecting child node to parent
135
+ &::after {
136
+ content: '';
137
+ position: absolute;
138
+ top: 50%;
139
+ left: calc(var(--level) * var(--indent-size) - 4px);
140
+ width: 12px;
141
+ height: 1px;
142
+ background-color: var(--tree-connecting-lines-color);
143
+ z-index: 10; /* Ensure it stays above the content */
144
+ }
145
+
146
+ &.ff-is-last::before {
147
+ height: calc(var(--node-height) / 2);
148
+ }
149
+ }
147
150
  }
148
151
 
149
152
  // Remove the lines for root level
@@ -153,17 +156,10 @@
153
156
  }
154
157
  }
155
158
 
156
- th:first-child {
157
- position: sticky;
158
- left: 0;
159
- z-index: 999;
160
- background-color: var(--slider-table-color);
161
- }
159
+ th:first-child,
162
160
  td:first-child {
163
161
  position: sticky;
164
162
  left: 0;
165
- z-index: 99;
166
- background-color: var(--ff-status-card-text-color);
167
163
  }
168
164
  }
169
165
 
@@ -1,6 +1,12 @@
1
1
  /* eslint-disable */
2
2
  // @ts-nocheck
3
- import React, { ReactNode, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
+ import React, {
4
+ ReactNode,
5
+ useEffect,
6
+ useLayoutEffect,
7
+ useRef,
8
+ useState,
9
+ } from 'react';
4
10
  import { prepareData } from '../../utils/TableCell/TableCell';
5
11
  import Icon from '../Icon';
6
12
  import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
@@ -162,7 +168,7 @@ const TableTree = ({
162
168
  return columnsData.map((column: any) => {
163
169
  if (column.accessor === 'title') {
164
170
  return (
165
- <td className="ff-title-container">
171
+ <td className={`ff-title-container ${isLast ? 'ff-is-last' : ''}`}>
166
172
  <span className="ff-toggle-folder" onClick={handleToggleExpand}>
167
173
  {node.folder && (
168
174
  <span
@@ -236,9 +242,7 @@ const TableTree = ({
236
242
  <>
237
243
  <tr
238
244
  ref={nodeRef}
239
- className={`ff-node-li ${node.children ? 'ff-has-children' : ''} ${
240
- isLast ? 'ff-is-last' : ''
241
- }`}
245
+ className={`ff-node-li ${node.children ? 'ff-has-children' : ''} `}
242
246
  style={
243
247
  {
244
248
  '--level': level,
@@ -262,7 +266,14 @@ const TableTree = ({
262
266
  const renderTree = (nodes: any, level = 0) => {
263
267
  return nodes.map((node: any, index: number) => {
264
268
  const isLast = index === nodes.length - 1;
265
- return <TreeNode key={node.key || index} node={node} level={level} isLast={isLast} />;
269
+ return (
270
+ <TreeNode
271
+ key={node.key || index}
272
+ node={node}
273
+ level={level}
274
+ isLast={isLast}
275
+ />
276
+ );
266
277
  });
267
278
  };
268
279
 
@@ -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 Toaster from './Toast';
4
4
  import Button from '../Button';
@@ -9,17 +9,17 @@ const meta: Meta<typeof Toaster> = {
9
9
  parameters: {
10
10
  layout: 'centered',
11
11
  },
12
-
13
12
  tags: ['autodocs'],
14
13
  };
15
14
 
16
15
  type Story = StoryObj<typeof Toaster>;
16
+
17
17
  const defaultArgs = {
18
18
  isOpen: false,
19
19
  toastTitle: 'Success',
20
- toastMessage: 'Variable name Requested for Review successfully',
20
+ toastMessage: 'Operation completed successfully!',
21
21
  closeButtonLabel: 'x',
22
- displayDuration: 3000, // Set toast displayDuration in milliseconds
22
+ displayDuration: 3000, // Set toast display duration in milliseconds
23
23
  };
24
24
 
25
25
  export const Controlled: Story = {
@@ -27,49 +27,19 @@ export const Controlled: Story = {
27
27
  ...defaultArgs,
28
28
  },
29
29
  render: () => {
30
- const [open1, setOpen1] = useState(false);
31
- const handleButtonClick1 = () => {
32
- setOpen1(true);
33
- };
34
- const handleCancelClick1 = () => {
35
- setOpen1(false);
36
- };
30
+ const [toasts, setToasts] = useState({
31
+ success: false,
32
+ info: false,
33
+ confirm: false,
34
+ warning: false,
35
+ alert: false,
36
+ error: false,
37
+ });
37
38
 
38
- const [open2, setOpen2] = useState(false);
39
- const handleButtonClick2 = () => {
40
- setOpen2(true);
41
- };
42
- const handleCancelClick2 = () => {
43
- setOpen2(false);
44
- };
45
- const [open3, setOpen3] = useState(false);
46
- const handleButtonClick3 = () => {
47
- setOpen3(true);
48
- };
49
- const handleCancelClick3 = () => {
50
- setOpen3(false);
51
- };
52
- const [open4, setOpen4] = useState(false);
53
- const handleButtonClick4 = () => {
54
- setOpen4(true);
55
- };
56
- const handleCancelClick4 = () => {
57
- setOpen4(false);
58
- };
59
- const [open5, setOpen5] = useState(false);
60
- const handleButtonClick5 = () => {
61
- setOpen5(true);
62
- };
63
- const handleCancelClick5 = () => {
64
- setOpen5(false);
65
- };
66
- const [open6, setOpen6] = useState(false);
67
- const handleButtonClick6 = () => {
68
- setOpen6(true);
69
- };
70
- const handleCancelClick6 = () => {
71
- setOpen6(false);
39
+ const handleToastToggle = (key: keyof typeof toasts) => {
40
+ setToasts((prev) => ({ ...prev, [key]: !prev[key] }));
72
41
  };
42
+
73
43
  return (
74
44
  <div className="fireflink-stories-toaster-container">
75
45
  <div className="fireflink-stories-toaster-container-row">
@@ -77,48 +47,45 @@ export const Controlled: Story = {
77
47
  <Button
78
48
  variant="primary"
79
49
  label="SUCCESS"
80
- onClick={handleButtonClick1}
81
- disabled={false}
50
+ onClick={() => handleToastToggle('success')}
82
51
  />
83
52
  <Toaster
84
53
  {...defaultArgs}
85
- isOpen={open1}
54
+ isOpen={toasts.success}
86
55
  variant="success"
87
56
  toastTitle="Success!"
88
- onCancelClick={handleCancelClick1}
89
- toastMessage="Variable name Requested for Review successfully"
57
+ toastMessage="Variable name requested for review successfully."
58
+ onCancelClick={() => handleToastToggle('success')}
90
59
  />
91
60
  </div>
92
61
  <div>
93
62
  <Button
94
63
  variant="secondary"
95
64
  label="Information"
96
- onClick={handleButtonClick2}
97
- disabled={false}
65
+ onClick={() => handleToastToggle('info')}
98
66
  />
99
67
  <Toaster
100
68
  {...defaultArgs}
101
- isOpen={open2}
69
+ isOpen={toasts.info}
102
70
  variant="info"
103
- toastTitle="Info!!!"
104
- onCancelClick={handleCancelClick2}
105
- toastMessage="Data updated succesfully"
71
+ toastTitle="Info!"
72
+ toastMessage="Data updated successfully."
73
+ onCancelClick={() => handleToastToggle('info')}
106
74
  />
107
75
  </div>
108
76
  <div>
109
77
  <Button
110
78
  variant="delete"
111
79
  label="Confirmation"
112
- onClick={handleButtonClick3}
113
- disabled={false}
80
+ onClick={() => handleToastToggle('confirm')}
114
81
  />
115
82
  <Toaster
116
83
  {...defaultArgs}
117
- isOpen={open3}
84
+ isOpen={toasts.confirm}
118
85
  variant="confirm"
119
- toastTitle="Delete !!"
120
- onCancelClick={handleCancelClick3}
121
- toastMessage="Are you sure to delete data?"
86
+ toastTitle="Delete Confirmation"
87
+ toastMessage="Are you sure you want to delete this data?"
88
+ onCancelClick={() => handleToastToggle('confirm')}
122
89
  />
123
90
  </div>
124
91
  </div>
@@ -126,49 +93,46 @@ export const Controlled: Story = {
126
93
  <div>
127
94
  <Button
128
95
  variant="primary"
129
- label="WARNING "
130
- onClick={handleButtonClick4}
131
- disabled={false}
96
+ label="WARNING"
97
+ onClick={() => handleToastToggle('warning')}
132
98
  />
133
99
  <Toaster
134
100
  {...defaultArgs}
135
- isOpen={open4}
101
+ isOpen={toasts.warning}
136
102
  variant="warning"
137
103
  toastTitle="Warning!"
138
- onCancelClick={handleCancelClick4}
139
- toastMessage="Variable name Requested for Review successfully"
104
+ toastMessage="Action might have consequences."
105
+ onCancelClick={() => handleToastToggle('warning')}
140
106
  />
141
107
  </div>
142
108
  <div>
143
109
  <Button
144
110
  variant="primary"
145
- label="click "
146
- onClick={handleButtonClick5}
147
- disabled={false}
111
+ label="Alert"
112
+ onClick={() => handleToastToggle('alert')}
148
113
  />
149
114
  <Toaster
150
115
  {...defaultArgs}
151
- isOpen={open5}
152
- variant="success"
153
- toastTitle="Success!"
154
- onCancelClick={handleCancelClick5}
155
- toastMessage="Variable name Requested for Review successfully"
116
+ isOpen={toasts.alert}
117
+ variant="alert"
118
+ toastTitle="Alert!"
119
+ toastMessage="Immediate action required!"
120
+ onCancelClick={() => handleToastToggle('alert')}
156
121
  />
157
122
  </div>
158
123
  <div>
159
124
  <Button
160
125
  variant="delete"
161
- label="ERROR "
162
- onClick={handleButtonClick6}
163
- disabled={false}
126
+ label="ERROR"
127
+ onClick={() => handleToastToggle('error')}
164
128
  />
165
129
  <Toaster
166
130
  {...defaultArgs}
167
- isOpen={open6}
131
+ isOpen={toasts.error}
168
132
  variant="danger"
169
- toastTitle="Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!Error!"
170
- onCancelClick={handleCancelClick6}
171
- toastMessage="SomethingVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariableVariable"
133
+ toastTitle="Error!"
134
+ toastMessage="An error occurred while processing your request.An error occurred while processing your request.An error occurred while processing your request.An error occurred while processing your request.An error occurred while processing your request.An error occurred while processing your request.An error occurred while processing your request."
135
+ onCancelClick={() => handleToastToggle('error')}
172
136
  />
173
137
  </div>
174
138
  </div>
@@ -26,10 +26,11 @@ const Toaster: React.FC<ToasterProps> = ({
26
26
  warning: 'warning',
27
27
  danger: 'error',
28
28
  confirm: 'delete',
29
+ alert: 'alert',
29
30
  };
30
31
 
31
32
  const getToasterIcon = (
32
- variant: 'success' | 'warning' | 'danger' | 'info' | 'confirm'
33
+ variant: 'success' | 'warning' | 'danger' | 'info' | 'confirm' | 'alert'
33
34
  ) => {
34
35
  const name = iconMap[variant];
35
36
  return <Icon name={name} height={40} width={40} />;
@@ -3,7 +3,7 @@ export interface ToasterProps {
3
3
  isOpen: boolean;
4
4
 
5
5
  /**Variant for different type of toast message. */
6
- variant: 'success' | 'warning' | 'danger' | 'info' | 'confirm';
6
+ variant: 'success' | 'warning' | 'danger' | 'info' | 'confirm' | 'alert';
7
7
 
8
8
  /**Title of the toaster */
9
9
  toastTitle: string;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { Meta, StoryObj } from '@storybook/react';
2
3
  import { Toastify, toast } from './Toastify';
3
4
  import Button from '../Button';
@@ -26,7 +27,6 @@ export const Controlled: Story = {
26
27
  ...defaultArgs,
27
28
  },
28
29
  render: () => (
29
-
30
30
  /*
31
31
  Note:-
32
32
  import { Toastify, toast } from 'pixel-react';
@@ -40,7 +40,7 @@ export const Controlled: Story = {
40
40
  <Button
41
41
  variant="primary"
42
42
  label="Show Success Toast"
43
- onClick={() => toast.success('Your request was successful!')}
43
+ onClick={() => toast.success('Your request was successful!','Your request was successful! Your request was successful! Your request was successful! Your request was successful!')}
44
44
  />
45
45
  <Button
46
46
  variant="delete"
@@ -49,20 +49,20 @@ export const Controlled: Story = {
49
49
  />
50
50
  <Button
51
51
  variant="warning"
52
- label="Show Object Toast"
52
+ label="Show warning Object Toast"
53
53
  onClick={() =>
54
54
  toast.warning('Something went wrong!', { a: 'hi', b: '5', c: 10 })
55
55
  }
56
56
  />
57
57
  <Button
58
- variant="warning"
59
- label="Show Array Toast"
60
- onClick={() => toast.warning('Something went wrong!', ['1', 4, 'hi'])}
58
+ variant="secondary"
59
+ label="Show info Array Toast"
60
+ onClick={() => toast.info('Something went wrong!', ['1', 4, 'hi'])}
61
61
  />
62
62
  <Button
63
- variant="warning"
64
- label="Show function Toast"
65
- onClick={() => toast.warning('Something went wrong!', () => {})}
63
+ variant="tertiary"
64
+ label="Show alert function Toast"
65
+ onClick={() => toast.alert('Something went wrong!', () => {})}
66
66
  />
67
67
  </div>
68
68
  ),
@@ -89,4 +89,6 @@ export const toast = {
89
89
  openToast('warning', arg1, arg2),
90
90
  info: (arg1: AcceptedType, arg2?: AcceptedType) =>
91
91
  openToast('info', arg1, arg2),
92
+ alert: (arg1: AcceptedType, arg2?: AcceptedType) =>
93
+ openToast('alert', arg1, arg2),
92
94
  };
@@ -1,4 +1,4 @@
1
- export type Variant = 'success' | 'warning' | 'danger' | 'info' | 'confirm';
1
+ export type Variant = 'success' | 'warning' | 'danger' | 'info' | 'alert';
2
2
 
3
3
  export interface ToastProps {
4
4
  isOpen: boolean;
package/src/index.ts CHANGED
@@ -61,6 +61,7 @@ import ModuleChip from './components/ModulesChip/ModuleChip';
61
61
  import IconRadialChart from './components/Charts/IconRadialChart';
62
62
  import AttachImage from './components/AttachImage';
63
63
  import StatusCard from './components/StatusCard';
64
+ import VariableDropdown from './components/Editor/VariableDropdown';
64
65
 
65
66
  import LineChart from './components/Charts/LineChart';
66
67
  // Utils imports
@@ -155,6 +156,7 @@ export {
155
156
  AttachImage,
156
157
  ToggleSwitch,
157
158
  Avatar,
159
+ VariableDropdown,
158
160
  // utils exports
159
161
  checkEmpty,
160
162
  getExtension,