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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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. }
  202. `;
  203. export const ParticipantActionsPermanent = styled(ParticipantActions)`
  204. display: flex;
  205. `;
  206. export const ParticipantContent = styled.div`
  207. align-items: center;
  208. box-shadow: inset 0px -1px 0px rgba(255, 255, 255, 0.15);
  209. display: flex;
  210. flex: 1;
  211. height: 100%;
  212. overflow: hidden;
  213. padding-right: ${props => props.theme.panePadding}px;
  214. `;
  215. export const ParticipantContainer = styled.div`
  216. align-items: center;
  217. color: white;
  218. display: flex;
  219. font-size: 13px;
  220. height: ${props => props.theme.participantItemHeight}px;
  221. margin: 0 -${props => props.theme.panePadding}px;
  222. padding-left: ${props => props.theme.panePadding}px;
  223. position: relative;
  224. ${props => !props.isHighlighted && '&:hover {'}
  225. background-color: #292929;
  226. & ${ParticipantActions} {
  227. ${props => props.trigger === ACTION_TRIGGER.HOVER && `
  228. display: flex;
  229. `}
  230. }
  231. & ${ParticipantContent} {
  232. box-shadow: none;
  233. }
  234. ${props => !props.isHighlighted && '}'}
  235. `;
  236. export const ParticipantInviteButton = styled(Button).attrs({
  237. primary: true
  238. })`
  239. font-size: 15px;
  240. height: 40px;
  241. width: 100%;
  242. & > *:not(:last-child) {
  243. margin-right: 8px;
  244. }
  245. `;
  246. export const ParticipantName = styled.div`
  247. overflow: hidden;
  248. text-overflow: ellipsis;
  249. white-space: nowrap;
  250. `;
  251. export const ParticipantNameContainer = styled.div`
  252. display: flex;
  253. flex: 1;
  254. margin-right: 8px;
  255. overflow: hidden;
  256. `;
  257. export const ParticipantStates = styled.div`
  258. display: flex;
  259. justify-content: flex-end;
  260. & > * {
  261. align-items: center;
  262. display: flex;
  263. justify-content: center;
  264. }
  265. & > *:not(:last-child) {
  266. margin-right: 8px;
  267. }
  268. `;
  269. export const RaisedHandIndicatorBackground = styled.div`
  270. background-color: #ed9e1b;
  271. border-radius: 3px;
  272. height: 24px;
  273. width: 24px;
  274. `;
  275. export const VolumeInput = styled.input.attrs({
  276. type: 'range'
  277. })`
  278. width: 100%;
  279. `;
  280. export const VolumeInputContainer = styled.div`
  281. position: relative;
  282. width: 100%;
  283. `;
  284. export const VolumeOverlay = styled.div`
  285. background-color: #0376da;
  286. border-radius: 1px 0 0 1px;
  287. height: 100%;
  288. left: 0;
  289. pointer-events: none;
  290. position: absolute;
  291. `;