styled.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import styled, { css } from 'styled-components';
  2. import { color } from '../../constants/style';
  3. export const Wrapper = styled('div')<{ open: boolean }>`
  4. border-bottom-left-radius: 4px;
  5. border-bottom-right-radius: 4px;
  6. background-color: white;
  7. position: fixed;
  8. top: 60px;
  9. right: 10px;
  10. display: inline-flex;
  11. padding: 9px 16px;
  12. box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.38);
  13. z-index: 2;
  14. transform: translateY(${props => (props.open ? '0' : '-120px')});
  15. transition: transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms;
  16. `;
  17. export const InputWrapper = styled.div`
  18. width: 230px;
  19. height: 34px;
  20. border-top-left-radius: 4px;
  21. border-bottom-left-radius: 4px;
  22. overflow: hidden;
  23. background-color: ${color['light-gray']};
  24. display: flex;
  25. justify-content: space-between;
  26. align-items: center;
  27. padding: 10px;
  28. `;
  29. export const Input = styled.input`
  30. background-color: ${color['light-gray']};
  31. outline: none;
  32. border: none;
  33. width: 66%;
  34. height: 34px;
  35. box-sizing: border-box;
  36. padding: 0;
  37. `;
  38. export const ResultInfo = styled.span`
  39. display: block;
  40. width: 33%;
  41. text-align: right;
  42. `;
  43. export const ArrowButton = styled('button')<{ variant: string }>`
  44. height: 34px;
  45. width: 30px;
  46. outline: none;
  47. border: none;
  48. background-color: ${color['light-gray']};
  49. cursor: pointer;
  50. position: relative;
  51. display: flex;
  52. align-items: center;
  53. justify-content: center;
  54. ${props =>
  55. props.variant === 'top'
  56. ? css`
  57. margin-left: 1px;
  58. :after {
  59. content: '';
  60. width: 0;
  61. height: 0;
  62. border-left: 5px solid transparent;
  63. border-right: 5px solid transparent;
  64. border-bottom: 5px solid black;
  65. }
  66. :hover:after {
  67. border-bottom: 5px solid ${color.black38};
  68. }
  69. `
  70. : css`
  71. border-top-right-radius: 4px;
  72. border-bottom-right-radius: 4px;
  73. margin-left: 1px;
  74. :after {
  75. content: '';
  76. width: 0;
  77. height: 0;
  78. border-left: 5px solid transparent;
  79. border-right: 5px solid transparent;
  80. border-top: 5px solid black;
  81. }
  82. :hover:after {
  83. border-top: 5px solid ${color.black38};
  84. }
  85. `}
  86. `;
  87. export const LoadingWrapper = styled.div`
  88. transform: scale(0.7);
  89. transform-origin: right;
  90. margin-top: 3px;
  91. `;