@atlaskit/emoji 64.1.1 → 64.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -0
  3. package/dist/cjs/api/EmojiResource.js +36 -1
  4. package/dist/cjs/api/media/SiteEmojiResource.js +10 -2
  5. package/dist/cjs/components/common/CachingEmoji.js +33 -5
  6. package/dist/cjs/components/common/DeleteButton.js +9 -13
  7. package/dist/cjs/components/common/Emoji.js +25 -36
  8. package/dist/cjs/components/common/EmojiActions.js +26 -31
  9. package/dist/cjs/components/common/EmojiButton.js +7 -7
  10. package/dist/cjs/components/common/EmojiDeletePreview.js +20 -26
  11. package/dist/cjs/components/common/EmojiErrorMessage.js +10 -14
  12. package/dist/cjs/components/common/EmojiPlaceholder.js +5 -12
  13. package/dist/cjs/components/common/EmojiPreview.js +20 -40
  14. package/dist/cjs/components/common/EmojiPreviewComponent.js +34 -0
  15. package/dist/cjs/components/common/EmojiUploadPicker.js +26 -24
  16. package/dist/cjs/components/common/EmojiUploadPreview.js +22 -28
  17. package/dist/cjs/components/common/ResourcedEmoji.js +25 -9
  18. package/dist/cjs/components/common/ResourcedEmojiComponent.js +17 -0
  19. package/dist/cjs/components/common/RetryableButton.js +12 -18
  20. package/dist/cjs/components/common/Scrollable.js +5 -10
  21. package/dist/cjs/components/common/UfoErrorBoundary.js +52 -0
  22. package/dist/cjs/components/common/styles.js +210 -266
  23. package/dist/cjs/components/picker/CategorySelector.js +13 -12
  24. package/dist/cjs/components/picker/EmojiPicker.js +6 -6
  25. package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +8 -14
  26. package/dist/cjs/components/picker/EmojiPickerComponent.js +9 -18
  27. package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +8 -12
  28. package/dist/cjs/components/picker/EmojiPickerFooter.js +8 -14
  29. package/dist/cjs/components/picker/EmojiPickerList.js +8 -9
  30. package/dist/cjs/components/picker/EmojiPickerListSearch.js +10 -8
  31. package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +9 -15
  32. package/dist/cjs/components/picker/styles.js +113 -161
  33. package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +9 -15
  34. package/dist/cjs/components/typeahead/EmojiTypeAheadItem.js +10 -13
  35. package/dist/cjs/components/typeahead/EmojiTypeAheadList.js +17 -22
  36. package/dist/cjs/components/typeahead/styles.js +17 -19
  37. package/dist/cjs/components/uploader/EmojiUploadComponent.js +10 -16
  38. package/dist/cjs/components/uploader/styles.js +4 -4
  39. package/dist/cjs/i18n/cs.js +2 -2
  40. package/dist/cjs/i18n/da.js +2 -2
  41. package/dist/cjs/i18n/de.js +2 -2
  42. package/dist/cjs/i18n/en_ZZ.js +51 -0
  43. package/dist/cjs/i18n/es.js +2 -2
  44. package/dist/cjs/i18n/et.js +2 -2
  45. package/dist/cjs/i18n/fi.js +2 -2
  46. package/dist/cjs/i18n/fr.js +2 -2
  47. package/dist/cjs/i18n/hu.js +2 -2
  48. package/dist/cjs/i18n/it.js +2 -2
  49. package/dist/cjs/i18n/ja.js +2 -2
  50. package/dist/cjs/i18n/ko.js +2 -2
  51. package/dist/cjs/i18n/nb.js +2 -2
  52. package/dist/cjs/i18n/nl.js +2 -2
  53. package/dist/cjs/i18n/pl.js +2 -2
  54. package/dist/cjs/i18n/pt_BR.js +2 -2
  55. package/dist/cjs/i18n/pt_PT.js +2 -2
  56. package/dist/cjs/i18n/ru.js +2 -2
  57. package/dist/cjs/i18n/sk.js +2 -2
  58. package/dist/cjs/i18n/sv.js +2 -2
  59. package/dist/cjs/i18n/th.js +2 -2
  60. package/dist/cjs/i18n/tr.js +2 -2
  61. package/dist/cjs/i18n/uk.js +2 -2
  62. package/dist/cjs/i18n/vi.js +2 -2
  63. package/dist/cjs/i18n/zh.js +2 -2
  64. package/dist/cjs/i18n/zh_TW.js +2 -2
  65. package/dist/cjs/index.js +3 -3
  66. package/dist/cjs/types.js +12 -2
  67. package/dist/cjs/util/{analytics.js → analytics/analytics.js} +34 -2
  68. package/dist/cjs/util/analytics/index.js +203 -0
  69. package/dist/cjs/util/analytics/samplingUfo.js +278 -0
  70. package/dist/cjs/util/analytics/useSampledUFOComponentExperience.js +49 -0
  71. package/dist/cjs/util/constants.js +10 -3
  72. package/dist/cjs/version.json +1 -1
  73. package/dist/es2019/api/EmojiResource.js +28 -1
  74. package/dist/es2019/api/media/SiteEmojiResource.js +10 -2
  75. package/dist/es2019/components/common/CachingEmoji.js +29 -5
  76. package/dist/es2019/components/common/DeleteButton.js +8 -6
  77. package/dist/es2019/components/common/Emoji.js +27 -36
  78. package/dist/es2019/components/common/EmojiActions.js +26 -24
  79. package/dist/es2019/components/common/EmojiButton.js +6 -6
  80. package/dist/es2019/components/common/EmojiDeletePreview.js +20 -20
  81. package/dist/es2019/components/common/EmojiErrorMessage.js +9 -8
  82. package/dist/es2019/components/common/EmojiPlaceholder.js +5 -8
  83. package/dist/es2019/components/common/EmojiPreview.js +19 -35
  84. package/dist/es2019/components/common/EmojiPreviewComponent.js +21 -0
  85. package/dist/es2019/components/common/EmojiUploadPicker.js +25 -22
  86. package/dist/es2019/components/common/EmojiUploadPreview.js +22 -22
  87. package/dist/es2019/components/common/ResourcedEmoji.js +22 -5
  88. package/dist/es2019/components/common/ResourcedEmojiComponent.js +16 -0
  89. package/dist/es2019/components/common/RetryableButton.js +10 -11
  90. package/dist/es2019/components/common/Scrollable.js +6 -10
  91. package/dist/es2019/components/common/UfoErrorBoundary.js +11 -0
  92. package/dist/es2019/components/common/styles.js +195 -262
  93. package/dist/es2019/components/picker/CategorySelector.js +15 -12
  94. package/dist/es2019/components/picker/EmojiPicker.js +7 -5
  95. package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +8 -8
  96. package/dist/es2019/components/picker/EmojiPickerComponent.js +10 -10
  97. package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +8 -7
  98. package/dist/es2019/components/picker/EmojiPickerFooter.js +8 -8
  99. package/dist/es2019/components/picker/EmojiPickerList.js +9 -8
  100. package/dist/es2019/components/picker/EmojiPickerListSearch.js +11 -8
  101. package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +10 -8
  102. package/dist/es2019/components/picker/styles.js +112 -160
  103. package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +9 -8
  104. package/dist/es2019/components/typeahead/EmojiTypeAheadItem.js +12 -13
  105. package/dist/es2019/components/typeahead/EmojiTypeAheadList.js +18 -19
  106. package/dist/es2019/components/typeahead/styles.js +14 -15
  107. package/dist/es2019/components/uploader/EmojiUploadComponent.js +10 -9
  108. package/dist/es2019/components/uploader/styles.js +4 -4
  109. package/dist/es2019/i18n/cs.js +2 -2
  110. package/dist/es2019/i18n/da.js +2 -2
  111. package/dist/es2019/i18n/de.js +2 -2
  112. package/dist/es2019/i18n/en_ZZ.js +43 -0
  113. package/dist/es2019/i18n/es.js +2 -2
  114. package/dist/es2019/i18n/et.js +2 -2
  115. package/dist/es2019/i18n/fi.js +2 -2
  116. package/dist/es2019/i18n/fr.js +2 -2
  117. package/dist/es2019/i18n/hu.js +2 -2
  118. package/dist/es2019/i18n/it.js +2 -2
  119. package/dist/es2019/i18n/ja.js +2 -2
  120. package/dist/es2019/i18n/ko.js +2 -2
  121. package/dist/es2019/i18n/nb.js +2 -2
  122. package/dist/es2019/i18n/nl.js +2 -2
  123. package/dist/es2019/i18n/pl.js +2 -2
  124. package/dist/es2019/i18n/pt_BR.js +2 -2
  125. package/dist/es2019/i18n/pt_PT.js +2 -2
  126. package/dist/es2019/i18n/ru.js +2 -2
  127. package/dist/es2019/i18n/sk.js +2 -2
  128. package/dist/es2019/i18n/sv.js +2 -2
  129. package/dist/es2019/i18n/th.js +2 -2
  130. package/dist/es2019/i18n/tr.js +2 -2
  131. package/dist/es2019/i18n/uk.js +2 -2
  132. package/dist/es2019/i18n/vi.js +2 -2
  133. package/dist/es2019/i18n/zh.js +2 -2
  134. package/dist/es2019/i18n/zh_TW.js +2 -2
  135. package/dist/es2019/index.js +2 -1
  136. package/dist/es2019/types.js +10 -1
  137. package/dist/es2019/util/{analytics.js → analytics/analytics.js} +28 -1
  138. package/dist/es2019/util/analytics/index.js +3 -0
  139. package/dist/es2019/util/analytics/samplingUfo.js +147 -0
  140. package/dist/es2019/util/analytics/useSampledUFOComponentExperience.js +39 -0
  141. package/dist/es2019/util/constants.js +5 -1
  142. package/dist/es2019/version.json +1 -1
  143. package/dist/esm/api/EmojiResource.js +32 -1
  144. package/dist/esm/api/media/SiteEmojiResource.js +10 -2
  145. package/dist/esm/components/common/CachingEmoji.js +31 -5
  146. package/dist/esm/components/common/DeleteButton.js +8 -6
  147. package/dist/esm/components/common/Emoji.js +26 -29
  148. package/dist/esm/components/common/EmojiActions.js +26 -25
  149. package/dist/esm/components/common/EmojiButton.js +6 -6
  150. package/dist/esm/components/common/EmojiDeletePreview.js +19 -20
  151. package/dist/esm/components/common/EmojiErrorMessage.js +9 -8
  152. package/dist/esm/components/common/EmojiPlaceholder.js +5 -8
  153. package/dist/esm/components/common/EmojiPreview.js +19 -33
  154. package/dist/esm/components/common/EmojiPreviewComponent.js +20 -0
  155. package/dist/esm/components/common/EmojiUploadPicker.js +27 -25
  156. package/dist/esm/components/common/EmojiUploadPreview.js +21 -22
  157. package/dist/esm/components/common/ResourcedEmoji.js +22 -9
  158. package/dist/esm/components/common/ResourcedEmojiComponent.js +16 -0
  159. package/dist/esm/components/common/RetryableButton.js +11 -12
  160. package/dist/esm/components/common/Scrollable.js +6 -10
  161. package/dist/esm/components/common/UfoErrorBoundary.js +38 -0
  162. package/dist/esm/components/common/styles.js +192 -242
  163. package/dist/esm/components/picker/CategorySelector.js +14 -12
  164. package/dist/esm/components/picker/EmojiPicker.js +6 -5
  165. package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +8 -8
  166. package/dist/esm/components/picker/EmojiPickerComponent.js +9 -10
  167. package/dist/esm/components/picker/EmojiPickerEmojiRow.js +8 -7
  168. package/dist/esm/components/picker/EmojiPickerFooter.js +8 -8
  169. package/dist/esm/components/picker/EmojiPickerList.js +8 -8
  170. package/dist/esm/components/picker/EmojiPickerListSearch.js +10 -8
  171. package/dist/esm/components/picker/EmojiPickerVirtualItems.js +9 -8
  172. package/dist/esm/components/picker/styles.js +108 -149
  173. package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +8 -8
  174. package/dist/esm/components/typeahead/EmojiTypeAheadItem.js +11 -13
  175. package/dist/esm/components/typeahead/EmojiTypeAheadList.js +17 -19
  176. package/dist/esm/components/typeahead/styles.js +14 -14
  177. package/dist/esm/components/uploader/EmojiUploadComponent.js +9 -9
  178. package/dist/esm/components/uploader/styles.js +4 -4
  179. package/dist/esm/i18n/cs.js +2 -2
  180. package/dist/esm/i18n/da.js +2 -2
  181. package/dist/esm/i18n/de.js +2 -2
  182. package/dist/esm/i18n/en_ZZ.js +43 -0
  183. package/dist/esm/i18n/es.js +2 -2
  184. package/dist/esm/i18n/et.js +2 -2
  185. package/dist/esm/i18n/fi.js +2 -2
  186. package/dist/esm/i18n/fr.js +2 -2
  187. package/dist/esm/i18n/hu.js +2 -2
  188. package/dist/esm/i18n/it.js +2 -2
  189. package/dist/esm/i18n/ja.js +2 -2
  190. package/dist/esm/i18n/ko.js +2 -2
  191. package/dist/esm/i18n/nb.js +2 -2
  192. package/dist/esm/i18n/nl.js +2 -2
  193. package/dist/esm/i18n/pl.js +2 -2
  194. package/dist/esm/i18n/pt_BR.js +2 -2
  195. package/dist/esm/i18n/pt_PT.js +2 -2
  196. package/dist/esm/i18n/ru.js +2 -2
  197. package/dist/esm/i18n/sk.js +2 -2
  198. package/dist/esm/i18n/sv.js +2 -2
  199. package/dist/esm/i18n/th.js +2 -2
  200. package/dist/esm/i18n/tr.js +2 -2
  201. package/dist/esm/i18n/uk.js +2 -2
  202. package/dist/esm/i18n/vi.js +2 -2
  203. package/dist/esm/i18n/zh.js +2 -2
  204. package/dist/esm/i18n/zh_TW.js +2 -2
  205. package/dist/esm/index.js +2 -1
  206. package/dist/esm/types.js +10 -1
  207. package/dist/esm/util/{analytics.js → analytics/analytics.js} +28 -1
  208. package/dist/esm/util/analytics/index.js +3 -0
  209. package/dist/esm/util/analytics/samplingUfo.js +259 -0
  210. package/dist/esm/util/analytics/useSampledUFOComponentExperience.js +39 -0
  211. package/dist/esm/util/constants.js +5 -1
  212. package/dist/esm/version.json +1 -1
  213. package/dist/types/api/EmojiResource.d.ts +1 -0
  214. package/dist/types/components/common/EmojiActions.d.ts +2 -3
  215. package/dist/types/components/common/EmojiDeletePreview.d.ts +3 -3
  216. package/dist/types/components/common/EmojiErrorMessage.d.ts +2 -1
  217. package/dist/types/components/common/EmojiPreview.d.ts +2 -3
  218. package/dist/types/components/common/EmojiPreviewComponent.d.ts +7 -0
  219. package/dist/types/components/common/EmojiUploadPreview.d.ts +3 -3
  220. package/dist/types/components/common/ResourcedEmoji.d.ts +2 -0
  221. package/dist/types/components/common/RetryableButton.d.ts +0 -2
  222. package/dist/types/components/common/UfoErrorBoundary.d.ts +8 -0
  223. package/dist/types/components/common/styles.d.ts +44 -44
  224. package/dist/types/components/picker/EmojiPicker.d.ts +2 -3
  225. package/dist/types/components/picker/styles.d.ts +17 -18
  226. package/dist/types/components/typeahead/styles.d.ts +8 -7
  227. package/dist/types/components/uploader/styles.d.ts +2 -2
  228. package/dist/types/i18n/cs.d.ts +1 -1
  229. package/dist/types/i18n/da.d.ts +1 -1
  230. package/dist/types/i18n/de.d.ts +1 -1
  231. package/dist/types/i18n/en_ZZ.d.ts +43 -0
  232. package/dist/types/i18n/es.d.ts +1 -1
  233. package/dist/types/i18n/et.d.ts +1 -1
  234. package/dist/types/i18n/fi.d.ts +1 -1
  235. package/dist/types/i18n/fr.d.ts +1 -1
  236. package/dist/types/i18n/hu.d.ts +1 -1
  237. package/dist/types/i18n/it.d.ts +1 -1
  238. package/dist/types/i18n/ja.d.ts +1 -1
  239. package/dist/types/i18n/ko.d.ts +1 -1
  240. package/dist/types/i18n/nb.d.ts +1 -1
  241. package/dist/types/i18n/nl.d.ts +1 -1
  242. package/dist/types/i18n/pl.d.ts +1 -1
  243. package/dist/types/i18n/pt_BR.d.ts +1 -1
  244. package/dist/types/i18n/pt_PT.d.ts +1 -1
  245. package/dist/types/i18n/ru.d.ts +1 -1
  246. package/dist/types/i18n/sk.d.ts +1 -1
  247. package/dist/types/i18n/sv.d.ts +1 -1
  248. package/dist/types/i18n/th.d.ts +1 -1
  249. package/dist/types/i18n/tr.d.ts +1 -1
  250. package/dist/types/i18n/uk.d.ts +1 -1
  251. package/dist/types/i18n/vi.d.ts +1 -1
  252. package/dist/types/i18n/zh.d.ts +1 -1
  253. package/dist/types/i18n/zh_TW.d.ts +1 -1
  254. package/dist/types/index.d.ts +1 -1
  255. package/dist/types/types.d.ts +6 -0
  256. package/dist/types/util/{analytics.d.ts → analytics/analytics.d.ts} +9 -5
  257. package/dist/types/util/analytics/index.d.ts +5 -0
  258. package/dist/types/util/analytics/samplingUfo.d.ts +31 -0
  259. package/dist/types/util/analytics/useSampledUFOComponentExperience.d.ts +8 -0
  260. package/dist/types/util/constants.d.ts +2 -0
  261. package/local-config-example.ts +3 -3
  262. package/package.json +14 -11
  263. package/dist/cjs/components/picker/EmojiPickerPreview.js +0 -87
  264. package/dist/es2019/components/picker/EmojiPickerPreview.js +0 -43
  265. package/dist/esm/components/picker/EmojiPickerPreview.js +0 -67
  266. package/dist/types/components/picker/EmojiPickerPreview.d.ts +0 -9
@@ -1,15 +1,17 @@
1
+ import { css } from '@emotion/core';
1
2
  import { borderRadius } from '@atlaskit/theme/constants';
2
- import * as colors from '@atlaskit/theme/colors';
3
3
  import { token } from '@atlaskit/tokens';
4
4
  import { defaultEmojiHeight } from '../../util/constants';
5
5
  import { akEmojiSelectedBackgroundColor } from '../../util/shared-styles';
6
- import { style } from 'typestyle';
7
- export const selected = 'emoji-common-selected';
8
- export const selectOnHover = 'emoji-common-select-on-hover';
6
+ import { N20, N200, N300, N900, R300, R400 } from '@atlaskit/theme/colors';
7
+ export const commonSelectedStyles = 'emoji-common-selected';
8
+ export const selectOnHoverStyles = 'emoji-common-select-on-hover';
9
9
  export const emojiSprite = 'emoji-common-emoji-sprite';
10
- export const emojiNode = 'emoji-common-node';
10
+ export const emojiNodeStyles = 'emoji-common-node';
11
11
  export const emojiImage = 'emoji-common-emoji-image';
12
- export const deleteButton = style({
12
+ export const emojiDeleteButton = 'emoji-common-deleteButton';
13
+ export const emojiMainStyle = 'emoji-common-main-styles';
14
+ export const deleteButton = css({
13
15
  // hide by default
14
16
  visibility: 'hidden',
15
17
  display: 'flex',
@@ -22,7 +24,13 @@ export const deleteButton = style({
22
24
  paddingTop: '4px',
23
25
  marginBottom: '-4px'
24
26
  });
25
- export const emoji = style({
27
+ export const emojiToneSelectorContainer = css({
28
+ flex: 1,
29
+ display: 'flex',
30
+ justifyContent: 'flex-end',
31
+ padding: '8px 10px 8px 0'
32
+ });
33
+ export const emojiStyles = css({
26
34
  borderRadius: '5px',
27
35
  backgroundColor: 'transparent',
28
36
  display: 'inline-block',
@@ -31,204 +39,148 @@ export const emoji = style({
31
39
  // headings. Smaller headings get a slight increase in height, cannot add more negative margin
32
40
  // as a "selected" emoji (e.g. in the editor) will not look good.
33
41
  margin: '-1px 0',
34
- $nest: {
35
- [`&.${selected},&.${selectOnHover}:hover`]: {
36
- backgroundColor: akEmojiSelectedBackgroundColor
37
- },
38
- [`&.${selected},&.${selectOnHover}:hover .${deleteButton}`]: {
39
- // show delete button on hover
40
- visibility: 'visible'
41
- },
42
- img: {
43
- display: 'block'
44
- }
42
+ [`&.${commonSelectedStyles},&.${selectOnHoverStyles}:hover`]: {
43
+ backgroundColor: akEmojiSelectedBackgroundColor
44
+ },
45
+ [`&.${commonSelectedStyles},&.${selectOnHoverStyles}:hover .${emojiDeleteButton}`]: {
46
+ // show delete button on hover
47
+ visibility: 'visible'
48
+ },
49
+ img: {
50
+ display: 'block'
45
51
  }
46
52
  });
47
- export const emojiContainer = style({
53
+ export const emojiContainer = css({
48
54
  display: 'inline-block',
49
55
  // Ensure along with vertical align middle, we don't increase the line height for h1..h6, and p
50
56
  margin: '-1px 0',
51
- $nest: {
52
- [`&.${selected},&.${selectOnHover}:hover`]: {
53
- backgroundColor: akEmojiSelectedBackgroundColor
54
- },
55
- [`.${emojiSprite}`]: {
56
- background: 'transparent no-repeat',
57
- display: 'inline-block',
58
- verticalAlign: 'middle',
59
- height: `${defaultEmojiHeight}px`,
60
- width: `${defaultEmojiHeight}px`
61
- }
57
+ [`&.${commonSelectedStyles},&.${selectOnHoverStyles}:hover`]: {
58
+ backgroundColor: akEmojiSelectedBackgroundColor
59
+ },
60
+ [`.${emojiSprite}`]: {
61
+ background: 'transparent no-repeat',
62
+ display: 'inline-block',
63
+ verticalAlign: 'middle',
64
+ minHeight: `${defaultEmojiHeight}px`,
65
+ minWidth: `${defaultEmojiHeight}px`
62
66
  }
63
67
  });
64
68
  export const placeholder = 'emoji-common-placeholder';
65
- export const placeholderContainer = style({
69
+ export const placeholderContainer = css({
66
70
  // Ensure no vertical reflow
67
71
  margin: '-1px 0',
68
72
  display: 'inline-block',
69
- background: '#f7f7f7',
73
+ background: token('color.border', '#f7f7f7'),
70
74
  borderRadius: '20%',
71
75
  verticalAlign: 'middle',
72
76
  whiteSpace: 'nowrap'
73
77
  });
74
- export const placeholderEmoji = style({
75
- display: 'inline-block',
76
- verticalAlign: 'middle',
77
- whiteSpace: 'nowrap'
78
- });
79
- export const emojiButton = style({
78
+ export const emojiButton = css({
80
79
  backgroundColor: 'transparent',
81
80
  border: '0',
82
81
  cursor: 'pointer',
83
82
  padding: 0,
84
- $nest: {
85
- /* Firefox */
86
- ['&::-moz-focus-inner']: {
87
- border: '0 none',
88
- padding: 0
83
+
84
+ /* Firefox */
85
+ ['&::-moz-focus-inner']: {
86
+ border: '0 none',
87
+ padding: 0
88
+ },
89
+ '&>span': {
90
+ borderRadius: '5px',
91
+ padding: '8px',
92
+ // Scale sprite to fit regardless of default emoji size
93
+ [`&>.${emojiSprite}`]: {
94
+ height: '24px',
95
+ width: '24px'
89
96
  },
90
- '&>span': {
91
- borderRadius: '5px',
92
- padding: '8px',
93
- $nest: {
94
- // Scale sprite to fit regardless of default emoji size
95
- [`&>.${emojiSprite}`]: {
96
- height: '24px',
97
- width: '24px'
98
- },
99
- // Scale image to fit regardless of default emoji size
100
- [`&>img`]: {
101
- height: '24px',
102
- width: '24px'
103
- }
104
- }
97
+ // Scale image to fit regardless of default emoji size
98
+ [`&>img`]: {
99
+ height: '24px',
100
+ width: '24px'
105
101
  }
106
102
  }
107
103
  });
108
- export const hiddenToneButton = style({
104
+ export const hiddenToneButton = css({
109
105
  // Hide currently selected tone that rendered in the ToneSelector to avoid duplication
110
- // Set $ unique: true to be able to apply the ccs property to an element as described here https://github.com/typestyle/typestyle/issues/253
111
- display: 'none',
112
- $unique: true
106
+ display: 'none'
113
107
  }); // Emoji Preview
114
108
 
115
109
  export const buttons = 'emoji-common-buttons';
116
- export const preview = 'emoji-common-preview';
117
- export const previewImg = 'emoji-common-preview-image';
118
- export const previewText = 'emoji-common-preview-text';
119
- export const name = 'emoji-common-name';
120
- export const shortName = 'emoji-common-shortname';
121
- export const previewSingleLine = 'emoji-common-preview-single-line';
122
110
  export const toneSelectorContainer = 'emoji-common-tone-selector-container';
123
- export const emojiPreviewSection = 'emoji-preview-section';
124
- export const emojiPreview = style({
111
+ export const emojiPickerAddEmoji = 'emoji-picker-add-emoji';
112
+ export const previewText = css({
125
113
  display: 'flex',
126
- height: '50px',
127
- boxSizing: 'border-box',
128
- $nest: {
129
- [`.${preview}`]: {
130
- display: 'flex',
131
- flexDirection: 'row',
132
- flexWrap: 'nowrap',
133
- padding: '10px',
134
- $nest: {
135
- [`.${emojiSprite}`]: {
136
- height: '32px',
137
- margin: '0',
138
- width: '32px'
139
- },
140
- [`.${previewImg}`]: {
141
- display: 'inline-block',
142
- flex: 'initial',
143
- width: '32px',
144
- $nest: {
145
- '&>span': {
146
- width: '32px',
147
- height: '32px',
148
- padding: 0,
149
- maxHeight: 'inherit',
150
- $nest: {
151
- '&>img': {
152
- position: 'relative',
153
- left: '50%',
154
- top: '50%',
155
- transform: 'translateX(-50%) translateY(-50%)',
156
- maxHeight: '32px',
157
- maxWidth: '32px',
158
- padding: 0,
159
- display: 'block'
160
- }
161
- }
162
- }
163
- }
164
- },
165
- [`.${previewText}`]: {
166
- display: 'flex',
167
- flexDirection: 'column',
168
- marginLeft: '10px',
169
- marginTop: '-2px',
170
- maxWidth: '285px',
171
- width: '285px'
172
- /* IE */
173
- ,
174
- flexGrow: 1,
175
- flexShrink: 1,
176
- $nest: {
177
- [`.${name}`]: {
178
- display: 'block',
179
- color: token('color.text', colors.N900),
180
- overflow: 'hidden',
181
- textOverflow: 'ellipsis',
182
- whiteSpace: 'nowrap',
183
- $nest: {
184
- ['&:first-letter']: {
185
- textTransform: 'uppercase'
186
- }
187
- }
188
- },
189
- [`.${shortName}`]: {
190
- display: 'block',
191
- color: token('color.text.subtle', colors.N200),
192
- fontSize: '12px',
193
- lineHeight: 1,
194
- marginBottom: '-2px',
195
- overflow: 'hidden',
196
- paddingBottom: '2px',
197
- textOverflow: 'ellipsis',
198
- whiteSpace: 'nowrap'
199
- }
200
- }
201
- },
202
- [`.${previewSingleLine}`]: {
203
- paddingTop: '10px',
204
- $nest: {
205
- [`.${name}`]: {
206
- display: 'none'
207
- },
208
- [`.${shortName}`]: {
209
- color: token('color.text', colors.N900),
210
- fontSize: '14px'
211
- }
212
- }
213
- }
214
- }
215
- },
216
- [`.${previewText}`]: {
217
- maxWidth: '235px',
218
- width: '235px'
219
- /* IE */
220
-
221
- }
114
+ flexDirection: 'column',
115
+ alignSelf: 'center',
116
+ marginTop: '-2px',
117
+ marginLeft: '10px',
118
+ maxWidth: '285px',
119
+ width: '285px'
120
+ /* IE */
121
+ ,
122
+ flexGrow: 1,
123
+ flexShrink: 1
124
+ });
125
+ export const emojiName = css({
126
+ display: 'block',
127
+ color: token('color.text', N900),
128
+ overflow: 'hidden',
129
+ textOverflow: 'ellipsis',
130
+ whiteSpace: 'nowrap',
131
+ ['&:first-letter']: {
132
+ textTransform: 'uppercase'
222
133
  }
223
134
  });
224
- export const emojiToneSelectorContainer = style({
225
- flex: 1,
135
+ export const emojiShortName = css({
136
+ display: 'block',
137
+ color: token('color.text.subtle', N200),
138
+ fontSize: '12px',
139
+ lineHeight: 1,
140
+ marginBottom: '-2px',
141
+ overflow: 'hidden',
142
+ paddingBottom: '2px',
143
+ textOverflow: 'ellipsis',
144
+ whiteSpace: 'nowrap',
145
+ ['&:first-of-type']: {
146
+ color: token('color.text', N900),
147
+ fontSize: '14px'
148
+ }
149
+ });
150
+ export const preview = css({
226
151
  display: 'flex',
227
- justifyContent: 'flex-end',
228
- padding: '8px 10px 8px 0'
152
+ flexDirection: 'row',
153
+ flexWrap: 'nowrap',
154
+ padding: '10px'
155
+ });
156
+ export const previewImg = css({
157
+ display: 'inline-block',
158
+ flex: 'initial',
159
+ width: '32px',
160
+ [`& .${emojiSprite}, > span`]: {
161
+ width: '32px',
162
+ height: '32px',
163
+ padding: 0,
164
+ maxHeight: 'inherit'
165
+ },
166
+ [`& > span > img`]: {
167
+ position: 'relative',
168
+ left: '50%',
169
+ top: '50%',
170
+ transform: 'translateX(-50%) translateY(-50%)',
171
+ maxHeight: '32px',
172
+ maxWidth: '32px',
173
+ padding: 0,
174
+ display: 'block'
175
+ }
176
+ });
177
+ export const emojiPreview = css({
178
+ display: 'flex',
179
+ height: '50px',
180
+ boxSizing: 'border-box'
229
181
  }); // Scrollable
230
182
 
231
- export const emojiScrollable = style({
183
+ export const emojiScrollable = css({
232
184
  border: `1px solid ${token('color.border', '#fff')}`,
233
185
  borderRadius: `${borderRadius()}px`,
234
186
  display: 'block',
@@ -238,192 +190,173 @@ export const emojiScrollable = style({
238
190
  padding: '0'
239
191
  }); // EmojiUpload
240
192
 
241
- export const emojiUpload = style({
193
+ export const emojiUpload = css({
242
194
  height: '78px',
243
195
  padding: '10px',
244
196
  display: 'flex',
245
197
  flexDirection: 'column',
246
198
  justifyContent: 'space-around'
247
199
  });
248
- export const uploadChooseFileMessage = style({
249
- color: token('color.text.subtle', colors.N300),
200
+ export const uploadChooseFileMessage = css({
201
+ color: token('color.text.subtle', N300),
250
202
  fontSize: '12px',
251
203
  paddingBottom: '7px'
252
204
  });
253
- export const emojiUploadBottom = style({
205
+ export const emojiUploadBottom = css({
254
206
  fontSize: '11px'
255
207
  });
256
- export const uploadChooseFileRow = style({
208
+ export const uploadChooseFileRow = css({
257
209
  display: 'flex',
258
210
  justifyContent: 'space-between'
259
211
  });
260
- export const uploadChooseFileEmojiName = style({
212
+ export const uploadChooseFileEmojiName = css({
261
213
  flex: '1 1 auto',
262
214
  marginRight: '5px',
263
- $nest: {
264
- input: {
265
- background: 'transparent',
266
- border: 0,
267
- outline: 'none',
268
- $nest: {
269
- ['&:invalid']: {
270
- boxShadow: 'none'
271
- },
272
- ['&::-ms-clear']: {
273
- display: 'none'
274
- }
275
- }
215
+ input: {
216
+ background: 'transparent',
217
+ border: 0,
218
+ outline: 'none',
219
+ ['&:invalid']: {
220
+ boxShadow: 'none'
221
+ },
222
+ ['&::-ms-clear']: {
223
+ display: 'none'
276
224
  }
277
225
  }
278
226
  });
279
- export const uploadChooseFileBrowse = style({
227
+ export const uploadChooseFileBrowse = css({
280
228
  flex: '0 0 auto'
281
229
  });
282
- export const uploadPreviewFooter = style({
230
+ export const uploadPreviewFooter = css({
283
231
  display: 'flex',
284
232
  flexDirection: 'column',
285
233
  height: '100px',
286
234
  padding: '10px'
287
235
  });
288
- export const uploadPreview = style({
236
+ export const uploadPreview = css({
289
237
  display: 'flex',
290
238
  justifyContent: 'space-between',
291
239
  alignItems: 'center',
292
- background: token('color.background.neutral', colors.N20),
240
+ background: token('color.background.neutral', N20),
293
241
  borderRadius: `${borderRadius()}px`,
294
242
  padding: '10px'
295
243
  });
296
- export const uploadPreviewText = style({
297
- $nest: {
298
- h5: {
299
- color: token('color.text.subtle', colors.N300),
300
- paddingBottom: '4px',
301
- fontSize: '12px'
302
- },
303
- img: {
304
- maxHeight: '20px',
305
- maxWidth: '50px'
306
- }
244
+ export const uploadPreviewText = css({
245
+ h5: {
246
+ color: token('color.text.subtle', N300),
247
+ paddingBottom: '4px',
248
+ fontSize: '12px'
249
+ },
250
+ img: {
251
+ maxHeight: '20px',
252
+ maxWidth: '50px'
307
253
  }
308
254
  });
309
- export const bigEmojiPreview = style({
255
+ export const bigEmojiPreview = css({
310
256
  paddingLeft: '4px',
311
- $nest: {
312
- img: {
313
- maxHeight: '40px',
314
- maxWidth: '100px'
315
- }
257
+ img: {
258
+ maxHeight: '40px',
259
+ maxWidth: '100px'
316
260
  }
317
261
  });
318
- export const uploadAddRow = style({
262
+ export const uploadAddRow = css({
319
263
  display: 'flex',
320
264
  justifyContent: 'flex-end',
321
265
  alignItems: 'center',
322
266
  paddingTop: '10px'
323
267
  });
324
- export const AddCustomEmoji = style({
268
+ export const addCustomEmoji = css({
325
269
  alignSelf: 'center',
326
270
  marginLeft: '10px',
327
271
  marginBottom: '10px'
328
272
  }); // Emoji Delete preview
329
273
 
330
274
  export const submitDelete = 'emoji-submit-delete';
331
- export const previewButtonGroup = 'emoji-preview-button-group';
332
- export const deletePreview = style({
275
+ export const deletePreview = css({
333
276
  height: '100px',
334
277
  padding: '10px',
335
278
  display: 'flex',
336
279
  flexDirection: 'column',
337
280
  justifyContent: 'flex-end'
338
281
  });
339
- export const deleteText = style({
282
+ export const deleteText = css({
340
283
  height: '64px',
341
284
  fontSize: '12px',
342
- $nest: {
343
- ':first-child': {
344
- color: token('color.text.subtle', colors.N300),
345
- lineHeight: '16px'
346
- }
285
+ '&:first-of-type': {
286
+ color: token('color.text.subtle', N300),
287
+ lineHeight: '16px'
347
288
  }
348
289
  });
349
- export const deleteFooter = style({
290
+ export const previewButtonGroup = css({
291
+ display: 'flex'
292
+ });
293
+ export const deleteFooter = css({
350
294
  display: 'flex',
351
295
  height: '40px',
352
296
  alignItems: 'center',
353
297
  justifyContent: 'space-between',
354
- $nest: {
355
- img: {
356
- maxHeight: '32px',
357
- maxWidth: '72px'
358
- },
359
- [`.${previewButtonGroup}`]: {
298
+ img: {
299
+ maxHeight: '32px',
300
+ maxWidth: '72px'
301
+ },
302
+ [`.${submitDelete}`]: {
303
+ width: '84px',
304
+ fontWeight: 'bold',
305
+ marginRight: '4px'
306
+ },
307
+ button: {
308
+ display: 'flex',
309
+ justifyContent: 'center',
310
+ fontSize: '14px',
311
+ div: {
360
312
  display: 'flex'
361
- },
362
- [`.${submitDelete}`]: {
363
- width: '84px',
364
- fontWeight: 'bold',
365
- marginRight: '4px'
366
- },
367
- button: {
368
- display: 'flex',
369
- justifyContent: 'center',
370
- fontSize: '14px',
371
- $nest: {
372
- div: {
373
- display: 'flex'
374
- }
375
- }
376
313
  }
377
314
  }
378
315
  });
379
- export const emojiDeleteErrorMessage = style({
316
+ export const emojiDeleteErrorMessage = css({
380
317
  display: 'flex',
381
- color: token('color.text.danger', colors.R400),
318
+ color: token('color.text.danger', R400),
382
319
  alignItems: 'center',
383
320
  justifyContent: 'flex-end',
384
321
  paddingRight: '4px'
385
322
  });
386
- export const emojiChooseFileErrorMessage = style({
323
+ export const emojiChooseFileErrorMessage = css({
387
324
  display: 'flex',
388
- color: token('color.text.danger', colors.R300),
325
+ color: token('color.text.danger', R300),
389
326
  paddingRight: '10px',
390
327
  justifyContent: 'flex-start'
391
328
  });
392
- export const emojiPreviewErrorMessage = style({
329
+ export const emojiPreviewErrorMessage = css({
393
330
  display: 'inline-flex',
394
- color: token('color.text.danger', colors.R400),
331
+ color: token('color.text.danger', R400),
395
332
  paddingRight: '10px',
396
333
  justifyContent: 'flex-end',
397
334
  alignItems: 'center'
398
335
  });
399
- export const addCustomEmojiButton = style({
336
+ export const addCustomEmojiButton = css({
400
337
  maxWidth: '285px'
401
338
  });
402
- export const uploadRetryButton = style({
339
+ export const uploadRetryButton = css({
403
340
  maxWidth: '172px',
404
341
  justifyContent: 'center',
405
342
  fontWeight: 'bold',
406
343
  marginRight: '4px',
407
- $nest: {
408
- div: {
409
- display: 'flex'
410
- }
344
+ div: {
345
+ display: 'flex'
411
346
  }
412
347
  });
413
- export const uploadEmojiButton = style({
348
+ export const uploadEmojiButton = css({
414
349
  maxWidth: '187px',
415
350
  justifyContent: 'center',
416
351
  marginRight: '4px',
417
- $nest: {
418
- div: {
419
- display: 'flex'
420
- }
352
+ div: {
353
+ display: 'flex'
421
354
  }
422
355
  });
423
- export const cancelButton = style({
356
+ export const cancelButton = css({
424
357
  maxWidth: '100px'
425
358
  });
426
- export const buttonSpinner = style({
359
+ export const buttonSpinner = css({
427
360
  marginRight: '10px',
428
361
  marginLeft: '10px'
429
362
  });
@@ -1,12 +1,14 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import classNames from 'classnames';
2
+
3
+ /** @jsx jsx */
4
+ import { jsx } from '@emotion/core';
3
5
  import React from 'react';
4
6
  import { PureComponent } from 'react';
5
7
  import { injectIntl } from 'react-intl-next';
6
8
  import { defaultCategories } from '../../util/constants';
7
9
  import { messages } from '../i18n';
8
10
  import { CategoryDescriptionMap } from './categories';
9
- import * as styles from './styles';
11
+ import { active, categorySelector, disable, categoryStyles } from './styles';
10
12
  export const sortCategories = (c1, c2) => CategoryDescriptionMap[c1].order - CategoryDescriptionMap[c2].order;
11
13
 
12
14
  const addNewCategories = (oldCategories, newCategories) => {
@@ -75,37 +77,38 @@ class CategorySelector extends PureComponent {
75
77
  const {
76
78
  formatMessage
77
79
  } = intl;
78
- categoriesSection = /*#__PURE__*/React.createElement("ul", null, categories.map(categoryId => {
80
+ categoriesSection = jsx("ul", null, categories.map(categoryId => {
79
81
  const category = CategoryDescriptionMap[categoryId];
80
- const categoryClasses = [styles.category];
82
+ const categoryClasses = [categoryStyles];
81
83
 
82
84
  if (categoryId === this.props.activeCategoryId) {
83
- categoryClasses.push(styles.active);
85
+ categoryClasses.push(active);
84
86
  }
85
87
 
86
88
  if (disableCategories) {
87
- categoryClasses.push(styles.disable);
89
+ categoryClasses.push(disable);
88
90
  }
89
91
 
90
92
  const Icon = category.icon;
91
93
  const categoryName = formatMessage(messages[category.name]);
92
- return /*#__PURE__*/React.createElement("li", {
94
+ return jsx("li", {
93
95
  key: category.id
94
- }, /*#__PURE__*/React.createElement("button", {
96
+ }, jsx("button", {
95
97
  "aria-label": categoryName,
96
98
  "data-category-id": category.id,
97
- className: classNames(categoryClasses),
99
+ disabled: disableCategories,
100
+ css: categoryClasses,
98
101
  onClick: this.onClick,
99
102
  title: categoryName,
100
103
  type: "button"
101
- }, /*#__PURE__*/React.createElement(Icon, {
104
+ }, jsx(Icon, {
102
105
  label: categoryName
103
106
  })));
104
107
  }));
105
108
  }
106
109
 
107
- return /*#__PURE__*/React.createElement("div", {
108
- className: classNames([styles.categorySelector])
110
+ return jsx("div", {
111
+ css: categorySelector
109
112
  }, categoriesSection);
110
113
  }
111
114