File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
packages/component-library/src/SingleToggleGroup Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 2020 transition-duration : 100ms ;
2121 transition-timing-function : linear ;
2222 }
23-
23+ & [data-rounded ] {
24+ border-radius : theme .border-radius (" full" );
25+ .bubble {
26+ border-radius : theme .border-radius (" full" );
27+ }
28+ }
29+
2430 & [data-selected ] {
2531 color : theme .color (" button" , " solid" , " foreground" );
2632 pointer-events : none ;
3844 );
3945 }
4046
47+
4148 & [data-pressed ] .bubble {
4249 background-color : theme .color (
4350 " button" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ import { SingleToggleGroup as SingleToggleGroupComponent } from "./index.jsx";
55const meta = {
66 component : SingleToggleGroupComponent ,
77 argTypes : {
8+ rounded : {
9+ control : "boolean" ,
10+ table : {
11+ category : "Appearance" ,
12+ } ,
13+ } ,
814 items : {
915 table : {
1016 disable : true ,
@@ -21,6 +27,7 @@ export default meta;
2127
2228export const SingleToggleGroup = {
2329 args : {
30+ rounded : false ,
2431 items : [
2532 { id : "foo" , children : "Foo" } ,
2633 { id : "bar" , children : "Bar" } ,
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ type OwnProps = {
1414 selectedKey ?: Key | undefined ;
1515 onSelectionChange ?: ( newValue : Key ) => void ;
1616 items : ComponentProps < typeof ToggleButton > [ ] ;
17+ rounded ?: boolean | undefined ;
1718} ;
19+
1820type Props = Omit <
1921 ComponentProps < typeof ToggleButtonGroup > ,
2022 keyof OwnProps | "selectionMode" | "selectedKeys"
@@ -26,6 +28,7 @@ export const SingleToggleGroup = ({
2628 onSelectionChange,
2729 className,
2830 items,
31+ rounded = false ,
2932 ...props
3033} : Props ) => {
3134 const id = useId ( ) ;
@@ -63,6 +66,7 @@ export const SingleToggleGroup = ({
6366 ) }
6467 data-size = "sm"
6568 data-variant = "ghost"
69+ data-rounded = { rounded ? true : undefined }
6670 { ...toggleButton }
6771 >
6872 { ( args ) => (
You can’t perform that action at this time.
0 commit comments