@sendbird/uikit-react-native-foundation 3.1.2 → 3.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 (254) 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/components/TextInput/index.js +10 -3
  37. package/lib/commonjs/components/TextInput/index.js.map +1 -1
  38. package/lib/commonjs/index.js +16 -2
  39. package/lib/commonjs/index.js.map +1 -1
  40. package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
  41. package/lib/commonjs/styles/createScaleFactor.js +5 -4
  42. package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
  43. package/lib/commonjs/styles/createStyleSheet.js +4 -0
  44. package/lib/commonjs/styles/createStyleSheet.js.map +1 -1
  45. package/lib/commonjs/theme/DarkUIKitTheme.js +80 -36
  46. package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
  47. package/lib/commonjs/theme/LightUIKitTheme.js +80 -36
  48. package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
  49. package/lib/commonjs/types.js.map +1 -1
  50. package/lib/commonjs/ui/Avatar/AvatarStack.js +96 -0
  51. package/lib/commonjs/ui/Avatar/AvatarStack.js.map +1 -0
  52. package/lib/commonjs/ui/Avatar/index.js +6 -3
  53. package/lib/commonjs/ui/Avatar/index.js.map +1 -1
  54. package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
  55. package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
  56. package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js +108 -0
  57. package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js.map +1 -0
  58. package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js +1 -1
  59. package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
  60. package/lib/commonjs/ui/GroupChannelMessage/index.js +2 -0
  61. package/lib/commonjs/ui/GroupChannelMessage/index.js.map +1 -1
  62. package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
  63. package/lib/commonjs/ui/Header/index.js +5 -4
  64. package/lib/commonjs/ui/Header/index.js.map +1 -1
  65. package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
  66. package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -1
  67. package/lib/commonjs/ui/ProfileCard/index.js.map +1 -1
  68. package/lib/commonjs/ui/TypingIndicatorBubble/index.js +118 -0
  69. package/lib/commonjs/ui/TypingIndicatorBubble/index.js.map +1 -0
  70. package/lib/module/assets/icon/icon-audio-off-filled.png +0 -0
  71. package/lib/module/assets/icon/icon-audio-off-filled@2x.png +0 -0
  72. package/lib/module/assets/icon/icon-audio-off-filled@3x.png +0 -0
  73. package/lib/module/assets/icon/icon-audio-off.png +0 -0
  74. package/lib/module/assets/icon/icon-audio-off@2x.png +0 -0
  75. package/lib/module/assets/icon/icon-audio-off@3x.png +0 -0
  76. package/lib/module/assets/icon/icon-audio-on-filled.png +0 -0
  77. package/lib/module/assets/icon/icon-audio-on-filled@2x.png +0 -0
  78. package/lib/module/assets/icon/icon-audio-on-filled@3x.png +0 -0
  79. package/lib/module/assets/icon/icon-audio-on.png +0 -0
  80. package/lib/module/assets/icon/icon-audio-on@2x.png +0 -0
  81. package/lib/module/assets/icon/icon-audio-on@3x.png +0 -0
  82. package/lib/module/assets/icon/icon-pause.png +0 -0
  83. package/lib/module/assets/icon/icon-pause@2x.png +0 -0
  84. package/lib/module/assets/icon/icon-pause@3x.png +0 -0
  85. package/lib/module/assets/icon/icon-recording.png +0 -0
  86. package/lib/module/assets/icon/icon-recording@2x.png +0 -0
  87. package/lib/module/assets/icon/icon-recording@3x.png +0 -0
  88. package/lib/module/assets/icon/icon-stop.png +0 -0
  89. package/lib/module/assets/icon/icon-stop@2x.png +0 -0
  90. package/lib/module/assets/icon/icon-stop@3x.png +0 -0
  91. package/lib/module/assets/icon/index.js +7 -0
  92. package/lib/module/assets/icon/index.js.map +1 -1
  93. package/lib/module/components/Box/index.js +2 -2
  94. package/lib/module/components/Box/index.js.map +1 -1
  95. package/lib/module/components/Icon/index.js +4 -3
  96. package/lib/module/components/Icon/index.js.map +1 -1
  97. package/lib/module/components/Image/FastImageInternal.js.map +1 -1
  98. package/lib/module/components/Image/index.js.map +1 -1
  99. package/lib/module/components/Modal/index.js +1 -1
  100. package/lib/module/components/Modal/index.js.map +1 -1
  101. package/lib/module/components/PressBox/index.js.map +1 -1
  102. package/lib/module/components/ProgressBar/index.js +62 -0
  103. package/lib/module/components/ProgressBar/index.js.map +1 -0
  104. package/lib/module/components/RegexText/index.js.map +1 -1
  105. package/lib/module/components/TextInput/index.js +10 -3
  106. package/lib/module/components/TextInput/index.js.map +1 -1
  107. package/lib/module/index.js +4 -2
  108. package/lib/module/index.js.map +1 -1
  109. package/lib/module/styles/HeaderStyleContext.js.map +1 -1
  110. package/lib/module/styles/createScaleFactor.js +5 -4
  111. package/lib/module/styles/createScaleFactor.js.map +1 -1
  112. package/lib/module/styles/createStyleSheet.js +4 -0
  113. package/lib/module/styles/createStyleSheet.js.map +1 -1
  114. package/lib/module/theme/DarkUIKitTheme.js +80 -36
  115. package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
  116. package/lib/module/theme/LightUIKitTheme.js +80 -36
  117. package/lib/module/theme/LightUIKitTheme.js.map +1 -1
  118. package/lib/module/types.js.map +1 -1
  119. package/lib/module/ui/Avatar/AvatarStack.js +88 -0
  120. package/lib/module/ui/Avatar/AvatarStack.js.map +1 -0
  121. package/lib/module/ui/Avatar/index.js +6 -3
  122. package/lib/module/ui/Avatar/index.js.map +1 -1
  123. package/lib/module/ui/BottomSheet/index.js.map +1 -1
  124. package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
  125. package/lib/module/ui/GroupChannelMessage/Message.file.voice.js +98 -0
  126. package/lib/module/ui/GroupChannelMessage/Message.file.voice.js.map +1 -0
  127. package/lib/module/ui/GroupChannelMessage/Message.unknown.js +1 -1
  128. package/lib/module/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
  129. package/lib/module/ui/GroupChannelMessage/index.js +2 -0
  130. package/lib/module/ui/GroupChannelMessage/index.js.map +1 -1
  131. package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
  132. package/lib/module/ui/Header/index.js +5 -4
  133. package/lib/module/ui/Header/index.js.map +1 -1
  134. package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
  135. package/lib/module/ui/OpenChannelPreview/index.js.map +1 -1
  136. package/lib/module/ui/ProfileCard/index.js.map +1 -1
  137. package/lib/module/ui/TypingIndicatorBubble/index.js +108 -0
  138. package/lib/module/ui/TypingIndicatorBubble/index.js.map +1 -0
  139. package/lib/typescript/src/assets/icon/index.d.ts +7 -0
  140. package/lib/typescript/src/components/Box/index.d.ts +2 -1
  141. package/lib/typescript/src/components/Divider/index.d.ts +2 -1
  142. package/lib/typescript/src/components/Icon/index.d.ts +76 -7
  143. package/lib/typescript/src/components/Image/FastImageInternal.d.ts +2 -1
  144. package/lib/typescript/src/components/Image/index.d.ts +2 -1
  145. package/lib/typescript/src/components/ImageWithPlaceholder/index.d.ts +2 -1
  146. package/lib/typescript/src/components/Modal/index.d.ts +2 -1
  147. package/lib/typescript/src/components/PressBox/index.d.ts +2 -1
  148. package/lib/typescript/src/components/ProgressBar/index.d.ts +12 -0
  149. package/lib/typescript/src/components/RegexText/index.d.ts +3 -2
  150. package/lib/typescript/src/components/Switch/index.d.ts +1 -1
  151. package/lib/typescript/src/components/Text/index.d.ts +2 -1
  152. package/lib/typescript/src/components/VideoThumbnail/index.d.ts +2 -1
  153. package/lib/typescript/src/index.d.ts +5 -3
  154. package/lib/typescript/src/styles/HeaderStyleContext.d.ts +2 -2
  155. package/lib/typescript/src/styles/createScaleFactor.d.ts +4 -5
  156. package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +1 -1
  157. package/lib/typescript/src/types.d.ts +11 -7
  158. package/lib/typescript/src/ui/ActionMenu/index.d.ts +2 -1
  159. package/lib/typescript/src/ui/Alert/index.d.ts +2 -1
  160. package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +1 -1
  161. package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +2 -1
  162. package/lib/typescript/src/ui/Avatar/AvatarStack.d.ts +16 -0
  163. package/lib/typescript/src/ui/Avatar/index.d.ts +30 -8
  164. package/lib/typescript/src/ui/Badge/index.d.ts +2 -1
  165. package/lib/typescript/src/ui/BottomSheet/index.d.ts +3 -2
  166. package/lib/typescript/src/ui/Button/index.d.ts +1 -1
  167. package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +2 -1
  168. package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +1 -1
  169. package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +3 -3
  170. package/lib/typescript/src/ui/Dialog/index.d.ts +1 -1
  171. package/lib/typescript/src/ui/GroupChannelMessage/Message.admin.d.ts +2 -1
  172. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.d.ts +2 -1
  173. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.image.d.ts +2 -1
  174. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.video.d.ts +2 -1
  175. package/lib/typescript/src/ui/GroupChannelMessage/Message.file.voice.d.ts +14 -0
  176. package/lib/typescript/src/ui/GroupChannelMessage/Message.unknown.d.ts +2 -1
  177. package/lib/typescript/src/ui/GroupChannelMessage/Message.user.d.ts +2 -1
  178. package/lib/typescript/src/ui/GroupChannelMessage/Message.user.og.d.ts +2 -1
  179. package/lib/typescript/src/ui/GroupChannelMessage/MessageBubbleWithText.d.ts +2 -1
  180. package/lib/typescript/src/ui/GroupChannelMessage/MessageContainer.d.ts +4 -3
  181. package/lib/typescript/src/ui/GroupChannelMessage/MessageOpenGraph.d.ts +2 -1
  182. package/lib/typescript/src/ui/GroupChannelMessage/index.d.ts +43 -7
  183. package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +3 -3
  184. package/lib/typescript/src/ui/Header/index.d.ts +8 -12
  185. package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +2 -1
  186. package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
  187. package/lib/typescript/src/ui/OpenChannelMessage/Message.admin.d.ts +2 -1
  188. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.d.ts +2 -1
  189. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.image.d.ts +2 -1
  190. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.video.d.ts +2 -1
  191. package/lib/typescript/src/ui/OpenChannelMessage/Message.unknown.d.ts +2 -1
  192. package/lib/typescript/src/ui/OpenChannelMessage/Message.user.d.ts +2 -1
  193. package/lib/typescript/src/ui/OpenChannelMessage/Message.user.og.d.ts +2 -1
  194. package/lib/typescript/src/ui/OpenChannelMessage/MessageContainer.d.ts +2 -1
  195. package/lib/typescript/src/ui/OpenChannelMessage/index.d.ts +7 -7
  196. package/lib/typescript/src/ui/OpenChannelPreview/index.d.ts +2 -2
  197. package/lib/typescript/src/ui/OutlinedButton/index.d.ts +2 -1
  198. package/lib/typescript/src/ui/Placeholder/index.d.ts +2 -1
  199. package/lib/typescript/src/ui/ProfileCard/index.d.ts +3 -2
  200. package/lib/typescript/src/ui/Prompt/index.d.ts +2 -1
  201. package/lib/typescript/src/ui/Toast/index.d.ts +2 -2
  202. package/lib/typescript/src/ui/TypingIndicatorBubble/index.d.ts +10 -0
  203. package/package.json +5 -9
  204. package/src/assets/icon/icon-audio-off-filled.png +0 -0
  205. package/src/assets/icon/icon-audio-off-filled@2x.png +0 -0
  206. package/src/assets/icon/icon-audio-off-filled@3x.png +0 -0
  207. package/src/assets/icon/icon-audio-off.png +0 -0
  208. package/src/assets/icon/icon-audio-off@2x.png +0 -0
  209. package/src/assets/icon/icon-audio-off@3x.png +0 -0
  210. package/src/assets/icon/icon-audio-on-filled.png +0 -0
  211. package/src/assets/icon/icon-audio-on-filled@2x.png +0 -0
  212. package/src/assets/icon/icon-audio-on-filled@3x.png +0 -0
  213. package/src/assets/icon/icon-audio-on.png +0 -0
  214. package/src/assets/icon/icon-audio-on@2x.png +0 -0
  215. package/src/assets/icon/icon-audio-on@3x.png +0 -0
  216. package/src/assets/icon/icon-pause.png +0 -0
  217. package/src/assets/icon/icon-pause@2x.png +0 -0
  218. package/src/assets/icon/icon-pause@3x.png +0 -0
  219. package/src/assets/icon/icon-recording.png +0 -0
  220. package/src/assets/icon/icon-recording@2x.png +0 -0
  221. package/src/assets/icon/icon-recording@3x.png +0 -0
  222. package/src/assets/icon/icon-stop.png +0 -0
  223. package/src/assets/icon/icon-stop@2x.png +0 -0
  224. package/src/assets/icon/icon-stop@3x.png +0 -0
  225. package/src/assets/icon/index.ts +7 -0
  226. package/src/components/Box/index.tsx +1 -1
  227. package/src/components/Icon/index.tsx +6 -7
  228. package/src/components/Image/FastImageInternal.tsx +3 -2
  229. package/src/components/Image/index.ts +2 -1
  230. package/src/components/Modal/index.tsx +1 -1
  231. package/src/components/PressBox/index.tsx +1 -0
  232. package/src/components/ProgressBar/index.tsx +72 -0
  233. package/src/components/RegexText/index.tsx +3 -3
  234. package/src/components/TextInput/index.tsx +10 -3
  235. package/src/index.ts +5 -4
  236. package/src/styles/HeaderStyleContext.tsx +1 -1
  237. package/src/styles/createScaleFactor.ts +5 -5
  238. package/src/styles/createStyleSheet.ts +4 -0
  239. package/src/theme/DarkUIKitTheme.ts +80 -37
  240. package/src/theme/LightUIKitTheme.ts +80 -37
  241. package/src/types.ts +31 -7
  242. package/src/ui/Avatar/AvatarStack.tsx +103 -0
  243. package/src/ui/Avatar/index.tsx +8 -14
  244. package/src/ui/BottomSheet/index.tsx +2 -2
  245. package/src/ui/Dialog/DialogSheet.tsx +2 -2
  246. package/src/ui/GroupChannelMessage/Message.file.voice.tsx +123 -0
  247. package/src/ui/GroupChannelMessage/Message.unknown.tsx +1 -1
  248. package/src/ui/GroupChannelMessage/index.ts +7 -0
  249. package/src/ui/GroupChannelPreview/index.tsx +2 -2
  250. package/src/ui/Header/index.tsx +8 -12
  251. package/src/ui/OpenChannelMessage/MessageContainer.tsx +1 -1
  252. package/src/ui/OpenChannelPreview/index.tsx +1 -1
  253. package/src/ui/ProfileCard/index.tsx +2 -2
  254. package/src/ui/TypingIndicatorBubble/index.tsx +120 -0
@@ -45,7 +45,7 @@ const Box = ({ style, children, ...props }: BoxProps) => {
45
45
  const boxStyle = useBoxStyle(props);
46
46
 
47
47
  return (
48
- <View style={[boxStyle, style]} {...props}>
48
+ <View {...props} style={[boxStyle, style]}>
49
49
  {children}
50
50
  </View>
51
51
  );
@@ -17,10 +17,8 @@ type Props = {
17
17
  style?: StyleProp<ImageStyle>;
18
18
  containerStyle?: StyleProp<ViewStyle>;
19
19
  };
20
- const Icon: ((props: Props) => JSX.Element) & {
21
- Assets: typeof IconAssets;
22
- File: typeof FileIcon;
23
- } = ({ icon, color, size = 24, containerStyle, style }) => {
20
+
21
+ const Icon = ({ icon, color, size = 24, containerStyle, style }: Props) => {
24
22
  const sizeStyle = sizeStyles[size as SizeFactor] ?? { width: size, height: size };
25
23
  const { colors } = useUIKitTheme();
26
24
  return (
@@ -68,6 +66,7 @@ const sizeStyles = createStyleSheet({
68
66
  },
69
67
  });
70
68
 
71
- Icon.Assets = IconAssets;
72
- Icon.File = FileIcon;
73
- export default Icon;
69
+ export default Object.assign(Icon, {
70
+ Assets: IconAssets,
71
+ File: FileIcon,
72
+ });
@@ -1,9 +1,10 @@
1
+ import type { ReactNode } from 'react';
1
2
  import type { FastImageProps } from 'react-native-fast-image';
2
3
 
3
- let FastImageInternal: (props: FastImageProps) => JSX.Element | null = () => null;
4
+ let FastImageInternal: (props: FastImageProps) => ReactNode | null = () => null;
4
5
 
5
6
  try {
6
- FastImageInternal = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;
7
+ FastImageInternal = require('react-native-fast-image') as (props: FastImageProps) => ReactNode;
7
8
  } catch {}
8
9
 
9
10
  export default FastImageInternal;
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import type { ImageProps as NativeImageProps } from 'react-native';
2
3
  import { NativeModules } from 'react-native';
3
4
 
@@ -7,7 +8,7 @@ export interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'o
7
8
  tintColor?: string;
8
9
  }
9
10
 
10
- export type SendbirdImageComponent = (props: SendbirdImageProps) => JSX.Element;
11
+ export type SendbirdImageComponent = (props: SendbirdImageProps) => ReactNode;
11
12
 
12
13
  function getImageModule(): SendbirdImageComponent {
13
14
  const hasFastImage = Boolean(NativeModules.FastImageView);
@@ -86,7 +86,7 @@ const Modal = ({
86
86
  <KeyboardAvoidingView
87
87
  // NOTE: This is trick for Android.
88
88
  // When orientation is changed on Android, the offset that to avoid soft-keyboard is not updated normally.
89
- key={`${width}-${height}`}
89
+ key={Platform.OS === 'android' && enableKeyboardAvoid ? `${width}-${height}` : undefined}
90
90
  enabled={enableKeyboardAvoid}
91
91
  style={styles.background}
92
92
  behavior={Platform.select({ ios: 'padding', default: 'height' })}
@@ -10,6 +10,7 @@ type PressBoxStateParams = {
10
10
  };
11
11
 
12
12
  type Props = {
13
+ disabled?: boolean;
13
14
  onPress?: (event: GestureResponderEvent) => void;
14
15
  onLongPress?: (event: GestureResponderEvent) => void;
15
16
  delayLongPress?: number;
@@ -0,0 +1,72 @@
1
+ import React, { ReactNode, useEffect, useRef } from 'react';
2
+ import { Animated, Easing, StyleSheet, ViewStyle } from 'react-native';
3
+
4
+ import { NOOP } from '@sendbird/uikit-utils';
5
+
6
+ import useUIKitTheme from '../../theme/useUIKitTheme';
7
+ import Box from '../Box';
8
+
9
+ type Props = {
10
+ current: number;
11
+ total: number;
12
+ trackColor?: string;
13
+ barColor?: string;
14
+ overlay?: ReactNode | undefined;
15
+ style?: ViewStyle;
16
+ };
17
+ const ProgressBar = ({ current = 100, total = 100, trackColor, barColor, overlay, style }: Props) => {
18
+ const { colors } = useUIKitTheme();
19
+
20
+ const uiColors = {
21
+ track: trackColor ?? colors.primary,
22
+ bar: barColor ?? colors.onBackground01,
23
+ };
24
+
25
+ const progress = useRef(new Animated.Value(0)).current;
26
+ const percent = current / total;
27
+ const stopped = percent === 0;
28
+
29
+ useEffect(() => {
30
+ if (!Number.isNaN(percent)) {
31
+ const animation = Animated.timing(progress, {
32
+ toValue: stopped ? 0 : percent,
33
+ duration: stopped ? 0 : 100,
34
+ useNativeDriver: false,
35
+ easing: Easing.linear,
36
+ });
37
+
38
+ animation.start();
39
+ return () => animation.stop();
40
+ }
41
+
42
+ return NOOP;
43
+ }, [percent]);
44
+
45
+ return (
46
+ <Box
47
+ height={36}
48
+ flexDirection={'row'}
49
+ backgroundColor={uiColors.track}
50
+ alignItems={'center'}
51
+ overflow={'hidden'}
52
+ style={style}
53
+ >
54
+ <Animated.View
55
+ style={{
56
+ position: 'absolute',
57
+ width: progress.interpolate({
58
+ inputRange: [0, 1],
59
+ outputRange: ['0%', '100%'],
60
+ extrapolate: 'clamp',
61
+ }),
62
+ height: '100%',
63
+ opacity: 0.38,
64
+ backgroundColor: uiColors.bar,
65
+ }}
66
+ />
67
+ <Box style={StyleSheet.absoluteFill}>{overlay}</Box>
68
+ </Box>
69
+ );
70
+ };
71
+
72
+ export default ProgressBar;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
 
3
3
  import { replaceWithRegex } from '@sendbird/uikit-utils';
4
4
 
@@ -12,7 +12,7 @@ export interface RegexTextPattern {
12
12
  index: number;
13
13
  keyPrefix: string;
14
14
  parentProps?: TextProps;
15
- }): string | JSX.Element;
15
+ }): string | ReactNode;
16
16
  }
17
17
 
18
18
  type Props = { patterns: RegexTextPattern[] } & TextProps;
@@ -20,7 +20,7 @@ type Props = { patterns: RegexTextPattern[] } & TextProps;
20
20
  const RegexText = ({ children, patterns, ...props }: Props) => {
21
21
  if (patterns.length === 0 || typeof children !== 'string') return <>{children}</>;
22
22
 
23
- const matchedTexts: Array<string | JSX.Element> = [children];
23
+ const matchedTexts: Array<string | ReactNode> = [children];
24
24
 
25
25
  patterns.forEach(({ regex, replacer }, patterIndex) => {
26
26
  const matchedTextsTemp = matchedTexts.concat();
@@ -15,6 +15,10 @@ const TextInput = React.forwardRef<RNTextInput, Props>(function TextInput(
15
15
  const variantStyle = colors['ui']['input'][variant];
16
16
  const inputStyle = editable ? variantStyle.active : variantStyle.disabled;
17
17
  const underlineStyle = variant === 'underline' && { borderBottomWidth: 2, borderBottomColor: inputStyle.highlight };
18
+ const fontStyle = {
19
+ ...typography.body3,
20
+ lineHeight: typography.body3.fontSize ? typography.body3.fontSize * 1.2 : undefined,
21
+ };
18
22
 
19
23
  return (
20
24
  <RNTextInput
@@ -23,7 +27,7 @@ const TextInput = React.forwardRef<RNTextInput, Props>(function TextInput(
23
27
  selectionColor={inputStyle.highlight}
24
28
  placeholderTextColor={inputStyle.placeholder}
25
29
  style={[
26
- typography.body3,
30
+ fontStyle,
27
31
  styles.input,
28
32
  { color: inputStyle.text, backgroundColor: inputStyle.background },
29
33
  underlineStyle,
@@ -38,8 +42,11 @@ const TextInput = React.forwardRef<RNTextInput, Props>(function TextInput(
38
42
 
39
43
  const styles = createStyleSheet({
40
44
  input: {
41
- paddingVertical: 8,
42
- paddingHorizontal: 16,
45
+ includeFontPadding: false,
46
+ paddingTop: 8,
47
+ paddingBottom: 8,
48
+ paddingLeft: 16,
49
+ paddingRight: 16,
43
50
  },
44
51
  });
45
52
 
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ export { default as Image } from './components/Image';
9
9
  export { default as ImageWithPlaceholder } from './components/ImageWithPlaceholder';
10
10
  export { default as Modal } from './components/Modal';
11
11
  export { default as PressBox } from './components/PressBox';
12
+ export { default as ProgressBar } from './components/ProgressBar';
12
13
  export { default as RegexText } from './components/RegexText';
13
14
  export type { RegexTextPattern } from './components/RegexText';
14
15
  export { default as Switch } from './components/Switch';
@@ -25,14 +26,13 @@ export { default as BottomSheet } from './ui/BottomSheet';
25
26
  export { default as Button } from './ui/Button';
26
27
  export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
27
28
  export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
29
+ export { default as GroupChannelMessage } from './ui/GroupChannelMessage';
30
+ export type { GroupChannelMessageProps } from './ui/GroupChannelMessage';
31
+ export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
28
32
  export { default as Header } from './ui/Header';
29
33
  export { default as LoadingSpinner } from './ui/LoadingSpinner';
30
34
  export { default as MenuBar } from './ui/MenuBar';
31
35
  export type { MenuBarProps } from './ui/MenuBar';
32
- export { default as GroupChannelMessage } from './ui/GroupChannelMessage';
33
- export type { GroupChannelMessageProps } from './ui/GroupChannelMessage';
34
- export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
35
-
36
36
  export { default as OpenChannelMessage } from './ui/OpenChannelMessage';
37
37
  export type { OpenChannelMessageProps } from './ui/OpenChannelMessage';
38
38
  export { default as OpenChannelPreview } from './ui/OpenChannelPreview';
@@ -41,6 +41,7 @@ export { default as Placeholder } from './ui/Placeholder';
41
41
  export { default as ProfileCard } from './ui/ProfileCard';
42
42
  export { default as Prompt } from './ui/Prompt';
43
43
  export { default as Toast, useToast, ToastProvider } from './ui/Toast';
44
+ export { default as TypingIndicatorBubble } from './ui/TypingIndicatorBubble';
44
45
 
45
46
  /** Styles **/
46
47
  export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
@@ -6,7 +6,7 @@ import type { HeaderProps } from '../ui/Header';
6
6
  import getDefaultHeaderHeight from './getDefaultHeaderHeight';
7
7
 
8
8
  export type HeaderStyleContextType = {
9
- HeaderComponent: (props: HeaderProps) => React.ReactElement | null;
9
+ HeaderComponent: (props: HeaderProps) => React.ReactNode | null;
10
10
  defaultTitleAlign: 'left' | 'center';
11
11
  statusBarTranslucent: boolean;
12
12
  topInset: number;
@@ -10,9 +10,9 @@ const createScaleFactor = (deviceWidth = DESIGNED_DEVICE_WIDTH) => {
10
10
  return (dp: number) => PixelRatio.roundToNearestPixel(dp * rangedRatio);
11
11
  };
12
12
 
13
- createScaleFactor.updateScaleFactor = (scaleFactor: (dp: number) => number) => {
14
- DEFAULT_SCALE_FACTOR = scaleFactor;
15
- };
16
-
17
13
  export let DEFAULT_SCALE_FACTOR = createScaleFactor();
18
- export default createScaleFactor;
14
+ export default Object.assign(createScaleFactor, {
15
+ updateScaleFactor: (scaleFactor: (dp: number) => number) => {
16
+ DEFAULT_SCALE_FACTOR = scaleFactor;
17
+ },
18
+ });
@@ -18,11 +18,15 @@ const preProcessor: Partial<StylePreprocessor> = {
18
18
  'height': SCALE_FACTOR_WITH_STR,
19
19
  'width': SCALE_FACTOR_WITH_STR,
20
20
  'padding': SCALE_FACTOR_WITH_STR,
21
+ 'paddingVertical': SCALE_FACTOR_WITH_STR,
22
+ 'paddingHorizontal': SCALE_FACTOR_WITH_STR,
21
23
  'paddingTop': SCALE_FACTOR_WITH_STR,
22
24
  'paddingBottom': SCALE_FACTOR_WITH_STR,
23
25
  'paddingLeft': SCALE_FACTOR_WITH_STR,
24
26
  'paddingRight': SCALE_FACTOR_WITH_STR,
25
27
  'margin': SCALE_FACTOR_WITH_STR,
28
+ 'marginVertical': SCALE_FACTOR_WITH_STR,
29
+ 'marginHorizontal': SCALE_FACTOR_WITH_STR,
26
30
  'marginTop': SCALE_FACTOR_WITH_STR,
27
31
  'marginBottom': SCALE_FACTOR_WITH_STR,
28
32
  'marginLeft': SCALE_FACTOR_WITH_STR,
@@ -3,41 +3,6 @@ import createTheme from './createTheme';
3
3
  const DarkUIKitTheme = createTheme({
4
4
  colorScheme: 'dark',
5
5
  colors: (palette) => {
6
- const groupChannelMessage = {
7
- incoming: {
8
- enabled: {
9
- textMsg: palette.onBackgroundDark01,
10
- textEdited: palette.onBackgroundDark02,
11
- textTime: palette.onBackgroundDark03,
12
- textSenderName: palette.onBackgroundDark02,
13
- background: palette.background400,
14
- },
15
- pressed: {
16
- textMsg: palette.onBackgroundDark01,
17
- textEdited: palette.onBackgroundDark02,
18
- textTime: palette.onBackgroundDark03,
19
- textSenderName: palette.onBackgroundDark02,
20
- background: palette.primary500,
21
- },
22
- },
23
- outgoing: {
24
- enabled: {
25
- textMsg: palette.onBackgroundLight01,
26
- textEdited: palette.onBackgroundLight02,
27
- textTime: palette.onBackgroundDark03,
28
- textSenderName: palette.transparent,
29
- background: palette.primary200,
30
- },
31
- pressed: {
32
- textMsg: palette.onBackgroundLight01,
33
- textEdited: palette.onBackgroundLight02,
34
- textTime: palette.onBackgroundDark03,
35
- textSenderName: palette.transparent,
36
- background: palette.primary300,
37
- },
38
- },
39
- };
40
-
41
6
  return {
42
7
  primary: palette.primary200,
43
8
  secondary: palette.secondary200,
@@ -149,7 +114,6 @@ const DarkUIKitTheme = createTheme({
149
114
  },
150
115
  },
151
116
  },
152
- message: groupChannelMessage,
153
117
  dateSeparator: {
154
118
  default: {
155
119
  none: {
@@ -158,7 +122,60 @@ const DarkUIKitTheme = createTheme({
158
122
  },
159
123
  },
160
124
  },
161
- groupChannelMessage,
125
+ groupChannelMessage: {
126
+ incoming: {
127
+ enabled: {
128
+ textMsg: palette.onBackgroundDark01,
129
+ textEdited: palette.onBackgroundDark02,
130
+ textTime: palette.onBackgroundDark03,
131
+ textSenderName: palette.onBackgroundDark02,
132
+ background: palette.background400,
133
+ textVoicePlaytime: palette.onBackgroundDark01,
134
+ voiceSpinner: palette.primary200,
135
+ voiceProgressTrack: palette.background400,
136
+ voiceActionIcon: palette.primary200,
137
+ voiceActionIconBackground: palette.background700,
138
+ },
139
+ pressed: {
140
+ textMsg: palette.onBackgroundDark01,
141
+ textEdited: palette.onBackgroundDark02,
142
+ textTime: palette.onBackgroundDark03,
143
+ textSenderName: palette.onBackgroundDark02,
144
+ background: palette.primary500,
145
+ textVoicePlaytime: palette.onBackgroundDark01,
146
+ voiceSpinner: palette.primary200,
147
+ voiceProgressTrack: palette.background400,
148
+ voiceActionIcon: palette.primary200,
149
+ voiceActionIconBackground: palette.background700,
150
+ },
151
+ },
152
+ outgoing: {
153
+ enabled: {
154
+ textMsg: palette.onBackgroundLight01,
155
+ textEdited: palette.onBackgroundLight02,
156
+ textTime: palette.onBackgroundDark03,
157
+ textSenderName: palette.transparent,
158
+ background: palette.primary200,
159
+ textVoicePlaytime: palette.onBackgroundLight01,
160
+ voiceSpinner: palette.primary300,
161
+ voiceProgressTrack: palette.primary200,
162
+ voiceActionIcon: palette.primary200,
163
+ voiceActionIconBackground: palette.background700,
164
+ },
165
+ pressed: {
166
+ textMsg: palette.onBackgroundLight01,
167
+ textEdited: palette.onBackgroundLight02,
168
+ textTime: palette.onBackgroundDark03,
169
+ textSenderName: palette.transparent,
170
+ background: palette.primary300,
171
+ textVoicePlaytime: palette.onBackgroundLight01,
172
+ voiceSpinner: palette.primary300,
173
+ voiceProgressTrack: palette.primary200,
174
+ voiceActionIcon: palette.primary200,
175
+ voiceActionIconBackground: palette.background700,
176
+ },
177
+ },
178
+ },
162
179
  groupChannelPreview: {
163
180
  default: {
164
181
  none: {
@@ -243,6 +260,32 @@ const DarkUIKitTheme = createTheme({
243
260
  },
244
261
  },
245
262
  },
263
+ voiceMessageInput: {
264
+ default: {
265
+ active: {
266
+ textCancel: palette.primary200,
267
+ textTime: palette.onBackgroundLight01,
268
+ background: palette.background600,
269
+ actionIcon: palette.onBackgroundDark01,
270
+ actionIconBackground: palette.background500,
271
+ sendIcon: palette.onBackgroundLight01,
272
+ sendIconBackground: palette.primary200,
273
+ progressTrack: palette.primary200,
274
+ recording: palette.error300,
275
+ },
276
+ inactive: {
277
+ textCancel: palette.primary200,
278
+ textTime: palette.onBackgroundDark03,
279
+ background: palette.background600,
280
+ actionIcon: palette.onBackgroundDark01,
281
+ actionIconBackground: palette.background500,
282
+ sendIcon: palette.onBackgroundDark04,
283
+ sendIconBackground: palette.background500,
284
+ progressTrack: palette.background400,
285
+ recording: palette.error200,
286
+ },
287
+ },
288
+ },
246
289
  },
247
290
  };
248
291
  },
@@ -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
  };