pixel-react 1.4.2 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/lib/components/AddResourceButton/type.d.ts +1 -1
  3. package/lib/components/Drawer/Types.d.ts +4 -0
  4. package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +13 -0
  5. package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +0 -13
  6. package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +29 -1
  7. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +3 -9
  8. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +2 -10
  9. package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +0 -1
  10. package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +27 -2
  11. package/lib/components/Form/Forms.d.ts +4 -2
  12. package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
  13. package/lib/components/MenuOption/MenuOption.d.ts +1 -1
  14. package/lib/components/MenuOption/types.d.ts +49 -15
  15. package/lib/components/MiniModal/types.d.ts +1 -1
  16. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  17. package/lib/components/MultiSelect/MultiSelectTypes.d.ts +4 -5
  18. package/lib/components/MultiSelect/dropdownTypes.d.ts +2 -0
  19. package/lib/components/RadioButton/RadioButton.d.ts +1 -0
  20. package/lib/components/RadioButton/radioButtonTypes.d.ts +3 -1
  21. package/lib/components/Select/components/types.d.ts +4 -2
  22. package/lib/components/Table/Table.d.ts +1 -1
  23. package/lib/components/ToggleSwitch/ToggleSwitch.d.ts +10 -0
  24. package/lib/components/ToggleSwitch/index.d.ts +1 -0
  25. package/lib/index.d.ts +110 -24
  26. package/lib/index.esm.js +5732 -648
  27. package/lib/index.esm.js.map +1 -1
  28. package/lib/index.js +5728 -642
  29. package/lib/index.js.map +1 -1
  30. package/lib/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +11 -11
  32. package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
  33. package/src/assets/Themes/BaseTheme.scss +17 -23
  34. package/src/assets/Themes/DarkTheme.scss +25 -38
  35. package/src/assets/icons/apk_file_type.svg +4 -0
  36. package/src/assets/icons/compressed_file_type.svg +4 -0
  37. package/src/assets/icons/csv_file_type.svg +4 -0
  38. package/src/assets/icons/excel_corner_menu.svg +3 -0
  39. package/src/assets/icons/formula_icon.svg +3 -0
  40. package/src/assets/icons/gif_file_type.svg +4 -0
  41. package/src/assets/icons/html_file_type.svg +4 -0
  42. package/src/assets/icons/ipk_file_type.svg +4 -0
  43. package/src/assets/icons/jpg_file_type.svg +4 -0
  44. package/src/assets/icons/json_file_type.svg +4 -0
  45. package/src/assets/icons/pdf_file_type.svg +4 -0
  46. package/src/assets/icons/png_file_type.svg +4 -0
  47. package/src/assets/icons/quick_run_setting_icon.svg +5 -0
  48. package/src/assets/icons/run_automation_scripts_icon.svg +33 -0
  49. package/src/assets/icons/run_manual_testcase_icon.svg +4 -0
  50. package/src/assets/icons/search.svg +2 -2
  51. package/src/assets/icons/txt_file_type.svg +4 -0
  52. package/src/assets/icons/xls_file_type.svg +4 -0
  53. package/src/assets/icons/xlsx_file_type.svg +4 -0
  54. package/src/assets/icons/xml_file_type.svg +4 -0
  55. package/src/assets/styles/_fonts.scss +32 -2
  56. package/src/components/AddResourceButton/AddButton.tsx +7 -7
  57. package/src/components/AddResourceButton/type.ts +1 -1
  58. package/src/components/AttachmentButton/AttachmentButton.scss +1 -1
  59. package/src/components/AttachmentButton/AttachmentButton.stories.tsx +1 -0
  60. package/src/components/Button/Button.scss +22 -20
  61. package/src/components/Button/Button.tsx +8 -1
  62. package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
  63. package/src/components/Drawer/Drawer.scss +4 -3
  64. package/src/components/Drawer/Drawer.tsx +14 -18
  65. package/src/components/Drawer/Types.ts +4 -0
  66. package/src/components/Editor/Editor.tsx +9 -11
  67. package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +39 -0
  68. package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +51 -0
  69. package/src/components/Excel/ExcelFile/ExcelFile.tsx +7 -8
  70. package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +35 -0
  71. package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +44 -7
  72. package/src/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.tsx +8 -1
  73. package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +45 -6
  74. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +37 -2
  75. package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +69 -24
  76. package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +59 -0
  77. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.ts +18 -65
  78. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.ts +5 -110
  79. package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.ts +0 -2
  80. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +105 -1
  81. package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +670 -673
  82. package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +38 -2
  83. package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +0 -4
  84. package/src/components/FileDropzone/FileDropzone.scss +4 -2
  85. package/src/components/FileDropzone/FileDropzone.tsx +1 -1
  86. package/src/components/FileDropzone/FilePreview.tsx +3 -1
  87. package/src/components/Form/Form.scss +2 -0
  88. package/src/components/Form/Form.stories.tsx +195 -6
  89. package/src/components/Form/Forms.tsx +15 -8
  90. package/src/components/Icon/iconList.ts +46 -0
  91. package/src/components/IconRadioGroup/IconRadioGroup.scss +3 -0
  92. package/src/components/IconRadioGroup/IconRadioGroup.tsx +20 -17
  93. package/src/components/Input/Input.scss +14 -15
  94. package/src/components/Input/Input.stories.tsx +2 -1
  95. package/src/components/InputWithDropdown/InputWithDropdown.scss +12 -13
  96. package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +3 -2
  97. package/src/components/InputWithDropdown/InputWithDropdown.tsx +22 -19
  98. package/src/components/MenuOption/MenuOption.scss +11 -10
  99. package/src/components/MenuOption/MenuOption.stories.tsx +51 -232
  100. package/src/components/MenuOption/MenuOption.tsx +131 -52
  101. package/src/components/MenuOption/types.ts +55 -14
  102. package/src/components/MiniModal/MiniModal.stories.tsx +7 -6
  103. package/src/components/MiniModal/MiniModal.tsx +29 -23
  104. package/src/components/MiniModal/types.ts +1 -1
  105. package/src/components/MultiSelect/Dropdown.tsx +11 -12
  106. package/src/components/MultiSelect/MultiSelect.scss +1 -0
  107. package/src/components/MultiSelect/MultiSelect.stories.tsx +45 -10
  108. package/src/components/MultiSelect/MultiSelect.tsx +29 -13
  109. package/src/components/MultiSelect/MultiSelectTypes.ts +7 -5
  110. package/src/components/MultiSelect/dropdownTypes.ts +2 -0
  111. package/src/components/RadioButton/RadioButton.scss +3 -1
  112. package/src/components/RadioButton/RadioButton.tsx +3 -1
  113. package/src/components/RadioButton/radioButtonTypes.tsx +5 -1
  114. package/src/components/Search/Search.scss +25 -6
  115. package/src/components/Search/Search.tsx +45 -24
  116. package/src/components/Select/Select.scss +12 -12
  117. package/src/components/Select/Select.stories.tsx +2 -0
  118. package/src/components/Select/Select.tsx +11 -5
  119. package/src/components/Select/components/Dropdown.scss +2 -0
  120. package/src/components/Select/components/Dropdown.tsx +19 -4
  121. package/src/components/Select/components/types.ts +4 -2
  122. package/src/components/StatusButton/StatusButton.tsx +26 -20
  123. package/src/components/Table/Table.scss +1 -3
  124. package/src/components/Table/Table.stories.tsx +1 -0
  125. package/src/components/Table/Table.tsx +7 -3
  126. package/src/components/ToggleSwitch/ToggleSwitch.scss +59 -0
  127. package/src/components/ToggleSwitch/ToggleSwitch.stories.tsx +52 -0
  128. package/src/components/ToggleSwitch/ToggleSwitch.tsx +30 -0
  129. package/src/components/ToggleSwitch/index.ts +1 -0
  130. package/src/components/Typography/Typography.scss +32 -2
  131. package/src/hooks/useFileDropzone.tsx +1 -0
  132. package/src/index.ts +4 -2
  133. package/src/components/Excel/ContextMenu/ContextMenu.scss +0 -99
  134. package/src/components/Excel/ContextMenu/ContextMenu.tsx +0 -103
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Meta, StoryObj } from '@storybook/react';
2
3
  import Input from './Input';
3
4
  import { ChangeEvent, useState } from 'react';
@@ -58,7 +59,7 @@ export const Controlled: Story = {
58
59
 
59
60
  const onChangeHandler = (event: ChangeEvent<HTMLInputElement>) => {
60
61
  const value = event.target.value;
61
- if (event.target.required) {
62
+ if (event.target) {
62
63
  if (value.length <= 0) {
63
64
  setError(true);
64
65
  setHelperText(`${event?.target?.name} is required`);
@@ -19,7 +19,7 @@
19
19
  display: flex;
20
20
  flex-direction: row;
21
21
  }
22
- .ff-floating-input--left-dropdown{
22
+ .ff-floating-input--left-dropdown {
23
23
  width: 698px;
24
24
  }
25
25
 
@@ -28,7 +28,7 @@
28
28
  position: absolute;
29
29
  z-index: 9;
30
30
  color: var(--input-default-border-color);
31
- top: 7px;
31
+ top: 6px;
32
32
  left: 7px;
33
33
  @extend .fontSm;
34
34
  transition: all 0.3s ease-in-out;
@@ -56,7 +56,6 @@
56
56
  border-right: 1px solid var(--input-default-border-color);
57
57
  border-radius: 4px 0 0 4px;
58
58
  @extend .fontSm;
59
- top: 1px;
60
59
 
61
60
  &::-webkit-outer-spin-button,
62
61
  &::-webkit-inner-spin-button {
@@ -104,7 +103,7 @@
104
103
  }
105
104
 
106
105
  .ff-floating-dropdown--left {
107
- min-width: 94px;
106
+ min-width: 94px;
108
107
  }
109
108
  .seperatorline {
110
109
  height: 26px;
@@ -116,7 +115,7 @@
116
115
  }
117
116
  &:hover {
118
117
  .ff-input-with-dropdown {
119
- border-color: var(--input-hover-border-color);
118
+ border-color: var(--brand-color);
120
119
 
121
120
  &--filled {
122
121
  border-color: var(--input-default-border-color);
@@ -140,7 +139,7 @@
140
139
  }
141
140
  }
142
141
  .ff-floating-input {
143
- border-color: var(--input-hover-border-color);
142
+ border-color: var(--brand-color);
144
143
  &--filled {
145
144
  border-color: var(--input-default-border-color);
146
145
  }
@@ -162,12 +161,12 @@
162
161
  }
163
162
 
164
163
  .ff-floating-label {
165
- top: -6px;
164
+ top: -9px;
166
165
  background-color: var(--input-label-bg-color);
167
166
  padding: 0px 2px;
168
167
  color: var(--input-active-text-color);
169
- line-height: 12px;
170
- font-size: 8px !important;
168
+ line-height: 15px;
169
+ font-size: 10px !important;
171
170
 
172
171
  &--error {
173
172
  color: var(--input-error-text-color);
@@ -190,11 +189,11 @@
190
189
  border-color: var(--input-active-text-color);
191
190
  .ff-floating-label {
192
191
  //re-written label container code to place it at on border
193
- top: -6px;
192
+ top: -9px;
194
193
  background-color: var(--input-label-bg-color);
195
194
  padding: 0px 2px;
196
- line-height: 12px;
197
- font-size: 8px !important;
195
+ line-height: 15px;
196
+ font-size: 10px !important;
198
197
  }
199
198
  }
200
199
  }
@@ -208,7 +207,7 @@
208
207
 
209
208
  .ff-helper-text {
210
209
  color: var(--input-error-text-color);
211
- @extend .font-size-8;
210
+ @extend .fontXs;
212
211
  padding: 0 11px;
213
212
  }
214
213
  }
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import type { Meta, StoryObj } from '@storybook/react';
2
3
  import InputWithDropdown from './InputWithDropdown';
3
4
  import { ChangeEvent, useState } from 'react';
@@ -51,7 +52,7 @@ export const DisabledWithValue: Story = {
51
52
 
52
53
  export const Controlled: Story = {
53
54
  render: () => {
54
- const [value, setValue] = useState<number>(0);
55
+ const [value, setValue] = useState<number | string>(0);
55
56
  const [error, setError] = useState<boolean>(false);
56
57
  const [helperText, setHelperText] = useState<string>('');
57
58
 
@@ -74,7 +75,7 @@ export const Controlled: Story = {
74
75
 
75
76
  const onInputChangeHandler = (event: ChangeEvent<HTMLInputElement>) => {
76
77
  const inputValue = parseInt(event.target.value);
77
- setValue(inputValue);
78
+ setValue(event.target.value);
78
79
 
79
80
  if (event.target) {
80
81
  if (inputValue < 0 || checkEmpty(value)) {
@@ -16,14 +16,15 @@ const InputWithDropdown = ({
16
16
  helperText,
17
17
  optionsList,
18
18
  selectedOption,
19
+ autoComplete = 'off',
19
20
  onDropdownChangeHandler = () => {},
20
21
  onInputChangeHandler,
21
22
  onInputBlurHandler,
22
23
  optionsRequired = true,
23
- dropdownPosition = 'right',
24
+ dropdownPosition = 'right',
24
25
  type = 'text',
25
26
  }: InputWithDropdownProps) => {
26
- const isValueFilled = !checkEmpty(value) || dropdownPosition==='left';
27
+ const isValueFilled = !checkEmpty(value) || dropdownPosition === 'left';
27
28
 
28
29
  return (
29
30
  <div
@@ -42,22 +43,23 @@ const InputWithDropdown = ({
42
43
  >
43
44
  {dropdownPosition === 'left' && (
44
45
  <>
45
- <Select
46
- optionsList={optionsList}
47
- selectedOption={selectedOption}
48
- showLabel={false}
49
- showBorder={false}
50
- onChange={onDropdownChangeHandler}
51
- disabled={disabled || !optionsRequired}
52
- optionsRequired={optionsRequired}
53
- className={classNames('ff-floating-dropdown', {
54
- 'ff-floating-dropdown--disabled': !!disabled,
55
- 'ff-floating-dropdown--error': !!error,
56
- 'ff-floating-dropdown--left': dropdownPosition === 'left'
57
- })}
58
- width={94}
59
- />
60
- <div className='seperatorline'/>
46
+ <Select
47
+ optionsList={optionsList}
48
+ selectedOption={selectedOption}
49
+ showLabel={false}
50
+ showBorder={false}
51
+ onChange={onDropdownChangeHandler}
52
+ disabled={disabled || !optionsRequired}
53
+ optionsRequired={optionsRequired}
54
+ className={classNames('ff-floating-dropdown', {
55
+ 'ff-floating-dropdown--disabled': !!disabled,
56
+ 'ff-floating-dropdown--error': !!error,
57
+ 'ff-floating-dropdown--left': dropdownPosition === 'left',
58
+ })}
59
+ width={94}
60
+ height={30}
61
+ />
62
+ <div className="seperatorline" />
61
63
  </>
62
64
  )}
63
65
  <div className={classNames('ff-floating-label-input-container')}>
@@ -81,6 +83,7 @@ const InputWithDropdown = ({
81
83
  onChange={onInputChangeHandler}
82
84
  onBlur={onInputBlurHandler}
83
85
  placeholder={placeholder}
86
+ autoComplete={autoComplete}
84
87
  required={required}
85
88
  disabled={disabled}
86
89
  className={classNames('ff-floating-input', {
@@ -105,6 +108,7 @@ const InputWithDropdown = ({
105
108
  'ff-floating-dropdown--error': !!error,
106
109
  })}
107
110
  width={120}
111
+ height={30}
108
112
  />
109
113
  )}
110
114
  </fieldset>
@@ -115,5 +119,4 @@ const InputWithDropdown = ({
115
119
  );
116
120
  };
117
121
 
118
-
119
122
  export default InputWithDropdown;
@@ -3,7 +3,6 @@
3
3
  .ff-menu-option-container {
4
4
  cursor: pointer;
5
5
  position: relative;
6
-
7
6
  .ff-icon-label {
8
7
  display: flex;
9
8
  align-items: center;
@@ -43,25 +42,27 @@
43
42
  }
44
43
  }
45
44
  }
45
+ }
46
+
47
+ .ff-option-card {
48
+ position: fixed;
49
+ margin: 4px;
46
50
 
47
- .ff-option-card {
48
- position: absolute;
51
+ .ff-option-wrapper {
49
52
  border: 1px solid var(--option-card-border-color);
50
53
  background: var(--option-card-bg-color);
51
- border-radius: 4px;
52
- margin: 2px;
54
+ overflow: hidden;
53
55
  min-height: 32px;
54
- min-width: 111px;
55
- white-space: nowrap;
56
-
56
+ min-width: 112px;
57
+ width: max-content;
58
+ border-radius: 4px;
57
59
  .ff-options {
58
60
  @extend .fontSm;
59
61
  cursor: pointer;
60
- border-radius: 4px;
62
+ border-radius: 3px;
61
63
  display: flex;
62
64
  align-items: center;
63
65
  padding: 8px;
64
- line-height: 16px;
65
66
  gap: 8px;
66
67
  &:hover {
67
68
  background-color: var(--hover-color);
@@ -1,36 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import MenuOption from './MenuOption';
3
3
  import './MenuOption.scss';
4
-
5
- export const DefaultMenuOption: Story = {
6
- args: {
7
- iconName: 'more',
8
- options: [
9
- {
10
- label: 'StepGroup',
11
- icon: 'success',
12
- value: [],
13
- disable: true,
14
- },
15
- {
16
- label: 'Script',
17
- value: ['SCR101', 'SCR102'],
18
- icon: 'success',
19
- },
20
- {
21
- label: 'Script',
22
- value: ['SCR101', 'SCR102'],
23
- icon: 'success',
24
- },
25
- {
26
- label: 'Script',
27
- value: ['SCR101', 'SCR102'],
28
- icon: 'success',
29
- },
30
- ],
31
- zIndex:1000000,
32
- },
33
- };
4
+ import React from 'react';
34
5
 
35
6
  const meta: Meta<typeof MenuOption> = {
36
7
  title: 'Components/MenuOption',
@@ -55,229 +26,77 @@ const meta: Meta<typeof MenuOption> = {
55
26
  tooltipPlacement: {
56
27
  control: {
57
28
  type: 'select',
58
- options: ['top', 'bottom', 'left', 'right'],
29
+ options: ['top', 'down', 'left', 'right'],
59
30
  },
60
31
  defaultValue: 'top',
61
32
  },
62
33
  dropdownPlacement: {
63
34
  control: {
64
35
  type: 'select',
65
- options: ['top', 'bottom', 'left', 'right'],
36
+ options: ['top', 'down', 'left', 'right'],
66
37
  },
67
- defaultValue: 'bottom',
38
+ defaultValue: 'down',
68
39
  },
69
40
  },
70
41
  };
71
42
 
72
43
  type Story = StoryObj<typeof MenuOption>;
73
44
 
74
- export const ControlledMenuOption: Story = {
75
- render: (args) => {
76
- const options = [
77
- {
78
- label: 'Option1',
79
- value: 'opt1',
80
- icon: 'success',
81
- },
82
- {
83
- label: 'Option2',
84
- value: 'opt2',
85
- icon: 'success',
86
- },
87
- {
88
- label: 'Delete option',
89
- value: 'deleteOpt',
90
- icon: 'delete',
91
- },
92
- ];
93
-
94
- return (
95
- <MenuOption
96
- iconName={args.iconName}
97
- labelName={args.labelName}
98
- options={options}
99
- tooltipTitle={args.tooltipTitle}
100
- tooltipPlacement={args.tooltipPlacement}
101
- dropdownPlacement={args.dropdownPlacement}
102
- />
103
- );
45
+ const options = [
46
+ { label: 'Option 1', value: 'opt1', icon: 'success' },
47
+ { label: 'Option 2', value: 'opt2', icon: 'success' },
48
+ {
49
+ label: 'Delete',
50
+ value: 'deleteOpt',
51
+ icon: 'delete',
52
+ iconColor: 'var(--delete-text-color)',
104
53
  },
105
- };
54
+ ];
106
55
 
107
- // Story for MenuOption with label
108
- export const MenuOptionWithLabel: Story = {
109
- args: {
110
- labelName: 'more',
111
- iconName: 'more',
112
- options: [
113
- {
114
- label: 'Option1',
115
- value: 'opt1',
116
- icon: 'success',
117
- },
118
- {
119
- label: 'Option2',
120
- value: 'opt2',
121
- icon: 'success',
122
- },
123
- ],
124
- },
56
+ const handleOptionClick = (option: { label: string }) => {
57
+ alert(`Option clicked: ${option.label}`);
125
58
  };
126
59
 
127
- // Story for MenuOption with disabled hover effect
128
- export const MenuOptionWithDisabledHoverEffect: Story = {
129
- render: () => {
130
- const options = [
131
- {
132
- label: 'StepGroup',
133
- icon: 'success',
134
- value: [],
135
- disable: true,
136
- },
137
- {
138
- label: 'Script',
139
- value: ['SCR101', 'SCR102'],
140
- icon: 'success',
141
- },
142
- ];
143
- const zIndex=1000000;
144
- return (
145
- <MenuOption
146
- iconName="more"
147
- tooltipTitle="more options"
148
- tooltipPlacement="top"
149
- dropdownPlacement="right"
150
- options={options}
151
- zIndex={zIndex}
152
- />
153
- );
154
- },
60
+ export const ControlledMenuOptionTop: Story = {
61
+ render: (args) => (
62
+ <MenuOption
63
+ iconName="more"
64
+ labelName={args.labelName}
65
+ options={options}
66
+ tooltipTitle={args.tooltipTitle}
67
+ tooltipPlacement={args.tooltipPlacement}
68
+ dropdownPlacement="top" // Override dropdown position to top
69
+ onOptionClick={handleOptionClick}
70
+ />
71
+ ),
155
72
  };
156
73
 
157
- // Story for MenuOption with tooltip
158
- export const MenuOptionWithToolTip: Story = {
159
- args: {
160
- labelName: 'ImpactList',
161
- iconName: 'success',
162
- tooltipTitle: 'More Info',
163
- tooltipPlacement: 'bottom',
164
- options: [
165
- {
166
- label: 'Option1',
167
- value: 'opt1',
168
- icon: 'success',
169
- },
170
- {
171
- label: 'Option2',
172
- value: 'opt2',
173
- icon: 'success',
174
- },
175
- ],
176
- },
74
+ export const ControlledMenuOptionBottom: Story = {
75
+ render: (args) => (
76
+ <MenuOption
77
+ iconName="more"
78
+ labelName={args.labelName}
79
+ options={options}
80
+ tooltipTitle={args.tooltipTitle}
81
+ tooltipPlacement={args.tooltipPlacement}
82
+ dropdownPlacement="down"
83
+ onOptionClick={handleOptionClick}
84
+ />
85
+ ),
177
86
  };
178
87
 
179
- // Story for MenuOption with 'top' placement
180
- export const MenuOptionPlacementTop: Story = {
181
- args: {
182
- iconName: 'more',
183
- labelName: 'Top Placement',
184
- dropdownPlacement: 'top',
185
- options: [
186
- {
187
- label: 'Option1',
188
- value: 'opt1',
189
- icon: 'success',
190
- },
191
- {
192
- label: 'Option2',
193
- value: 'opt2',
194
- icon: 'success',
195
- },
196
- ],
197
- },
198
- };
199
-
200
- // Story for MenuOption with 'down' placement
201
- export const MenuOptionPlacementDown: Story = {
202
- args: {
203
- iconName: 'more',
204
- labelName: ' Placement',
205
- dropdownPlacement: 'down',
206
- options: [
207
- {
208
- label: 'Option1',
209
- value: 'opt1',
210
- icon: 'success',
211
- },
212
- {
213
- label: 'Option2',
214
- value: 'opt2',
215
- icon: 'success',
216
- },
217
- ],
218
- },
219
- };
220
-
221
- // Story for MenuOption with 'left' placement
222
- export const MenuOptionPlacementLeft: Story = {
223
- args: {
224
- iconName: 'more',
225
- labelName: 'Left Placement',
226
- dropdownPlacement: 'left',
227
- options: [
228
- {
229
- label: 'Option1',
230
- value: 'opt1',
231
- icon: 'delete',
232
- },
233
- {
234
- label: 'Option2',
235
- value: 'opt2',
236
- icon: 'success',
237
- },
238
- ],
239
- },
240
- };
241
-
242
- // Story for MenuOption with 'right' placement
243
- export const MenuOptionPlacementRight: Story = {
244
- args: {
245
- iconName: 'more',
246
- dropdownPlacement: 'right',
247
- options: [
248
- {
249
- label: 'Option1',
250
- value: 'opt1',
251
- icon: 'success',
252
- },
253
- {
254
- label: 'Option2',
255
- value: 'opt2',
256
- icon: 'success',
257
- },
258
- ],
259
- },
260
- };
261
-
262
-
263
- export const MenuOptionCustom: Story = {
264
- args: {
265
- iconName: 'more',
266
- dropdownPlacement: 'bottom',
267
- variant:'dark',
268
- options: [
269
- {
270
- label: 'Option1',
271
- value: 'opt1',
272
- icon: 'success',
273
- },
274
- {
275
- label: 'Option2',
276
- value: 'opt2',
277
- icon: 'success',
278
- },
279
- ],
280
- },
88
+ export const ControlledMenuOptionRight: Story = {
89
+ render: (args) => (
90
+ <MenuOption
91
+ iconName="more"
92
+ labelName={args.labelName}
93
+ options={options}
94
+ tooltipTitle={args.tooltipTitle}
95
+ tooltipPlacement={args.tooltipPlacement}
96
+ dropdownPlacement="right"
97
+ onOptionClick={handleOptionClick}
98
+ />
99
+ ),
281
100
  };
282
101
 
283
102
  export default meta;