pixel-react 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -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;
|
|
@@ -38,7 +38,7 @@ import ViewIcon from '../../assets/icons/view_icon.svg?react';
|
|
|
38
38
|
import ExportCollection from '../../assets/icons/export_collection_icon.svg?react';
|
|
39
39
|
import RunIcon from '../../assets/icons/run_icon.svg?react';
|
|
40
40
|
import AddVariable from '../../assets/icons/add_variable_icon.svg?react';
|
|
41
|
-
|
|
41
|
+
import ManualLocator from '../../assets/icons/manual_locator.svg?react';
|
|
42
42
|
import LicenseIcon from '../../assets/icons/active_license_icon.svg?react';
|
|
43
43
|
import DeleteIcon from '../../assets/icons/delete.svg?react';
|
|
44
44
|
import DetailsIcon from '../../assets/icons/details.svg?react';
|
|
@@ -54,6 +54,14 @@ import DownloadFile from '../../assets/icons/download-icon.svg?react';
|
|
|
54
54
|
import RefreshIcon from '../../assets/icons/refresh-icon.svg?react';
|
|
55
55
|
import LicenseInfo from '../../assets/icons/license_info.svg?react';
|
|
56
56
|
import LicenseWarning from '../../assets/icons/license_warning.svg?react';
|
|
57
|
+
import Windows from '../../assets/icons/windows.svg?react';
|
|
58
|
+
import DataListIcon from '../../assets/icons/dataset_list.svg?react';
|
|
59
|
+
import Mac from '../../assets/icons/mac.svg?react';
|
|
60
|
+
import Android from '../../assets/icons/android.svg?react';
|
|
61
|
+
import Chrome from '../../assets/icons/chrome.svg?react';
|
|
62
|
+
import BrowserStack from '../../assets/icons/browser_stack.svg?react';
|
|
63
|
+
import Run from '../../assets/icons/run_icon.svg?react';
|
|
64
|
+
|
|
57
65
|
import DownloadIcon from '../../assets/icons/download_icon.svg?react';
|
|
58
66
|
import WebIcon from '../../assets/icons/web_icon.svg?react';
|
|
59
67
|
import WebMobileIcon from '../../assets/icons/web&mobile_icon.svg?react';
|
|
@@ -62,12 +70,13 @@ import SalesForceIcon from '../../assets/icons/sales_force.svg?react';
|
|
|
62
70
|
import MSDynamicIcon from '../../assets/icons/ms_dynamic.svg?react';
|
|
63
71
|
import AllProjectsIcon from '../../assets/icons/all_projects.svg?react';
|
|
64
72
|
import AndroidIcon from '../../assets/icons/android_icon.svg?react';
|
|
65
|
-
|
|
73
|
+
import AddLocator from '../../assets/icons/add_locator.svg?react';
|
|
66
74
|
import SwitchLicenseIcon from '../../assets/icons/switch_license_icon.svg?react';
|
|
67
75
|
import FireflinkLogo from '../../assets/icons/fireflink_logo.svg?react';
|
|
68
|
-
import WSWBDeleteIcon from '../../assets/icons/wswb_delete_icon.svg?react'
|
|
69
|
-
import WSWBPlusIcon from '../../assets/icons/wswb_plus_icon.svg?react'
|
|
70
|
-
|
|
76
|
+
import WSWBDeleteIcon from '../../assets/icons/wswb_delete_icon.svg?react';
|
|
77
|
+
import WSWBPlusIcon from '../../assets/icons/wswb_plus_icon.svg?react';
|
|
78
|
+
import LabelPlusIcon from '../../assets/icons/label_plus.svg?react';
|
|
79
|
+
import Drag from '../../assets/icons/drag_icon.svg?react';
|
|
71
80
|
|
|
72
81
|
//icons
|
|
73
82
|
Components['delete_info'] = DeleteInfoIcon;
|
|
@@ -131,10 +140,20 @@ Components['sales_force'] = SalesForceIcon;
|
|
|
131
140
|
Components['ms_dynamic'] = MSDynamicIcon;
|
|
132
141
|
Components['all_projects'] = AllProjectsIcon;
|
|
133
142
|
Components['android_icon'] = AndroidIcon;
|
|
134
|
-
|
|
143
|
+
Components['label_plus'] = LabelPlusIcon;
|
|
144
|
+
Components['manual_locator'] = ManualLocator;
|
|
135
145
|
Components['select_license'] = SwitchLicenseIcon;
|
|
136
146
|
Components['fireflink-logo'] = FireflinkLogo;
|
|
137
147
|
Components['wswb_delete_icon'] = WSWBDeleteIcon;
|
|
138
148
|
Components['wswb_plus_icon'] = WSWBPlusIcon;
|
|
149
|
+
Components['add_locator'] = AddLocator;
|
|
150
|
+
Components['drag'] = Drag;
|
|
151
|
+
Components['windows'] = Windows;
|
|
152
|
+
Components['datalist_icon'] = DataListIcon;
|
|
153
|
+
Components['mac_icon'] = Mac;
|
|
154
|
+
Components['android_icon'] = Android;
|
|
155
|
+
Components['chrome_icon'] = Chrome;
|
|
156
|
+
Components['browser_stack_icon'] = BrowserStack;
|
|
157
|
+
Components['run_icon'] = Run;
|
|
139
158
|
|
|
140
159
|
export default Components;
|
|
@@ -3,6 +3,7 @@ import './InputWithDropdown.scss';
|
|
|
3
3
|
import { InputWithDropdownProps } from './types';
|
|
4
4
|
import Select from '../Select/Select';
|
|
5
5
|
import Typography from '../Typography';
|
|
6
|
+
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
|
6
7
|
|
|
7
8
|
const InputWithDropdown = ({
|
|
8
9
|
name = '',
|
|
@@ -20,7 +21,7 @@ const InputWithDropdown = ({
|
|
|
20
21
|
onInputBlurHandler,
|
|
21
22
|
optionsRequired = true,
|
|
22
23
|
}: InputWithDropdownProps) => {
|
|
23
|
-
const isValueFilled = value
|
|
24
|
+
const isValueFilled = !checkEmpty(value);
|
|
24
25
|
return (
|
|
25
26
|
<div
|
|
26
27
|
className={classNames('ff-input-with-dropdown-container', {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.ff-machine-input-field-wrapper {
|
|
2
|
+
min-width: 100px;
|
|
3
|
+
height: 32px;
|
|
4
|
+
position: relative;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
|
|
7
|
+
.ff-machine-input-field,
|
|
8
|
+
.ff-machine-input-field-reverse {
|
|
9
|
+
height: 100%;
|
|
10
|
+
width: 100%;
|
|
11
|
+
border: 1px solid var(--ff-machine-input-field-border-color);
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: space-around;
|
|
16
|
+
|
|
17
|
+
.ff-machine-icon-text-wrapper,
|
|
18
|
+
.ff-machine-icon-text-wrapper-reverse {
|
|
19
|
+
display: flex;
|
|
20
|
+
|
|
21
|
+
.ff-machine-icon {
|
|
22
|
+
margin-right: 8px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ff-machine-icon-text-wrapper-reverse {
|
|
27
|
+
flex-direction: row-reverse;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ff-machine-input-field-reverse {
|
|
32
|
+
flex-direction: row-reverse;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ff-machine-input-label {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: -6px;
|
|
38
|
+
left: 8px;
|
|
39
|
+
background-color: var(--ff-machine-input-field-border-color);
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
padding: 1px 2px;
|
|
42
|
+
height: 10px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MachineInputField from './MachineInputField';
|
|
3
|
+
import { MachineType } from './types';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof MachineInputField> = {
|
|
6
|
+
title: 'Components/MachineInputField',
|
|
7
|
+
component: MachineInputField,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof MachineInputField>;
|
|
15
|
+
|
|
16
|
+
// Sample data for the MachineInputField
|
|
17
|
+
const sampleOptions: MachineType[] = [
|
|
18
|
+
{ label: 'Local', type: 'Local' },
|
|
19
|
+
{ label: '121.25.36', type: 'Google Chrome' },
|
|
20
|
+
{ label: '17, iPhone 15', type: 'mac' },
|
|
21
|
+
{ label: 'Samsung Galaxy S23', type: 'android' },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const Primary: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
width: '410px', // Example width
|
|
27
|
+
options: sampleOptions,
|
|
28
|
+
runCount: 1,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import './MachineInputField.scss';
|
|
3
|
+
import Typography from '../Typography';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import { MachineInputFieldProps, MachineType } from './types';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
|
|
8
|
+
const MachineInputField = forwardRef<HTMLDivElement, MachineInputFieldProps>(
|
|
9
|
+
(
|
|
10
|
+
{
|
|
11
|
+
width = '',
|
|
12
|
+
options = [],
|
|
13
|
+
runCount = 0,
|
|
14
|
+
className = '',
|
|
15
|
+
contentReverse = false,
|
|
16
|
+
},
|
|
17
|
+
ref
|
|
18
|
+
) => {
|
|
19
|
+
const getIcon: Record<MachineType['type'], string> = {
|
|
20
|
+
Local: 'browser_stack_icon',
|
|
21
|
+
mac: 'mac_icon',
|
|
22
|
+
android: 'android_icon',
|
|
23
|
+
'Google Chrome': 'chrome_icon',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
ref={ref}
|
|
29
|
+
style={{ width: width }}
|
|
30
|
+
className={classNames('ff-machine-input-field-wrapper', className)}
|
|
31
|
+
>
|
|
32
|
+
<Typography
|
|
33
|
+
as="span"
|
|
34
|
+
color="var(--ff-machine-input-field-text-color)"
|
|
35
|
+
fontSize={8}
|
|
36
|
+
textAlign="center"
|
|
37
|
+
className="ff-machine-input-label"
|
|
38
|
+
>
|
|
39
|
+
Run {runCount}
|
|
40
|
+
</Typography>
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
className={classNames('ff-machine-input-field', {
|
|
44
|
+
'ff-machine-input-field-reverse': contentReverse,
|
|
45
|
+
})}
|
|
46
|
+
>
|
|
47
|
+
{options.map(({ label, type }) => (
|
|
48
|
+
<div
|
|
49
|
+
key={type}
|
|
50
|
+
className={classNames('ff-machine-icon-text-wrapper', {
|
|
51
|
+
'ff-machine-icon-text-wrapper-reverse': contentReverse,
|
|
52
|
+
})}
|
|
53
|
+
>
|
|
54
|
+
<Icon name={getIcon[type]} className="ff-machine-icon" />
|
|
55
|
+
<Typography
|
|
56
|
+
className="ff-machine-text"
|
|
57
|
+
color="var(--ff-machine-input-field-text-color)"
|
|
58
|
+
>
|
|
59
|
+
{label}
|
|
60
|
+
</Typography>
|
|
61
|
+
</div>
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
MachineInputField.displayName = 'MachineInputField';
|
|
70
|
+
|
|
71
|
+
export default MachineInputField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MachineInputField';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface MachineType {
|
|
2
|
+
type: 'Local' | 'mac' | 'android' | 'Google Chrome';
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface MachineInputFieldProps {
|
|
7
|
+
width: string;
|
|
8
|
+
options: MachineType[];
|
|
9
|
+
runCount: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
contentReverse?: boolean;
|
|
12
|
+
}
|
|
@@ -16,6 +16,17 @@
|
|
|
16
16
|
&:hover {
|
|
17
17
|
background-color: var(--hover-color);
|
|
18
18
|
}
|
|
19
|
+
&.dark {
|
|
20
|
+
background-color: var(--brand-color);
|
|
21
|
+
&:hover {
|
|
22
|
+
background-color: var(--menu-variant-dark-icon-color);
|
|
23
|
+
svg {
|
|
24
|
+
path {
|
|
25
|
+
fill: var(--brand-color);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
19
30
|
}
|
|
20
31
|
|
|
21
32
|
.ff-menuicon-container-clicked {
|
|
@@ -27,6 +38,9 @@
|
|
|
27
38
|
&:hover {
|
|
28
39
|
background-color: var(--brand-color);
|
|
29
40
|
}
|
|
41
|
+
&.dark {
|
|
42
|
+
background-color: var(--menu-variant-dark-icon-color);
|
|
43
|
+
}
|
|
30
44
|
}
|
|
31
45
|
}
|
|
32
46
|
|