Skip to content

Commit bc9602a

Browse files
fix(EntityStatus): fix buttons bg in selected table rows
1 parent c81a708 commit bc9602a

File tree

7 files changed

+43
-162
lines changed

7 files changed

+43
-162
lines changed

src/components/DeveloperUILinkButton/DeveloperUILinkButton.scss

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/components/DeveloperUILinkButton/DeveloperUILinkButton.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/components/DeveloperUILinkButton/i18n/en.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/components/DeveloperUILinkButton/i18n/index.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 31 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
@use '../../styles/mixins.scss';
22

33
.entity-status {
4-
--button-width: 28px;
4+
--button-width: 24px;
5+
--entity-status-height: 20px;
6+
57
position: relative;
68

79
display: inline-flex;
810
align-items: center;
911

1012
max-width: 100%;
11-
height: 100%;
13+
height: var(--entity-status-height);
1214

1315
@include mixins.body-2-typography();
1416

@@ -18,16 +20,24 @@
1820

1921
&__info-icon,
2022
&__clipboard-button {
23+
--g-button-focus-outline-width: 2px;
24+
--g-button-focus-outline-offset: -2px;
25+
opacity: 0;
2126
color: var(--g-color-text-secondary);
2227

23-
@include mixins.table-hover-appearing-button();
24-
25-
&_visible {
28+
&_visible,
29+
&:focus-visible,
30+
&:hover,
31+
.entity-status__wrapper:focus-within &,
32+
.data-table__row:hover &,
33+
.ydb-paginated-table__row:hover & {
2634
opacity: 1;
2735
}
28-
}
2936

30-
&__info-icon {
37+
&:focus-visible,
38+
.entity-status__wrapper:focus-within {
39+
background-color: var(--g-color-base-float);
40+
}
3141
&:hover {
3242
color: var(--g-color-text-primary);
3343
}
@@ -38,6 +48,8 @@
3848

3949
overflow: hidden;
4050

51+
height: var(--entity-status-height);
52+
4153
&_with-clipboard-button {
4254
padding-right: var(--button-width);
4355
}
@@ -63,34 +75,33 @@
6375
gap: var(--g-spacing-1);
6476

6577
width: 0;
66-
height: 100%;
6778

68-
&_visible {
79+
&_visible,
80+
&:focus-within {
6981
width: min-content;
70-
padding: var(--g-spacing-1);
7182

7283
background-color: var(--g-color-base-background);
7384
}
7485

7586
.data-table__row:hover &,
76-
.ydb-paginated-table__row:hover &,
77-
.ydb-tree-view__item & {
87+
.ydb-paginated-table__row:hover & {
7888
width: min-content;
79-
padding: var(--g-spacing-1);
8089

8190
background-color: var(--ydb-data-table-color-hover);
8291
}
8392
}
8493

85-
&__label {
86-
margin-right: 2px;
87-
88-
color: var(--g-color-text-complementary);
94+
&__wrapper_with-clipboard-button &__link {
95+
width: calc(100% + var(--button-width));
96+
}
8997

90-
@include mixins.body-2-typography();
98+
&__wrapper_with-info-button &__link {
99+
width: calc(100% + var(--button-width));
100+
}
91101

92-
&_size_l {
93-
font-size: var(--g-text-header-2-font-size);
102+
&__wrapper_with-clipboard-button {
103+
&.entity-status__wrapper_with-info-button .entity-status__link {
104+
width: calc(100% + 2 * var(--button-width));
94105
}
95106
}
96107

@@ -99,26 +110,11 @@
99110
overflow: hidden;
100111

101112
width: 100%;
102-
margin-top: 5px;
103113

104114
white-space: nowrap;
105115
text-overflow: ellipsis;
106116
}
107117

108-
&__wrapper_with-clipboard-button &__link {
109-
width: calc(100% + var(--button-width));
110-
}
111-
112-
&__wrapper_with-info-button &__link {
113-
width: calc(100% + var(--button-width));
114-
}
115-
116-
&__wrapper_with-clipboard-button {
117-
&.entity-status__wrapper_with-info-button .entity-status__link {
118-
width: calc(100% + 2 * var(--button-width));
119-
}
120-
}
121-
122118
&__link_with-left-trim {
123119
text-align: end;
124120
direction: rtl;
@@ -127,19 +123,4 @@
127123
unicode-bidi: plaintext;
128124
}
129125
}
130-
131-
&__label {
132-
&_state_blue {
133-
color: var(--ydb-color-status-blue);
134-
}
135-
&_state_yellow {
136-
color: var(--ydb-color-status-yellow);
137-
}
138-
&_state_orange {
139-
color: var(--ydb-color-status-orange);
140-
}
141-
&_state_red {
142-
color: var(--ydb-color-status-red);
143-
}
144-
}
145126
}

src/components/EntityStatus/EntityStatus.tsx

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ interface EntityStatusProps {
1818
status?: EFlag;
1919
name?: string;
2020
renderName?: (name?: string) => React.ReactNode;
21-
label?: string;
2221
path?: string;
23-
iconPath?: string;
2422

2523
size?: StatusIconSize;
2624
mode?: StatusIconMode;
@@ -45,9 +43,7 @@ export function EntityStatus({
4543
status = EFlag.Grey,
4644
name = '',
4745
renderName = defaultRenderName,
48-
label,
4946
path,
50-
iconPath,
5147

5248
size = 's',
5349
mode = 'color',
@@ -71,13 +67,7 @@ export function EntityStatus({
7167

7268
return <StatusIcon className={b('icon')} status={status} size={size} mode={mode} />;
7369
};
74-
const renderStatusLink = (href: string) => {
75-
return (
76-
<UIKitLink target="_blank" href={href}>
77-
{renderIcon()}
78-
</UIKitLink>
79-
);
80-
};
70+
8171
const renderLink = () => {
8272
if (path) {
8373
if (externalLink) {
@@ -96,14 +86,10 @@ export function EntityStatus({
9686
}
9787
return name && <span className={b('name')}>{renderName(name)}</span>;
9888
};
89+
9990
return (
10091
<div className={b(null, className)}>
101-
{iconPath ? renderStatusLink(iconPath) : renderIcon()}
102-
{label && (
103-
<span title={label} className={b('label', {size, state: status.toLowerCase()})}>
104-
{label}
105-
</span>
106-
)}
92+
{renderIcon()}
10793
{(path || name) && (
10894
<div
10995
className={b('wrapper', {
@@ -127,15 +113,15 @@ export function EntityStatus({
127113
placement={['top-start', 'bottom-start']}
128114
onOpenChange={(visible) => setInfoIconHovered(visible)}
129115
>
130-
<Button view="normal" size="xs">
131-
<Icon
132-
data={CircleInfo}
133-
size="12"
134-
className={b('info-icon', {
135-
visible:
136-
clipboardButtonAlwaysVisible || infoIconHovered,
137-
})}
138-
/>
116+
<Button
117+
view="normal"
118+
size="xs"
119+
className={b('info-icon', {
120+
visible:
121+
clipboardButtonAlwaysVisible || infoIconHovered,
122+
})}
123+
>
124+
<Icon data={CircleInfo} size="12" />
139125
</Button>
140126
</Popover>
141127
)}

src/styles/mixins.scss

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -284,29 +284,3 @@
284284
--entity-state-border-color: var(--g-color-line-generic-hover);
285285
}
286286
}
287-
288-
@mixin table-hover-appearing-button {
289-
opacity: 0;
290-
291-
&_visible,
292-
&:focus-visible {
293-
opacity: 1;
294-
}
295-
&:focus-visible {
296-
position: absolute;
297-
top: 2px;
298-
right: 2px;
299-
300-
background-color: var(--g-color-base-float);
301-
}
302-
.data-table__row:hover &,
303-
.ydb-paginated-table__row:hover & {
304-
opacity: 1;
305-
}
306-
.data-table__row:hover &:focus-visible,
307-
.ydb-paginated-table__row:hover &:focus-visible {
308-
position: static;
309-
310-
background-color: unset;
311-
}
312-
}

0 commit comments

Comments
 (0)