pixel-react 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.yarn/install-state.gz +0 -0
- package/lib/components/AddResourceButton/type.d.ts +1 -1
- package/lib/components/Drawer/Types.d.ts +4 -0
- package/lib/components/Excel/ExcelContextMenu/ExcelContextMenu.d.ts +13 -0
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.d.ts +0 -13
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/actions.d.ts +29 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.d.ts +3 -9
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.d.ts +2 -10
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.d.ts +0 -1
- package/lib/components/Excel/ExcelFile/ExcelFileComponents/types.d.ts +27 -2
- package/lib/components/Form/Forms.d.ts +4 -2
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/types.d.ts +49 -15
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +4 -5
- package/lib/components/MultiSelect/dropdownTypes.d.ts +2 -0
- package/lib/components/RadioButton/RadioButton.d.ts +1 -0
- package/lib/components/RadioButton/radioButtonTypes.d.ts +3 -1
- package/lib/components/Select/components/types.d.ts +4 -2
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/ToggleSwitch/ToggleSwitch.d.ts +10 -0
- package/lib/components/ToggleSwitch/index.d.ts +1 -0
- package/lib/index.d.ts +109 -23
- package/lib/index.esm.js +5711 -635
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +5707 -629
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +10 -0
- package/src/assets/Themes/BaseTheme.scss +17 -23
- package/src/assets/Themes/DarkTheme.scss +25 -38
- package/src/assets/icons/apk_file_type.svg +4 -0
- package/src/assets/icons/compressed_file_type.svg +4 -0
- package/src/assets/icons/csv_file_type.svg +4 -0
- package/src/assets/icons/excel_corner_menu.svg +3 -0
- package/src/assets/icons/formula_icon.svg +3 -0
- package/src/assets/icons/gif_file_type.svg +4 -0
- package/src/assets/icons/html_file_type.svg +4 -0
- package/src/assets/icons/ipk_file_type.svg +4 -0
- package/src/assets/icons/jpg_file_type.svg +4 -0
- package/src/assets/icons/json_file_type.svg +4 -0
- package/src/assets/icons/pdf_file_type.svg +4 -0
- package/src/assets/icons/png_file_type.svg +4 -0
- package/src/assets/icons/quick_run_setting_icon.svg +5 -0
- package/src/assets/icons/run_automation_scripts_icon.svg +33 -0
- package/src/assets/icons/run_manual_testcase_icon.svg +4 -0
- package/src/assets/icons/search.svg +2 -2
- package/src/assets/icons/txt_file_type.svg +4 -0
- package/src/assets/icons/xls_file_type.svg +4 -0
- package/src/assets/icons/xlsx_file_type.svg +4 -0
- package/src/assets/icons/xml_file_type.svg +4 -0
- package/src/components/AddResourceButton/AddButton.tsx +7 -7
- package/src/components/AddResourceButton/type.ts +1 -1
- package/src/components/AttachmentButton/AttachmentButton.scss +1 -1
- package/src/components/AttachmentButton/AttachmentButton.stories.tsx +1 -0
- package/src/components/Button/Button.scss +22 -20
- package/src/components/Button/Button.tsx +8 -1
- package/src/components/Charts/DashboardDonutChart/DashboardDonutChart.tsx +2 -2
- package/src/components/Drawer/Drawer.scss +4 -3
- package/src/components/Drawer/Drawer.tsx +14 -18
- package/src/components/Drawer/Types.ts +4 -0
- package/src/components/Editor/Editor.tsx +9 -11
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.scss +39 -0
- package/src/components/Excel/ExcelContextMenu/ExcelContextMenu.tsx +51 -0
- package/src/components/Excel/ExcelFile/ExcelFile.tsx +7 -8
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Cell.tsx +35 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/ColumnIndicator.tsx +44 -7
- package/src/components/Excel/ExcelFile/ExcelFileComponents/CornerIndicator.tsx +8 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/RowIndicator.tsx +45 -6
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.scss +37 -2
- package/src/components/Excel/ExcelFile/ExcelFileComponents/Spreadsheet.tsx +69 -24
- package/src/components/Excel/ExcelFile/ExcelFileComponents/actions.ts +59 -0
- package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/engine.ts +18 -65
- package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/formula.ts +5 -110
- package/src/components/Excel/ExcelFile/ExcelFileComponents/engine/point-graph.ts +0 -2
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducer.ts +105 -1
- package/src/components/Excel/ExcelFile/ExcelFileComponents/reducerFunctions.ts +670 -673
- package/src/components/Excel/ExcelFile/ExcelFileComponents/types.ts +38 -2
- package/src/components/Excel/ExcelToolBar/ExcelToolBar.tsx +0 -4
- package/src/components/FileDropzone/FileDropzone.scss +4 -2
- package/src/components/FileDropzone/FileDropzone.tsx +1 -1
- package/src/components/FileDropzone/FilePreview.tsx +3 -1
- package/src/components/Form/Form.scss +2 -0
- package/src/components/Form/Form.stories.tsx +195 -6
- package/src/components/Form/Forms.tsx +15 -8
- package/src/components/Icon/iconList.ts +46 -0
- package/src/components/IconRadioGroup/IconRadioGroup.scss +3 -0
- package/src/components/IconRadioGroup/IconRadioGroup.tsx +20 -17
- package/src/components/Input/Input.scss +14 -15
- package/src/components/Input/Input.stories.tsx +2 -1
- package/src/components/InputWithDropdown/InputWithDropdown.scss +12 -13
- package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +3 -2
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +22 -19
- package/src/components/MenuOption/MenuOption.scss +11 -10
- package/src/components/MenuOption/MenuOption.stories.tsx +51 -232
- package/src/components/MenuOption/MenuOption.tsx +131 -52
- package/src/components/MenuOption/types.ts +55 -14
- package/src/components/MiniModal/MiniModal.stories.tsx +2 -3
- package/src/components/MultiSelect/Dropdown.tsx +11 -12
- package/src/components/MultiSelect/MultiSelect.scss +1 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +45 -10
- package/src/components/MultiSelect/MultiSelect.tsx +29 -13
- package/src/components/MultiSelect/MultiSelectTypes.ts +7 -5
- package/src/components/MultiSelect/dropdownTypes.ts +2 -0
- package/src/components/RadioButton/RadioButton.scss +3 -1
- package/src/components/RadioButton/RadioButton.tsx +3 -1
- package/src/components/RadioButton/radioButtonTypes.tsx +5 -1
- package/src/components/Search/Search.scss +25 -6
- package/src/components/Search/Search.tsx +45 -24
- package/src/components/Select/Select.scss +12 -12
- package/src/components/Select/Select.stories.tsx +2 -0
- package/src/components/Select/Select.tsx +11 -5
- package/src/components/Select/components/Dropdown.scss +2 -0
- package/src/components/Select/components/Dropdown.tsx +19 -4
- package/src/components/Select/components/types.ts +4 -2
- package/src/components/StatusButton/StatusButton.tsx +26 -20
- package/src/components/Table/Table.scss +1 -3
- package/src/components/Table/Table.stories.tsx +1 -0
- package/src/components/Table/Table.tsx +7 -3
- package/src/components/ToggleSwitch/ToggleSwitch.scss +59 -0
- package/src/components/ToggleSwitch/ToggleSwitch.stories.tsx +52 -0
- package/src/components/ToggleSwitch/ToggleSwitch.tsx +30 -0
- package/src/components/ToggleSwitch/index.ts +1 -0
- package/src/hooks/useFileDropzone.tsx +1 -0
- package/src/index.ts +4 -2
- package/src/components/Excel/ContextMenu/ContextMenu.scss +0 -99
- 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
|
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:
|
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(--
|
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(--
|
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: -
|
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:
|
170
|
-
font-size:
|
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: -
|
192
|
+
top: -9px;
|
194
193
|
background-color: var(--input-label-bg-color);
|
195
194
|
padding: 0px 2px;
|
196
|
-
line-height:
|
197
|
-
font-size:
|
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 .
|
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(
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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-
|
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
|
-
|
52
|
-
margin: 2px;
|
54
|
+
overflow: hidden;
|
53
55
|
min-height: 32px;
|
54
|
-
min-width:
|
55
|
-
|
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:
|
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', '
|
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', '
|
36
|
+
options: ['top', 'down', 'left', 'right'],
|
66
37
|
},
|
67
|
-
defaultValue: '
|
38
|
+
defaultValue: 'down',
|
68
39
|
},
|
69
40
|
},
|
70
41
|
};
|
71
42
|
|
72
43
|
type Story = StoryObj<typeof MenuOption>;
|
73
44
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|
-
|
108
|
-
|
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
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
{
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
}
|
137
|
-
|
138
|
-
|
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
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
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
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
{
|
187
|
-
|
188
|
-
|
189
|
-
|
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;
|