styled.ts 2.4 KB

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