File tree Expand file tree Collapse file tree 3 files changed +8
-22
lines changed
Expand file tree Collapse file tree 3 files changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,5 @@ export const Playground: Story = {
1919 align : "center" ,
2020 fillWidth : false ,
2121 loading : false ,
22- showLabelWithLoading : false ,
2322 } ,
2423} ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ describe("Button", () => {
2424 expect ( counter ) . toEqual ( 1 ) ;
2525 } ) ;
2626
27- it ( "given a loading button, it should render the loading icon " , async ( ) => {
27+ it ( "given a loading button, it should render the loading animation " , async ( ) => {
2828 const { getAllByTestId } = renderButton ( {
2929 label : "Button" ,
3030 loading : true ,
@@ -34,19 +34,7 @@ describe("Button", () => {
3434 expect ( loadingButton . length ) . toEqual ( 1 ) ;
3535 } ) ;
3636
37- it ( "given a loading button and showLabelWithLoading, it should render the loading icon and the label" , async ( ) => {
38- const { getAllByTestId, getByTestId } = renderButton ( {
39- label : "Button" ,
40- loading : true ,
41- showLabelWithLoading : true ,
42- } ) ;
43-
44- const loadingButton = getAllByTestId ( "click-ui-loading-icon" ) ;
45- expect ( loadingButton . length ) . toEqual ( 1 ) ;
46- expect ( getByTestId ( "click-ui-loading-icon-wrapper" ) ) . toHaveTextContent ( "Button" ) ;
47- } ) ;
48-
49- it ( "given a non-loading button, it should not render the loading icon" , async ( ) => {
37+ it ( "given a non-loading button, it should not render the loading animation" , async ( ) => {
5038 const { queryAllByTestId } = renderButton ( {
5139 label : "Button" ,
5240 loading : false ,
Original file line number Diff line number Diff line change @@ -71,10 +71,10 @@ export const Button = ({
7171
7272const shimmer = keyframes `
7373 0% {
74- background- position: -200px 0;
74+ background- position: 100% 0;
7575 }
7676 100% {
77- background- position: 200px 0;
77+ background- position: -100% 0;
7878 }
7979` ;
8080
@@ -108,27 +108,26 @@ const StyledButton = styled(BaseButton)<{
108108 right: 0;
109109 bottom: 0;
110110 pointer-events: none;
111- background-size: 200px 100%;
111+ background-size: 200% 100%;
112112 opacity: 0;
113113 }
114114
115115 ${ ( { $loading, $styleType, theme } ) => {
116116 if ( ! $loading ) return "" ;
117117
118- // Create dynamic shimmer gradient using the button's background colors
119- const bgDefault = "rgba(255, 255, 255, 0)" ;
120118 const bgHover = theme . click . button . basic . color [ $styleType ] . background . hover ;
121119
122120 const shimmerGradient = `linear-gradient(
123121 90deg,
124122 ${ bgHover } 0%,
125- ${ theme . global . color . background . default } 50%,
123+ transparent 50%,
126124 ${ bgHover } 100%
127125 )` ;
128126
129127 return css `
130128 & ::before {
131- background : ${ shimmerGradient } 0% 0% / 50% 100% no-repeat;
129+ background : ${ shimmerGradient } ;
130+ background-size : 200% 100% ;
132131 animation : ${ shimmer } 1.5s ease-in-out infinite;
133132 opacity : 1 ;
134133 }
You can’t perform that action at this time.
0 commit comments