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 20
20
transition-duration : 100ms ;
21
21
transition-timing-function : linear ;
22
22
}
23
-
23
+ & [data-rounded ] {
24
+ border-radius : theme .border-radius (" full" );
25
+ .bubble {
26
+ border-radius : theme .border-radius (" full" );
27
+ }
28
+ }
29
+
24
30
& [data-selected ] {
25
31
color : theme .color (" button" , " solid" , " foreground" );
26
32
pointer-events : none ;
38
44
);
39
45
}
40
46
47
+
41
48
& [data-pressed ] .bubble {
42
49
background-color : theme .color (
43
50
" button" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ import { SingleToggleGroup as SingleToggleGroupComponent } from "./index.jsx";
5
5
const meta = {
6
6
component : SingleToggleGroupComponent ,
7
7
argTypes : {
8
+ rounded : {
9
+ control : "boolean" ,
10
+ table : {
11
+ category : "Appearance" ,
12
+ } ,
13
+ } ,
8
14
items : {
9
15
table : {
10
16
disable : true ,
@@ -21,6 +27,7 @@ export default meta;
21
27
22
28
export const SingleToggleGroup = {
23
29
args : {
30
+ rounded : false ,
24
31
items : [
25
32
{ id : "foo" , children : "Foo" } ,
26
33
{ id : "bar" , children : "Bar" } ,
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ type OwnProps = {
14
14
selectedKey ?: Key | undefined ;
15
15
onSelectionChange ?: ( newValue : Key ) => void ;
16
16
items : ComponentProps < typeof ToggleButton > [ ] ;
17
+ rounded ?: boolean | undefined ;
17
18
} ;
19
+
18
20
type Props = Omit <
19
21
ComponentProps < typeof ToggleButtonGroup > ,
20
22
keyof OwnProps | "selectionMode" | "selectedKeys"
@@ -26,6 +28,7 @@ export const SingleToggleGroup = ({
26
28
onSelectionChange,
27
29
className,
28
30
items,
31
+ rounded = false ,
29
32
...props
30
33
} : Props ) => {
31
34
const id = useId ( ) ;
@@ -63,6 +66,7 @@ export const SingleToggleGroup = ({
63
66
) }
64
67
data-size = "sm"
65
68
data-variant = "ghost"
69
+ data-rounded = { rounded ? true : undefined }
66
70
{ ...toggleButton }
67
71
>
68
72
{ ( args ) => (
You can’t perform that action at this time.
0 commit comments