styles.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. import styled from 'styled-components/macro';
  2. import theme from 'styled-theming';
  3. const StyledEventsCalendar = styled.div`
  4. .rbc-month-view,
  5. .rbc-time-view,
  6. .rbc-time-header {
  7. border: 1px solid var(--border);
  8. }
  9. .rbc-off-range-bg,
  10. .rbc-today {
  11. background: transparent;
  12. }
  13. .rbc-header {
  14. border-bottom: 1px solid var(--border);
  15. height: 40px;
  16. display: flex;
  17. align-items: center;
  18. justify-content: center;
  19. font-family: var(--heading-font);
  20. font-size: 10px;
  21. text-transform: uppercase;
  22. color: var(--header);
  23. font-weight: 600;
  24. button {
  25. font-weight: 600;
  26. }
  27. }
  28. .rbc-day-bg + .rbc-day-bg,
  29. .rbc-header + .rbc-header,
  30. .rbc-time-header-content,
  31. .rbc-time-content > * + * > * {
  32. border-left: 1px solid var(--border);
  33. }
  34. .rbc-time-content,
  35. .rbc-time-content:first-of-type {
  36. border-top: none;
  37. }
  38. .rbc-time-header.rbc-overflowing {
  39. border-right: 1px solid var(--border);
  40. }
  41. .rbc-month-row + .rbc-month-row {
  42. border-top: 1px solid var(--border);
  43. }
  44. .rbc-day-slot .rbc-time-slot {
  45. border-top: 1px dashed var(--border);
  46. }
  47. .rbc-timeslot-group {
  48. border-bottom: 1px dashed var(--border);
  49. position: relative;
  50. &:last-of-type {
  51. border-bottom: none;
  52. }
  53. }
  54. .rbc-current-time-indicator {
  55. background: ${theme('theme', {
  56. light: 'var(--azure)',
  57. dark: 'var(--accent)'
  58. })};
  59. }
  60. .rbc-time-gutter {
  61. width: 68px;
  62. .rbc-timeslot-group {
  63. .rbc-time-slot {
  64. &:first-of-type {
  65. flex: 1;
  66. align-items: center;
  67. justify-content: center;
  68. position: relative;
  69. &:before {
  70. content: '';
  71. position: absolute;
  72. top: 50%;
  73. left: 0;
  74. width: 100%;
  75. height: 1px;
  76. border-top: 1px dashed var(--border);
  77. transform: translateY(-50%);
  78. z-index: 1;
  79. }
  80. .rbc-label {
  81. position: relative;
  82. z-index: 2;
  83. font-family: var(--heading-font);
  84. font-size: 9px;
  85. letter-spacing: 0.45px;
  86. font-weight: 600;
  87. color: var(--btn-text);
  88. height: 20px;
  89. width: 40px;
  90. background: var(--widget);
  91. border-radius: 8px;
  92. display: flex;
  93. align-items: center;
  94. justify-content: center;
  95. line-height: 11px;
  96. }
  97. }
  98. &:last-of-type {
  99. display: none;
  100. }
  101. }
  102. }
  103. }
  104. &.day {
  105. .rbc-day-slot .rbc-timeslot-group:first-of-type .rbc-time-slot:first-of-type {
  106. border-top: none;
  107. }
  108. .rbc-time-header {
  109. display: none;
  110. }
  111. }
  112. &.week {
  113. .rbc-allday-cell,
  114. .rbc-current-time-indicator{
  115. display: none;
  116. }
  117. .rbc-time-header {
  118. border: none;
  119. }
  120. }
  121. &.month .rbc-month-view {
  122. min-height: 500px;
  123. .rbc-date-cell {
  124. padding: 4px 0 0 0;
  125. text-align: center;
  126. &.rbc-off-range {
  127. opacity: .5;
  128. }
  129. &.rbc-now .rbc-button-link {
  130. font-weight: 600;
  131. color: ${theme('theme', {
  132. light: 'var(--blue)',
  133. dark: 'var(--accent)'
  134. })};
  135. }
  136. .rbc-button-link {
  137. font-size: 0.75rem;
  138. font-family: var(--heading-font);
  139. font-weight: 500;
  140. }
  141. }
  142. // tablet portrait
  143. @media screen and (min-width: 768px) {
  144. min-height: 800px;
  145. .rbc-date-cell {
  146. text-align: right;
  147. padding: 10px;
  148. }
  149. }
  150. // desktop
  151. @media screen and (min-width: 1280px) {
  152. min-height: 1200px;
  153. }
  154. }
  155. .rbc-time-view {
  156. flex: unset;
  157. }
  158. .rbc-timeslot-group {
  159. max-height: 40px;
  160. .rbc-time-slot {
  161. display: flex;
  162. align-items: center;
  163. height: 20px;
  164. }
  165. }
  166. .rbc-events-container {
  167. margin: 0 !important;
  168. .rbc-event {
  169. padding: 0;
  170. background: transparent;
  171. border: none;
  172. border-radius: 0;
  173. &-label {
  174. display: none;
  175. }
  176. }
  177. }
  178. .rbc-event {
  179. padding: 0;
  180. background: transparent !important;
  181. border-radius: 0;
  182. outline: none !important;
  183. }
  184. .rbc-show-more {
  185. color: ${theme('theme', {
  186. light: 'var(--blue)',
  187. dark: 'var(--accent)'
  188. })};
  189. background: transparent;
  190. margin: 10px auto 0;
  191. }
  192. .rbc-row-segment {
  193. min-height: 20px;
  194. // desktop
  195. @media screen and (min-width: 1280px) {
  196. min-height: 40px;
  197. }
  198. }
  199. `;
  200. const Header = styled.div`
  201. margin-bottom: 20px;
  202. display: flex;
  203. flex-direction: column;
  204. gap: 20px;
  205. text-align: center;
  206. // tablet landscape
  207. @media screen and (min-width: 1024px) {
  208. flex-direction: row;
  209. align-items: center;
  210. justify-content: space-between;
  211. &[dir="ltr"] {
  212. &[data-view="day"] .date {
  213. margin-left: 68px;
  214. }
  215. }
  216. &[dir="rtl"] {
  217. &[data-view="day"] .date {
  218. margin-right: 68px;
  219. }
  220. }
  221. }
  222. `;
  223. const Navigation = styled.div`
  224. grid-template-columns: repeat(3, 1fr);
  225. width: 100%;
  226. // tablet landscape
  227. @media screen and (min-width: 1024px) {
  228. max-width: 300px;
  229. }
  230. `;
  231. export {StyledEventsCalendar, Navigation, Header}