pixel-react 1.0.2 → 1.0.4
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/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 +13 -10
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +1 -0
- package/lib/components/InputWithDropdown/types.d.ts +4 -0
- package/lib/components/MenuOption/types.d.ts +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/types.d.ts +5 -1
- package/lib/components/StateDropdown/StateDropdown.d.ts +3 -0
- package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
- package/lib/components/StateDropdown/StateDropdownTypes.d.ts +11 -0
- package/lib/components/StateDropdown/index.d.ts +1 -0
- package/lib/components/StatusButton/StatusButton.d.ts +4 -0
- package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
- package/lib/components/StatusButton/index.d.ts +1 -0
- package/lib/components/StatusButton/types.d.ts +35 -0
- package/lib/components/Tabs/Tabs.d.ts +1 -1
- package/lib/components/Tabs/Tabs.stories.d.ts +1 -0
- package/lib/components/Tabs/types.d.ts +6 -2
- package/lib/index.d.ts +76 -10
- package/lib/index.esm.js +287 -57
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +288 -56
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/StyleGuide/ColorPalette/ColorPalette.scss +4 -5
- package/src/StyleGuide/Typography/Typography.scss +4 -5
- package/src/assets/Themes/BaseTheme.scss +45 -16
- package/src/assets/Themes/DarkTheme.scss +48 -10
- package/src/assets/Themes/Theme.scss +7 -191
- package/src/assets/icons/active_license_icon.svg +3 -0
- package/src/assets/icons/delete.svg +2 -16
- package/src/assets/icons/delete_info.svg +17 -0
- package/src/assets/icons/details.svg +3 -0
- package/src/assets/icons/edit_icon.svg +5 -0
- package/src/assets/icons/expired_license_icon.svg +3 -0
- package/src/assets/icons/expiringSoon_license_icon.svg +3 -0
- package/src/assets/icons/export_collection_icon.svg +13 -0
- package/src/assets/icons/hide_icon.svg +9 -0
- package/src/assets/icons/impactList.svg +6 -0
- package/src/assets/icons/run_icon.svg +26 -0
- package/src/assets/icons/view_icon.svg +3 -0
- package/src/assets/utils/functionUtils.ts +5 -5
- package/src/components/Accordion/Accordion.scss +1 -2
- package/src/components/AddButton/AddButton.scss +38 -0
- package/src/components/AddButton/AddButton.stories.tsx +24 -0
- package/src/components/AddButton/AddButton.tsx +25 -0
- package/src/components/AddButton/index.ts +1 -0
- package/src/components/AddButton/types.ts +4 -0
- package/src/components/AddResourceButton/type.ts +42 -10
- package/src/components/Button/Button.scss +1 -1
- package/src/components/Button/index.ts +1 -1
- package/src/components/Charts/DonutChart/DonutChart.scss +1 -1
- package/src/components/Charts/RadialChart/RadialChart.scss +1 -1
- package/src/components/Drawer/Drawer.scss +9 -10
- package/src/components/ExpandableMenu/ExpandableMenu.scss +1 -1
- package/src/components/Icon/Icons.scss +5 -6
- package/src/components/Icon/iconList.ts +24 -2
- package/src/components/Input/Input.stories.tsx +1 -1
- package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +59 -2
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +3 -1
- package/src/components/InputWithDropdown/types.ts +4 -0
- package/src/components/MenuOption/MenuOption.scss +1 -1
- package/src/components/MenuOption/types.ts +1 -1
- package/src/components/MultiSelect/MultiSelect.scss +1 -1
- package/src/components/RadioButton/RadioButton.scss +2 -3
- package/src/components/Search/Search.scss +71 -73
- package/src/components/Select/Select.tsx +29 -25
- package/src/components/Select/types.ts +5 -1
- package/src/components/StateDropdown/StateDropdown.stories.tsx +99 -0
- package/src/components/StateDropdown/StateDropdown.tsx +223 -0
- package/src/components/StateDropdown/StateDropdownTypes.tsx +21 -0
- package/src/components/StateDropdown/index.ts +1 -0
- package/src/components/StatusButton/StatusButton.scss +90 -0
- package/src/components/StatusButton/StatusButton.stories.tsx +91 -0
- package/src/components/StatusButton/StatusButton.tsx +40 -0
- package/src/components/StatusButton/index.ts +1 -0
- package/src/components/StatusButton/types.ts +45 -0
- package/src/components/Table/Table.scss +3 -3
- package/src/components/Tabs/Tabs.scss +3 -0
- package/src/components/Tabs/Tabs.stories.tsx +31 -0
- package/src/components/Tabs/Tabs.tsx +6 -1
- package/src/components/Tabs/types.ts +6 -2
- package/src/components/TextArea/Textarea.scss +1 -2
- package/src/components/Toggle/Toggle.scss +5 -4
- package/src/components/Tooltip/Tooltip.scss +1 -1
- package/src/index.ts +5 -0
- package/vite.config.js +1 -1
- package/lib/index.css +0 -404
- package/lib/index.esm.css +0 -404
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import Select from './../Select/Select';
|
|
2
|
+
import { StateDropdownProps } from './StateDropdownTypes';
|
|
3
|
+
|
|
4
|
+
const StateDropdown = ({
|
|
5
|
+
value,
|
|
6
|
+
nodeObj,
|
|
7
|
+
isReviewer = false,
|
|
8
|
+
isApprovePage = false,
|
|
9
|
+
handleStateValueClick,
|
|
10
|
+
handleDropdownOptionsClick,
|
|
11
|
+
disabled = false,
|
|
12
|
+
isOnlyReviewer = false,
|
|
13
|
+
userHasOnlyViewAccess = false,
|
|
14
|
+
}: StateDropdownProps) => {
|
|
15
|
+
let currentState=value.toUpperCase();
|
|
16
|
+
let content;
|
|
17
|
+
let options;
|
|
18
|
+
const isReviewerAndClickedOnReviewState: boolean =
|
|
19
|
+
isReviewer &&
|
|
20
|
+
!isApprovePage &&
|
|
21
|
+
currentState === 'REVIEW' &&
|
|
22
|
+
!nodeObj;
|
|
23
|
+
let selectedOption: { label: string; value: string } = {
|
|
24
|
+
label: '',
|
|
25
|
+
value: '',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
if (isOnlyReviewer && !isApprovePage) {
|
|
29
|
+
options = [
|
|
30
|
+
{
|
|
31
|
+
label: 'New',
|
|
32
|
+
value: 'New',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Approve',
|
|
36
|
+
value: 'Approve',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
} else if (!isReviewer && !isApprovePage) {
|
|
40
|
+
options = [
|
|
41
|
+
{
|
|
42
|
+
label: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
|
43
|
+
value: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Approve',
|
|
47
|
+
value: 'Approve',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
} else if (isReviewerAndClickedOnReviewState) {
|
|
51
|
+
options = [
|
|
52
|
+
{
|
|
53
|
+
label: 'Review',
|
|
54
|
+
value: 'Review',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Approve',
|
|
58
|
+
value: 'Approve',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
} else if (isReviewer && !isApprovePage) {
|
|
62
|
+
options = [
|
|
63
|
+
{
|
|
64
|
+
label: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
|
65
|
+
value: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Review',
|
|
69
|
+
value: 'Review',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Approve',
|
|
73
|
+
value: 'Approve',
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
} else if (isReviewer && isApprovePage) {
|
|
77
|
+
options = [
|
|
78
|
+
{
|
|
79
|
+
label: 'Review',
|
|
80
|
+
value: 'Review',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'Approve',
|
|
84
|
+
value: 'Approve',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'Reject',
|
|
88
|
+
value: 'Reject',
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
} else {
|
|
92
|
+
options = [
|
|
93
|
+
{
|
|
94
|
+
label: 'New',
|
|
95
|
+
value: 'New',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: 'Review',
|
|
99
|
+
value: 'Review',
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let handleSelectedOption:(value:string)=>{label:string,value:string}=(value)=>{
|
|
105
|
+
return {label:value , value: value};
|
|
106
|
+
};
|
|
107
|
+
if (currentState === 'REVIEW' && isApprovePage) {
|
|
108
|
+
selectedOption = handleSelectedOption(value);
|
|
109
|
+
} else if (currentState === 'REVIEW' && !isApprovePage) {
|
|
110
|
+
selectedOption = handleSelectedOption(value);
|
|
111
|
+
} else if (currentState === 'NEW' && !isApprovePage) {
|
|
112
|
+
selectedOption = handleSelectedOption(value);
|
|
113
|
+
} else if (currentState === 'REJECTED' && !isApprovePage) {
|
|
114
|
+
selectedOption = handleSelectedOption(value);
|
|
115
|
+
} else {
|
|
116
|
+
selectedOption = handleSelectedOption(value);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (
|
|
120
|
+
((currentState === 'NEW' && !isApprovePage) ||
|
|
121
|
+
(isApprovePage && currentState === 'REVIEW') ||
|
|
122
|
+
isReviewerAndClickedOnReviewState ||
|
|
123
|
+
(currentState === 'REJECTED' && !isApprovePage)) &&
|
|
124
|
+
!userHasOnlyViewAccess
|
|
125
|
+
) {
|
|
126
|
+
content = !disabled ? (
|
|
127
|
+
<Select
|
|
128
|
+
label={value}
|
|
129
|
+
disabled={disabled}
|
|
130
|
+
onChange={handleDropdownOptionsClick}
|
|
131
|
+
optionsList={options}
|
|
132
|
+
selectedOption={selectedOption}
|
|
133
|
+
showLabel={false}
|
|
134
|
+
showBorder={true}
|
|
135
|
+
/>
|
|
136
|
+
) : (
|
|
137
|
+
<Select
|
|
138
|
+
label={value}
|
|
139
|
+
disabled={true}
|
|
140
|
+
onChange={handleDropdownOptionsClick}
|
|
141
|
+
optionsList={options}
|
|
142
|
+
selectedOption={selectedOption}
|
|
143
|
+
showLabel={false}
|
|
144
|
+
showBorder={true}
|
|
145
|
+
/>
|
|
146
|
+
);
|
|
147
|
+
} else if (
|
|
148
|
+
currentState === 'REVIEW' &&
|
|
149
|
+
(!isApprovePage || userHasOnlyViewAccess)
|
|
150
|
+
) {
|
|
151
|
+
content = (
|
|
152
|
+
<Select
|
|
153
|
+
label={value}
|
|
154
|
+
disabled={true}
|
|
155
|
+
onChange={handleDropdownOptionsClick}
|
|
156
|
+
optionsList={options}
|
|
157
|
+
selectedOption={selectedOption}
|
|
158
|
+
showLabel={false}
|
|
159
|
+
showBorder={true}
|
|
160
|
+
/>
|
|
161
|
+
);
|
|
162
|
+
} else if (currentState === 'APPROVED') {
|
|
163
|
+
content = (
|
|
164
|
+
<Select
|
|
165
|
+
label={value}
|
|
166
|
+
disabled={true}
|
|
167
|
+
onChange={handleDropdownOptionsClick}
|
|
168
|
+
optionsList={options}
|
|
169
|
+
selectedOption={selectedOption}
|
|
170
|
+
showLabel={false}
|
|
171
|
+
showBorder={true}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
} else if (
|
|
175
|
+
currentState === 'REJECTED' &&
|
|
176
|
+
userHasOnlyViewAccess
|
|
177
|
+
) {
|
|
178
|
+
content = (
|
|
179
|
+
<Select
|
|
180
|
+
label={value}
|
|
181
|
+
disabled={true}
|
|
182
|
+
onChange={handleDropdownOptionsClick}
|
|
183
|
+
optionsList={options}
|
|
184
|
+
selectedOption={selectedOption}
|
|
185
|
+
showLabel={false}
|
|
186
|
+
showBorder={true}
|
|
187
|
+
/>
|
|
188
|
+
);
|
|
189
|
+
} else if (currentState === 'NEW' && userHasOnlyViewAccess) {
|
|
190
|
+
content = (
|
|
191
|
+
<Select
|
|
192
|
+
label={value}
|
|
193
|
+
disabled={true}
|
|
194
|
+
onChange={handleDropdownOptionsClick}
|
|
195
|
+
optionsList={options}
|
|
196
|
+
selectedOption={selectedOption}
|
|
197
|
+
showLabel={false}
|
|
198
|
+
showBorder={true}
|
|
199
|
+
/>
|
|
200
|
+
);
|
|
201
|
+
} else {
|
|
202
|
+
content = '';
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<div
|
|
207
|
+
onClick={() => {
|
|
208
|
+
if (
|
|
209
|
+
value.toLowerCase() === 'review' &&
|
|
210
|
+
!userHasOnlyViewAccess &&
|
|
211
|
+
!isApprovePage &&
|
|
212
|
+
!isReviewer
|
|
213
|
+
) {
|
|
214
|
+
handleStateValueClick();
|
|
215
|
+
}
|
|
216
|
+
}}
|
|
217
|
+
>
|
|
218
|
+
{content}
|
|
219
|
+
</div>
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export default StateDropdown;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface StateDropdownProps{
|
|
2
|
+
|
|
3
|
+
value:string;
|
|
4
|
+
|
|
5
|
+
nodeObj:{};
|
|
6
|
+
|
|
7
|
+
isReviewer:boolean;
|
|
8
|
+
|
|
9
|
+
isApprovePage:boolean;
|
|
10
|
+
|
|
11
|
+
handleDropdownOptionsClick:()=>void;
|
|
12
|
+
|
|
13
|
+
disabled:boolean;
|
|
14
|
+
|
|
15
|
+
isOnlyReviewer:boolean;
|
|
16
|
+
|
|
17
|
+
userHasOnlyViewAccess:boolean;
|
|
18
|
+
|
|
19
|
+
handleStateValueClick:()=>void;
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './StateDropdown';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@mixin status-colors($bg-color, $text-color) {
|
|
2
|
+
background-color: $bg-color;
|
|
3
|
+
color: $text-color;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ff-status-button {
|
|
7
|
+
border: none;
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
padding: 0 4px;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
width: 76px;
|
|
12
|
+
height: 16px;
|
|
13
|
+
|
|
14
|
+
&__text {
|
|
15
|
+
color: inherit;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
max-width: 76px;
|
|
20
|
+
text-transform: capitalize;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&--passed {
|
|
24
|
+
@include status-colors(
|
|
25
|
+
var(--status-button-bg-passed),
|
|
26
|
+
var(--status-button-text-passed)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--failed {
|
|
31
|
+
@include status-colors(
|
|
32
|
+
var(--status-button-bg-failed),
|
|
33
|
+
var(--status-button-text-failed)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--running {
|
|
38
|
+
@include status-colors(
|
|
39
|
+
var(--status-button-bg-running),
|
|
40
|
+
var(--status-button-text-running)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&--skipped {
|
|
45
|
+
@include status-colors(
|
|
46
|
+
var(--status-button-bg-skipped),
|
|
47
|
+
var(--status-button-text-skipped)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--warning {
|
|
52
|
+
@include status-colors(
|
|
53
|
+
var(--status-button-bg-warning),
|
|
54
|
+
var(--status-button-text-warning)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--terminated {
|
|
59
|
+
@include status-colors(
|
|
60
|
+
var(--status-button-bg-terminated),
|
|
61
|
+
var(--status-button-text-terminated)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&--partially-executed {
|
|
66
|
+
@include status-colors(
|
|
67
|
+
var(--status-button-bg-partiallyExecuted),
|
|
68
|
+
var(--status-button-text-partiallyExecuted)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&--aborted {
|
|
73
|
+
@include status-colors(
|
|
74
|
+
var(--status-button-bg-aborted),
|
|
75
|
+
var(--status-button-text-aborted)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--not-executed {
|
|
80
|
+
@include status-colors(
|
|
81
|
+
var(--status-button-bg-notExecuted),
|
|
82
|
+
var(--status-button-text-notExecuted)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:disabled {
|
|
87
|
+
opacity: 50%;
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import StatusButton from './StatusButton';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof StatusButton> = {
|
|
5
|
+
title: 'Components/StatusButton',
|
|
6
|
+
component: StatusButton,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof StatusButton>;
|
|
14
|
+
|
|
15
|
+
const defaultArgs = {
|
|
16
|
+
disabled: false,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Passed: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
...defaultArgs,
|
|
22
|
+
label: 'Passed',
|
|
23
|
+
status: 'passed',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Failed: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
...defaultArgs,
|
|
30
|
+
label: 'Failed',
|
|
31
|
+
status: 'failed',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Running: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
...defaultArgs,
|
|
38
|
+
label: 'Running',
|
|
39
|
+
status: 'running',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Terminated: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
...defaultArgs,
|
|
46
|
+
label: 'Terminated',
|
|
47
|
+
status: 'terminated',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Skipped: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
...defaultArgs,
|
|
54
|
+
label: 'Skipped',
|
|
55
|
+
status: 'skipped',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Warning: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
...defaultArgs,
|
|
62
|
+
label: 'Warning',
|
|
63
|
+
status: 'warning',
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const PartiallyExecuted: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
...defaultArgs,
|
|
70
|
+
label: 'Partially Executed',
|
|
71
|
+
status: 'partially-executed',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Aborted: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
...defaultArgs,
|
|
78
|
+
label: 'Aborted',
|
|
79
|
+
status: 'aborted',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const NotExecuted: Story = {
|
|
84
|
+
args: {
|
|
85
|
+
...defaultArgs,
|
|
86
|
+
label: 'Not Executed',
|
|
87
|
+
status: 'not-executed',
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default meta;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import './StatusButton.scss';
|
|
3
|
+
import { StatusButtonProps } from './types';
|
|
4
|
+
import Typography from '../Typography';
|
|
5
|
+
|
|
6
|
+
const StatusButton = ({
|
|
7
|
+
status = 'passed',
|
|
8
|
+
label = '',
|
|
9
|
+
onClick = () => {},
|
|
10
|
+
className = '',
|
|
11
|
+
style = {},
|
|
12
|
+
disabled = false,
|
|
13
|
+
...props
|
|
14
|
+
}: StatusButtonProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<button
|
|
17
|
+
className={classNames(
|
|
18
|
+
'ff-status-button',
|
|
19
|
+
`ff-status-button--${status}`,
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
style={style}
|
|
23
|
+
onClick={onClick}
|
|
24
|
+
disabled={disabled}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
<Typography
|
|
28
|
+
as="div"
|
|
29
|
+
fontWeight="semi-bold"
|
|
30
|
+
lineHeight="16px"
|
|
31
|
+
textAlign="center"
|
|
32
|
+
className="ff-status-button__text"
|
|
33
|
+
>
|
|
34
|
+
{label}
|
|
35
|
+
</Typography>
|
|
36
|
+
</button>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default StatusButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './StatusButton';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface StatusButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Status of the button
|
|
6
|
+
*/
|
|
7
|
+
status:
|
|
8
|
+
| 'passed'
|
|
9
|
+
| 'failed'
|
|
10
|
+
| 'running'
|
|
11
|
+
| 'skipped'
|
|
12
|
+
| 'warning'
|
|
13
|
+
| 'terminated'
|
|
14
|
+
| 'partially-executed'
|
|
15
|
+
| 'aborted'
|
|
16
|
+
| 'not-executed';
|
|
17
|
+
/**
|
|
18
|
+
* Button label (status text)
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Button content
|
|
27
|
+
*/
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Button id
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Disabled state
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Classname for the button
|
|
39
|
+
*/
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Additional styles for the button
|
|
43
|
+
*/
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../assets/styles/_fonts';
|
|
2
2
|
|
|
3
3
|
.ff-fixed-header-table {
|
|
4
4
|
overflow-y: auto;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
transform: translateX(20px);
|
|
45
45
|
}
|
|
46
46
|
&:hover {
|
|
47
|
-
background-color: var(--
|
|
47
|
+
background-color: var(--hover-color);
|
|
48
48
|
|
|
49
49
|
.icon-container {
|
|
50
50
|
opacity: 1;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
background-color: var(--brand-color);
|
|
76
76
|
}
|
|
77
77
|
.secondary-bg {
|
|
78
|
-
background-color: var(--
|
|
78
|
+
background-color: var(--slider-table-color);
|
|
79
79
|
}
|
|
80
80
|
.default-bg {
|
|
81
81
|
background-color: transparent;
|
|
@@ -101,4 +101,35 @@ export const TabsWithDisabledTab: Story = {
|
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
+
export const WithoutBorder: Story = {
|
|
105
|
+
render: () => {
|
|
106
|
+
const [activeTabIdDefault, setActiveTabIdDefault] = useState<string>('0');
|
|
107
|
+
|
|
108
|
+
const tabsData = [
|
|
109
|
+
{ label: 'Tab--1', component: <TabContentOne /> },
|
|
110
|
+
{ label: 'Tab--2', component: <TabContentTwo /> },
|
|
111
|
+
{ label: 'Tab--3', component: <TabContentThree /> },
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<div style={{ display: 'flex', gap: '10px' }}>
|
|
116
|
+
<Tabs
|
|
117
|
+
tabsData={tabsData}
|
|
118
|
+
activeTabId={activeTabIdDefault}
|
|
119
|
+
onTabClick={setActiveTabIdDefault}
|
|
120
|
+
noBorder={true}
|
|
121
|
+
/>{' '}
|
|
122
|
+
<hr />
|
|
123
|
+
<Tabs
|
|
124
|
+
variant="capsule"
|
|
125
|
+
tabsData={tabsData}
|
|
126
|
+
activeTabId={activeTabIdDefault}
|
|
127
|
+
onTabClick={setActiveTabIdDefault}
|
|
128
|
+
noBorder={true}
|
|
129
|
+
/>
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
104
135
|
export default meta;
|
|
@@ -9,6 +9,7 @@ const Tabs = ({
|
|
|
9
9
|
tabsData,
|
|
10
10
|
activeTabId,
|
|
11
11
|
onTabClick,
|
|
12
|
+
noBorder = false,
|
|
12
13
|
}: TabsProps) => {
|
|
13
14
|
const tabs = tabsData.map((tab, index) => ({
|
|
14
15
|
id: index.toString(),
|
|
@@ -19,7 +20,11 @@ const Tabs = ({
|
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<div className={`ff-tabs-container`}>
|
|
22
|
-
<div
|
|
23
|
+
<div
|
|
24
|
+
className={classNames(`ff-tab-row--${variant}`, {
|
|
25
|
+
'ff-tab-row--no-border': noBorder,
|
|
26
|
+
})}
|
|
27
|
+
>
|
|
23
28
|
{tabs.map((tab) => (
|
|
24
29
|
<button
|
|
25
30
|
key={tab.id}
|
|
@@ -10,7 +10,7 @@ export interface Tab {
|
|
|
10
10
|
/**
|
|
11
11
|
* The content to display when this tab is active.
|
|
12
12
|
*/
|
|
13
|
-
component
|
|
13
|
+
component?: JSX.Element | React.ReactNode;
|
|
14
14
|
/**
|
|
15
15
|
* Optional property to indicate if the tab is disabled.
|
|
16
16
|
*/
|
|
@@ -21,7 +21,7 @@ export interface TabsProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* An array of tab objects containing label, component, and optional disabled status.
|
|
23
23
|
*/
|
|
24
|
-
tabsData: { label: string; component
|
|
24
|
+
tabsData: { label: string; component?: JSX.Element; disabled?: boolean }[];
|
|
25
25
|
/**
|
|
26
26
|
* Defines the styling variant of the tabs.
|
|
27
27
|
*/
|
|
@@ -35,4 +35,8 @@ export interface TabsProps {
|
|
|
35
35
|
* onTabClick : function updates the active tab state when a user interacts with the tabs,
|
|
36
36
|
*/
|
|
37
37
|
onTabClick: (id: string) => void;
|
|
38
|
+
/**
|
|
39
|
+
* noBorder:true , removes the outer border from tabs
|
|
40
|
+
*/
|
|
41
|
+
noBorder?: boolean;
|
|
38
42
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "sass:map";
|
|
1
2
|
$switch-sizes: (
|
|
2
3
|
small: (
|
|
3
4
|
button-size: 16px,
|
|
@@ -20,10 +21,10 @@ $switch-sizes: (
|
|
|
20
21
|
);
|
|
21
22
|
|
|
22
23
|
@mixin switch-size($size) {
|
|
23
|
-
$button-size: map
|
|
24
|
-
$container-width: map
|
|
25
|
-
$container-height: map
|
|
26
|
-
$translate-x: map
|
|
24
|
+
$button-size: map.get(map.get($switch-sizes, $size), button-size);
|
|
25
|
+
$container-width: map.get(map.get($switch-sizes, $size), container-width);
|
|
26
|
+
$container-height: map.get(map.get($switch-sizes, $size), container-height);
|
|
27
|
+
$translate-x: map.get(map.get($switch-sizes, $size), translate-x);
|
|
27
28
|
|
|
28
29
|
width: $container-width;
|
|
29
30
|
height: $container-height;
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import RadialChart from './components/Charts/RadialChart';
|
|
|
13
13
|
import ExpandableMenu from './components/ExpandableMenu';
|
|
14
14
|
import Select from './components/Select/Select';
|
|
15
15
|
import TextArea from './components/TextArea';
|
|
16
|
+
import StatusButton from './components/StatusButton';
|
|
16
17
|
|
|
17
18
|
import MenuOption from './components/MenuOption';
|
|
18
19
|
import Table from './components/Table/Table';
|
|
@@ -35,6 +36,7 @@ import Tabs from './components/Tabs';
|
|
|
35
36
|
import HighlightText from './components/HighlightText';
|
|
36
37
|
import Checkbox from './components/Checkbox';
|
|
37
38
|
import Search from './components/Search/Search';
|
|
39
|
+
import StateDropdown from './components/StateDropdown';
|
|
38
40
|
|
|
39
41
|
// Utils imports
|
|
40
42
|
import { checkEmpty } from './utils/checkEmpty/checkEmpty';
|
|
@@ -80,6 +82,9 @@ export {
|
|
|
80
82
|
Tabs,
|
|
81
83
|
Checkbox,
|
|
82
84
|
Search,
|
|
85
|
+
StateDropdown,
|
|
86
|
+
StatusButton,
|
|
87
|
+
|
|
83
88
|
|
|
84
89
|
// utils exports
|
|
85
90
|
checkEmpty,
|