@sendbird/uikit-react-native-foundation 1.0.0-rc.4 → 1.0.2
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.
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/Dialog/index.js.map +1 -1
- package/lib/commonjs/ui/Divider/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/Icon/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/Modal/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Switch/index.js.map +1 -1
- package/lib/commonjs/ui/Text/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/commonjs/ui/URLParsedText/index.js.map +1 -1
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/Dialog/index.js.map +1 -1
- package/lib/module/ui/Divider/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/Icon/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/Modal/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Switch/index.js.map +1 -1
- package/lib/module/ui/Text/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/module/ui/URLParsedText/index.js.map +1 -1
- package/lib/typescript/src/components/Image/index.d.ts +1 -2
- package/lib/typescript/src/styles/HeaderStyleContext.d.ts +1 -1
- package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +3 -3
- package/lib/typescript/src/ui/ActionMenu/index.d.ts +1 -2
- package/lib/typescript/src/ui/Alert/index.d.ts +1 -2
- package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +3 -3
- package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +1 -2
- package/lib/typescript/src/ui/Avatar/index.d.ts +1 -2
- package/lib/typescript/src/ui/Badge/index.d.ts +1 -2
- package/lib/typescript/src/ui/BottomSheet/index.d.ts +1 -2
- package/lib/typescript/src/ui/Button/index.d.ts +3 -3
- package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +1 -2
- package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +3 -3
- package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +4 -4
- package/lib/typescript/src/ui/Dialog/index.d.ts +3 -3
- package/lib/typescript/src/ui/Divider/index.d.ts +1 -2
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +1 -1
- package/lib/typescript/src/ui/Header/index.d.ts +6 -10
- package/lib/typescript/src/ui/Icon/index.d.ts +1 -2
- package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +1 -2
- package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
- package/lib/typescript/src/ui/Modal/index.d.ts +1 -2
- package/lib/typescript/src/ui/Placeholder/index.d.ts +1 -2
- package/lib/typescript/src/ui/Prompt/index.d.ts +1 -2
- package/lib/typescript/src/ui/Switch/index.d.ts +3 -3
- package/lib/typescript/src/ui/Text/index.d.ts +1 -2
- package/lib/typescript/src/ui/Toast/index.d.ts +5 -5
- package/lib/typescript/src/ui/URLParsedText/index.d.ts +1 -2
- package/package.json +5 -5
- package/src/components/Image/index.ts +1 -2
- package/src/styles/HeaderStyleContext.tsx +2 -2
- package/src/theme/UIKitThemeProvider.tsx +4 -2
- package/src/ui/ActionMenu/index.tsx +1 -1
- package/src/ui/Alert/index.tsx +1 -8
- package/src/ui/Avatar/AvatarGroup.tsx +5 -2
- package/src/ui/Avatar/AvatarIcon.tsx +1 -1
- package/src/ui/Avatar/index.tsx +12 -3
- package/src/ui/Badge/index.tsx +1 -1
- package/src/ui/BottomSheet/index.tsx +1 -1
- package/src/ui/Button/index.tsx +4 -4
- package/src/ui/ChannelFrozenBanner/index.tsx +1 -1
- package/src/ui/Dialog/DialogBox.tsx +3 -3
- package/src/ui/Dialog/DialogSheet.tsx +4 -4
- package/src/ui/Dialog/index.tsx +3 -3
- package/src/ui/Divider/index.tsx +1 -1
- package/src/ui/GroupChannelPreview/index.tsx +2 -2
- package/src/ui/Header/index.tsx +6 -12
- package/src/ui/Icon/index.tsx +7 -2
- package/src/ui/LoadingSpinner/index.tsx +2 -2
- package/src/ui/MenuBar/index.tsx +2 -2
- package/src/ui/Modal/index.tsx +2 -2
- package/src/ui/Placeholder/index.tsx +1 -1
- package/src/ui/Prompt/index.tsx +2 -2
- package/src/ui/Switch/index.tsx +4 -4
- package/src/ui/Text/index.tsx +1 -1
- package/src/ui/Toast/index.tsx +8 -4
- package/src/ui/URLParsedText/index.tsx +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { ImageProps as NativeImageProps } from 'react-native';
|
|
3
2
|
export interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'onError'> {
|
|
4
3
|
onLoad?: (event: {
|
|
@@ -10,6 +9,6 @@ export interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'o
|
|
|
10
9
|
}) => void;
|
|
11
10
|
tintColor?: string;
|
|
12
11
|
}
|
|
13
|
-
export declare type SendbirdImageComponent =
|
|
12
|
+
export declare type SendbirdImageComponent = (props: SendbirdImageProps) => JSX.Element;
|
|
14
13
|
declare const _default: SendbirdImageComponent;
|
|
15
14
|
export default _default;
|
|
@@ -16,5 +16,5 @@ export declare type HeaderStyleContextType = {
|
|
|
16
16
|
};
|
|
17
17
|
export declare const HeaderStyleContext: React.Context<HeaderStyleContextType>;
|
|
18
18
|
declare type Props = Pick<HeaderStyleContextType, 'statusBarTranslucent' | 'defaultTitleAlign' | 'HeaderComponent'>;
|
|
19
|
-
export declare const HeaderStyleProvider: React.
|
|
19
|
+
export declare const HeaderStyleProvider: ({ children, HeaderComponent, defaultTitleAlign, statusBarTranslucent, }: React.PropsWithChildren<Props>) => JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { UIKitTheme } from '../types';
|
|
3
|
-
declare type Props = {
|
|
3
|
+
declare type Props = React.PropsWithChildren<{
|
|
4
4
|
theme?: UIKitTheme;
|
|
5
|
-
}
|
|
6
|
-
declare const UIKitThemeProvider:
|
|
5
|
+
}>;
|
|
6
|
+
declare const UIKitThemeProvider: ({ children, theme }: Props) => JSX.Element;
|
|
7
7
|
export default UIKitThemeProvider;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare type ActionMenuItem = {
|
|
3
2
|
title?: string;
|
|
4
3
|
menuItems: {
|
|
@@ -13,5 +12,5 @@ declare type Props = {
|
|
|
13
12
|
onError?: (error: unknown) => void;
|
|
14
13
|
onDismiss?: () => void;
|
|
15
14
|
} & ActionMenuItem;
|
|
16
|
-
declare const ActionMenu:
|
|
15
|
+
declare const ActionMenu: ({ visible, onHide, onError, onDismiss, title, menuItems }: Props) => JSX.Element;
|
|
17
16
|
export default ActionMenu;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { AlertButton } from 'react-native';
|
|
3
2
|
export declare type AlertItem = {
|
|
4
3
|
title?: string;
|
|
@@ -10,5 +9,5 @@ declare type Props = {
|
|
|
10
9
|
onHide: () => void;
|
|
11
10
|
onDismiss?: () => void;
|
|
12
11
|
} & AlertItem;
|
|
13
|
-
declare const Alert:
|
|
12
|
+
declare const Alert: ({ onDismiss, visible, onHide, title, message, buttons }: Props) => JSX.Element;
|
|
14
13
|
export default Alert;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
declare type Props = {
|
|
3
|
+
declare type Props = React.PropsWithChildren<{
|
|
4
4
|
size?: number;
|
|
5
5
|
containerStyle?: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
|
-
declare const AvatarGroup:
|
|
6
|
+
}>;
|
|
7
|
+
declare const AvatarGroup: ({ children, containerStyle, size }: Props) => JSX.Element;
|
|
8
8
|
export default AvatarGroup;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import Icon from '../Icon';
|
|
4
3
|
declare type Props = {
|
|
@@ -7,5 +6,5 @@ declare type Props = {
|
|
|
7
6
|
backgroundColor?: string;
|
|
8
7
|
containerStyle?: StyleProp<ViewStyle>;
|
|
9
8
|
};
|
|
10
|
-
declare const AvatarIcon:
|
|
9
|
+
declare const AvatarIcon: ({ size, icon, containerStyle, backgroundColor }: Props) => JSX.Element;
|
|
11
10
|
export default AvatarIcon;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import AvatarGroup from './AvatarGroup';
|
|
4
3
|
import AvatarIcon from './AvatarIcon';
|
|
@@ -13,5 +12,5 @@ declare type Props = {
|
|
|
13
12
|
muted?: boolean;
|
|
14
13
|
containerStyle?: StyleProp<ViewStyle>;
|
|
15
14
|
};
|
|
16
|
-
declare const Avatar:
|
|
15
|
+
declare const Avatar: ((props: Props) => JSX.Element) & SubComponents;
|
|
17
16
|
export default Avatar;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
count: number;
|
|
@@ -8,5 +7,5 @@ declare type Props = {
|
|
|
8
7
|
style?: StyleProp<ViewStyle>;
|
|
9
8
|
size?: 'small' | 'default';
|
|
10
9
|
};
|
|
11
|
-
declare const Badge:
|
|
10
|
+
declare const Badge: ({ count, maxCount, badgeColor, textColor, style, size }: Props) => JSX.Element;
|
|
12
11
|
export default Badge;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type Icon from '../Icon';
|
|
3
2
|
export declare type BottomSheetItem = {
|
|
4
3
|
sheetItems: {
|
|
@@ -15,5 +14,5 @@ declare type Props = {
|
|
|
15
14
|
onError?: (error: unknown) => void;
|
|
16
15
|
onDismiss?: () => void;
|
|
17
16
|
} & BottomSheetItem;
|
|
18
|
-
declare const BottomSheet:
|
|
17
|
+
declare const BottomSheet: ({ onDismiss, onHide, visible, sheetItems }: Props) => JSX.Element;
|
|
19
18
|
export default BottomSheet;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import Icon from '../Icon';
|
|
4
|
-
declare type Props = {
|
|
4
|
+
declare type Props = React.PropsWithChildren<{
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
icon?: keyof typeof Icon.Assets;
|
|
7
7
|
variant?: 'contained' | 'text';
|
|
@@ -9,6 +9,6 @@ declare type Props = {
|
|
|
9
9
|
onPress?: () => void;
|
|
10
10
|
buttonColor?: string;
|
|
11
11
|
contentColor?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const Button:
|
|
12
|
+
}>;
|
|
13
|
+
declare const Button: ({ icon, variant, buttonColor, contentColor, disabled, onPress, style, children, }: Props) => JSX.Element;
|
|
14
14
|
export default Button;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
style?: StyleProp<ViewStyle>;
|
|
@@ -6,5 +5,5 @@ declare type Props = {
|
|
|
6
5
|
textColor?: string;
|
|
7
6
|
backgroundColor?: string;
|
|
8
7
|
};
|
|
9
|
-
declare const ChannelFrozenBanner:
|
|
8
|
+
declare const ChannelFrozenBanner: ({ text, backgroundColor, textColor, style }: Props) => JSX.Element;
|
|
10
9
|
export default ChannelFrozenBanner;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
declare type Props = {
|
|
3
|
+
declare type Props = React.PropsWithChildren<{
|
|
4
4
|
style?: StyleProp<ViewStyle>;
|
|
5
|
-
}
|
|
6
|
-
declare const DialogBox:
|
|
5
|
+
}>;
|
|
6
|
+
declare const DialogBox: ({ style, children }: Props) => JSX.Element;
|
|
7
7
|
export default DialogBox;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import Icon from '../Icon';
|
|
4
|
-
declare type Props = {
|
|
4
|
+
declare type Props = React.PropsWithChildren<{
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
}
|
|
7
|
-
declare const DialogSheet:
|
|
6
|
+
}>;
|
|
7
|
+
declare const DialogSheet: ((props: Props) => JSX.Element) & {
|
|
8
8
|
Item: typeof SheetItem;
|
|
9
9
|
};
|
|
10
10
|
export declare type SheetItemProps = {
|
|
@@ -13,5 +13,5 @@ export declare type SheetItemProps = {
|
|
|
13
13
|
title: string;
|
|
14
14
|
titleColor?: string;
|
|
15
15
|
};
|
|
16
|
-
declare const SheetItem:
|
|
16
|
+
declare const SheetItem: ({ icon, title, iconColor, titleColor }: SheetItemProps) => JSX.Element;
|
|
17
17
|
export default DialogSheet;
|
|
@@ -26,7 +26,7 @@ declare type DialogContextType = {
|
|
|
26
26
|
openPrompt: (props: DialogPropsBy<'Prompt'>) => void;
|
|
27
27
|
openSheet: (props: DialogPropsBy<'BottomSheet'>) => void;
|
|
28
28
|
};
|
|
29
|
-
declare type Props = {
|
|
29
|
+
declare type Props = React.PropsWithChildren<{
|
|
30
30
|
defaultLabels?: {
|
|
31
31
|
alert?: {
|
|
32
32
|
ok?: string;
|
|
@@ -37,8 +37,8 @@ declare type Props = {
|
|
|
37
37
|
cancel?: string;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
}
|
|
41
|
-
export declare const DialogProvider:
|
|
40
|
+
}>;
|
|
41
|
+
export declare const DialogProvider: ({ defaultLabels, children }: Props) => JSX.Element;
|
|
42
42
|
export declare const useActionMenu: () => Pick<DialogContextType, "openMenu">;
|
|
43
43
|
export declare const useAlert: () => Pick<DialogContextType, "alert">;
|
|
44
44
|
export declare const usePrompt: () => Pick<DialogContextType, "openPrompt">;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
style?: StyleProp<ViewStyle>;
|
|
5
4
|
space?: number;
|
|
6
5
|
};
|
|
7
|
-
declare const Divider:
|
|
6
|
+
declare const Divider: ({ style, space }: Props) => JSX.Element;
|
|
8
7
|
export default Divider;
|
|
@@ -13,5 +13,5 @@ declare type Props = {
|
|
|
13
13
|
frozen?: boolean;
|
|
14
14
|
notificationOff?: boolean;
|
|
15
15
|
};
|
|
16
|
-
declare const _default: React.
|
|
16
|
+
declare const _default: React.MemoExoticComponent<({ customCover, coverUrl, memberCount, badgeCount, maxBadgeCount, body, bodyIcon, title, titleCaption, frozen, notificationOff, }: Props) => JSX.Element>;
|
|
17
17
|
export default _default;
|
|
@@ -12,18 +12,14 @@ declare type HeaderProps = BaseHeaderProps<{
|
|
|
12
12
|
}, {
|
|
13
13
|
clearTitleMargin?: boolean;
|
|
14
14
|
}>;
|
|
15
|
-
declare const Header:
|
|
15
|
+
declare const Header: ((props: HeaderProps) => JSX.Element) & {
|
|
16
16
|
Button: typeof HeaderButton;
|
|
17
17
|
Title: typeof HeaderTitle;
|
|
18
18
|
Subtitle: typeof HeaderSubtitle;
|
|
19
19
|
};
|
|
20
|
-
declare const HeaderTitle:
|
|
21
|
-
|
|
22
|
-
} &
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} & TextProps>;
|
|
26
|
-
declare const HeaderButton: React.FC<TouchableOpacityProps & {
|
|
27
|
-
color?: string;
|
|
28
|
-
}>;
|
|
20
|
+
declare const HeaderTitle: ({ children, style, ...props }: TextProps) => JSX.Element;
|
|
21
|
+
declare const HeaderSubtitle: ({ children, style, ...props }: TextProps) => JSX.Element;
|
|
22
|
+
declare const HeaderButton: ({ children, disabled, onPress, color, ...props }: TouchableOpacityProps & {
|
|
23
|
+
color?: string | undefined;
|
|
24
|
+
}) => JSX.Element;
|
|
29
25
|
export default Header;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ImageStyle, StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import IconAssets from '../../assets/icon';
|
|
4
3
|
declare type IconNames = keyof typeof IconAssets;
|
|
@@ -9,7 +8,7 @@ declare type Props = {
|
|
|
9
8
|
style?: StyleProp<ImageStyle>;
|
|
10
9
|
containerStyle?: StyleProp<ViewStyle>;
|
|
11
10
|
};
|
|
12
|
-
declare const Icon:
|
|
11
|
+
declare const Icon: ((props: Props) => JSX.Element) & {
|
|
13
12
|
Assets: typeof IconAssets;
|
|
14
13
|
};
|
|
15
14
|
export default Icon;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
size?: number;
|
|
5
4
|
color?: string;
|
|
6
5
|
style?: StyleProp<ViewStyle>;
|
|
7
6
|
};
|
|
8
|
-
declare const LoadingSpinner:
|
|
7
|
+
declare const LoadingSpinner: ({ size, color, style }: Props) => JSX.Element;
|
|
9
8
|
export default LoadingSpinner;
|
|
@@ -11,5 +11,5 @@ export declare type MenuBarProps = {
|
|
|
11
11
|
actionLabel?: string;
|
|
12
12
|
actionItem?: React.ReactNode;
|
|
13
13
|
};
|
|
14
|
-
declare const MenuBar:
|
|
14
|
+
declare const MenuBar: ({ variant, disabled, onPress, name, icon, iconColor, iconBackgroundColor, actionLabel, actionItem, }: MenuBarProps) => JSX.Element;
|
|
15
15
|
export default MenuBar;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ModalProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
type?: 'slide' | 'fade';
|
|
@@ -14,5 +13,5 @@ declare type Props = {
|
|
|
14
13
|
* Modal Close: Triggered by Modal.props.onClose() call
|
|
15
14
|
* - Modal.props.onClose() -> visible false -> animation start -> modalVisible false
|
|
16
15
|
* */
|
|
17
|
-
declare const Modal:
|
|
16
|
+
declare const Modal: ({ children, onClose, backgroundStyle, onDismiss, type, visible, disableBackgroundClose, enableKeyboardAvoid, statusBarTranslucent, ...props }: Props) => JSX.Element;
|
|
18
17
|
export default Modal;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import Icon from '../Icon';
|
|
3
2
|
declare type Props = {
|
|
4
3
|
loading?: boolean;
|
|
@@ -7,5 +6,5 @@ declare type Props = {
|
|
|
7
6
|
errorRetryLabel?: string;
|
|
8
7
|
onPressRetry?: () => void;
|
|
9
8
|
};
|
|
10
|
-
declare const Placeholder:
|
|
9
|
+
declare const Placeholder: ({ icon, loading, message, errorRetryLabel, onPressRetry }: Props) => JSX.Element;
|
|
11
10
|
export default Placeholder;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare type PromptItem = {
|
|
3
2
|
title: string;
|
|
4
3
|
placeholder?: string;
|
|
@@ -14,5 +13,5 @@ declare type Props = {
|
|
|
14
13
|
onDismiss?: () => void;
|
|
15
14
|
autoFocus?: boolean;
|
|
16
15
|
} & PromptItem;
|
|
17
|
-
declare const Prompt:
|
|
16
|
+
declare const Prompt: ({ onDismiss, visible, onHide, autoFocus, title, defaultValue, placeholder, onSubmit, onCancel, submitLabel, cancelLabel, }: Props) => JSX.Element;
|
|
18
17
|
export default Prompt;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
declare type SwitchProps = React.PropsWithChildren<{
|
|
3
3
|
trackColor?: string;
|
|
4
4
|
thumbColor?: string;
|
|
5
5
|
inactiveThumbColor?: string;
|
|
6
6
|
inactiveTrackColor?: string;
|
|
7
7
|
value: boolean;
|
|
8
8
|
onChangeValue: (val: boolean) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const Switch:
|
|
9
|
+
}>;
|
|
10
|
+
declare const Switch: ({ value, onChangeValue, inactiveThumbColor, inactiveTrackColor, trackColor, thumbColor, }: SwitchProps) => JSX.Element;
|
|
11
11
|
export default Switch;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { TextProps as RNTextProps } from 'react-native';
|
|
3
2
|
import type { TypoName, UIKitTheme } from '../../types';
|
|
4
3
|
declare type TypographyProps = Partial<Record<TypoName, boolean>>;
|
|
5
4
|
export declare type TextProps = RNTextProps & TypographyProps & {
|
|
6
5
|
color?: ((colors: UIKitTheme['colors']) => string) | string;
|
|
7
6
|
};
|
|
8
|
-
declare const Text:
|
|
7
|
+
declare const Text: ({ children, color, style, ...props }: TextProps) => JSX.Element;
|
|
9
8
|
export default Text;
|
|
@@ -3,16 +3,16 @@ declare type ToastType = 'normal' | 'error' | 'success';
|
|
|
3
3
|
declare type Context = {
|
|
4
4
|
show(text: string, type?: ToastType): void;
|
|
5
5
|
};
|
|
6
|
-
declare type Props = {
|
|
6
|
+
declare type Props = React.PropsWithChildren<{
|
|
7
7
|
top?: number;
|
|
8
8
|
bottom?: number;
|
|
9
9
|
visible: boolean;
|
|
10
10
|
type: ToastType;
|
|
11
11
|
children: string;
|
|
12
|
-
};
|
|
13
|
-
declare const Toast: React.FC<Props>;
|
|
14
|
-
export declare const ToastProvider: React.FC<{
|
|
15
|
-
dismissTimeout?: number;
|
|
16
12
|
}>;
|
|
13
|
+
declare const Toast: ({ visible, type, children, top, bottom }: Props) => JSX.Element;
|
|
14
|
+
export declare const ToastProvider: ({ children, dismissTimeout, }: React.PropsWithChildren<{
|
|
15
|
+
dismissTimeout?: number | undefined;
|
|
16
|
+
}>) => JSX.Element;
|
|
17
17
|
export declare const useToast: () => Context;
|
|
18
18
|
export default Toast;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { TextProps } from '../Text';
|
|
3
2
|
declare type OnPressUrl = (url: string, httpProtocol: boolean) => void;
|
|
4
3
|
declare type Props = TextProps & {
|
|
5
4
|
onPressUrl?: OnPressUrl;
|
|
6
5
|
strict?: boolean;
|
|
7
6
|
};
|
|
8
|
-
declare const URLParsedText:
|
|
7
|
+
declare const URLParsedText: ({ children, onPressUrl, strict, ...props }: Props) => JSX.Element;
|
|
9
8
|
export default URLParsedText;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "react-native-uikit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@sendbird/uikit-utils": "1.0.
|
|
41
|
+
"@sendbird/uikit-utils": "1.0.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/react": "
|
|
45
|
-
"@types/react-native": "
|
|
44
|
+
"@types/react": "*",
|
|
45
|
+
"@types/react-native": "*",
|
|
46
46
|
"react": "17.0.2",
|
|
47
47
|
"react-native": "0.66.4",
|
|
48
48
|
"react-native-builder-bob": "^0.18.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"readmeFile": "./README.md",
|
|
81
81
|
"displayName": "@sendbird/uikit-react-native-foundation"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "257ece5f957e03ff5c08b79780b33d9d19adc5de"
|
|
84
84
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { ImageProps as NativeImageProps } from 'react-native';
|
|
3
2
|
import { NativeModules } from 'react-native';
|
|
4
3
|
|
|
@@ -8,7 +7,7 @@ export interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'o
|
|
|
8
7
|
tintColor?: string;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
export type SendbirdImageComponent =
|
|
10
|
+
export type SendbirdImageComponent = (props: SendbirdImageProps) => JSX.Element;
|
|
12
11
|
|
|
13
12
|
function getImageModule(): SendbirdImageComponent {
|
|
14
13
|
const hasFastImage = Boolean(NativeModules.FastImageView);
|
|
@@ -29,12 +29,12 @@ export const HeaderStyleContext = React.createContext<HeaderStyleContextType>({
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
type Props = Pick<HeaderStyleContextType, 'statusBarTranslucent' | 'defaultTitleAlign' | 'HeaderComponent'>;
|
|
32
|
-
export const HeaderStyleProvider
|
|
32
|
+
export const HeaderStyleProvider = ({
|
|
33
33
|
children,
|
|
34
34
|
HeaderComponent = () => null,
|
|
35
35
|
defaultTitleAlign,
|
|
36
36
|
statusBarTranslucent,
|
|
37
|
-
}) => {
|
|
37
|
+
}: React.PropsWithChildren<Props>) => {
|
|
38
38
|
const { top } = useSafeAreaInsets();
|
|
39
39
|
|
|
40
40
|
return (
|
|
@@ -4,8 +4,10 @@ import type { UIKitTheme } from '../types';
|
|
|
4
4
|
import LightUIKitTheme from './LightUIKitTheme';
|
|
5
5
|
import UIKitThemeContext from './UIKitThemeContext';
|
|
6
6
|
|
|
7
|
-
type Props = {
|
|
8
|
-
|
|
7
|
+
type Props = React.PropsWithChildren<{
|
|
8
|
+
theme?: UIKitTheme;
|
|
9
|
+
}>;
|
|
10
|
+
const UIKitThemeProvider = ({ children, theme = LightUIKitTheme }: Props) => {
|
|
9
11
|
return <UIKitThemeContext.Provider value={theme}>{children}</UIKitThemeContext.Provider>;
|
|
10
12
|
};
|
|
11
13
|
|
|
@@ -26,7 +26,7 @@ type Props = {
|
|
|
26
26
|
onError?: (error: unknown) => void;
|
|
27
27
|
onDismiss?: () => void;
|
|
28
28
|
} & ActionMenuItem;
|
|
29
|
-
const ActionMenu
|
|
29
|
+
const ActionMenu = ({ visible, onHide, onError, onDismiss, title, menuItems }: Props) => {
|
|
30
30
|
const { statusBarTranslucent } = useHeaderStyle();
|
|
31
31
|
const { colors } = useUIKitTheme();
|
|
32
32
|
const [pending, setPending] = useState(false);
|
package/src/ui/Alert/index.tsx
CHANGED
|
@@ -20,14 +20,7 @@ type Props = {
|
|
|
20
20
|
onHide: () => void;
|
|
21
21
|
onDismiss?: () => void;
|
|
22
22
|
} & AlertItem;
|
|
23
|
-
const Alert:
|
|
24
|
-
onDismiss,
|
|
25
|
-
visible,
|
|
26
|
-
onHide,
|
|
27
|
-
title = '',
|
|
28
|
-
message = '',
|
|
29
|
-
buttons = [{ text: 'OK' }],
|
|
30
|
-
}) => {
|
|
23
|
+
const Alert = ({ onDismiss, visible, onHide, title = '', message = '', buttons = [{ text: 'OK' }] }: Props) => {
|
|
31
24
|
const { statusBarTranslucent } = useHeaderStyle();
|
|
32
25
|
const { colors } = useUIKitTheme();
|
|
33
26
|
|
|
@@ -3,8 +3,11 @@ import { StyleProp, View, ViewStyle } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
const MAX = 4;
|
|
5
5
|
|
|
6
|
-
type Props = {
|
|
7
|
-
|
|
6
|
+
type Props = React.PropsWithChildren<{
|
|
7
|
+
size?: number;
|
|
8
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
}>;
|
|
10
|
+
const AvatarGroup = ({ children, containerStyle, size = 56 }: Props) => {
|
|
8
11
|
const childAmount = React.Children.count(children);
|
|
9
12
|
|
|
10
13
|
if (childAmount === 0) {
|
|
@@ -11,7 +11,7 @@ type Props = {
|
|
|
11
11
|
backgroundColor?: string;
|
|
12
12
|
containerStyle?: StyleProp<ViewStyle>;
|
|
13
13
|
};
|
|
14
|
-
const AvatarIcon
|
|
14
|
+
const AvatarIcon = ({ size = 56, icon, containerStyle, backgroundColor }: Props) => {
|
|
15
15
|
const { colors, palette } = useUIKitTheme();
|
|
16
16
|
return (
|
|
17
17
|
<View
|
package/src/ui/Avatar/index.tsx
CHANGED
|
@@ -10,7 +10,10 @@ import Icon from '../Icon';
|
|
|
10
10
|
import AvatarGroup from './AvatarGroup';
|
|
11
11
|
import AvatarIcon from './AvatarIcon';
|
|
12
12
|
|
|
13
|
-
type SubComponents = {
|
|
13
|
+
type SubComponents = {
|
|
14
|
+
Group: typeof AvatarGroup;
|
|
15
|
+
Icon: typeof AvatarIcon;
|
|
16
|
+
};
|
|
14
17
|
type Props = {
|
|
15
18
|
uri?: string;
|
|
16
19
|
size?: number;
|
|
@@ -18,7 +21,13 @@ type Props = {
|
|
|
18
21
|
muted?: boolean;
|
|
19
22
|
containerStyle?: StyleProp<ViewStyle>;
|
|
20
23
|
};
|
|
21
|
-
const Avatar:
|
|
24
|
+
const Avatar: ((props: Props) => JSX.Element) & SubComponents = ({
|
|
25
|
+
uri,
|
|
26
|
+
square,
|
|
27
|
+
muted = false,
|
|
28
|
+
size = 56,
|
|
29
|
+
containerStyle,
|
|
30
|
+
}) => {
|
|
22
31
|
const { colors, palette } = useUIKitTheme();
|
|
23
32
|
const [loadFailure, setLoadFailure] = useState(false);
|
|
24
33
|
|
|
@@ -47,7 +56,7 @@ const Avatar: React.FC<Props> & SubComponents = ({ uri, square, muted = false, s
|
|
|
47
56
|
);
|
|
48
57
|
};
|
|
49
58
|
|
|
50
|
-
const MutedOverlay
|
|
59
|
+
const MutedOverlay = ({ size }: { size: number }) => {
|
|
51
60
|
const { palette } = useUIKitTheme();
|
|
52
61
|
return (
|
|
53
62
|
<View style={[styles.container, StyleSheet.absoluteFill]}>
|
package/src/ui/Badge/index.tsx
CHANGED
|
@@ -16,7 +16,7 @@ type Props = {
|
|
|
16
16
|
size?: 'small' | 'default';
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const Badge
|
|
19
|
+
const Badge = ({ count, maxCount, badgeColor, textColor, style, size = 'default' }: Props) => {
|
|
20
20
|
const { colors } = useUIKitTheme();
|
|
21
21
|
const isSmall = size === 'small';
|
|
22
22
|
return (
|
|
@@ -22,7 +22,7 @@ type Props = {
|
|
|
22
22
|
onError?: (error: unknown) => void;
|
|
23
23
|
onDismiss?: () => void;
|
|
24
24
|
} & BottomSheetItem;
|
|
25
|
-
const BottomSheet
|
|
25
|
+
const BottomSheet = ({ onDismiss, onHide, visible, sheetItems }: Props) => {
|
|
26
26
|
const { statusBarTranslucent } = useHeaderStyle();
|
|
27
27
|
const { width } = useWindowDimensions();
|
|
28
28
|
const { bottom, left, right } = useSafeAreaInsets();
|
package/src/ui/Button/index.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
|
6
6
|
import Icon from '../Icon';
|
|
7
7
|
import Text from '../Text';
|
|
8
8
|
|
|
9
|
-
type Props = {
|
|
9
|
+
type Props = React.PropsWithChildren<{
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
11
11
|
icon?: keyof typeof Icon.Assets;
|
|
12
12
|
variant?: 'contained' | 'text';
|
|
@@ -14,8 +14,8 @@ type Props = {
|
|
|
14
14
|
onPress?: () => void;
|
|
15
15
|
buttonColor?: string;
|
|
16
16
|
contentColor?: string;
|
|
17
|
-
}
|
|
18
|
-
const Button
|
|
17
|
+
}>;
|
|
18
|
+
const Button = ({
|
|
19
19
|
icon,
|
|
20
20
|
variant = 'contained',
|
|
21
21
|
buttonColor,
|
|
@@ -24,7 +24,7 @@ const Button: React.FC<Props> = ({
|
|
|
24
24
|
onPress,
|
|
25
25
|
style,
|
|
26
26
|
children,
|
|
27
|
-
}) => {
|
|
27
|
+
}: Props) => {
|
|
28
28
|
const { colors } = useUIKitTheme();
|
|
29
29
|
|
|
30
30
|
const getStateColor = (pressed: boolean, disabled?: boolean) => {
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
backgroundColor?: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const ChannelFrozenBanner
|
|
15
|
+
const ChannelFrozenBanner = ({ text = 'Channel is frozen', backgroundColor, textColor, style }: Props) => {
|
|
16
16
|
const { palette } = useUIKitTheme();
|
|
17
17
|
|
|
18
18
|
return (
|
|
@@ -4,10 +4,10 @@ import { StyleProp, View, ViewStyle } from 'react-native';
|
|
|
4
4
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
6
|
|
|
7
|
-
type Props = {
|
|
7
|
+
type Props = React.PropsWithChildren<{
|
|
8
8
|
style?: StyleProp<ViewStyle>;
|
|
9
|
-
}
|
|
10
|
-
const DialogBox
|
|
9
|
+
}>;
|
|
10
|
+
const DialogBox = ({ style, children }: Props) => {
|
|
11
11
|
const { colors } = useUIKitTheme();
|
|
12
12
|
return (
|
|
13
13
|
<View style={[styles.container, { backgroundColor: colors.ui.dialog.default.none.background }, style]}>
|