You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

styled.js 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. import React from 'react';
  2. import styled from 'styled-components';
  3. import { Icon, IconHorizontalPoints } from '../../base/icons';
  4. import { ACTION_TRIGGER } from '../constants';
  5. export const ignoredChildClassName = 'ignore-child';
  6. export const AntiCollapse = styled.br`
  7. font-size: 0;
  8. `;
  9. export const Button = styled.button`
  10. align-items: center;
  11. background-color: ${
  12. // eslint-disable-next-line no-confusing-arrow
  13. props => props.primary ? '#0056E0' : '#3D3D3D'
  14. };
  15. border: 0;
  16. border-radius: 6px;
  17. display: flex;
  18. font-weight: unset;
  19. justify-content: center;
  20. min-height: 32px;
  21. &:hover {
  22. background-color: ${
  23. // eslint-disable-next-line no-confusing-arrow
  24. props => props.primary ? '#246FE5' : '#525252'
  25. };
  26. }
  27. `;
  28. export const QuickActionButton = styled(Button)`
  29. padding: 0 12px;
  30. `;
  31. export const Container = styled.div`
  32. box-sizing: border-box;
  33. flex: 1;
  34. overflow-y: auto;
  35. position: relative;
  36. padding: 0 ${props => props.theme.panePadding}px;
  37. & > * + *:not(.${ignoredChildClassName}) {
  38. margin-top: 16px;
  39. }
  40. &::-webkit-scrollbar {
  41. display: none;
  42. }
  43. `;
  44. export const ContextMenu = styled.div.attrs(props => {
  45. return {
  46. className: props.className
  47. };
  48. })`
  49. background-color: #292929;
  50. border-radius: 3px;
  51. box-shadow: 0px 3px 16px rgba(0, 0, 0, 0.6), 0px 0px 4px 1px rgba(0, 0, 0, 0.25);
  52. color: white;
  53. font-size: ${props => props.theme.contextFontSize}px;
  54. font-weight: ${props => props.theme.contextFontWeight};
  55. margin-top: ${props => {
  56. const {
  57. participantActionButtonHeight,
  58. participantItemHeight
  59. } = props.theme;
  60. return ((3 * participantItemHeight) + participantActionButtonHeight) / 4;
  61. }}px;
  62. position: absolute;
  63. right: ${props => props.theme.panePadding}px;
  64. top: 0;
  65. z-index: 2;
  66. & > li {
  67. list-style: none;
  68. }
  69. ${props => props.isHidden && `
  70. pointer-events: none;
  71. visibility: hidden;
  72. `}
  73. `;
  74. export const ContextMenuIcon = styled(Icon).attrs({
  75. size: 20
  76. })`
  77. & > svg {
  78. fill: #a4b8d1;
  79. }
  80. `;
  81. export const ContextMenuItem = styled.div`
  82. align-items: center;
  83. box-sizing: border-box;
  84. cursor: pointer;
  85. display: flex;
  86. min-height: 40px;
  87. padding: 8px 16px;
  88. & > *:not(:last-child) {
  89. margin-right: 16px;
  90. }
  91. &:hover {
  92. background-color: #525252;
  93. }
  94. `;
  95. export const ContextMenuItemGroup = styled.div`
  96. &:not(:empty) {
  97. padding: 8px 0;
  98. }
  99. & + &:not(:empty) {
  100. border-top: 1px solid #4C4D50;
  101. }
  102. `;
  103. export const Close = styled.div`
  104. align-items: center;
  105. cursor: pointer;
  106. display: flex;
  107. height: 20px;
  108. justify-content: center;
  109. width: 20px;
  110. &:before, &:after {
  111. content: '';
  112. background-color: #a4b8d1;
  113. border-radius: 2px;
  114. height: 2px;
  115. position: absolute;
  116. transform-origin: center center;
  117. width: 21px;
  118. }
  119. &:before {
  120. transform: rotate(45deg);
  121. }
  122. &:after {
  123. transform: rotate(-45deg);
  124. }
  125. `;
  126. export const Footer = styled.div`
  127. background-color: #141414;
  128. display: flex;
  129. justify-content: flex-end;
  130. padding: 24px ${props => props.theme.panePadding}px;
  131. & > *:not(:last-child) {
  132. margin-right: 16px;
  133. }
  134. `;
  135. export const FooterButton = styled(Button)`
  136. height: 40px;
  137. font-size: 15px;
  138. padding: 0 16px;
  139. `;
  140. export const FooterEllipsisButton = styled(FooterButton).attrs({
  141. children: <Icon src = { IconHorizontalPoints } />
  142. })`
  143. padding: 8px;
  144. `;
  145. export const FooterEllipsisContainer = styled.div`
  146. position: relative;
  147. `;
  148. export const Header = styled.div`
  149. align-items: center;
  150. box-sizing: border-box;
  151. display: flex;
  152. height: ${props => props.theme.headerSize}px;
  153. padding: 0 20px;
  154. `;
  155. export const Heading = styled.div`
  156. color: #d1dbe8;
  157. font-style: normal;
  158. font-size: 15px;
  159. line-height: 24px;
  160. margin: 8px 0 ${props => props.theme.panePadding}px;
  161. `;
  162. export const ColoredIcon = styled.div`
  163. & > div > svg {
  164. fill: ${props => props.color || '#fff'};
  165. }
  166. `;
  167. export const ParticipantActionButton = styled(Button)`
  168. height: ${props => props.theme.participantActionButtonHeight}px;
  169. padding: 6px 10px;
  170. `;
  171. export const ParticipantActionEllipsis = styled(ParticipantActionButton).attrs({
  172. children: <Icon src = { IconHorizontalPoints } />,
  173. primary: true
  174. })`
  175. padding: 6px;
  176. `;
  177. export const ParticipantActions = styled.div`
  178. align-items: center;
  179. z-index: 1;
  180. & > *:not(:last-child) {
  181. margin-right: 8px;
  182. }
  183. `;
  184. export const ParticipantActionsHover = styled(ParticipantActions)`
  185. background-color: #292929;
  186. bottom: 1px;
  187. display: none;
  188. position: absolute;
  189. right: ${props => props.theme.panePadding};
  190. top: 0;
  191. &:after {
  192. content: '';
  193. background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #292929 100%);
  194. bottom: 0;
  195. display: block;
  196. left: 0;
  197. pointer-events: none;
  198. position: absolute;
  199. top: 0;
  200. transform: translateX(-100%);
  201. width: 40px;
  202. }
  203. `;
  204. export const ParticipantActionsPermanent = styled(ParticipantActions)`
  205. display: flex;
  206. `;
  207. export const ParticipantContent = styled.div`
  208. align-items: center;
  209. box-shadow: inset 0px -1px 0px rgba(255, 255, 255, 0.15);
  210. display: flex;
  211. flex: 1;
  212. height: 100%;
  213. overflow: hidden;
  214. padding-right: ${props => props.theme.panePadding}px;
  215. `;
  216. export const ParticipantContainer = styled.div`
  217. align-items: center;
  218. color: white;
  219. display: flex;
  220. font-size: 13px;
  221. height: ${props => props.theme.participantItemHeight}px;
  222. margin: 0 -${props => props.theme.panePadding}px;
  223. padding-left: ${props => props.theme.panePadding}px;
  224. position: relative;
  225. ${props => !props.isHighlighted && '&:hover {'}
  226. background-color: #292929;
  227. & ${ParticipantActions} {
  228. ${props => props.trigger === ACTION_TRIGGER.HOVER && `
  229. display: flex;
  230. `}
  231. }
  232. & ${ParticipantContent} {
  233. box-shadow: none;
  234. }
  235. ${props => !props.isHighlighted && '}'}
  236. `;
  237. export const ParticipantInviteButton = styled(Button).attrs({
  238. primary: true
  239. })`
  240. font-size: 15px;
  241. height: 40px;
  242. width: 100%;
  243. & > *:not(:last-child) {
  244. margin-right: 8px;
  245. }
  246. `;
  247. export const ParticipantName = styled.div`
  248. overflow: hidden;
  249. text-overflow: ellipsis;
  250. white-space: nowrap;
  251. `;
  252. export const ParticipantNameContainer = styled.div`
  253. display: flex;
  254. flex: 1;
  255. margin-right: 8px;
  256. overflow: hidden;
  257. `;
  258. export const ParticipantStates = styled.div`
  259. display: flex;
  260. justify-content: flex-end;
  261. & > * {
  262. align-items: center;
  263. display: flex;
  264. justify-content: center;
  265. }
  266. & > *:not(:last-child) {
  267. margin-right: 8px;
  268. }
  269. `;
  270. export const RaisedHandIndicatorBackground = styled.div`
  271. background-color: #ed9e1b;
  272. border-radius: 3px;
  273. height: 24px;
  274. width: 24px;
  275. `;
  276. export const VolumeInput = styled.input.attrs({
  277. type: 'range'
  278. })`
  279. width: 100%;
  280. `;
  281. export const VolumeInputContainer = styled.div`
  282. position: relative;
  283. width: 100%;
  284. `;
  285. export const VolumeOverlay = styled.div`
  286. background-color: #0376da;
  287. border-radius: 1px 0 0 1px;
  288. height: 100%;
  289. left: 0;
  290. pointer-events: none;
  291. position: absolute;
  292. `;