19
19
import { useState } from 'react' ;
20
20
21
21
import { cssModules } from '../../bpk-react-utils' ;
22
- import BpkAriaLive from '../../bpk-component-aria-live'
23
22
// @ts -expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
23
import SwapVertical from '../../bpk-component-icon/sm/swap--vertical' ;
25
24
26
25
import STYLES from './BpkSwapButton.module.scss' ;
27
26
28
27
const getClassName = cssModules ( STYLES ) ;
29
28
29
+ export const SWAPBUTTON_STYLES = {
30
+ surfaceContrast : 'surface-contrast' ,
31
+ canvasDefault : 'canvas-default' ,
32
+ canvasContrast : 'canvas-contrast' ,
33
+ } ;
34
+ export type SwapButtonStyle = ( typeof SWAPBUTTON_STYLES ) [ keyof typeof SWAPBUTTON_STYLES ]
35
+
30
36
export type Props = {
31
37
onClick : ( ) => void ,
32
38
ariaLabel : string ,
39
+ swapButtonStyle ?: SwapButtonStyle ,
33
40
}
34
41
const BpkSwapButton = ( props : Props ) => {
35
- const { ariaLabel, onClick } = props ;
42
+ const { ariaLabel, onClick, swapButtonStyle = SWAPBUTTON_STYLES . surfaceContrast } = props ;
36
43
37
44
const [ rotationDegree , setRotationDegree ] = useState ( 0 ) ;
38
45
@@ -48,7 +55,7 @@ const BpkSwapButton = ( props: Props ) => {
48
55
< div className = { getClassName ( 'bpk-swap-button' ) } >
49
56
< button
50
57
type = "button"
51
- className = { getClassName ( 'bpk-swap-button__button' ) }
58
+ className = { getClassName ( 'bpk-swap-button__button' , `bpk-swap-button__button-- ${ swapButtonStyle } ` ) }
52
59
style = { { transform : `rotate(${ rotationDegree } deg)` } }
53
60
aria-label = { ariaLabel }
54
61
onClick = { ( ) => {
0 commit comments