您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

styled.js 6.7KB

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