Skip to content

Commit 44dc5b2

Browse files
authored
Merge pull request #363 from eccenca/bugfix/lessDenseSmallTags-CMEM-7149
Fix visual appearance of small tags (CMEM-7149)
2 parents 680a66c + ef1f3ae commit 44dc5b2

7 files changed

Lines changed: 53 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1111
- `<ApplicationViewability />`
1212
- component for hiding elements in specific media
1313

14+
### Fixed
15+
16+
- `<Tag />`
17+
- create more whitespace inside `small` tag
18+
- reduce visual impact of border
19+
1420
### Changed
1521

1622
- automatically hide user interaction elements in print view

src/components/OverviewItem/stories/OverviewItem.stories.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ import {
66
Badge,
77
Card,
88
Depiction,
9+
OverflowText,
910
OverviewItem,
1011
OverviewItemActions,
1112
OverviewItemDepiction,
1213
OverviewItemDescription,
14+
OverviewItemLine,
15+
Tag,
16+
TagList,
1317
} from "./../../../../index";
1418
import { FullExample as OtherDepictionExample } from "./../../Depiction/stories/Depiction.stories";
1519
import { Default as ActionsExample } from "./OverviewItemActions.stories";
1620
import { AutoTransform as DepictionExample } from "./OverviewItemDepiction.stories";
1721
import { Default as DescriptionExample } from "./OverviewItemDescription.stories";
22+
import { Default as LineExample } from "./OverviewItemLine.stories";
1823

1924
export default {
2025
title: "Components/OverviewItem",
@@ -76,3 +81,26 @@ ItemWithDepictionElement.args = {
7681
hasSpacing: true,
7782
hasCardWrapper: true,
7883
};
84+
85+
export const ItemWithTags = Template.bind({});
86+
ItemWithTags.args = {
87+
children: [
88+
<OverviewItemDepiction {...DepictionExample.args} key={"depiction"} />,
89+
<OverviewItemDescription key={"description"}>
90+
<OverviewItemLine {...LineExample.args} />
91+
<OverviewItemLine small>
92+
<OverflowText>
93+
<TagList>
94+
<Tag small>Test</Tag>
95+
<Tag small>Tag</Tag>
96+
<Tag small>List</Tag>
97+
</TagList>
98+
</OverflowText>
99+
</OverviewItemLine>
100+
</OverviewItemDescription>,
101+
<OverviewItemActions children={ActionsExample.args.children[0]} key={"actions"} />,
102+
],
103+
densityHigh: false,
104+
hasSpacing: true,
105+
hasCardWrapper: true,
106+
};

src/components/OverviewItem/stories/OverviewItemActions.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
subcomponents: { Button, IconButton, ContextMenu },
1010
argTypes: {
1111
children: {
12-
control: "none",
12+
control: false,
1313
description: "User-interactive elements.",
1414
},
1515
},
@@ -20,7 +20,7 @@ const Template: StoryFn<typeof OverviewItemActions> = (args) => <OverviewItemAct
2020
export const Default = Template.bind({});
2121
Default.args = {
2222
children: [
23-
<IconButton name="item-remove" tooltip="Remove this item" disruptive />,
23+
<IconButton name="item-remove" text="Remove this item" disruptive />,
2424
<Button affirmative>Other action</Button>,
2525
],
2626
};

src/components/OverviewItem/stories/OverviewItemDescription.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default {
1212
},
1313
argTypes: {
1414
children: {
15-
control: "none",
15+
control: false,
1616
description: "Elements for text content.",
1717
},
1818
},

src/components/OverviewItem/stories/OverviewItemLine.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
component: OverviewItemLine,
1010
argTypes: {
1111
children: {
12-
control: "none",
12+
control: false,
1313
description: "Elements for line content.",
1414
},
1515
},

src/components/Tag/stories/TagList.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
component: TagList,
99
argTypes: {
1010
children: {
11-
control: "none",
11+
control: false,
1212
},
1313
},
1414
} as Meta<typeof TagList>;
@@ -18,5 +18,5 @@ const Template: StoryFn<typeof TagList> = (args) => <TagList {...args} />;
1818
export const List = Template.bind({});
1919
List.args = {
2020
label: "Tag list",
21-
children: [<Tag>Short</Tag>, <Tag>List</Tag>, <Tag>Of</Tag>, <Tag>Tags</Tag>],
21+
children: [<Tag small>Short</Tag>, <Tag>List</Tag>, <Tag>Of</Tag>, <Tag large>Tags</Tag>],
2222
};

src/components/Tag/tag.scss

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ $tag-round-adjustment: 0 !default;
3030
@import "~@blueprintjs/core/src/components/tag/tag";
3131

3232
.#{$eccgui}-tag__item {
33+
--eccgui-tag-border-width: 1px;
34+
3335
flex-grow: 0;
3436
flex-shrink: 0;
3537
min-width: calc(#{$tag-height} - 2px);
3638
min-height: calc(#{$tag-height} - 2px);
3739
max-height: calc(#{$tag-height} - 2px);
3840
padding: 0 $tag-padding-top;
41+
line-height: calc(#{$tag-height} - 2px);
3942

4043
&.#{$ns}-round {
4144
border-radius: $tag-height * 0.5;
@@ -55,11 +58,12 @@ $tag-round-adjustment: 0 !default;
5558
}
5659

5760
&.#{$eccgui}-tag--small {
58-
min-width: calc(#{$tag-height-small} + #{$tag-padding-small} - 2px);
59-
min-height: calc(#{$tag-height-small} + #{$tag-padding-small} - 2px);
60-
max-height: calc(#{$tag-height-small} + #{$tag-padding-small} - 2px);
61+
min-width: calc(#{$tag-height-small} + #{$tag-padding-small});
62+
min-height: calc(#{$tag-height-small} + #{$tag-padding-small});
63+
max-height: calc(#{$tag-height-small} + #{$tag-padding-small});
6164
padding: 0 $tag-padding-small;
62-
line-height: calc(#{$tag-height-small} - 2px);
65+
font-size: calc(#{$eccgui-size-typo-tag} - 1px);
66+
line-height: calc(#{$tag-height-small} + #{$tag-padding-small});
6367

6468
&.#{$ns}-round {
6569
border-radius: $tag-height-small * 0.5;
@@ -75,7 +79,7 @@ $tag-round-adjustment: 0 !default;
7579
min-height: calc(#{$tag-height-large} + #{$tag-padding-large} - 2px);
7680
max-height: calc(#{$tag-height-large} + #{$tag-padding-large} - 2px);
7781
font-size: $eccgui-size-typo-tag-large;
78-
line-height: calc(#{$tag-height-large} - 2px);
82+
line-height: calc(#{$tag-height-large} + #{$tag-padding-large} - 2px);
7983

8084
&.#{$ns}-round {
8185
border-radius: $tag-height-large * 0.5;
@@ -138,7 +142,7 @@ $tag-round-adjustment: 0 !default;
138142

139143
.#{$ns}-tag {
140144
border-style: solid;
141-
border-width: 1px;
145+
border-width: var(--eccgui-tag-border-width);
142146

143147
&:not([class*="#{$ns}-intent-"]) {
144148
--eccgui-tag-bg: #{$tag-default-color};
@@ -151,7 +155,7 @@ $tag-round-adjustment: 0 !default;
151155
var(--eccgui-tag-bg) var(--eccgui-tag-emfactor),
152156
eccgui-color-var("identity", "background", "100")
153157
);
154-
border-color: var(--eccgui-tag-border);
158+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), calc(0.25 * var(--eccgui-tag-emfactor)));
155159

156160
&.#{$eccgui}-tag--strongeremphasis {
157161
--eccgui-tag-emfactor: 95%;
@@ -211,7 +215,7 @@ $tag-round-adjustment: 0 !default;
211215
var(--eccgui-tag-bg) var(--eccgui-tag-emfactor),
212216
eccgui-color-var("identity", "background", "100")
213217
);
214-
border-color: var(--eccgui-tag-border);
218+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), calc(0.25 * var(--eccgui-tag-emfactor)));
215219

216220
&.#{$eccgui}-tag--strongeremphasis {
217221
--eccgui-tag-emfactor: 100%;
@@ -231,7 +235,7 @@ $tag-round-adjustment: 0 !default;
231235

232236
&[class*="#{$eccgui}-intent--"] {
233237
color: eccgui-color-rgba(var(--eccgui-tag-text), var(--eccgui-tag-emfactor));
234-
border-color: eccgui-color-rgba(var(--eccgui-tag-border), var(--eccgui-tag-emfactor));
238+
border-color: eccgui-color-rgba(var(--eccgui-tag-border), calc(0.25 * var(--eccgui-tag-emfactor)));
235239
}
236240

237241
&.#{$eccgui}-intent--primary {

0 commit comments

Comments
 (0)