@sendbird/uikit-react-native-foundation 1.0.0 → 1.1.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 (125) hide show
  1. package/lib/commonjs/components/Image/index.js.map +1 -1
  2. package/lib/commonjs/styles/HeaderStyleContext.js +10 -2
  3. package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
  4. package/lib/commonjs/styles/createScaleFactor.js +2 -1
  5. package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
  6. package/lib/commonjs/theme/UIKitThemeProvider.js.map +1 -1
  7. package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
  8. package/lib/commonjs/ui/Alert/index.js.map +1 -1
  9. package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
  10. package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
  11. package/lib/commonjs/ui/Avatar/index.js.map +1 -1
  12. package/lib/commonjs/ui/Badge/index.js.map +1 -1
  13. package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
  14. package/lib/commonjs/ui/Button/index.js.map +1 -1
  15. package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
  16. package/lib/commonjs/ui/Dialog/DialogBox.js.map +1 -1
  17. package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
  18. package/lib/commonjs/ui/Dialog/index.js.map +1 -1
  19. package/lib/commonjs/ui/Divider/index.js.map +1 -1
  20. package/lib/commonjs/ui/GroupChannelPreview/index.js +15 -11
  21. package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
  22. package/lib/commonjs/ui/Header/index.js +3 -8
  23. package/lib/commonjs/ui/Header/index.js.map +1 -1
  24. package/lib/commonjs/ui/Icon/index.js.map +1 -1
  25. package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
  26. package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
  27. package/lib/commonjs/ui/Modal/index.js.map +1 -1
  28. package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
  29. package/lib/commonjs/ui/Prompt/index.js.map +1 -1
  30. package/lib/commonjs/ui/Switch/index.js.map +1 -1
  31. package/lib/commonjs/ui/Text/index.js.map +1 -1
  32. package/lib/commonjs/ui/Toast/index.js.map +1 -1
  33. package/lib/commonjs/ui/URLParsedText/index.js.map +1 -1
  34. package/lib/module/components/Image/index.js.map +1 -1
  35. package/lib/module/styles/HeaderStyleContext.js +10 -3
  36. package/lib/module/styles/HeaderStyleContext.js.map +1 -1
  37. package/lib/module/styles/createScaleFactor.js +2 -1
  38. package/lib/module/styles/createScaleFactor.js.map +1 -1
  39. package/lib/module/theme/UIKitThemeProvider.js.map +1 -1
  40. package/lib/module/ui/ActionMenu/index.js.map +1 -1
  41. package/lib/module/ui/Alert/index.js.map +1 -1
  42. package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
  43. package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
  44. package/lib/module/ui/Avatar/index.js.map +1 -1
  45. package/lib/module/ui/Badge/index.js.map +1 -1
  46. package/lib/module/ui/BottomSheet/index.js.map +1 -1
  47. package/lib/module/ui/Button/index.js.map +1 -1
  48. package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
  49. package/lib/module/ui/Dialog/DialogBox.js.map +1 -1
  50. package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
  51. package/lib/module/ui/Dialog/index.js.map +1 -1
  52. package/lib/module/ui/Divider/index.js.map +1 -1
  53. package/lib/module/ui/GroupChannelPreview/index.js +15 -9
  54. package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
  55. package/lib/module/ui/Header/index.js +4 -8
  56. package/lib/module/ui/Header/index.js.map +1 -1
  57. package/lib/module/ui/Icon/index.js.map +1 -1
  58. package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
  59. package/lib/module/ui/MenuBar/index.js.map +1 -1
  60. package/lib/module/ui/Modal/index.js.map +1 -1
  61. package/lib/module/ui/Placeholder/index.js.map +1 -1
  62. package/lib/module/ui/Prompt/index.js.map +1 -1
  63. package/lib/module/ui/Switch/index.js.map +1 -1
  64. package/lib/module/ui/Text/index.js.map +1 -1
  65. package/lib/module/ui/Toast/index.js.map +1 -1
  66. package/lib/module/ui/URLParsedText/index.js.map +1 -1
  67. package/lib/typescript/src/components/Image/index.d.ts +1 -2
  68. package/lib/typescript/src/styles/HeaderStyleContext.d.ts +2 -1
  69. package/lib/typescript/src/styles/getDefaultHeaderHeight.d.ts +1 -1
  70. package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +3 -3
  71. package/lib/typescript/src/ui/ActionMenu/index.d.ts +1 -2
  72. package/lib/typescript/src/ui/Alert/index.d.ts +1 -2
  73. package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +3 -3
  74. package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +1 -2
  75. package/lib/typescript/src/ui/Avatar/index.d.ts +1 -2
  76. package/lib/typescript/src/ui/Badge/index.d.ts +1 -2
  77. package/lib/typescript/src/ui/BottomSheet/index.d.ts +1 -2
  78. package/lib/typescript/src/ui/Button/index.d.ts +3 -3
  79. package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +1 -2
  80. package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +3 -3
  81. package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +4 -4
  82. package/lib/typescript/src/ui/Dialog/index.d.ts +3 -3
  83. package/lib/typescript/src/ui/Divider/index.d.ts +1 -2
  84. package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +3 -2
  85. package/lib/typescript/src/ui/Header/index.d.ts +6 -10
  86. package/lib/typescript/src/ui/Icon/index.d.ts +1 -2
  87. package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +1 -2
  88. package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
  89. package/lib/typescript/src/ui/Modal/index.d.ts +1 -2
  90. package/lib/typescript/src/ui/Placeholder/index.d.ts +1 -2
  91. package/lib/typescript/src/ui/Prompt/index.d.ts +1 -2
  92. package/lib/typescript/src/ui/Switch/index.d.ts +3 -3
  93. package/lib/typescript/src/ui/Text/index.d.ts +1 -2
  94. package/lib/typescript/src/ui/Toast/index.d.ts +5 -5
  95. package/lib/typescript/src/ui/URLParsedText/index.d.ts +1 -2
  96. package/package.json +5 -5
  97. package/src/components/Image/index.ts +1 -2
  98. package/src/styles/HeaderStyleContext.tsx +8 -3
  99. package/src/styles/createScaleFactor.ts +2 -1
  100. package/src/theme/UIKitThemeProvider.tsx +4 -2
  101. package/src/ui/ActionMenu/index.tsx +1 -1
  102. package/src/ui/Alert/index.tsx +1 -8
  103. package/src/ui/Avatar/AvatarGroup.tsx +5 -2
  104. package/src/ui/Avatar/AvatarIcon.tsx +1 -1
  105. package/src/ui/Avatar/index.tsx +12 -3
  106. package/src/ui/Badge/index.tsx +1 -1
  107. package/src/ui/BottomSheet/index.tsx +1 -1
  108. package/src/ui/Button/index.tsx +4 -4
  109. package/src/ui/ChannelFrozenBanner/index.tsx +1 -1
  110. package/src/ui/Dialog/DialogBox.tsx +3 -3
  111. package/src/ui/Dialog/DialogSheet.tsx +4 -4
  112. package/src/ui/Dialog/index.tsx +3 -3
  113. package/src/ui/Divider/index.tsx +1 -1
  114. package/src/ui/GroupChannelPreview/index.tsx +18 -9
  115. package/src/ui/Header/index.tsx +9 -17
  116. package/src/ui/Icon/index.tsx +7 -2
  117. package/src/ui/LoadingSpinner/index.tsx +2 -2
  118. package/src/ui/MenuBar/index.tsx +2 -2
  119. package/src/ui/Modal/index.tsx +2 -2
  120. package/src/ui/Placeholder/index.tsx +1 -1
  121. package/src/ui/Prompt/index.tsx +2 -2
  122. package/src/ui/Switch/index.tsx +4 -4
  123. package/src/ui/Text/index.tsx +1 -1
  124. package/src/ui/Toast/index.tsx +8 -4
  125. package/src/ui/URLParsedText/index.tsx +1 -1
@@ -23,7 +23,7 @@ export type MenuBarProps = {
23
23
  actionLabel?: string;
24
24
  actionItem?: React.ReactNode;
25
25
  };
26
- const MenuBar: React.FC<MenuBarProps> = ({
26
+ const MenuBar = ({
27
27
  variant = 'default',
28
28
  disabled,
29
29
  onPress,
@@ -33,7 +33,7 @@ const MenuBar: React.FC<MenuBarProps> = ({
33
33
  iconBackgroundColor,
34
34
  actionLabel,
35
35
  actionItem = null,
36
- }) => {
36
+ }: MenuBarProps) => {
37
37
  const { palette, colors } = useUIKitTheme();
38
38
 
39
39
  return (
@@ -34,7 +34,7 @@ type Props = {
34
34
  * Modal Close: Triggered by Modal.props.onClose() call
35
35
  * - Modal.props.onClose() -> visible false -> animation start -> modalVisible false
36
36
  * */
37
- const Modal: React.FC<Props> = ({
37
+ const Modal = ({
38
38
  children,
39
39
  onClose,
40
40
  backgroundStyle,
@@ -45,7 +45,7 @@ const Modal: React.FC<Props> = ({
45
45
  enableKeyboardAvoid = false,
46
46
  statusBarTranslucent,
47
47
  ...props
48
- }) => {
48
+ }: Props) => {
49
49
  const { palette } = useUIKitTheme();
50
50
  const { content, backdrop, showTransition, hideTransition } = useModalAnimation(type);
51
51
  const panResponder = useModalPanResponder(type, content.translateY, showTransition, onClose);
@@ -19,7 +19,7 @@ type Props = {
19
19
  onPressRetry?: () => void;
20
20
  };
21
21
 
22
- const Placeholder: React.FC<Props> = ({ icon, loading = false, message = '', errorRetryLabel, onPressRetry }) => {
22
+ const Placeholder = ({ icon, loading = false, message = '', errorRetryLabel, onPressRetry }: Props) => {
23
23
  const { colors } = useUIKitTheme();
24
24
 
25
25
  // loading ? styles.containerLoading : errorRetryLabel ? styles.containerError : styles.container
@@ -28,7 +28,7 @@ type Props = {
28
28
  onDismiss?: () => void;
29
29
  autoFocus?: boolean;
30
30
  } & PromptItem;
31
- const Prompt: React.FC<Props> = ({
31
+ const Prompt = ({
32
32
  onDismiss,
33
33
  visible,
34
34
  onHide,
@@ -40,7 +40,7 @@ const Prompt: React.FC<Props> = ({
40
40
  onCancel = NOOP,
41
41
  submitLabel = 'Submit',
42
42
  cancelLabel = 'Cancel',
43
- }) => {
43
+ }: Props) => {
44
44
  const { statusBarTranslucent } = useHeaderStyle();
45
45
  const { colors } = useUIKitTheme();
46
46
  const inputRef = useRef<RNTextInput>(null);
@@ -4,7 +4,7 @@ import { Animated, Platform, Pressable } from 'react-native';
4
4
  import createStyleSheet from '../../styles/createStyleSheet';
5
5
  import useUIKitTheme from '../../theme/useUIKitTheme';
6
6
 
7
- interface SwitchProps {
7
+ type SwitchProps = React.PropsWithChildren<{
8
8
  trackColor?: string;
9
9
  thumbColor?: string;
10
10
  inactiveThumbColor?: string;
@@ -12,15 +12,15 @@ interface SwitchProps {
12
12
 
13
13
  value: boolean;
14
14
  onChangeValue: (val: boolean) => void;
15
- }
16
- const Switch: React.FC<SwitchProps> = ({
15
+ }>;
16
+ const Switch = ({
17
17
  value,
18
18
  onChangeValue,
19
19
  inactiveThumbColor,
20
20
  inactiveTrackColor,
21
21
  trackColor,
22
22
  thumbColor,
23
- }) => {
23
+ }: SwitchProps) => {
24
24
  const { select, palette, colors } = useUIKitTheme();
25
25
  const position = useRef(new Animated.Value(0)).current;
26
26
 
@@ -6,7 +6,7 @@ import type { TypoName, UIKitTheme } from '../../types';
6
6
 
7
7
  type TypographyProps = Partial<Record<TypoName, boolean>>;
8
8
  export type TextProps = RNTextProps & TypographyProps & { color?: ((colors: UIKitTheme['colors']) => string) | string };
9
- const Text: React.FC<TextProps> = ({ children, color, style, ...props }) => {
9
+ const Text = ({ children, color, style, ...props }: TextProps) => {
10
10
  const { colors } = useUIKitTheme();
11
11
  const typoStyle = useTypographyFilter(props);
12
12
  return (
@@ -12,13 +12,13 @@ type Context = { show(text: string, type?: ToastType): void };
12
12
 
13
13
  const ToastContext = createContext<Context | null>(null);
14
14
 
15
- type Props = {
15
+ type Props = React.PropsWithChildren<{
16
16
  top?: number;
17
17
  bottom?: number;
18
18
  visible: boolean;
19
19
  type: ToastType;
20
20
  children: string;
21
- };
21
+ }>;
22
22
 
23
23
  const useOpacity = () => {
24
24
  const opacity = useRef(new Animated.Value(0)).current;
@@ -32,7 +32,8 @@ const useOpacity = () => {
32
32
  hide: () => transition(0),
33
33
  };
34
34
  };
35
- const Toast: React.FC<Props> = ({ visible, type, children, top, bottom }) => {
35
+
36
+ const Toast = ({ visible, type, children, top, bottom }: Props) => {
36
37
  const { colors, select, palette } = useUIKitTheme();
37
38
  const { opacity, show, hide } = useOpacity();
38
39
 
@@ -67,7 +68,10 @@ const Toast: React.FC<Props> = ({ visible, type, children, top, bottom }) => {
67
68
  };
68
69
 
69
70
  const VISIBLE_MS = 3000;
70
- export const ToastProvider: React.FC<{ dismissTimeout?: number }> = ({ children, dismissTimeout = VISIBLE_MS }) => {
71
+ export const ToastProvider = ({
72
+ children,
73
+ dismissTimeout = VISIBLE_MS,
74
+ }: React.PropsWithChildren<{ dismissTimeout?: number }>) => {
71
75
  const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });
72
76
  const { bottom } = useSafeAreaInsets();
73
77
 
@@ -18,7 +18,7 @@ type Props = TextProps & {
18
18
  onPressUrl?: OnPressUrl;
19
19
  strict?: boolean;
20
20
  };
21
- const URLParsedText: React.FC<Props> = ({ children, onPressUrl = openUrl, strict, ...props }) => {
21
+ const URLParsedText = ({ children, onPressUrl = openUrl, strict, ...props }: Props) => {
22
22
  const parsedChildren = useMemo((): React.ReactNode => {
23
23
  return React.Children.map(React.Children.toArray(children), (child) => {
24
24
  if (typeof child === 'string') {