styled.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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: 32px;
  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 14px;
  28. `;
  29. export const Input = styled.input`
  30. background-color: ${color['light-gray']};
  31. outline: none;
  32. border: none;
  33. width: auto;
  34. height: 32px;
  35. box-sizing: border-box;
  36. padding: 0;
  37. flex: 1 2 auto;
  38. `;
  39. export const ResultInfo = styled.span`
  40. display: block;
  41. flex: 1 1 auto;
  42. text-align: right;
  43. `;
  44. export const ArrowButton = styled('button')<{ variant: string }>`
  45. height: 32px;
  46. width: 30px;
  47. outline: none;
  48. border: none;
  49. background-color: ${color['light-gray']};
  50. cursor: pointer;
  51. position: relative;
  52. display: flex;
  53. align-items: center;
  54. justify-content: center;
  55. ${props =>
  56. props.variant === 'top'
  57. ? css`
  58. margin-left: 1px;
  59. :after {
  60. content: '';
  61. width: 0;
  62. height: 0;
  63. border-left: 5px solid transparent;
  64. border-right: 5px solid transparent;
  65. border-bottom: 5px solid black;
  66. position: absolute;
  67. }
  68. :hover:after {
  69. border-bottom: 5px solid ${color.black38};
  70. }
  71. `
  72. : css`
  73. border-top-right-radius: 4px;
  74. border-bottom-right-radius: 4px;
  75. margin-left: 1px;
  76. :after {
  77. content: '';
  78. width: 0;
  79. height: 0;
  80. border-left: 5px solid transparent;
  81. border-right: 5px solid transparent;
  82. border-top: 5px solid black;
  83. position: absolute;
  84. }
  85. :hover:after {
  86. border-top: 5px solid ${color.black38};
  87. }
  88. `}
  89. `;