Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

constants.ts 9.0KB

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