pixel-react 1.1.3 → 1.1.5
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/AddButton/AddButton.d.ts +5 -0
- package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
- package/lib/components/AddButton/index.d.ts +1 -0
- package/lib/components/AddButton/types.d.ts +4 -0
- package/lib/components/AddResourceButton/type.d.ts +1 -1
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.d.ts +2 -1
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +1 -0
- package/lib/components/AllProjectsDropdown/types.d.ts +10 -0
- package/lib/components/AppHeader/types.d.ts +14 -10
- package/lib/components/Button/Button.stories.d.ts +1 -0
- package/lib/components/Button/types.d.ts +1 -1
- package/lib/components/Drawer/Drawer.stories.d.ts +3 -0
- package/lib/components/Drawer/Types.d.ts +25 -1
- package/lib/components/Icon/Icon.d.ts +1 -1
- package/lib/components/MachineInputField/MachineInputField.d.ts +4 -0
- package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
- package/lib/components/MachineInputField/index.d.ts +1 -0
- package/lib/components/MachineInputField/types.d.ts +11 -0
- package/lib/components/MenuOption/MenuOption.d.ts +1 -1
- package/lib/components/MenuOption/MenuOption.stories.d.ts +1 -0
- package/lib/components/MenuOption/types.d.ts +7 -0
- package/lib/components/Modal/types.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/types.d.ts +3 -0
- package/lib/components/SequentialConnectingBranch/components/Branches/Branches.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/Branches/types.d.ts +16 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/ConnectingBranches/types.d.ts +9 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/types.d.ts +3 -0
- package/lib/components/SequentialConnectingBranch/index.d.ts +1 -0
- package/lib/components/SequentialConnectingBranch/types.d.ts +32 -0
- package/lib/components/Tabs/types.d.ts +1 -0
- package/lib/index.d.ts +113 -17
- package/lib/index.esm.js +1244 -312
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1245 -311
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +2 -8
- package/src/assets/Themes/BaseTheme.scss +18 -2
- package/src/assets/Themes/DarkTheme.scss +11 -3
- package/src/assets/icons/add_locator.svg +5 -0
- package/src/assets/icons/android.svg +9 -0
- package/src/assets/icons/browser_stack.svg +9 -0
- package/src/assets/icons/chrome.svg +12 -0
- package/src/assets/icons/dataset_list.svg +3 -0
- package/src/assets/icons/drag_icon.svg +5 -0
- package/src/assets/icons/label_plus.svg +3 -0
- package/src/assets/icons/mac.svg +9 -0
- package/src/assets/icons/manual_locator.svg +8 -0
- package/src/assets/icons/windows.svg +6 -0
- package/src/assets/styles/_colors.scss +4 -4
- package/src/components/AddResourceButton/type.ts +1 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +2 -2
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.stories.tsx +99 -1
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.tsx +30 -56
- package/src/components/AllProjectsDropdown/types.ts +10 -0
- package/src/components/AppHeader/AppHeader.stories.tsx +20 -10
- package/src/components/AppHeader/AppHeader.tsx +24 -17
- package/src/components/AppHeader/types.ts +17 -13
- package/src/components/Button/Button.scss +4 -0
- package/src/components/Button/Button.stories.tsx +7 -0
- package/src/components/Button/index.ts +1 -1
- package/src/components/Button/types.ts +2 -2
- package/src/components/Drawer/Drawer.scss +22 -11
- package/src/components/Drawer/Drawer.stories.tsx +41 -0
- package/src/components/Drawer/Drawer.tsx +67 -40
- package/src/components/Drawer/Types.ts +25 -1
- package/src/components/GridLayout/GridLayout.scss +0 -2
- package/src/components/GridLayout/GridLayout.tsx +15 -8
- package/src/components/Icon/Icon.tsx +39 -33
- package/src/components/Icon/iconList.ts +25 -6
- package/src/components/InputWithDropdown/InputWithDropdown.scss +1 -1
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +2 -1
- package/src/components/MachineInputField/MachineInputField.scss +44 -0
- package/src/components/MachineInputField/MachineInputField.stories.tsx +32 -0
- package/src/components/MachineInputField/MachineInputField.tsx +71 -0
- package/src/components/MachineInputField/index.ts +1 -0
- package/src/components/MachineInputField/types.ts +12 -0
- package/src/components/MenuOption/MenuOption.scss +14 -0
- package/src/components/MenuOption/MenuOption.stories.tsx +21 -0
- package/src/components/MenuOption/MenuOption.tsx +5 -3
- package/src/components/MenuOption/types.ts +9 -0
- package/src/components/MiniModal/MiniModal.tsx +1 -1
- package/src/components/Modal/Modal.tsx +2 -0
- package/src/components/Modal/modal.scss +2 -2
- package/src/components/Modal/types.ts +1 -0
- package/src/components/Select/Select.tsx +2 -2
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.scss +117 -0
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.tsx +62 -0
- package/src/components/SequentialConnectingBranch/SequentialConnectingBranch.tsx +210 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.scss +51 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.tsx +107 -0
- package/src/components/SequentialConnectingBranch/components/AddBrowserModal/types.ts +5 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.scss +184 -0
- package/src/components/SequentialConnectingBranch/components/Branches/Branches.tsx +203 -0
- package/src/components/SequentialConnectingBranch/components/Branches/types.ts +18 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.scss +3 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/ConnectingBranches.tsx +66 -0
- package/src/components/SequentialConnectingBranch/components/ConnectingBranches/types.ts +10 -0
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.scss +31 -0
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.tsx +85 -0
- package/src/components/SequentialConnectingBranch/components/DatasetListModal/types.ts +4 -0
- package/src/components/SequentialConnectingBranch/index.ts +1 -0
- package/src/components/SequentialConnectingBranch/types.ts +42 -0
- package/src/components/Tabs/Tabs.stories.tsx +24 -25
- package/src/components/Tabs/Tabs.tsx +3 -10
- package/src/components/Tabs/types.ts +7 -1
- package/src/index.ts +5 -0
- package/lib/index.css +0 -404
- package/lib/index.esm.css +0 -404
@@ -1,5 +1,7 @@
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
2
2
|
import AllProjectsDropdown from './AllProjectsDropdown';
|
3
|
+
import { useState } from 'react';
|
4
|
+
import { optionsType } from './types';
|
3
5
|
|
4
6
|
const meta: Meta<typeof AllProjectsDropdown> = {
|
5
7
|
title: 'Components/AllProjectsDropdown',
|
@@ -12,9 +14,105 @@ const meta: Meta<typeof AllProjectsDropdown> = {
|
|
12
14
|
|
13
15
|
type Story = StoryObj<typeof AllProjectsDropdown>;
|
14
16
|
|
17
|
+
export const Default: Story = {
|
18
|
+
args: {
|
19
|
+
options: [
|
20
|
+
{
|
21
|
+
label: 'All Projects',
|
22
|
+
value: 'All Projects',
|
23
|
+
iconName: 'all_projects',
|
24
|
+
},
|
25
|
+
{
|
26
|
+
label: 'Pantaloon Project',
|
27
|
+
value: 'Pantaloon Web Project',
|
28
|
+
iconName: 'web_icon',
|
29
|
+
},
|
30
|
+
{
|
31
|
+
label: 'Mobile Project',
|
32
|
+
value: 'Mobile Project',
|
33
|
+
iconName: 'mobile_icon',
|
34
|
+
},
|
35
|
+
{
|
36
|
+
label: 'Web & Mobile Project',
|
37
|
+
value: 'Web & Mobile Project',
|
38
|
+
iconName: 'web&mobile_icon',
|
39
|
+
},
|
40
|
+
{
|
41
|
+
label: 'Sales Force',
|
42
|
+
value: 'Sales Force',
|
43
|
+
iconName: 'sales_force',
|
44
|
+
},
|
45
|
+
{
|
46
|
+
label: 'MS Dynamic',
|
47
|
+
value: 'MS Dynamic',
|
48
|
+
iconName: 'ms_dynamic',
|
49
|
+
},
|
50
|
+
{
|
51
|
+
label: 'Web Service',
|
52
|
+
value: 'Web Service',
|
53
|
+
iconName: '',
|
54
|
+
},
|
55
|
+
],
|
56
|
+
},
|
57
|
+
};
|
58
|
+
|
15
59
|
export const PrimaryIconButton: Story = {
|
16
60
|
render: () => {
|
17
|
-
|
61
|
+
const [selectedOption, setSelectedOption] = useState({
|
62
|
+
label: 'All Projects',
|
63
|
+
value: 'All Projects',
|
64
|
+
iconName: 'all_projects',
|
65
|
+
});
|
66
|
+
|
67
|
+
const handleSelectedOption = (option: optionsType) => {
|
68
|
+
setSelectedOption(option);
|
69
|
+
};
|
70
|
+
|
71
|
+
const options = [
|
72
|
+
{
|
73
|
+
label: 'All Projects',
|
74
|
+
value: 'All Projects',
|
75
|
+
iconName: 'all_projects',
|
76
|
+
},
|
77
|
+
{
|
78
|
+
label: 'Pantaloon Project',
|
79
|
+
value: 'Pantaloon Web Project',
|
80
|
+
iconName: 'web_icon',
|
81
|
+
},
|
82
|
+
{
|
83
|
+
label: 'Mobile Project',
|
84
|
+
value: 'Mobile Project',
|
85
|
+
iconName: 'mobile_icon',
|
86
|
+
},
|
87
|
+
{
|
88
|
+
label: 'Web & Mobile Project',
|
89
|
+
value: 'Web & Mobile Project',
|
90
|
+
iconName: 'web&mobile_icon',
|
91
|
+
},
|
92
|
+
{
|
93
|
+
label: 'Sales Force',
|
94
|
+
value: 'Sales Force',
|
95
|
+
iconName: 'sales_force',
|
96
|
+
},
|
97
|
+
{
|
98
|
+
label: 'MS Dynamic',
|
99
|
+
value: 'MS Dynamic',
|
100
|
+
iconName: 'ms_dynamic',
|
101
|
+
},
|
102
|
+
{
|
103
|
+
label: 'Web Service',
|
104
|
+
value: 'Web Service',
|
105
|
+
iconName: '',
|
106
|
+
},
|
107
|
+
];
|
108
|
+
|
109
|
+
return (
|
110
|
+
<AllProjectsDropdown
|
111
|
+
options={options}
|
112
|
+
onClick={handleSelectedOption}
|
113
|
+
selectedOption={selectedOption}
|
114
|
+
/>
|
115
|
+
);
|
18
116
|
},
|
19
117
|
};
|
20
118
|
|
@@ -1,79 +1,49 @@
|
|
1
1
|
import { useState } from 'react';
|
2
2
|
import Icon from '../Icon';
|
3
3
|
import Typography from '../Typography';
|
4
|
-
import { ffid } from '../../utils/ffID/ffid';
|
5
4
|
import { truncateText } from '../../utils/truncateText/truncateText';
|
6
5
|
import './AllProjectsDropdown.scss';
|
7
6
|
import classNames from 'classnames';
|
7
|
+
import { AllProjectsDropdownProps, optionsType } from './types';
|
8
8
|
|
9
|
-
const AllProjectsDropdown = (
|
10
|
-
|
11
|
-
|
9
|
+
const AllProjectsDropdown = ({
|
10
|
+
onClick = () => {},
|
11
|
+
options,
|
12
|
+
selectedOption = {
|
12
13
|
label: 'All Projects',
|
13
14
|
value: 'All Projects',
|
14
15
|
iconName: 'all_projects',
|
15
|
-
}
|
16
|
+
},
|
17
|
+
}: AllProjectsDropdownProps) => {
|
18
|
+
const [showOptions, setShowOptions] = useState(false);
|
19
|
+
const [selectedOptions, setSelectedOptions] = useState(selectedOption);
|
16
20
|
const [search, setSearch] = useState(true);
|
17
21
|
|
18
|
-
|
19
|
-
{
|
20
|
-
label: 'All Projects',
|
21
|
-
value: 'All Projects',
|
22
|
-
iconName: 'all_projects',
|
23
|
-
},
|
24
|
-
{
|
25
|
-
label: 'Pantaloon Project',
|
26
|
-
value: 'Pantaloon Web Project',
|
27
|
-
iconName: 'web_icon',
|
28
|
-
},
|
29
|
-
{
|
30
|
-
label: 'Mobile Project',
|
31
|
-
value: 'Mobile Project',
|
32
|
-
iconName: 'mobile_icon',
|
33
|
-
},
|
34
|
-
{
|
35
|
-
label: 'Web & Mobile Project',
|
36
|
-
value: 'Web & Mobile Project',
|
37
|
-
iconName: 'web&mobile_icon',
|
38
|
-
},
|
39
|
-
{
|
40
|
-
label: 'Sales Force',
|
41
|
-
value: 'Sales Force',
|
42
|
-
iconName: 'sales_force',
|
43
|
-
},
|
44
|
-
{
|
45
|
-
label: 'MS Dynamic',
|
46
|
-
value: 'MS Dynamic',
|
47
|
-
iconName: 'ms_dynamic',
|
48
|
-
},
|
49
|
-
{
|
50
|
-
label: 'Web Service',
|
51
|
-
value: 'Web Service',
|
52
|
-
iconName: '',
|
53
|
-
},
|
54
|
-
];
|
55
|
-
|
56
|
-
const handleSelect = () => {
|
22
|
+
const handleShowOption = () => {
|
57
23
|
setShowOptions(!showOptions);
|
58
24
|
};
|
59
25
|
|
60
|
-
const handleSelectOption = (option: {
|
61
|
-
label: string;
|
62
|
-
value: string;
|
63
|
-
iconName: string;
|
64
|
-
}) => {
|
26
|
+
const handleSelectOption = (option: optionsType) => {
|
65
27
|
setSelectedOptions(option);
|
66
28
|
setShowOptions(false);
|
29
|
+
() => onClick(option);
|
67
30
|
};
|
68
31
|
|
69
32
|
const handleInput = () => {
|
70
33
|
setSearch(false);
|
71
34
|
};
|
72
35
|
|
36
|
+
const handleSearchEnter = () => {
|
37
|
+
setSearch(false);
|
38
|
+
};
|
39
|
+
const handleSearchLeave = () => {
|
40
|
+
setSearch(true);
|
41
|
+
};
|
42
|
+
|
73
43
|
return (
|
74
44
|
<div className={classNames('ff-all-project')}>
|
75
45
|
<div
|
76
|
-
onClick={
|
46
|
+
onClick={handleShowOption}
|
77
47
|
className={classNames('ff-all-project-dropdown')}
|
78
48
|
>
|
79
49
|
<Typography
|
@@ -83,7 +53,7 @@ const AllProjectsDropdown = () => {
|
|
83
53
|
fontWeight={'regular'}
|
84
54
|
className={classNames('projects-label')}
|
85
55
|
>
|
86
|
-
{truncateText(selectedOptions
|
56
|
+
{truncateText(selectedOptions?.label, 12)}
|
87
57
|
</Typography>
|
88
58
|
<div className={classNames('label-icon')}>
|
89
59
|
<Icon
|
@@ -96,11 +66,15 @@ const AllProjectsDropdown = () => {
|
|
96
66
|
</div>
|
97
67
|
{showOptions && (
|
98
68
|
<div className={classNames('ff-dropdown')}>
|
99
|
-
<div
|
69
|
+
<div
|
70
|
+
className={classNames('ff-search')}
|
71
|
+
onMouseEnter={() => handleSearchEnter()}
|
72
|
+
onMouseLeave={() => handleSearchLeave()}
|
73
|
+
>
|
100
74
|
{search && <Icon name="search" height={8} width={8} />}
|
101
75
|
<input
|
102
76
|
type="text"
|
103
|
-
placeholder=
|
77
|
+
placeholder={`${search ? 'Search Project' : ''}`}
|
104
78
|
onClick={() => handleInput()}
|
105
79
|
/>
|
106
80
|
</div>
|
@@ -110,9 +84,9 @@ const AllProjectsDropdown = () => {
|
|
110
84
|
`${options.length > 4 ? 'scroll' : ''}`
|
111
85
|
)}
|
112
86
|
>
|
113
|
-
{options.map((option) => (
|
87
|
+
{options.map((option, index) => (
|
114
88
|
<div
|
115
|
-
key={
|
89
|
+
key={index}
|
116
90
|
onClick={() => handleSelectOption(option)}
|
117
91
|
className={classNames(
|
118
92
|
'projects-options',
|
@@ -133,7 +107,7 @@ const AllProjectsDropdown = () => {
|
|
133
107
|
}
|
134
108
|
/>
|
135
109
|
</div>
|
136
|
-
<Typography key={
|
110
|
+
<Typography key={index} as={'div'} lineHeight={'30px'}>
|
137
111
|
{option.label}
|
138
112
|
</Typography>
|
139
113
|
</div>
|
@@ -1,5 +1,10 @@
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
2
2
|
import AppHeader from './AppHeader';
|
3
|
+
import {
|
4
|
+
appHeaderMenuItemProps,
|
5
|
+
appHeaderSubMenuItemProps,
|
6
|
+
appHeaderQuickMenuItemProps,
|
7
|
+
} from './types';
|
3
8
|
import Icon from '../Icon';
|
4
9
|
import { useState } from 'react';
|
5
10
|
|
@@ -23,22 +28,23 @@ const defaultArgs = {
|
|
23
28
|
};
|
24
29
|
|
25
30
|
const headerMenuItems = [
|
31
|
+
{ menuLabel: 'Dashboard', menuName: 'Dashboard', subMenuItems: [] },
|
26
32
|
{
|
27
|
-
|
28
|
-
subMenuItems: [],
|
29
|
-
},
|
30
|
-
{
|
33
|
+
menuLabel: 'Repo',
|
31
34
|
menuName: 'Repo',
|
32
35
|
subMenuItems: [
|
33
36
|
{
|
37
|
+
subMenuLabel: 'Elements',
|
34
38
|
subMenuName: 'Elements',
|
35
39
|
quickMenuItems: [],
|
36
40
|
},
|
37
41
|
{
|
42
|
+
subMenuLabel: 'Program Elements',
|
38
43
|
subMenuName: 'Program Elements',
|
39
44
|
quickMenuItems: [],
|
40
45
|
},
|
41
46
|
{
|
47
|
+
subMenuLabel: 'Step Groups',
|
42
48
|
subMenuName: 'Step Groups',
|
43
49
|
quickMenuItems: [
|
44
50
|
{
|
@@ -58,13 +64,16 @@ const headerMenuItems = [
|
|
58
64
|
],
|
59
65
|
},
|
60
66
|
{
|
67
|
+
menuLabel: 'Test Data',
|
61
68
|
menuName: 'Test Data',
|
62
69
|
subMenuItems: [],
|
63
70
|
},
|
64
71
|
{
|
72
|
+
menuLabel: 'Test Dev',
|
65
73
|
menuName: 'Test Dev',
|
66
74
|
subMenuItems: [
|
67
75
|
{
|
76
|
+
subMenuLabel: 'Scripts',
|
68
77
|
subMenuName: 'Scripts',
|
69
78
|
quickMenuItems: [
|
70
79
|
{
|
@@ -90,6 +99,7 @@ const headerMenuItems = [
|
|
90
99
|
],
|
91
100
|
},
|
92
101
|
{
|
102
|
+
subMenuLabel: 'Executions',
|
93
103
|
subMenuName: 'Executions',
|
94
104
|
quickMenuItems: [],
|
95
105
|
},
|
@@ -121,14 +131,14 @@ export const Controlled: Story = {
|
|
121
131
|
const [selectedMenuItem, setSelectedMenuItem] = useState('Test Data');
|
122
132
|
const [selectedSubMenuItem, setSelectedSubMenuItem] = useState('');
|
123
133
|
const [selectedQuickMenuItem, setSelectedQuickMenuItem] = useState('');
|
124
|
-
const handleMenuClick = (item:
|
125
|
-
setSelectedMenuItem(item);
|
134
|
+
const handleMenuClick = (item: appHeaderMenuItemProps) => {
|
135
|
+
setSelectedMenuItem(item.menuLabel);
|
126
136
|
};
|
127
|
-
const handleSubMenuClick = (item:
|
128
|
-
setSelectedSubMenuItem(item);
|
137
|
+
const handleSubMenuClick = (item: appHeaderSubMenuItemProps) => {
|
138
|
+
setSelectedSubMenuItem(item.subMenuLabel);
|
129
139
|
};
|
130
|
-
const handleQuickMenuClick = (item:
|
131
|
-
setSelectedQuickMenuItem(item);
|
140
|
+
const handleQuickMenuClick = (item: appHeaderQuickMenuItemProps) => {
|
141
|
+
setSelectedQuickMenuItem(item.quickMenuIconName);
|
132
142
|
};
|
133
143
|
|
134
144
|
return (
|
@@ -3,10 +3,14 @@ import Icon from '../Icon';
|
|
3
3
|
import './AppHeader.scss';
|
4
4
|
import classNames from 'classnames';
|
5
5
|
import Typography from '../Typography';
|
6
|
+
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
7
|
+
// import AllProjectsDropdown from '../AllProjectsDropdown';
|
6
8
|
|
7
9
|
const AppHeader: React.FC<AppHeaderProps> = ({
|
8
10
|
logoIconName = 'fireflink_icon',
|
11
|
+
leftContent,
|
9
12
|
rightContent,
|
13
|
+
projectsList,
|
10
14
|
appHeaderMenuItems,
|
11
15
|
selectedMenu,
|
12
16
|
selectedSubMenu,
|
@@ -21,35 +25,38 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
21
25
|
<div className="ff-app-header-logo-icon">
|
22
26
|
<Icon color="" name={logoIconName} height={24} width={21} />
|
23
27
|
</div>
|
28
|
+
{leftContent && (
|
29
|
+
<div className="ff-app-header-left-content">{leftContent}</div>
|
30
|
+
)}
|
24
31
|
<div className="ff-app-header-nav-bar">
|
25
|
-
|
32
|
+
{checkEmpty(projectsList) && (
|
33
|
+
<div>{/* <AllProjectsDropdown /> */}</div>
|
34
|
+
)}
|
26
35
|
<div className="ff-app-header-nav-bar-items fontSm">
|
27
36
|
{appHeaderMenuItems.map((menuItem) => {
|
28
37
|
return (
|
29
38
|
<div
|
30
39
|
className={classNames('ff-app-header-nav-bar-item', {
|
31
40
|
['ff-app-header-nav-bar-item--selected']:
|
32
|
-
menuItem.
|
41
|
+
menuItem.menuLabel === selectedMenu,
|
33
42
|
})}
|
34
|
-
key={menuItem.
|
35
|
-
onClick={() => onMenuClick(menuItem
|
43
|
+
key={menuItem.menuLabel}
|
44
|
+
onClick={() => onMenuClick(menuItem)}
|
36
45
|
>
|
37
46
|
<Typography
|
38
47
|
as="div"
|
39
48
|
className="ff-app-header-nav-bar-item-label"
|
40
49
|
lineHeight="18px"
|
41
50
|
>
|
42
|
-
{menuItem.
|
51
|
+
{menuItem.menuLabel}
|
43
52
|
</Typography>
|
44
|
-
{menuItem.
|
53
|
+
{menuItem.menuLabel === selectedMenu &&
|
45
54
|
menuItem?.subMenuItems &&
|
46
55
|
menuItem.subMenuItems.map((subMenuItem) => {
|
47
56
|
return (
|
48
57
|
<div
|
49
|
-
key={subMenuItem.
|
50
|
-
onClick={() =>
|
51
|
-
onSubMenuClick(subMenuItem.subMenuName)
|
52
|
-
}
|
58
|
+
key={subMenuItem.subMenuLabel}
|
59
|
+
onClick={() => onSubMenuClick(subMenuItem)}
|
53
60
|
className="ff-app-header-submenu-container"
|
54
61
|
>
|
55
62
|
<Typography
|
@@ -58,14 +65,14 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
58
65
|
'ff-app-header-nav-bar-submenu-item',
|
59
66
|
{
|
60
67
|
['ff-app-header-nav-bar-submenu-item--selected']:
|
61
|
-
subMenuItem.
|
68
|
+
subMenuItem.subMenuLabel === selectedSubMenu,
|
62
69
|
}
|
63
70
|
)}
|
64
71
|
lineHeight="18px"
|
65
72
|
>
|
66
|
-
{subMenuItem.
|
73
|
+
{subMenuItem.subMenuLabel}
|
67
74
|
</Typography>
|
68
|
-
{subMenuItem.
|
75
|
+
{subMenuItem.subMenuLabel === selectedSubMenu &&
|
69
76
|
subMenuItem?.quickMenuItems && (
|
70
77
|
<div className="ff-app-header-quickmenu-container">
|
71
78
|
<div>
|
@@ -78,9 +85,7 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
78
85
|
<div
|
79
86
|
key={quickMenuItem.quickMenuIconName}
|
80
87
|
onClick={() =>
|
81
|
-
onQuickMenuClick(
|
82
|
-
quickMenuItem.quickMenuName
|
83
|
-
)
|
88
|
+
onQuickMenuClick(quickMenuItem)
|
84
89
|
}
|
85
90
|
className={classNames(
|
86
91
|
'ff-app-header-nav-bar-quickmenu-item',
|
@@ -116,7 +121,9 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
116
121
|
<Icon name="more" className="ff-app-header-more-icon" />
|
117
122
|
</div>
|
118
123
|
</div>
|
119
|
-
|
124
|
+
{rightContent && (
|
125
|
+
<div className="ff-app-header-right-content">{rightContent}</div>
|
126
|
+
)}
|
120
127
|
</div>
|
121
128
|
</>
|
122
129
|
);
|
@@ -2,26 +2,30 @@ import { ReactNode } from 'react';
|
|
2
2
|
|
3
3
|
export interface AppHeaderProps {
|
4
4
|
logoIconName: string;
|
5
|
-
|
6
|
-
|
5
|
+
leftContent?: ReactNode;
|
6
|
+
rightContent?: ReactNode;
|
7
|
+
projectsList?: string[];
|
7
8
|
appHeaderMenuItems: appHeaderMenuItemProps[];
|
8
|
-
appHeaderHiddenMenuItems
|
9
|
+
appHeaderHiddenMenuItems?: string[];
|
9
10
|
selectedMenu: string;
|
10
|
-
selectedSubMenu
|
11
|
-
selectedQuickMenu
|
12
|
-
onMenuClick
|
13
|
-
onSubMenuClick
|
14
|
-
onQuickMenuClick
|
11
|
+
selectedSubMenu?: string;
|
12
|
+
selectedQuickMenu?: string;
|
13
|
+
onMenuClick?: (text: any) => void;
|
14
|
+
onSubMenuClick?: (text: any) => void;
|
15
|
+
onQuickMenuClick?: (text: any) => void;
|
15
16
|
}
|
16
17
|
export interface appHeaderMenuItemProps {
|
17
|
-
|
18
|
-
|
18
|
+
menuLabel: string;
|
19
|
+
menuName?: string;
|
20
|
+
subMenuItems?: appHeaderSubMenuItemProps[];
|
19
21
|
}
|
20
22
|
export interface appHeaderSubMenuItemProps {
|
21
|
-
|
22
|
-
|
23
|
+
subMenuLabel: string;
|
24
|
+
subMenuName?: string;
|
25
|
+
quickMenuItems?: appHeaderQuickMenuItemProps[];
|
23
26
|
}
|
24
27
|
export interface appHeaderQuickMenuItemProps {
|
25
|
-
|
28
|
+
quickMenuLabel?: string;
|
29
|
+
quickMenuName?: string;
|
26
30
|
quickMenuIconName: string;
|
27
31
|
}
|
@@ -45,6 +45,13 @@ export const Delete: Story = {
|
|
45
45
|
variant: 'delete',
|
46
46
|
},
|
47
47
|
};
|
48
|
+
export const Warning: Story = {
|
49
|
+
args: {
|
50
|
+
...defaultArgs,
|
51
|
+
label: 'Warning',
|
52
|
+
variant: 'warning',
|
53
|
+
},
|
54
|
+
};
|
48
55
|
export const PrimaryWithIcon: Story = {
|
49
56
|
args: {
|
50
57
|
...defaultArgs,
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from './Button';
|
1
|
+
export { default } from './Button';
|
@@ -4,7 +4,7 @@ export interface ButtonProps {
|
|
4
4
|
/**
|
5
5
|
* Variant of the button
|
6
6
|
*/
|
7
|
-
variant: 'primary' | 'secondary' | 'tertiary' | 'delete';
|
7
|
+
variant: 'primary' | 'secondary' | 'tertiary' | 'delete'| 'warning';
|
8
8
|
/**
|
9
9
|
* What background color to use
|
10
10
|
*/
|
@@ -61,5 +61,5 @@ export interface ButtonProps {
|
|
61
61
|
* Give icon name availble in storybook that to be on left side of button
|
62
62
|
*/
|
63
63
|
iconPosition?: 'left' | 'right';
|
64
|
-
transparentBackground?:boolean;
|
64
|
+
transparentBackground?: boolean;
|
65
65
|
}
|
@@ -9,10 +9,9 @@
|
|
9
9
|
}
|
10
10
|
|
11
11
|
.ff-drawer {
|
12
|
-
height: 100vh;
|
13
12
|
position: fixed;
|
14
13
|
right: 0;
|
15
|
-
top:
|
14
|
+
top: 80px;
|
16
15
|
bottom: 0;
|
17
16
|
min-width: 450px;
|
18
17
|
background-color: var(--primary-button-text-color);
|
@@ -42,14 +41,14 @@
|
|
42
41
|
&--x-large {
|
43
42
|
transition: all 0.4s ease-in-out;
|
44
43
|
border-radius: 5px;
|
45
|
-
border:
|
44
|
+
border: 1px solid var(--border-color);
|
46
45
|
}
|
47
46
|
|
48
47
|
.ff-drawer-header {
|
49
|
-
padding:
|
48
|
+
padding: 4px 8px 4px 8px;
|
50
49
|
display: flex;
|
51
50
|
gap: 10px;
|
52
|
-
border-bottom:
|
51
|
+
border-bottom: 1px solid var(--border-color);
|
53
52
|
|
54
53
|
.ff-drawer-title {
|
55
54
|
@extend .fontSm;
|
@@ -59,6 +58,15 @@
|
|
59
58
|
align-items: center;
|
60
59
|
gap: 12px;
|
61
60
|
}
|
61
|
+
.ff-close-icon {
|
62
|
+
height: 16px;
|
63
|
+
width: 16px;
|
64
|
+
background-color: var(--button-bg-color);
|
65
|
+
border-radius: 4px;
|
66
|
+
display: flex;
|
67
|
+
align-items: center;
|
68
|
+
justify-content: center;
|
69
|
+
}
|
62
70
|
|
63
71
|
.ff-drawer-action-section {
|
64
72
|
width: 100%;
|
@@ -66,14 +74,17 @@
|
|
66
74
|
align-items: center;
|
67
75
|
justify-content: space-between;
|
68
76
|
gap: 12px;
|
77
|
+
height: 24px;
|
69
78
|
|
70
79
|
.ff-action-button {
|
71
80
|
display: flex;
|
72
81
|
align-items: center;
|
73
|
-
gap:
|
82
|
+
gap: 5px;
|
74
83
|
|
75
84
|
.ff-expand-collapse-button {
|
76
85
|
cursor: pointer;
|
86
|
+
height: 24px;
|
87
|
+
width: 24px;
|
77
88
|
background-color: var(--button-bg-color);
|
78
89
|
outline: none;
|
79
90
|
border: none;
|
@@ -82,8 +93,7 @@
|
|
82
93
|
display: flex;
|
83
94
|
align-items: center;
|
84
95
|
justify-content: center;
|
85
|
-
border-radius:
|
86
|
-
padding: 6px;
|
96
|
+
border-radius: 8px;
|
87
97
|
}
|
88
98
|
}
|
89
99
|
}
|
@@ -100,19 +110,20 @@
|
|
100
110
|
}
|
101
111
|
|
102
112
|
.ff-drawer-footer {
|
113
|
+
height: 24px;
|
103
114
|
position: absolute;
|
104
115
|
bottom: 0;
|
105
116
|
left: 0;
|
106
117
|
right: 0;
|
107
|
-
padding:
|
118
|
+
padding: 4px 8px 4px 8px;
|
108
119
|
display: flex;
|
109
120
|
justify-content: space-between;
|
110
|
-
border-top:
|
121
|
+
border-top: 1px solid var(--drawer-footer-border);
|
111
122
|
|
112
123
|
.button-container {
|
113
124
|
display: flex;
|
114
125
|
justify-content: flex-end;
|
115
|
-
gap:
|
126
|
+
gap: 10px;
|
116
127
|
}
|
117
128
|
}
|
118
129
|
}
|