@@ -2,7 +2,7 @@ import * as React from 'react';
22import cx from 'classnames' ;
33import Input , { COLOR , SIZE } from '../form-elements/Input' ;
44import type { InputPropsType } from '../form-elements/Input' ;
5- import Icon , { ICON_COLOR } from '../icons/Icon' ;
5+ import Icon from '../icons/Icon' ;
66import Button from '../buttons/Button' ;
77
88export type SearchPropsType = {
@@ -73,34 +73,21 @@ const Search = ({
7373 className = { cx ( `${ baseClassName } __input` , inputClassName ) }
7474 fullWidth
7575 />
76-
77- { withRoundButton ? (
78- < div className = { `${ baseClassName } __icon` } >
79- < Button
80- variant = "solid"
81- className = { cx ( {
82- 'sg-search-button--s' : size === 's' ,
83- } ) }
84- icon = {
85- < Icon
86- type = "search"
87- size = { size === 'l' ? 24 : 16 }
88- color = "adaptive"
89- />
90- }
91- iconOnly
92- size = { size === 'l' ? 'm' : 's' }
93- />
94- </ div >
95- ) : (
96- < button className = { `${ baseClassName } __icon` } >
97- < Icon
98- type = "search"
99- color = { ICON_COLOR [ 'icon-gray-50' ] }
100- size = { size === 'l' ? 24 : 16 }
101- />
102- </ button >
103- ) }
76+ < Button
77+ variant = { withRoundButton ? 'solid' : 'transparent-light' }
78+ className = { cx ( [
79+ `${ baseClassName } __icon` ,
80+ `${ baseClassName } __icon--${ size } ` ,
81+ {
82+ [ `${ baseClassName } __icon--transparent` ] : ! withRoundButton ,
83+ } ,
84+ ] ) }
85+ icon = {
86+ < Icon type = "search" size = { size === 'l' ? 24 : 16 } color = "adaptive" />
87+ }
88+ iconOnly
89+ size = { size === 'l' ? 'm' : 's' }
90+ />
10491 </ div >
10592 ) ;
10693} ;
0 commit comments