11import  React ,  {  useRef  }  from  "react" ; 
2- import  styled  from  "styled-components" ; 
2+ import  styled ,   {   css ,   keyframes   }  from  "styled-components" ; 
33import  Spine ,  {  VariantProp ,  variantColor  }  from  "./spine" ; 
44export  type  {  VariantProp  } ; 
55import  {  h2 ,  p ,  small  }  from  "../../../styles/common-style" ; 
@@ -8,10 +8,34 @@ export interface SideProp {
88  rightSided ?: boolean ; 
99} 
1010
11- const  Wrapper  =  styled . div < SideProp > ` 
11+ export  interface  StateProp  { 
12+   state ?: "loading"  |  "disabled"  |  "active" ; 
13+ } 
14+ 
15+ const  loading  =  keyframes ` 
16+   0%{ 
17+     opacity: 1; 
18+   } 
19+   50%{ 
20+     opacity: 0.5; 
21+   } 
22+   100%{ 
23+     opacity: 1; 
24+   } 
25+ ` ; 
26+ 
27+ const  Wrapper  =  styled . div < SideProp  &  StateProp > ` 
1228  display: flex; 
29+   position: relative; 
30+   opacity: ${ ( {  state } )  =>  ( ! state  ||  state  ===  "active"  ? 1  : 0.5 ) }  
1331  justify-content: ${ ( {  rightSided } )  =>  
1432    rightSided  ? "flex-start"  : "flex-end" }  ;
33+   ${ ( {  state } )  =>  
34+     state  ===  "loading"  
35+       ? css `  
36+           animation: ${ loading }  
37+         ` 
38+       : "none" }  ;
1539` ; 
1640
1741const  StyledTitle  =  styled . h2 `` ; 
@@ -78,7 +102,7 @@ const PartyTitleContainer = styled.div<SideProp>`
78102    rightSided  ? "flex-start"  : "flex-end" }  ;
79103` ; 
80104
81- interface  BulletProps  extends  VariantProp ,  SideProp  { 
105+ interface  BulletProps  extends  VariantProp ,  SideProp ,   StateProp  { 
82106  title : string ; 
83107  party : string  |  React . ReactElement ; 
84108  subtitle : string ; 
@@ -90,14 +114,17 @@ interface BulletProps extends VariantProp, SideProp {
90114
91115const  Bullet : React . FC < BulletProps >  =  ( props )  =>  { 
92116  const  {  title,  party,  subtitle,  ...restProps  }  =  props ; 
93-   const  {  rightSided,  variant,  line,  Icon,  isLast,  ...wrapperProps  }  = 
117+   const  {  rightSided,  variant,  line,  Icon,  isLast,  state ,   ...wrapperProps  }  = 
94118    restProps ; 
95119  const  titleRef  =  useRef < HTMLHeadingElement > ( null ) ; 
96120
97121  return  ( 
98-     < Wrapper  { ...{  rightSided } }  { ...wrapperProps } > 
122+     < Wrapper  { ...{  rightSided,  state  } }  { ...wrapperProps } > 
99123      < Spine  { ...{  variant,  line,  Icon,  titleRef } }  /> 
100-       < TextContainer  { ...{  variant,  rightSided,  isLast } } > 
124+       < TextContainer 
125+         className = "text-container" 
126+         { ...{  variant,  rightSided,  isLast } } 
127+       > 
101128        < PartyTitleContainer  { ...{  rightSided } } > 
102129          < StyledTitle  ref = { titleRef } > { title } </ StyledTitle > 
103130          { typeof  party  ===  `string`  ? ( 
0 commit comments