Skip to content

Commit 61c7232

Browse files
committed
feat: enhance SegmentedControl by wrapping item labels in Text component for improved styling
1 parent 87fa17c commit 61c7232

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Meta} from "@storybook/react-vite";
22
import {SegmentedControl, SegmentedControlItem} from "./SegmentedControl";
33
import React from "react";
4+
import {Text} from "../text/Text";
45

56
export default {
67
title: "Segmented Control",
@@ -9,13 +10,13 @@ export default {
910
export const SegmentedControlExample = () => {
1011
return <SegmentedControl defaultValue={"codezero"} type={"single"}>
1112
<SegmentedControlItem value={"codezero"}>
12-
CodeZero
13+
<Text>CodeZero</Text>
1314
</SegmentedControlItem>
1415
<SegmentedControlItem value={"github"}>
15-
Github
16+
<Text>Github</Text>
1617
</SegmentedControlItem>
1718
<SegmentedControlItem value={"apple"}>
18-
Apple
19+
<Text>Apple</Text>
1920
</SegmentedControlItem>
2021
</SegmentedControl>
2122
}

src/components/segmented-control/SegmentedControl.style.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
& {
2323
@include box.box();
2424
border-radius: variables.$borderRadius - variables.$xxs;
25-
@include helpers.fontStyle();
26-
font-size: variables.$sm;
27-
box-shadow: none;
25+
border: none;
2826
}
2927

3028
&[data-state="off"] {
3129
background: transparent;
30+
opacity: .6666666666;
3231
}
3332

3433
}

0 commit comments

Comments
 (0)