@sendbird/uikit-react-native-foundation 3.1.2 → 3.2.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 (232) hide show
  1. package/lib/commonjs/assets/icon/icon-audio-off-filled.png +0 -0
  2. package/lib/commonjs/assets/icon/icon-audio-off-filled@2x.png +0 -0
  3. package/lib/commonjs/assets/icon/icon-audio-off-filled@3x.png +0 -0
  4. package/lib/commonjs/assets/icon/icon-audio-off.png +0 -0
  5. package/lib/commonjs/assets/icon/icon-audio-off@2x.png +0 -0
  6. package/lib/commonjs/assets/icon/icon-audio-off@3x.png +0 -0
  7. package/lib/commonjs/assets/icon/icon-audio-on-filled.png +0 -0
  8. package/lib/commonjs/assets/icon/icon-audio-on-filled@2x.png +0 -0
  9. package/lib/commonjs/assets/icon/icon-audio-on-filled@3x.png +0 -0
  10. package/lib/commonjs/assets/icon/icon-audio-on.png +0 -0
  11. package/lib/commonjs/assets/icon/icon-audio-on@2x.png +0 -0
  12. package/lib/commonjs/assets/icon/icon-audio-on@3x.png +0 -0
  13. package/lib/commonjs/assets/icon/icon-pause.png +0 -0
  14. package/lib/commonjs/assets/icon/icon-pause@2x.png +0 -0
  15. package/lib/commonjs/assets/icon/icon-pause@3x.png +0 -0
  16. package/lib/commonjs/assets/icon/icon-recording.png +0 -0
  17. package/lib/commonjs/assets/icon/icon-recording@2x.png +0 -0
  18. package/lib/commonjs/assets/icon/icon-recording@3x.png +0 -0
  19. package/lib/commonjs/assets/icon/icon-stop.png +0 -0
  20. package/lib/commonjs/assets/icon/icon-stop@2x.png +0 -0
  21. package/lib/commonjs/assets/icon/icon-stop@3x.png +0 -0
  22. package/lib/commonjs/assets/icon/index.js +7 -0
  23. package/lib/commonjs/assets/icon/index.js.map +1 -1
  24. package/lib/commonjs/components/Box/index.js +2 -2
  25. package/lib/commonjs/components/Box/index.js.map +1 -1
  26. package/lib/commonjs/components/Icon/index.js +4 -3
  27. package/lib/commonjs/components/Icon/index.js.map +1 -1
  28. package/lib/commonjs/components/Image/FastImageInternal.js.map +1 -1
  29. package/lib/commonjs/components/Image/index.js.map +1 -1
  30. package/lib/commonjs/components/Modal/index.js +1 -1
  31. package/lib/commonjs/components/Modal/index.js.map +1 -1
  32. package/lib/commonjs/components/PressBox/index.js.map +1 -1
  33. package/lib/commonjs/components/ProgressBar/index.js +72 -0
  34. package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
  35. package/lib/commonjs/components/RegexText/index.js.map +1 -1
  36. package/lib/commonjs/index.js +7 -0
  37. package/lib/commonjs/index.js.map +1 -1
  38. package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
  39. package/lib/commonjs/styles/createScaleFactor.js +5 -4
  40. package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
  41. package/lib/commonjs/theme/DarkUIKitTheme.js +80 -36
  42. package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
  43. package/lib/commonjs/theme/LightUIKitTheme.js +80 -36
  44. package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
  45. package/lib/commonjs/types.js.map +1 -1
  46. package/lib/commonjs/ui/Avatar/index.js +4 -3
  47. package/lib/commonjs/ui/Avatar/index.js.map +1 -1
  48. package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
  49. package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
  50. package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js +108 -0
  51. package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js.map +1 -0
  52. package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js +1 -1
  53. package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
  54. package/lib/commonjs/ui/GroupChannelMessage/index.js +2 -0
  55. package/lib/commonjs/ui/GroupChannelMessage/index.js.map +1 -1
  56. package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
  57. package/lib/commonjs/ui/Header/index.js +5 -4
  58. package/lib/commonjs/ui/Header/index.js.map +1 -1
  59. package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
  60. package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -1
  61. package/lib/commonjs/ui/ProfileCard/index.js.map +1 -1
  62. package/lib/module/assets/icon/icon-audio-off-filled.png +0 -0
  63. package/lib/module/assets/icon/icon-audio-off-filled@2x.png +0 -0
  64. package/lib/module/assets/icon/icon-audio-off-filled@3x.png +0 -0
  65. package/lib/module/assets/icon/icon-audio-off.png +0 -0
  66. package/lib/module/assets/icon/icon-audio-off@2x.png +0 -0
  67. package/lib/module/assets/icon/icon-audio-off@3x.png +0 -0
  68. package/lib/module/assets/icon/icon-audio-on-filled.png +0 -0
  69. package/lib/module/assets/icon/icon-audio-on-filled@2x.png +0 -0
  70. package/lib/module/assets/icon/icon-audio-on-filled@3x.png +0 -0
  71. package/lib/module/assets/icon/icon-audio-on.png +0 -0
  72. package/lib/module/assets/icon/icon-audio-on@2x.png +0 -0
  73. package/lib/module/assets/icon/icon-audio-on@3x.png +0 -0
  74. package/lib/module/assets/icon/icon-pause.png +0 -0
  75. package/lib/module/assets/icon/icon-pause@2x.png +0 -0
  76. package/lib/module/assets/icon/icon-pause@3x.png +0 -0
  77. package/lib/module/assets/icon/icon-recording.png +0 -0
  78. package/lib/module/assets/icon/icon-recording@2x.png +0 -0
  79. package/lib/module/assets/icon/icon-recording@3x.png +0 -0
  80. package/lib/module/assets/icon/icon-stop.png +0 -0
  81. package/lib/module/assets/icon/icon-stop@2x.png +0 -0
  82. package/lib/module/assets/icon/icon-stop@3x.png +0 -0
  83. package/lib/module/assets/icon/index.js +7 -0
  84. package/lib/module/assets/icon/index.js.map +1 -1
  85. package/lib/module/components/Box/index.js +2 -2
  86. package/lib/module/components/Box/index.js.map +1 -1
  87. package/lib/module/components/Icon/index.js +4 -3
  88. package/lib/module/components/Icon/index.js.map +1 -1
  89. package/lib/module/components/Image/FastImageInternal.js.map +1 -1
  90. package/lib/module/components/Image/index.js.map +1 -1
  91. package/lib/module/components/Modal/index.js +1 -1
  92. package/lib/module/components/Modal/index.js.map +1 -1
  93. package/lib/module/components/PressBox/index.js.map +1 -1
  94. package/lib/module/components/ProgressBar/index.js +62 -0
  95. package/lib/module/components/ProgressBar/index.js.map +1 -0
  96. package/lib/module/components/RegexText/index.js.map +1 -1
  97. package/lib/module/index.js +1 -0
  98. package/lib/module/index.js.map +1 -1
  99. package/lib/module/styles/HeaderStyleContext.js.map +1 -1
  100. package/lib/module/styles/createScaleFactor.js +5 -4
  101. package/lib/module/styles/createScaleFactor.js.map +1 -1
  102. package/lib/module/theme/DarkUIKitTheme.js +80 -36
  103. package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
  104. package/lib/module/theme/LightUIKitTheme.js +80 -36
  105. package/lib/module/theme/LightUIKitTheme.js.map +1 -1
  106. package/lib/module/types.js.map +1 -1
  107. package/lib/module/ui/Avatar/index.js +4 -3
  108. package/lib/module/ui/Avatar/index.js.map +1 -1
  109. package/lib/module/ui/BottomSheet/index.js.map +1 -1
  110. package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
  111. package/lib/module/ui/GroupChannelMessage/Message.file.voice.js +98 -0
  112. package/lib/module/ui/GroupChannelMessage/Message.file.voice.js.map +1 -0
  113. package/lib/module/ui/GroupChannelMessage/Message.unknown.js +1 -1
  114. package/lib/module/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
  115. package/lib/module/ui/GroupChannelMessage/index.js +2 -0
  116. package/lib/module/ui/GroupChannelMessage/index.js.map +1 -1
  117. package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
  118. package/lib/module/ui/Header/index.js +5 -4
  119. package/lib/module/ui/Header/index.js.map +1 -1
  120. package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
  121. package/lib/module/ui/OpenChannelPreview/index.js.map +1 -1
  122. package/lib/module/ui/ProfileCard/index.js.map +1 -1
  123. package/lib/typescript/src/assets/icon/index.d.ts +7 -0
  124. package/lib/typescript/src/components/Box/index.d.ts +2 -1
  125. package/lib/typescript/src/components/Divider/index.d.ts +2 -1
  126. package/lib/typescript/src/components/Icon/index.d.ts +76 -7
  127. package/lib/typescript/src/components/Image/FastImageInternal.d.ts +2 -1
  128. package/lib/typescript/src/components/Image/index.d.ts +2 -1
  129. package/lib/typescript/src/components/ImageWithPlaceholder/index.d.ts +2 -1
  130. package/lib/typescript/src/components/Modal/index.d.ts +2 -1
  131. package/lib/typescript/src/components/PressBox/index.d.ts +2 -1
  132. package/lib/typescript/src/components/ProgressBar/index.d.ts +12 -0
  133. package/lib/typescript/src/components/RegexText/index.d.ts +3 -2
  134. package/lib/typescript/src/components/Switch/index.d.ts +1 -1
  135. package/lib/typescript/src/components/Text/index.d.ts +2 -1
  136. package/lib/typescript/src/components/VideoThumbnail/index.d.ts +2 -1
  137. package/lib/typescript/src/index.d.ts +1 -0
  138. package/lib/typescript/src/styles/HeaderStyleContext.d.ts +2 -2
  139. package/lib/typescript/src/styles/createScaleFactor.d.ts +4 -5
  140. package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +1 -1
  141. package/lib/typescript/src/types.d.ts +11 -7
  142. package/lib/typescript/src/ui/ActionMenu/index.d.ts +2 -1
  143. package/lib/typescript/src/ui/Alert/index.d.ts +2 -1
  144. package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +1 -1
  145. package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +2 -1
  146. package/lib/typescript/src/ui/Avatar/index.d.ts +16 -8
  147. package/lib/typescript/src/ui/Badge/index.d.ts +2 -1
  148. package/lib/typescript/src/ui/BottomSheet/index.d.ts +3 -2
  149. package/lib/typescript/src/ui/Button/index.d.ts +1 -1
  150. package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +2 -1
  151. package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +1 -1
  152. package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +3 -3
  153. package/lib/typescript/src/ui/Dialog/index.d.ts +1 -1
  154. package/lib/typescript/src/ui/GroupChannelMessage/Message.admin.d.ts +2 -1
  155. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.d.ts +2 -1
  156. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.image.d.ts +2 -1
  157. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.video.d.ts +2 -1
  158. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.voice.d.ts +14 -0
  159. package/lib/typescript/src/ui/GroupChannelMessage/Message.unknown.d.ts +2 -1
  160. package/lib/typescript/src/ui/GroupChannelMessage/Message.user.d.ts +2 -1
  161. package/lib/typescript/src/ui/GroupChannelMessage/Message.user.og.d.ts +2 -1
  162. package/lib/typescript/src/ui/GroupChannelMessage/MessageBubbleWithText.d.ts +2 -1
  163. package/lib/typescript/src/ui/GroupChannelMessage/MessageContainer.d.ts +4 -3
  164. package/lib/typescript/src/ui/GroupChannelMessage/MessageOpenGraph.d.ts +2 -1
  165. package/lib/typescript/src/ui/GroupChannelMessage/index.d.ts +43 -7
  166. package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +3 -3
  167. package/lib/typescript/src/ui/Header/index.d.ts +8 -12
  168. package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +2 -1
  169. package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
  170. package/lib/typescript/src/ui/OpenChannelMessage/Message.admin.d.ts +2 -1
  171. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.d.ts +2 -1
  172. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.image.d.ts +2 -1
  173. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.video.d.ts +2 -1
  174. package/lib/typescript/src/ui/OpenChannelMessage/Message.unknown.d.ts +2 -1
  175. package/lib/typescript/src/ui/OpenChannelMessage/Message.user.d.ts +2 -1
  176. package/lib/typescript/src/ui/OpenChannelMessage/Message.user.og.d.ts +2 -1
  177. package/lib/typescript/src/ui/OpenChannelMessage/MessageContainer.d.ts +2 -1
  178. package/lib/typescript/src/ui/OpenChannelMessage/index.d.ts +7 -7
  179. package/lib/typescript/src/ui/OpenChannelPreview/index.d.ts +2 -2
  180. package/lib/typescript/src/ui/OutlinedButton/index.d.ts +2 -1
  181. package/lib/typescript/src/ui/Placeholder/index.d.ts +2 -1
  182. package/lib/typescript/src/ui/ProfileCard/index.d.ts +3 -2
  183. package/lib/typescript/src/ui/Prompt/index.d.ts +2 -1
  184. package/lib/typescript/src/ui/Toast/index.d.ts +2 -2
  185. package/package.json +5 -9
  186. package/src/assets/icon/icon-audio-off-filled.png +0 -0
  187. package/src/assets/icon/icon-audio-off-filled@2x.png +0 -0
  188. package/src/assets/icon/icon-audio-off-filled@3x.png +0 -0
  189. package/src/assets/icon/icon-audio-off.png +0 -0
  190. package/src/assets/icon/icon-audio-off@2x.png +0 -0
  191. package/src/assets/icon/icon-audio-off@3x.png +0 -0
  192. package/src/assets/icon/icon-audio-on-filled.png +0 -0
  193. package/src/assets/icon/icon-audio-on-filled@2x.png +0 -0
  194. package/src/assets/icon/icon-audio-on-filled@3x.png +0 -0
  195. package/src/assets/icon/icon-audio-on.png +0 -0
  196. package/src/assets/icon/icon-audio-on@2x.png +0 -0
  197. package/src/assets/icon/icon-audio-on@3x.png +0 -0
  198. package/src/assets/icon/icon-pause.png +0 -0
  199. package/src/assets/icon/icon-pause@2x.png +0 -0
  200. package/src/assets/icon/icon-pause@3x.png +0 -0
  201. package/src/assets/icon/icon-recording.png +0 -0
  202. package/src/assets/icon/icon-recording@2x.png +0 -0
  203. package/src/assets/icon/icon-recording@3x.png +0 -0
  204. package/src/assets/icon/icon-stop.png +0 -0
  205. package/src/assets/icon/icon-stop@2x.png +0 -0
  206. package/src/assets/icon/icon-stop@3x.png +0 -0
  207. package/src/assets/icon/index.ts +7 -0
  208. package/src/components/Box/index.tsx +1 -1
  209. package/src/components/Icon/index.tsx +6 -7
  210. package/src/components/Image/FastImageInternal.tsx +3 -2
  211. package/src/components/Image/index.ts +2 -1
  212. package/src/components/Modal/index.tsx +1 -1
  213. package/src/components/PressBox/index.tsx +1 -0
  214. package/src/components/ProgressBar/index.tsx +72 -0
  215. package/src/components/RegexText/index.tsx +3 -3
  216. package/src/index.ts +1 -0
  217. package/src/styles/HeaderStyleContext.tsx +1 -1
  218. package/src/styles/createScaleFactor.ts +5 -5
  219. package/src/theme/DarkUIKitTheme.ts +80 -37
  220. package/src/theme/LightUIKitTheme.ts +80 -37
  221. package/src/types.ts +31 -7
  222. package/src/ui/Avatar/index.tsx +6 -14
  223. package/src/ui/BottomSheet/index.tsx +2 -2
  224. package/src/ui/Dialog/DialogSheet.tsx +2 -2
  225. package/src/ui/GroupChannelMessage/Message.file.voice.tsx +123 -0
  226. package/src/ui/GroupChannelMessage/Message.unknown.tsx +1 -1
  227. package/src/ui/GroupChannelMessage/index.ts +7 -0
  228. package/src/ui/GroupChannelPreview/index.tsx +2 -2
  229. package/src/ui/Header/index.tsx +8 -12
  230. package/src/ui/OpenChannelMessage/MessageContainer.tsx +1 -1
  231. package/src/ui/OpenChannelPreview/index.tsx +1 -1
  232. package/src/ui/ProfileCard/index.tsx +2 -2
@@ -3,41 +3,6 @@ import createTheme from './createTheme';
3
3
  const LightUIKitTheme = createTheme({
4
4
  colorScheme: 'light',
5
5
  colors: (palette) => {
6
- const groupChannelMessage = {
7
- incoming: {
8
- enabled: {
9
- textMsg: palette.onBackgroundLight01,
10
- textEdited: palette.onBackgroundLight02,
11
- textTime: palette.onBackgroundLight03,
12
- textSenderName: palette.onBackgroundLight02,
13
- background: palette.background100,
14
- },
15
- pressed: {
16
- textMsg: palette.onBackgroundLight01,
17
- textEdited: palette.onBackgroundLight02,
18
- textTime: palette.onBackgroundLight03,
19
- textSenderName: palette.onBackgroundLight02,
20
- background: palette.primary100,
21
- },
22
- },
23
- outgoing: {
24
- enabled: {
25
- textMsg: palette.onBackgroundDark01,
26
- textEdited: palette.onBackgroundDark02,
27
- textTime: palette.onBackgroundLight03,
28
- textSenderName: palette.transparent,
29
- background: palette.primary300,
30
- },
31
- pressed: {
32
- textMsg: palette.onBackgroundDark01,
33
- textEdited: palette.onBackgroundDark02,
34
- textTime: palette.onBackgroundLight03,
35
- textSenderName: palette.transparent,
36
- background: palette.primary400,
37
- },
38
- },
39
- };
40
-
41
6
  return {
42
7
  primary: palette.primary300,
43
8
  secondary: palette.secondary300,
@@ -149,7 +114,6 @@ const LightUIKitTheme = createTheme({
149
114
  },
150
115
  },
151
116
  },
152
- message: groupChannelMessage,
153
117
  dateSeparator: {
154
118
  default: {
155
119
  none: {
@@ -158,7 +122,60 @@ const LightUIKitTheme = createTheme({
158
122
  },
159
123
  },
160
124
  },
161
- groupChannelMessage,
125
+ groupChannelMessage: {
126
+ incoming: {
127
+ enabled: {
128
+ textMsg: palette.onBackgroundLight01,
129
+ textEdited: palette.onBackgroundLight02,
130
+ textTime: palette.onBackgroundLight03,
131
+ textSenderName: palette.onBackgroundLight02,
132
+ background: palette.background100,
133
+ textVoicePlaytime: palette.onBackgroundLight01,
134
+ voiceSpinner: palette.primary300,
135
+ voiceProgressTrack: palette.background100,
136
+ voiceActionIcon: palette.primary300,
137
+ voiceActionIconBackground: palette.background50,
138
+ },
139
+ pressed: {
140
+ textMsg: palette.onBackgroundLight01,
141
+ textEdited: palette.onBackgroundLight02,
142
+ textTime: palette.onBackgroundLight03,
143
+ textSenderName: palette.onBackgroundLight02,
144
+ background: palette.primary100,
145
+ textVoicePlaytime: palette.onBackgroundLight01,
146
+ voiceSpinner: palette.primary300,
147
+ voiceProgressTrack: palette.background100,
148
+ voiceActionIcon: palette.primary300,
149
+ voiceActionIconBackground: palette.background50,
150
+ },
151
+ },
152
+ outgoing: {
153
+ enabled: {
154
+ textMsg: palette.onBackgroundDark01,
155
+ textEdited: palette.onBackgroundDark02,
156
+ textTime: palette.onBackgroundLight03,
157
+ textSenderName: palette.transparent,
158
+ background: palette.primary300,
159
+ textVoicePlaytime: palette.onBackgroundDark01,
160
+ voiceSpinner: palette.primary200,
161
+ voiceProgressTrack: palette.primary300,
162
+ voiceActionIcon: palette.primary300,
163
+ voiceActionIconBackground: palette.background50,
164
+ },
165
+ pressed: {
166
+ textMsg: palette.onBackgroundDark01,
167
+ textEdited: palette.onBackgroundDark02,
168
+ textTime: palette.onBackgroundLight03,
169
+ textSenderName: palette.transparent,
170
+ background: palette.primary400,
171
+ textVoicePlaytime: palette.onBackgroundDark01,
172
+ voiceSpinner: palette.primary200,
173
+ voiceProgressTrack: palette.primary300,
174
+ voiceActionIcon: palette.primary300,
175
+ voiceActionIconBackground: palette.background50,
176
+ },
177
+ },
178
+ },
162
179
  groupChannelPreview: {
163
180
  default: {
164
181
  none: {
@@ -243,6 +260,32 @@ const LightUIKitTheme = createTheme({
243
260
  },
244
261
  },
245
262
  },
263
+ voiceMessageInput: {
264
+ default: {
265
+ active: {
266
+ textCancel: palette.primary300,
267
+ textTime: palette.onBackgroundDark01,
268
+ background: palette.background50,
269
+ actionIcon: palette.onBackgroundLight01,
270
+ actionIconBackground: palette.background100,
271
+ sendIcon: palette.onBackgroundDark01,
272
+ sendIconBackground: palette.primary300,
273
+ progressTrack: palette.primary300,
274
+ recording: palette.error300,
275
+ },
276
+ inactive: {
277
+ textCancel: palette.primary300,
278
+ textTime: palette.onBackgroundLight03,
279
+ background: palette.background50,
280
+ actionIcon: palette.onBackgroundLight01,
281
+ actionIconBackground: palette.background100,
282
+ sendIcon: palette.onBackgroundLight04,
283
+ sendIconBackground: palette.background100,
284
+ progressTrack: palette.background100,
285
+ recording: palette.error300,
286
+ },
287
+ },
288
+ },
246
289
  },
247
290
  };
248
291
  },
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type { ReactElement, ReactNode } from 'react';
2
+ import type { ReactNode } from 'react';
3
3
  import type { TextStyle } from 'react-native';
4
4
 
5
5
  export interface UIKitTypography {
@@ -43,7 +43,8 @@ export type Component =
43
43
  | 'ProfileCard'
44
44
  | 'Reaction'
45
45
  | 'OpenChannelMessage'
46
- | 'OpenChannelPreview';
46
+ | 'OpenChannelPreview'
47
+ | 'VoiceMessageInput';
47
48
 
48
49
  export type GetColorTree<
49
50
  Tree extends {
@@ -74,6 +75,7 @@ export type ComponentColorTree = GetColorTree<{
74
75
  Reaction: 'default' | 'rounded';
75
76
  OpenChannelMessage: 'default';
76
77
  OpenChannelPreview: 'default';
78
+ VoiceMessageInput: 'default';
77
79
  };
78
80
  State: {
79
81
  Header: 'none';
@@ -89,6 +91,7 @@ export type ComponentColorTree = GetColorTree<{
89
91
  Reaction: 'enabled' | 'selected';
90
92
  OpenChannelMessage: 'enabled' | 'pressed';
91
93
  OpenChannelPreview: 'none';
94
+ VoiceMessageInput: 'active' | 'inactive';
92
95
  };
93
96
  ColorPart: {
94
97
  Header: 'background' | 'borderBottom';
@@ -98,7 +101,17 @@ export type ComponentColorTree = GetColorTree<{
98
101
  Badge: 'text' | 'background';
99
102
  Placeholder: 'content' | 'highlight';
100
103
  DateSeparator: 'text' | 'background';
101
- GroupChannelMessage: 'textMsg' | 'textEdited' | 'textSenderName' | 'textTime' | 'background';
104
+ GroupChannelMessage:
105
+ | 'textMsg'
106
+ | 'textEdited'
107
+ | 'textSenderName'
108
+ | 'textTime'
109
+ | 'textVoicePlaytime'
110
+ | 'background'
111
+ | 'voiceSpinner'
112
+ | 'voiceProgressTrack'
113
+ | 'voiceActionIcon'
114
+ | 'voiceActionIconBackground';
102
115
  GroupChannelPreview:
103
116
  | 'textTitle'
104
117
  | 'textTitleCaption'
@@ -128,6 +141,16 @@ export type ComponentColorTree = GetColorTree<{
128
141
  | 'background'
129
142
  | 'coverBackground'
130
143
  | 'separator';
144
+ VoiceMessageInput:
145
+ | 'textCancel'
146
+ | 'textTime'
147
+ | 'background'
148
+ | 'actionIcon'
149
+ | 'actionIconBackground'
150
+ | 'sendIcon'
151
+ | 'sendIconBackground'
152
+ | 'progressTrack'
153
+ | 'recording';
131
154
  };
132
155
  }>;
133
156
  export type ComponentColors<T extends Component> = {
@@ -175,14 +198,15 @@ export interface UIKitColors {
175
198
  reaction: ComponentColors<'Reaction'>;
176
199
  openChannelMessage: ComponentColors<'OpenChannelMessage'>;
177
200
  openChannelPreview: ComponentColors<'OpenChannelPreview'>;
201
+ voiceMessageInput: ComponentColors<'VoiceMessageInput'>;
178
202
  };
179
203
  }
180
204
 
181
- export type HeaderElement = string | ReactElement | null;
205
+ export type HeaderElement = ReactNode;
182
206
  export type HeaderPartProps = {
183
- title?: HeaderElement;
184
- right?: HeaderElement;
185
- left?: HeaderElement;
207
+ title?: ReactNode;
208
+ right?: ReactNode;
209
+ left?: ReactNode;
186
210
  onPressLeft?: (...params: any[]) => any;
187
211
  onPressRight?: (...params: any[]) => any;
188
212
  };
@@ -10,10 +10,6 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
10
10
  import AvatarGroup from './AvatarGroup';
11
11
  import AvatarIcon from './AvatarIcon';
12
12
 
13
- type SubComponents = {
14
- Group: typeof AvatarGroup;
15
- Icon: typeof AvatarIcon;
16
- };
17
13
  type Props = {
18
14
  uri?: string;
19
15
  size?: number;
@@ -21,13 +17,8 @@ type Props = {
21
17
  muted?: boolean;
22
18
  containerStyle?: StyleProp<ViewStyle>;
23
19
  };
24
- const Avatar: ((props: Props) => JSX.Element) & SubComponents = ({
25
- uri,
26
- square,
27
- muted = false,
28
- size = 56,
29
- containerStyle,
30
- }) => {
20
+
21
+ const Avatar = ({ uri, square, muted = false, size = 56, containerStyle }: Props) => {
31
22
  const { colors, palette } = useUIKitTheme();
32
23
  const [loadFailure, setLoadFailure] = useState(false);
33
24
 
@@ -74,6 +65,7 @@ const styles = createStyleSheet({
74
65
  },
75
66
  });
76
67
 
77
- Avatar.Group = AvatarGroup;
78
- Avatar.Icon = AvatarIcon;
79
- export default Avatar;
68
+ export default Object.assign(Avatar, {
69
+ Group: AvatarGroup,
70
+ Icon: AvatarIcon,
71
+ });
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { TouchableOpacity, useWindowDimensions } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
 
@@ -17,7 +17,7 @@ export type BottomSheetItem = {
17
17
  disabled?: boolean;
18
18
  onPress: () => void;
19
19
  }[];
20
- HeaderComponent?: (props: HeaderProps) => JSX.Element;
20
+ HeaderComponent?: (props: HeaderProps) => ReactNode;
21
21
  };
22
22
  type Props = {
23
23
  visible: boolean;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { StyleProp, View, ViewStyle } from 'react-native';
3
3
 
4
4
  import Icon from '../../components/Icon';
@@ -9,7 +9,7 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
9
9
  type Props = React.PropsWithChildren<{
10
10
  style?: StyleProp<ViewStyle>;
11
11
  }>;
12
- const DialogSheet: ((props: Props) => JSX.Element) & { Item: typeof SheetItem } = ({ style, children }) => {
12
+ const DialogSheet: ((props: Props) => ReactNode) & { Item: typeof SheetItem } = ({ style, children }) => {
13
13
  const { colors } = useUIKitTheme();
14
14
  return (
15
15
  <View style={[styles.container, { backgroundColor: colors.ui.dialog.default.none.background }, style]}>
@@ -0,0 +1,123 @@
1
+ import React, { useEffect, useState } from 'react';
2
+
3
+ import type { SendbirdFileMessage } from '@sendbird/uikit-utils';
4
+ import { millsToMSS } from '@sendbird/uikit-utils';
5
+
6
+ import Box from '../../components/Box';
7
+ import Icon from '../../components/Icon';
8
+ import PressBox from '../../components/PressBox';
9
+ import ProgressBar from '../../components/ProgressBar';
10
+ import Text from '../../components/Text';
11
+ import createStyleSheet from '../../styles/createStyleSheet';
12
+ import useUIKitTheme from '../../theme/useUIKitTheme';
13
+ import LoadingSpinner from '../LoadingSpinner';
14
+ import MessageContainer from './MessageContainer';
15
+ import type { GroupChannelMessageProps } from './index';
16
+
17
+ export type VoiceFileMessageState = {
18
+ status: 'preparing' | 'playing' | 'paused';
19
+ currentTime: number;
20
+ duration: number;
21
+ };
22
+
23
+ type Props = GroupChannelMessageProps<
24
+ SendbirdFileMessage,
25
+ {
26
+ durationMetaArrayKey?: string;
27
+ onUnmount: () => void;
28
+ }
29
+ >;
30
+ const VoiceFileMessage = (props: Props) => {
31
+ const {
32
+ onLongPress,
33
+ variant = 'incoming',
34
+ onToggleVoiceMessage,
35
+ message,
36
+ durationMetaArrayKey = 'KEY_VOICE_MESSAGE_DURATION',
37
+ onUnmount,
38
+ } = props;
39
+
40
+ const { colors } = useUIKitTheme();
41
+
42
+ const [state, setState] = useState<VoiceFileMessageState>(() => {
43
+ const meta = message.metaArrays.find((it) => it.key === durationMetaArrayKey);
44
+ const value = meta?.value?.[0];
45
+ const initialDuration = value ? parseInt(value, 10) : 0;
46
+ return {
47
+ status: 'paused',
48
+ currentTime: 0,
49
+ duration: initialDuration,
50
+ };
51
+ });
52
+
53
+ useEffect(() => {
54
+ return () => {
55
+ onUnmount();
56
+ };
57
+ }, []);
58
+
59
+ const uiColors = colors.ui.groupChannelMessage[variant];
60
+ const remainingTime = state.duration - state.currentTime;
61
+
62
+ return (
63
+ <MessageContainer {...props}>
64
+ <Box style={styles.container} backgroundColor={uiColors.enabled.background}>
65
+ <PressBox onPress={() => onToggleVoiceMessage?.(state, setState)} onLongPress={onLongPress}>
66
+ <ProgressBar
67
+ current={state.currentTime}
68
+ total={state.duration}
69
+ style={{ minWidth: 136, height: 44 }}
70
+ trackColor={uiColors.enabled.voiceProgressTrack}
71
+ overlay={
72
+ <Box
73
+ flex={1}
74
+ flexDirection={'row'}
75
+ alignItems={'center'}
76
+ justifyContent={'space-between'}
77
+ paddingHorizontal={12}
78
+ >
79
+ {state.status === 'preparing' ? (
80
+ <LoadingSpinner size={24} color={uiColors.enabled.voiceSpinner} />
81
+ ) : (
82
+ <Icon
83
+ size={16}
84
+ containerStyle={{
85
+ backgroundColor: uiColors.enabled.voiceActionIconBackground,
86
+ padding: 6,
87
+ borderRadius: 16,
88
+ }}
89
+ icon={state.status === 'paused' ? 'play' : 'pause'}
90
+ />
91
+ )}
92
+ <Text
93
+ body3
94
+ style={{ lineHeight: undefined, marginLeft: 6, opacity: 0.88 }}
95
+ color={uiColors.enabled.textVoicePlaytime}
96
+ >
97
+ {millsToMSS(state.currentTime === 0 ? state.duration : remainingTime)}
98
+ </Text>
99
+ </Box>
100
+ }
101
+ />
102
+ </PressBox>
103
+ {props.children}
104
+ </Box>
105
+ </MessageContainer>
106
+ );
107
+ };
108
+
109
+ const styles = createStyleSheet({
110
+ container: {
111
+ borderRadius: 16,
112
+ overflow: 'hidden',
113
+ },
114
+ image: {
115
+ maxWidth: 240,
116
+ width: 240,
117
+ height: 160,
118
+ borderRadius: 16,
119
+ overflow: 'hidden',
120
+ },
121
+ });
122
+
123
+ export default VoiceFileMessage;
@@ -14,7 +14,7 @@ const UnknownMessage = (props: GroupChannelMessageProps<SendbirdMessage>) => {
14
14
  const { variant = 'incoming' } = props;
15
15
 
16
16
  const { colors } = useUIKitTheme();
17
- const color = colors.ui.groupChannelMessage['incoming'];
17
+ const color = colors.ui.groupChannelMessage[variant];
18
18
  const titleColor = variant === 'incoming' ? colors.onBackground01 : colors.onBackgroundReverse01;
19
19
  const descColor = variant === 'incoming' ? colors.onBackground02 : colors.onBackgroundReverse02;
20
20
 
@@ -6,6 +6,8 @@ import AdminMessage from './Message.admin';
6
6
  import FileMessage from './Message.file';
7
7
  import ImageFileMessage from './Message.file.image';
8
8
  import VideoFileMessage from './Message.file.video';
9
+ import VoiceFileMessage from './Message.file.voice';
10
+ import type { VoiceFileMessageState } from './Message.file.voice';
9
11
  import UnknownMessage from './Message.unknown';
10
12
  import UserMessage from './Message.user';
11
13
  import OpenGraphUser from './Message.user.og';
@@ -34,6 +36,10 @@ export type GroupChannelMessageProps<T extends SendbirdMessage, AdditionalProps
34
36
  onPressAvatar?: () => void;
35
37
  onPressURL?: (url: string) => void;
36
38
  onPressMentionedUser?: (mentionedUser?: SendbirdUser) => void;
39
+ onToggleVoiceMessage?: (
40
+ state: VoiceFileMessageState,
41
+ setState: React.Dispatch<React.SetStateAction<VoiceFileMessageState>>,
42
+ ) => Promise<void>;
37
43
  } & AdditionalProps;
38
44
 
39
45
  const GroupChannelMessage = {
@@ -42,6 +48,7 @@ const GroupChannelMessage = {
42
48
  File: FileMessage,
43
49
  ImageFile: ImageFileMessage,
44
50
  VideoFile: VideoFileMessage,
51
+ VoiceFile: VoiceFileMessage,
45
52
  Admin: AdminMessage,
46
53
  Unknown: UnknownMessage,
47
54
  };
@@ -11,13 +11,13 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
11
11
  import Badge from '../Badge';
12
12
 
13
13
  type Props = {
14
- customCover?: React.ReactElement;
14
+ customCover?: React.ReactNode;
15
15
  coverUrl: string;
16
16
 
17
17
  title: string;
18
18
 
19
19
  titleCaption: string;
20
- titleCaptionLeft?: React.ReactElement;
20
+ titleCaptionLeft?: React.ReactNode;
21
21
 
22
22
  bodyIcon?: keyof typeof Icon.Assets;
23
23
  body: string;
@@ -5,12 +5,11 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
5
  import { conditionChaining } from '@sendbird/uikit-utils';
6
6
 
7
7
  import Text, { TextProps } from '../../components/Text';
8
- import type { BaseHeaderProps } from '../../index';
8
+ import type { BaseHeaderProps, HeaderElement } from '../../index';
9
9
  import createStyleSheet from '../../styles/createStyleSheet';
10
10
  import useHeaderStyle from '../../styles/useHeaderStyle';
11
11
  import useUIKitTheme from '../../theme/useUIKitTheme';
12
12
 
13
- type HeaderElement = string | React.ReactElement | null;
14
13
  export type HeaderProps = BaseHeaderProps<
15
14
  {
16
15
  title?: HeaderElement;
@@ -27,11 +26,7 @@ export type HeaderProps = BaseHeaderProps<
27
26
  >;
28
27
 
29
28
  const AlignMapper = { left: 'flex-start', center: 'center', right: 'flex-end' } as const;
30
- const Header: ((props: HeaderProps) => JSX.Element) & {
31
- Button: typeof HeaderButton;
32
- Title: typeof HeaderTitle;
33
- Subtitle: typeof HeaderSubtitle;
34
- } = ({
29
+ const Header = ({
35
30
  children,
36
31
  titleAlign,
37
32
  title = null,
@@ -42,7 +37,7 @@ const Header: ((props: HeaderProps) => JSX.Element) & {
42
37
  clearTitleMargin = false,
43
38
  clearStatusBarTopInset = false,
44
39
  statusBarTopInsetAs = 'padding',
45
- }) => {
40
+ }: HeaderProps) => {
46
41
  const { topInset, defaultTitleAlign, defaultHeight } = useHeaderStyle();
47
42
 
48
43
  const { colors } = useUIKitTheme();
@@ -184,7 +179,8 @@ const styles = createStyleSheet({
184
179
  },
185
180
  });
186
181
 
187
- Header.Button = HeaderButton;
188
- Header.Title = HeaderTitle;
189
- Header.Subtitle = HeaderSubtitle;
190
- export default Header;
182
+ export default Object.assign(Header, {
183
+ Button: HeaderButton,
184
+ Title: HeaderTitle,
185
+ Subtitle: HeaderSubtitle,
186
+ });
@@ -101,7 +101,7 @@ const MessageContainer = ({
101
101
  );
102
102
  };
103
103
 
104
- const SendingStatusContainer = ({ children }: { children: React.ReactElement }) => {
104
+ const SendingStatusContainer = ({ children }: { children: React.ReactNode }) => {
105
105
  return (
106
106
  <Box flexDirection={'row'}>
107
107
  <Box marginTop={2}>{children}</Box>
@@ -10,7 +10,7 @@ import createStyleSheet from '../../styles/createStyleSheet';
10
10
  import useUIKitTheme from '../../theme/useUIKitTheme';
11
11
 
12
12
  type Props = {
13
- customCover?: React.ReactElement;
13
+ customCover?: React.ReactNode;
14
14
  coverUrl: string;
15
15
  title: string;
16
16
  participantsCount?: number;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { StyleProp, View, ViewStyle } from 'react-native';
3
3
 
4
4
  import Divider from '../../components/Divider';
@@ -11,7 +11,7 @@ type Props = {
11
11
  uri: string;
12
12
  username: string;
13
13
 
14
- button?: JSX.Element;
14
+ button?: ReactNode;
15
15
 
16
16
  bodyLabel: string;
17
17
  body: string;