Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. const Radio = (props: IRadio) => null;
  2.  
  3. const RadioButtonContainer = styled.div`
  4. display: flex;
  5. flex-direction: row;
  6. justify-content: center;
  7. align-items: center;
  8. margin-bottom: 20px;
  9. `;
  10.  
  11. const HiddenCheckbox = styled.input.attrs({ type: 'radio' })`
  12. border: 0;
  13. visibility: hidden;
  14. height: 1px;
  15. overflow: hidden;
  16. padding: 0;
  17. position: absolute;
  18. white-space: nowrap;
  19. width: 1px;
  20. `;
  21.  
  22. const RadiobuttonIcon = styled.div`
  23. position: absolute;
  24. height: 25px;
  25. width: 25px;
  26. ${(props: IRadio) => (props.checked || props.disabled ? 'visibility: visible;' : 'visibility: hidden;')}
  27. ${(props: IRadio) => (props.disabled ? `visibility: visible` : '')}
  28. &:after {
  29. content: '';
  30. position: absolute;
  31. border-radius: 50%;
  32. left: 6px;
  33. top: 6px;
  34. width: 8px;
  35. height: 8px;
  36. background-color: ${Colors.white};
  37. }
  38. `;
  39.  
  40. const StyledRadioButton = styled.div`
  41. display: inline-block;
  42. width: 20px;
  43. height: 20px;
  44. border-radius: 50%;
  45. box-sizing: border-box;
  46. cursor: pointer;
  47. ${(props: IRadio) => (props.checked && !props.disabled ? `background: ${Colors.turquoise};` : '')}
  48. ${(props: IRadio) => (props.disabled ? `background: ${Colors.gray};` : '')}
  49. ${(props: IRadio) => (props.checked || props.disabled ? '' : `border: 1px solid ${Colors.graylight};`)}
  50. transition: all 170ms;
  51. &:hover {
  52. ${(props: IRadio) => (props.checked || props.disabled ? '' : `border: 1px solid ${Colors.turquoise};`)}
  53. ${(props: IRadio) => (!props.disabled ? 'cursor: pointer;' : `cursor: not-allowed;`)}
  54. }
  55.  
  56. /* ${RadiobuttonIcon} {
  57. ${(props: IRadio) => (props.checked && !props.disabled ? 'visibility: visible;' : 'visibility: hidden;')}
  58. ${(props: IRadio) => (!props.checked && props.disabled ? `visibility: visible` : '')}
  59. } */
  60. `;
  61.  
  62. const RadioButtonName = styled.span`
  63. margin-left: 10px;
  64. `;
  65.  
  66. const RadioButtons = styled.div`
  67. display: flex;
  68. flex-direction: column;
  69. margin-right: auto;
  70. `;
  71.  
  72. export { RadioButtonGroup, Radio };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement