@@ -57,6 +57,8 @@ export interface SplitButtonProps
57
57
text : string ;
58
58
/** Sets rendering position of menu */
59
59
position ?: "left" | "right" ;
60
+ /** Renders the white variant of the secondary split button */
61
+ isWhite ?: boolean ;
60
62
}
61
63
62
64
export type SplitButtonHandle = {
@@ -83,6 +85,7 @@ export const SplitButton = forwardRef<SplitButtonHandle, SplitButtonProps>(
83
85
"data-element" : dataElement ,
84
86
"data-role" : dataRole ,
85
87
"aria-label" : ariaLabel ,
88
+ isWhite = false ,
86
89
...rest
87
90
} ,
88
91
ref ,
@@ -97,6 +100,8 @@ export const SplitButton = forwardRef<SplitButtonHandle, SplitButtonProps>(
97
100
const { isInFlatTable } =
98
101
useContext < FlatTableContextProps > ( FlatTableContext ) ;
99
102
103
+ const shouldRenderIsWhiteVariant = buttonType === "secondary" && isWhite ;
104
+
100
105
useImperativeHandle < SplitButtonHandle , SplitButtonHandle > (
101
106
ref ,
102
107
( ) => ( {
@@ -140,6 +145,7 @@ export const SplitButton = forwardRef<SplitButtonHandle, SplitButtonProps>(
140
145
onClick : handleMainClick ,
141
146
size,
142
147
subtext,
148
+ isWhite : shouldRenderIsWhiteVariant ,
143
149
...filterOutStyledSystemSpacingProps ( rest ) ,
144
150
} ;
145
151
@@ -148,6 +154,7 @@ export const SplitButton = forwardRef<SplitButtonHandle, SplitButtonProps>(
148
154
} ;
149
155
150
156
const toggleButtonProps = {
157
+ isWhite : shouldRenderIsWhiteVariant ,
151
158
disabled,
152
159
displayed : showAdditionalButtons ,
153
160
onTouchStart : showButtons ,
0 commit comments