pixel-react 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- 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/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 +99 -7
- package/lib/index.esm.js +789 -174
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +790 -173
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- 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/Button/Button.scss +4 -0
- package/src/components/Button/Button.stories.tsx +7 -0
- 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
@@ -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>
|
@@ -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,
|
@@ -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
|
}
|
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import Drawer from './Drawer';
|
3
3
|
import { useState } from 'react';
|
4
4
|
import Button from '../Button';
|
5
|
+
import Icon from '../Icon';
|
5
6
|
|
6
7
|
const meta: Meta<typeof Drawer> = {
|
7
8
|
title: 'Components/Drawer',
|
@@ -20,6 +21,7 @@ const defaultArgs = {
|
|
20
21
|
title: 'Drawer Title',
|
21
22
|
showEditButton: false,
|
22
23
|
_isExpanded: false,
|
24
|
+
showHeader: true,
|
23
25
|
onClose: () => {},
|
24
26
|
primaryButtonProps: {
|
25
27
|
label: 'Create',
|
@@ -49,12 +51,51 @@ const defaultArgs = {
|
|
49
51
|
overlay: false,
|
50
52
|
isFooterRequired: true,
|
51
53
|
footerContent: null,
|
54
|
+
backButtonIcon: <Icon name="error" height={16} width={16} />,
|
55
|
+
onCloseIconClick: () => alert('Close icon clicked!'),
|
52
56
|
};
|
53
57
|
|
54
58
|
export const Default: Story = {
|
55
59
|
args: {
|
56
60
|
...defaultArgs,
|
57
61
|
size: 'medium',
|
62
|
+
showHeader: true,
|
63
|
+
},
|
64
|
+
};
|
65
|
+
export const WithoutHeader: Story = {
|
66
|
+
args: {
|
67
|
+
...defaultArgs,
|
68
|
+
showHeader: false,
|
69
|
+
size: 'medium',
|
70
|
+
},
|
71
|
+
parameters: {
|
72
|
+
docs: { disable: true },
|
73
|
+
},
|
74
|
+
};
|
75
|
+
export const WithCustomHeader: Story = {
|
76
|
+
args: {
|
77
|
+
...defaultArgs,
|
78
|
+
customHeader: (
|
79
|
+
<div>
|
80
|
+
<h3>My Custom Header</h3>
|
81
|
+
</div>
|
82
|
+
),
|
83
|
+
},
|
84
|
+
parameters: {
|
85
|
+
docs: { disable: true },
|
86
|
+
},
|
87
|
+
};
|
88
|
+
export const WithCustomFooter: Story = {
|
89
|
+
args: {
|
90
|
+
...defaultArgs,
|
91
|
+
customFooter: (
|
92
|
+
<div>
|
93
|
+
<h3>My Custom Footer</h3>
|
94
|
+
</div>
|
95
|
+
),
|
96
|
+
},
|
97
|
+
parameters: {
|
98
|
+
docs: { disable: true },
|
58
99
|
},
|
59
100
|
};
|
60
101
|
|
@@ -25,6 +25,11 @@ const Drawer: FC<DrawerProps> = ({
|
|
25
25
|
_isExpanded = false,
|
26
26
|
isBackButtonVisible = false,
|
27
27
|
_isCloseModalButtonVisible = true,
|
28
|
+
showHeader = true,
|
29
|
+
backButtonIcon,
|
30
|
+
onCloseIconClick,
|
31
|
+
customHeader,
|
32
|
+
customFooter,
|
28
33
|
}: DrawerProps) => {
|
29
34
|
const [isExpanded, setIsExpanded] = useState(_isExpanded);
|
30
35
|
|
@@ -68,45 +73,69 @@ const Drawer: FC<DrawerProps> = ({
|
|
68
73
|
'ff-drawer--open': isOpen,
|
69
74
|
})}
|
70
75
|
>
|
71
|
-
|
72
|
-
<div className="ff-drawer-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
76
|
+
{showHeader && (
|
77
|
+
<div className="ff-drawer-header">
|
78
|
+
{customHeader ? (
|
79
|
+
customHeader
|
80
|
+
) : (
|
81
|
+
<div className="ff-drawer-action-section">
|
82
|
+
<div className="ff-action-button">
|
83
|
+
{showEditButton && (
|
84
|
+
<button
|
85
|
+
className="ff-expand-collapse-button"
|
86
|
+
onClick={onEdit}
|
87
|
+
>
|
88
|
+
<Icon name="logo" height={16} width={16} />
|
89
|
+
Edit
|
90
|
+
</button>
|
91
|
+
)}
|
92
|
+
{_isExpanded && (
|
93
|
+
<button
|
94
|
+
className="ff-expand-collapse-button"
|
95
|
+
onClick={toggleExpand}
|
96
|
+
>
|
97
|
+
<Icon
|
98
|
+
name={isExpanded ? 'logo' : 'logo'}
|
99
|
+
height={16}
|
100
|
+
width={16}
|
101
|
+
/>
|
102
|
+
</button>
|
103
|
+
)}
|
104
|
+
{isBackButtonVisible && (
|
105
|
+
<button
|
106
|
+
className="ff-expand-collapse-button"
|
107
|
+
onClick={onClose}
|
108
|
+
>
|
109
|
+
{backButtonIcon ? (
|
110
|
+
backButtonIcon
|
111
|
+
) : (
|
112
|
+
<Icon
|
113
|
+
name="error"
|
114
|
+
height={16}
|
115
|
+
width={16}
|
116
|
+
hoverEffect={false}
|
117
|
+
/>
|
118
|
+
)}
|
119
|
+
</button>
|
120
|
+
)}
|
121
|
+
{title && <div className="ff-drawer-title">{title}</div>}
|
122
|
+
</div>
|
123
|
+
{_isCloseModalButtonVisible && (
|
124
|
+
<div className="ff-close-icon">
|
125
|
+
<Icon
|
126
|
+
name="close"
|
127
|
+
hoverEffect={false}
|
128
|
+
onClick={onCloseIconClick || onClose}
|
129
|
+
height={6}
|
130
|
+
width={6}
|
131
|
+
color="var(--tabs-label-active-color)"
|
132
|
+
/>
|
133
|
+
</div>
|
134
|
+
)}
|
135
|
+
</div>
|
107
136
|
)}
|
108
137
|
</div>
|
109
|
-
|
138
|
+
)}
|
110
139
|
|
111
140
|
<div
|
112
141
|
className={classNames('ff-drawer-body', {
|
@@ -118,9 +147,7 @@ const Drawer: FC<DrawerProps> = ({
|
|
118
147
|
|
119
148
|
{isFooterRequired && (
|
120
149
|
<div className="ff-drawer-footer">
|
121
|
-
{footerContent
|
122
|
-
footerContent
|
123
|
-
) : (
|
150
|
+
{customFooter || footerContent || (
|
124
151
|
<>
|
125
152
|
<div className="button-container">
|
126
153
|
{leftSecondaryButtonProps.label && (
|
@@ -48,7 +48,7 @@ export interface DrawerProps {
|
|
48
48
|
/**
|
49
49
|
* Header title for the drawer
|
50
50
|
*/
|
51
|
-
title
|
51
|
+
title?: string | ReactNode;
|
52
52
|
/**
|
53
53
|
* To show the edit button on the header
|
54
54
|
*/
|
@@ -85,4 +85,28 @@ export interface DrawerProps {
|
|
85
85
|
* footer Content
|
86
86
|
*/
|
87
87
|
footerContent?: ReactNode;
|
88
|
+
/**
|
89
|
+
* To show or hide the header
|
90
|
+
*/
|
91
|
+
showHeader?: boolean;
|
92
|
+
/**
|
93
|
+
* Custom back button icon
|
94
|
+
* The icon to display for the back button.
|
95
|
+
* If not provided, a default icon will be used.
|
96
|
+
*/
|
97
|
+
backButtonIcon?: ReactNode;
|
98
|
+
/**
|
99
|
+
* Callback function when the close icon is clicked
|
100
|
+
*/
|
101
|
+
onCloseIconClick?: () => void;
|
102
|
+
/**
|
103
|
+
* Custom header for the drawer, replacing the default header.
|
104
|
+
* If provided, this will render in place of the default header.
|
105
|
+
*/
|
106
|
+
customHeader?: ReactNode;
|
107
|
+
/**
|
108
|
+
* Custom footer for the drawer, replacing the default footer.
|
109
|
+
* If provided, this will render in place of the default footer.
|
110
|
+
*/
|
111
|
+
customFooter?: ReactNode;
|
88
112
|
}
|
@@ -1,32 +1,39 @@
|
|
1
|
-
|
2
1
|
import React from 'react';
|
3
2
|
import './GridLayout.scss';
|
4
3
|
import { ContainerProps, RowProps, ColProps } from './types';
|
5
|
-
import cx from 'classnames'
|
4
|
+
import cx from 'classnames';
|
6
5
|
|
7
6
|
export const Container: React.FC<ContainerProps> = ({
|
8
7
|
children,
|
9
8
|
fluid = false,
|
10
9
|
gap = '0px',
|
11
|
-
className=''
|
10
|
+
className = '',
|
12
11
|
}) => {
|
13
12
|
const containerClassName = fluid ? 'ff-container-fluid' : 'ff-container';
|
14
13
|
return (
|
15
|
-
<div className={cx(containerClassName,className)} style={{ gap }}>
|
14
|
+
<div className={cx(containerClassName, className)} style={{ gap }}>
|
16
15
|
{children}
|
17
16
|
</div>
|
18
17
|
);
|
19
18
|
};
|
20
19
|
|
21
|
-
export const Row: React.FC<RowProps> = ({
|
20
|
+
export const Row: React.FC<RowProps> = ({
|
21
|
+
children,
|
22
|
+
gap = '0px',
|
23
|
+
className = '',
|
24
|
+
}) => {
|
22
25
|
return (
|
23
|
-
<div className={cx(
|
26
|
+
<div className={cx('ff-row', className)} style={{ gap }}>
|
24
27
|
{children}
|
25
28
|
</div>
|
26
29
|
);
|
27
30
|
};
|
28
31
|
|
29
|
-
export const Col: React.FC<ColProps> = ({
|
32
|
+
export const Col: React.FC<ColProps> = ({
|
33
|
+
children,
|
34
|
+
size = 12,
|
35
|
+
className = '',
|
36
|
+
}) => {
|
30
37
|
const colClassName = `ff-col-${size}`;
|
31
|
-
return <div className={cx(colClassName,className)}>{children}</div>;
|
38
|
+
return <div className={cx(colClassName, className)}>{children}</div>;
|
32
39
|
};
|
@@ -1,43 +1,49 @@
|
|
1
|
+
import { forwardRef } from 'react';
|
1
2
|
import classNames from 'classnames';
|
2
3
|
import Components from './iconList';
|
3
4
|
import './Icons.scss';
|
4
5
|
import { IconProps } from './types';
|
5
6
|
|
6
|
-
const Icon = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
const Icon = forwardRef<HTMLSpanElement, IconProps>(
|
8
|
+
(
|
9
|
+
{
|
10
|
+
name,
|
11
|
+
height,
|
12
|
+
width,
|
13
|
+
onClick = () => {},
|
14
|
+
color = 'var(--brand-color)', // Default color
|
15
|
+
hoverEffect = false,
|
16
|
+
className = '',
|
17
|
+
disabled = false,
|
18
|
+
...props
|
19
|
+
},
|
20
|
+
ref
|
21
|
+
) => {
|
22
|
+
const IconComponent = Components[name];
|
18
23
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
if (!IconComponent) {
|
23
|
-
return null;
|
24
|
-
}
|
24
|
+
const iconHeight = height || 16;
|
25
|
+
const iconWidth = width || 16;
|
25
26
|
|
27
|
+
if (!IconComponent) {
|
28
|
+
return null;
|
29
|
+
}
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
'ff-icon-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
31
|
+
return (
|
32
|
+
<span
|
33
|
+
ref={ref}
|
34
|
+
onClick={disabled ? () => {} : onClick}
|
35
|
+
style={{ height: `${iconHeight}px`, width: `${iconWidth}px` }}
|
36
|
+
className={classNames('ff-icon-container', {
|
37
|
+
'ff-icon-click': !!hoverEffect,
|
38
|
+
'ff-icon-disabled': disabled,
|
39
|
+
[className]: !!className,
|
40
|
+
})}
|
41
|
+
{...props}
|
42
|
+
>
|
43
|
+
<IconComponent height="100%" width="100%" style={{ color: color }} />
|
44
|
+
</span>
|
45
|
+
);
|
46
|
+
}
|
47
|
+
);
|
42
48
|
|
43
49
|
export default Icon;
|