File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,24 @@ export const WithLabelActive: Story = {
4343 } ,
4444} ;
4545
46+ export const IconOnlyIsSelect : Story = {
47+ args : {
48+ children : '' ,
49+ icon : 'starhollow' ,
50+ isActive : false ,
51+ isSelect : true ,
52+ } ,
53+ } ;
54+
55+ export const WithLabelIsSelect : Story = {
56+ args : {
57+ children : 'Hello World' ,
58+ icon : 'starhollow' ,
59+ isActive : false ,
60+ isSelect : true ,
61+ } ,
62+ } ;
63+
4664export const IconOnlyWithTooltip : Story = {
4765 args : {
4866 icon : 'starhollow' ,
Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ interface ButtonActionProps {
1010 icon : IconType ;
1111 children ?: string ;
1212 isActive ?: boolean ;
13+ isSelect ?: boolean ;
1314 tooltip ?: string ;
1415}
1516
1617interface ButtonStylingProps {
1718 isActive ?: boolean ;
19+ isSelect ?: boolean ;
1820}
1921
2022const StyledButton = styled . button < ButtonStylingProps > `
@@ -54,10 +56,20 @@ const StyledButton = styled.button<ButtonStylingProps>`
5456 }
5557` ;
5658
59+ const Chevron = (
60+ < svg viewBox = "0 0 8 8" width = "8px" height = "8px" >
61+ < path
62+ fill = "#73828C"
63+ d = "M.85 1.9a.5.5 0 1 0-.7.7l3.5 3.5c.2.2.5.2.7 0l3.5-3.5a.5.5 0 1 0-.7-.7L4 5.04.85 1.9Z"
64+ />
65+ </ svg >
66+ ) ;
67+
5768export const ButtonAction = ( {
5869 children,
5970 icon,
6071 isActive = false ,
72+ isSelect = false ,
6173 tooltip,
6274 ...rest
6375} : ButtonActionProps ) => {
@@ -69,16 +81,17 @@ export const ButtonAction = ({
6981 delayShow = { 600 }
7082 { ...rest }
7183 >
72- < StyledButton isActive = { isActive } as = "div" >
84+ < StyledButton isActive = { isActive } isSelect = { isSelect } as = "div" >
7385 { icon && < Icon icon = { icon } /> }
7486 { children }
7587 </ StyledButton >
7688 </ WithTooltip >
7789 ) ;
7890 return (
79- < StyledButton isActive = { isActive } { ...rest } >
91+ < StyledButton isActive = { isActive } isSelect = { isSelect } { ...rest } >
8092 { icon && < Icon icon = { icon } /> }
8193 { children }
94+ { isSelect ? Chevron : null }
8295 </ StyledButton >
8396 ) ;
8497} ;
You can’t perform that action at this time.
0 commit comments