Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

constants.ts 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. import { Theme } from '@mui/material';
  2. /**
  3. * The types of the buttons.
  4. */
  5. export enum BUTTON_TYPES {
  6. DESTRUCTIVE = 'destructive',
  7. PRIMARY = 'primary',
  8. SECONDARY = 'secondary',
  9. TERTIARY = 'tertiary'
  10. }
  11. /**
  12. * The modes of the buttons.
  13. */
  14. export const BUTTON_MODES: {
  15. CONTAINED: 'contained';
  16. } = {
  17. CONTAINED: 'contained'
  18. };
  19. /**
  20. * Returns an object containing the declaration of the common, reusable CSS classes.
  21. *
  22. * @param {Object} theme -The theme.
  23. *
  24. * @returns {Object} - The common styles.
  25. */
  26. export const commonStyles = (theme: Theme) => {
  27. return {
  28. '.empty-list': {
  29. listStyleType: 'none',
  30. margin: 0,
  31. padding: 0
  32. },
  33. '.mute-dialog': {
  34. '& .separator-line': {
  35. margin: `${theme.spacing(4)} 0 ${theme.spacing(4)} -20px`,
  36. padding: '0 20px',
  37. width: '100%',
  38. height: '1px',
  39. background: '#5E6D7A'
  40. },
  41. '& .control-row': {
  42. display: 'flex',
  43. justifyContent: 'space-between',
  44. marginTop: theme.spacing(3),
  45. '& label': {
  46. fontSize: '14px'
  47. }
  48. }
  49. },
  50. '.overflow-menu-item': {
  51. alignItems: 'center',
  52. color: theme.palette.text01,
  53. cursor: 'pointer',
  54. display: 'flex',
  55. fontSize: 14,
  56. fontWeight: 400,
  57. height: 40,
  58. lineHeight: '24px',
  59. padding: '8px 16px',
  60. boxSizing: 'border-box' as const,
  61. '& > div': {
  62. display: 'flex',
  63. alignItems: 'center'
  64. },
  65. '&.unclickable': {
  66. cursor: 'default'
  67. },
  68. '&.disabled': {
  69. cursor: 'initial',
  70. color: theme.palette.text03,
  71. '&:hover': {
  72. background: 'none'
  73. },
  74. '& svg': {
  75. fill: theme.palette.text03
  76. }
  77. },
  78. '@media (hover: hover) and (pointer: fine)': {
  79. '&:hover': {
  80. background: theme.palette.action02Hover
  81. },
  82. '&.unclickable:hover': {
  83. background: 'inherit'
  84. }
  85. }
  86. },
  87. '.overflow-menu-item-icon': {
  88. marginRight: '16px',
  89. '& i': {
  90. display: 'inline',
  91. fontSize: 24
  92. },
  93. '@media (hover: hover) and (pointer: fine)': {
  94. '&i:hover': {
  95. backgroundColor: 'initial'
  96. }
  97. },
  98. '& img': {
  99. maxWidth: 24,
  100. maxHeight: 24
  101. },
  102. '& svg': {
  103. fill: theme.palette.text01,
  104. height: 20,
  105. width: 20
  106. }
  107. },
  108. '.participant-avatar': {
  109. margin: `${theme.spacing(2)} ${theme.spacing(3)} ${theme.spacing(2)} 0`
  110. },
  111. '.prejoin-dialog': {
  112. background: '#1C2025',
  113. boxShadow: '0px 2px 20px rgba(0, 0, 0, 0.5)',
  114. borderRadius: '5px',
  115. color: '#fff',
  116. height: '400px',
  117. width: '375px',
  118. '.prejoin-dialog--small': {
  119. height: 300,
  120. width: 400
  121. },
  122. '.prejoin-dialog-label': {
  123. fontSize: '15px',
  124. lineHeight: '24px'
  125. },
  126. '.prejoin-dialog-label-num': {
  127. background: '#2b3b4b',
  128. border: '1px solid #A4B8D1',
  129. borderRadius: '50%',
  130. color: '#fff',
  131. display: 'inline-block',
  132. height: '24px',
  133. marginRight: theme.spacing(2),
  134. width: '24px'
  135. },
  136. '.prejoin-dialog-container': {
  137. alignItems: 'center',
  138. background: 'rgba(0,0,0,0.6)',
  139. display: 'flex',
  140. height: '100vh',
  141. justifyContent: 'center',
  142. left: 0,
  143. position: 'absolute' as const,
  144. top: 0,
  145. width: '100vw',
  146. zIndex: 3
  147. },
  148. '.prejoin-dialog-flag': {
  149. display: 'inline-block',
  150. marginRight: theme.spacing(2),
  151. transform: 'scale(1.2)'
  152. },
  153. '.prejoin-dialog-title': {
  154. display: 'inline-block',
  155. fontSize: '24px',
  156. lineHeight: '32px'
  157. },
  158. '.prejoin-dialog-icon': {
  159. cursor: 'pointer',
  160. '& > svg': {
  161. fill: '#A4B8D1'
  162. }
  163. },
  164. '.prejoin-dialog-btn': {
  165. width: '309px'
  166. },
  167. '.prejoin-dialog-dialin-container': {
  168. textAlign: 'center' as const
  169. },
  170. '.prejoin-dialog-delimiter': {
  171. background: '#5f6266',
  172. border: '0',
  173. height: '1px',
  174. margin: '0',
  175. padding: '0',
  176. width: '100%'
  177. },
  178. '.prejoin-dialog-delimiter-container': {
  179. margin: `${theme.spacing(3)} 0 ${theme.spacing(4)} 0`,
  180. position: 'relative' as const
  181. },
  182. '.prejoin-dialog-delimiter-txt-container': {
  183. position: 'absolute' as const,
  184. textAlign: 'center' as const,
  185. top: '-8px',
  186. width: '100%'
  187. },
  188. '.prejoin-dialog-delimiter-txt': {
  189. background: '#1C2025',
  190. color: '#5f6266',
  191. fontSize: '11px',
  192. textTransform: 'uppercase' as const,
  193. padding: `0 ${theme.spacing(2)}`
  194. }
  195. },
  196. '.prejoin-dialog-btn': {
  197. '&.primary, &.prejoin-dialog-btn.text': {
  198. width: '310px'
  199. }
  200. },
  201. '.toolbox-icon': {
  202. display: 'flex',
  203. borderRadius: 3,
  204. flexDirection: 'column' as const,
  205. fontSize: 24,
  206. height: 48,
  207. justifyContent: 'center',
  208. width: 48,
  209. '@media (hover: hover) and (pointer: fine)': {
  210. '&:hover': {
  211. background: theme.palette.ui04
  212. }
  213. },
  214. [theme.breakpoints.down(320)]: {
  215. height: 36,
  216. width: 36
  217. },
  218. '&.toggled': {
  219. background: theme.palette.ui03
  220. },
  221. '&.disabled': {
  222. cursor: 'initial !important',
  223. backgroundColor: `${theme.palette.disabled01} !important`,
  224. '& svg': {
  225. fill: `${theme.palette.text03} !important`
  226. }
  227. }
  228. },
  229. '.toolbox-button': {
  230. color: theme.palette.text01,
  231. cursor: 'pointer',
  232. display: 'inline-block',
  233. lineHeight: '48px',
  234. textAlign: 'center' as const
  235. },
  236. '.toolbox-content-items': {
  237. background: theme.palette.ui01,
  238. borderRadius: 6,
  239. margin: '0 auto',
  240. padding: 6,
  241. textAlign: 'center' as const,
  242. pointerEvents: 'all' as const,
  243. boxShadow: '0px 2px 8px 4px rgba(0, 0, 0, 0.25), 0px 0px 0px 1px rgba(0, 0, 0, 0.15)',
  244. '& > div': {
  245. marginLeft: 8,
  246. '&:first-child': {
  247. marginLeft: 0
  248. }
  249. }
  250. }
  251. };
  252. };
  253. /**
  254. * Returns the global styles.
  255. *
  256. * @param {Object} theme - The Jitsi theme.
  257. * @returns {Object}
  258. */
  259. export const getGlobalStyles = (theme: Theme) => {
  260. return {
  261. // @atlaskit/modal-dialog OVERRIDES
  262. '.atlaskit-portal div[role=dialog]': {
  263. // override dialog background
  264. '& > div': {
  265. background: theme.palette.ui02,
  266. color: theme.palette.text01
  267. }
  268. }
  269. };
  270. };