Skip to content

Commit ea5e351

Browse files
committed
feat: update Tab component to improve padding and enhance visual styles for horizontal and vertical orientations
1 parent b3adf77 commit ea5e351

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

src/components/tab/Tab.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export default {
1212
export const TabExample = () => {
1313
return <Tab orientation={"horizontal"} defaultValue={"overview"}>
1414
<TabList>
15-
<TabTrigger value={"overview"}>
16-
<Button variant={"none"}>
15+
<TabTrigger value={"overview"} asChild>
16+
<Button paddingSize={"xxs"} variant={"none"}>
1717
<IconHome size={16}/>
1818
<Text size={"md"} hierarchy={"primary"}>Collaborative documents</Text>
1919
</Button>
2020
</TabTrigger>
21-
<TabTrigger value={"organizations"}>
22-
<Button variant={"none"}>
21+
<TabTrigger value={"organizations"} asChild>
22+
<Button paddingSize={"xxs"} variant={"none"}>
2323
<IconBuilding size={16}/>
2424
<Text size={"md"} hierarchy={"primary"}>Inline comments</Text>
2525
</Button>
@@ -31,17 +31,17 @@ export const TabExample = () => {
3131
export const TabExampleVertical = () => {
3232
return <Tab orientation={"vertical"} defaultValue={"overview"}>
3333
<TabList>
34-
<TabTrigger value={"overview"}>
34+
<TabTrigger value={"overview"} asChild>
3535
<Button paddingSize={"xxs"} variant={"none"}>
3636
<Text size={"md"} hierarchy={"primary"}>Collaborative documents</Text>
3737
</Button>
3838
</TabTrigger>
39-
<TabTrigger value={"organizations"}>
39+
<TabTrigger value={"organizations"} asChild>
4040
<Button paddingSize={"xxs"} variant={"none"}>
4141
<Text size={"md"} hierarchy={"primary"}>Inline comments</Text>
4242
</Button>
4343
</TabTrigger>
44-
<TabTrigger value={"commands"}>
44+
<TabTrigger value={"commands"} asChild>
4545
<Button paddingSize={"xxs"} variant={"none"}>
4646
<Text size={"md"} hierarchy={"primary"}>Text-to-issue commands</Text>
4747
</Button>

src/components/tab/Tab.style.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
position: relative;
2424
box-sizing: border-box;
2525
opacity: 0.5;
26-
padding: 0;
2726
transition: all ease-in-out 0.2s;
2827

2928
&:after {
@@ -35,22 +34,26 @@
3534
}
3635

3736
&[data-orientation="vertical"] {
38-
padding-left: variables.$xxs;
37+
padding-left: variables.$xs * 2;
38+
3939
&:after {
40-
height: 100%;
40+
height: 50%;
4141
width: 3px;
42-
top: 0;
43-
left: 0;
42+
top: 50%;
43+
transform: translateY(-50%);
44+
left: variables.$xs;
4445
}
4546
}
4647

4748
&[data-orientation="horizontal"] {
48-
padding-bottom: variables.$xxs;
49+
50+
padding-bottom: variables.$xxs * 2;
51+
4952
&:after {
5053
width: 10%;
5154
min-width: 28px;
5255
height: 3px;
53-
bottom: 0;
56+
bottom: variables.$xxs;
5457
left: 50%;
5558
transform: translateX(-50%);
5659
}
@@ -59,6 +62,7 @@
5962
&[aria-selected=true] {
6063
&[data-orientation="vertical"], &[data-orientation="horizontal"] {
6164
opacity: 1;
65+
6266
&:after {
6367
background: variables.$info;
6468
}

0 commit comments

Comments
 (0)