@sendbird/uikit-react-native-foundation 2.0.3 → 2.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.
- package/lib/commonjs/assets/icon/{icon-moderations.png → icon-moderation.png} +0 -0
- package/lib/commonjs/assets/icon/{icon-moderations@2x.png → icon-moderation@2x.png} +0 -0
- package/lib/commonjs/assets/icon/{icon-moderations@3x.png → icon-moderation@3x.png} +0 -0
- package/lib/commonjs/assets/icon/icon-radio-off.png +0 -0
- package/lib/commonjs/assets/icon/icon-radio-off@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-radio-off@3x.png +0 -0
- package/lib/commonjs/assets/icon/icon-radio-on.png +0 -0
- package/lib/commonjs/assets/icon/icon-radio-on@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-radio-on@3x.png +0 -0
- package/lib/commonjs/assets/icon/index.js +3 -1
- package/lib/commonjs/assets/icon/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +4 -3
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/RegexText/index.js +50 -0
- package/lib/commonjs/components/RegexText/index.js.map +1 -0
- package/lib/commonjs/components/URLParsedText/index.js +15 -19
- package/lib/commonjs/components/URLParsedText/index.js.map +1 -1
- package/lib/commonjs/index.js +27 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/styles/createStyleSheet.js +2 -0
- package/lib/commonjs/styles/createStyleSheet.js.map +1 -1
- package/lib/commonjs/theme/DarkUIKitTheme.js +32 -0
- package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/LightUIKitTheme.js +32 -0
- package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarGroup.js +6 -7
- package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js +1 -1
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js +5 -2
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/index.js +2 -1
- package/lib/commonjs/ui/Dialog/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js +26 -9
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +3 -2
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js +2 -0
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/OutlinedButton/index.js +57 -0
- package/lib/commonjs/ui/OutlinedButton/index.js.map +1 -0
- package/lib/commonjs/ui/ProfileCard/index.js +94 -0
- package/lib/commonjs/ui/ProfileCard/index.js.map +1 -0
- package/lib/module/assets/icon/{icon-moderations.png → icon-moderation.png} +0 -0
- package/lib/module/assets/icon/{icon-moderations@2x.png → icon-moderation@2x.png} +0 -0
- package/lib/module/assets/icon/{icon-moderations@3x.png → icon-moderation@3x.png} +0 -0
- package/lib/module/assets/icon/icon-radio-off.png +0 -0
- package/lib/module/assets/icon/icon-radio-off@2x.png +0 -0
- package/lib/module/assets/icon/icon-radio-off@3x.png +0 -0
- package/lib/module/assets/icon/icon-radio-on.png +0 -0
- package/lib/module/assets/icon/icon-radio-on@2x.png +0 -0
- package/lib/module/assets/icon/icon-radio-on@3x.png +0 -0
- package/lib/module/assets/icon/index.js +3 -1
- package/lib/module/assets/icon/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +4 -3
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/RegexText/index.js +38 -0
- package/lib/module/components/RegexText/index.js.map +1 -0
- package/lib/module/components/URLParsedText/index.js +13 -15
- package/lib/module/components/URLParsedText/index.js.map +1 -1
- package/lib/module/index.js +7 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/styles/createStyleSheet.js +2 -0
- package/lib/module/styles/createStyleSheet.js.map +1 -1
- package/lib/module/theme/DarkUIKitTheme.js +32 -0
- package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/module/theme/LightUIKitTheme.js +32 -0
- package/lib/module/theme/LightUIKitTheme.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js +1 -1
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarGroup.js +5 -4
- package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/ui/Badge/index.js +2 -2
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js +5 -2
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Dialog/index.js +2 -1
- package/lib/module/ui/Dialog/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js +26 -9
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +3 -2
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js +2 -0
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/OutlinedButton/index.js +43 -0
- package/lib/module/ui/OutlinedButton/index.js.map +1 -0
- package/lib/module/ui/ProfileCard/index.js +78 -0
- package/lib/module/ui/ProfileCard/index.js.map +1 -0
- package/lib/typescript/src/assets/icon/index.d.ts +3 -1
- package/lib/typescript/src/components/Divider/index.d.ts +1 -1
- package/lib/typescript/src/components/Icon/index.d.ts +2 -2
- package/lib/typescript/src/components/Image/index.d.ts +1 -1
- package/lib/typescript/src/components/Modal/index.d.ts +3 -2
- package/lib/typescript/src/components/RegexText/index.d.ts +16 -0
- package/lib/typescript/src/components/Switch/index.d.ts +1 -1
- package/lib/typescript/src/components/Text/index.d.ts +2 -2
- package/lib/typescript/src/components/URLParsedText/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts +11 -4
- package/lib/typescript/src/styles/HeaderStyleContext.d.ts +4 -12
- package/lib/typescript/src/styles/createTypography.d.ts +1 -1
- package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +1 -1
- package/lib/typescript/src/theme/createTheme.d.ts +1 -1
- package/lib/typescript/src/types.d.ts +18 -10
- package/lib/typescript/src/ui/ActionMenu/index.d.ts +3 -2
- package/lib/typescript/src/ui/Alert/index.d.ts +2 -2
- package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +1 -1
- package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +1 -1
- package/lib/typescript/src/ui/Avatar/index.d.ts +2 -2
- package/lib/typescript/src/ui/Badge/index.d.ts +1 -1
- package/lib/typescript/src/ui/BottomSheet/index.d.ts +7 -3
- package/lib/typescript/src/ui/Button/index.d.ts +1 -1
- package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +1 -1
- package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +1 -1
- package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +2 -2
- package/lib/typescript/src/ui/Dialog/index.d.ts +4 -4
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +5 -2
- package/lib/typescript/src/ui/Header/index.d.ts +3 -2
- package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +1 -1
- package/lib/typescript/src/ui/MenuBar/index.d.ts +3 -2
- package/lib/typescript/src/ui/OutlinedButton/index.d.ts +8 -0
- package/lib/typescript/src/ui/Placeholder/index.d.ts +1 -1
- package/lib/typescript/src/ui/ProfileCard/index.d.ts +11 -0
- package/lib/typescript/src/ui/Prompt/index.d.ts +2 -2
- package/lib/typescript/src/ui/Toast/index.d.ts +3 -3
- package/package.json +6 -5
- package/src/assets/icon/{icon-moderations.png → icon-moderation.png} +0 -0
- package/src/assets/icon/{icon-moderations@2x.png → icon-moderation@2x.png} +0 -0
- package/src/assets/icon/{icon-moderations@3x.png → icon-moderation@3x.png} +0 -0
- package/src/assets/icon/icon-radio-off.png +0 -0
- package/src/assets/icon/icon-radio-off@2x.png +0 -0
- package/src/assets/icon/icon-radio-off@3x.png +0 -0
- package/src/assets/icon/icon-radio-on.png +0 -0
- package/src/assets/icon/icon-radio-on@2x.png +0 -0
- package/src/assets/icon/icon-radio-on@3x.png +0 -0
- package/src/assets/icon/index.ts +3 -1
- package/src/components/Modal/index.tsx +8 -6
- package/src/components/RegexText/index.tsx +48 -0
- package/src/components/URLParsedText/index.tsx +22 -24
- package/src/index.ts +11 -4
- package/src/styles/HeaderStyleContext.tsx +2 -13
- package/src/styles/createStyleSheet.ts +2 -0
- package/src/theme/DarkUIKitTheme.ts +32 -0
- package/src/theme/LightUIKitTheme.ts +32 -0
- package/src/types.ts +12 -1
- package/src/ui/ActionMenu/index.tsx +10 -1
- package/src/ui/Avatar/AvatarGroup.tsx +10 -6
- package/src/ui/Badge/index.tsx +2 -2
- package/src/ui/BottomSheet/index.tsx +4 -1
- package/src/ui/Dialog/index.tsx +1 -0
- package/src/ui/GroupChannelPreview/index.tsx +31 -7
- package/src/ui/Header/index.tsx +8 -3
- package/src/ui/MenuBar/index.tsx +4 -0
- package/src/ui/OutlinedButton/index.tsx +42 -0
- package/src/ui/ProfileCard/index.tsx +73 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextProps } from '../Text';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type OnPressUrl = (url: string, httpProtocol: boolean) => void;
|
|
3
|
+
type Props = TextProps & {
|
|
4
4
|
onPressUrl?: OnPressUrl;
|
|
5
5
|
strict?: boolean;
|
|
6
6
|
};
|
|
@@ -5,16 +5,17 @@ export { default as Divider } from './components/Divider';
|
|
|
5
5
|
export { default as Icon } from './components/Icon';
|
|
6
6
|
export { default as Image } from './components/Image';
|
|
7
7
|
export { default as Modal } from './components/Modal';
|
|
8
|
+
export { default as RegexText } from './components/RegexText';
|
|
8
9
|
export { default as Switch } from './components/Switch';
|
|
9
10
|
export { default as Text } from './components/Text';
|
|
10
11
|
export { default as TextInput } from './components/TextInput';
|
|
11
12
|
export { default as URLParsedText } from './components/URLParsedText';
|
|
12
13
|
/** UI **/
|
|
13
|
-
export { default as ActionMenu
|
|
14
|
+
export { default as ActionMenu } from './ui/ActionMenu';
|
|
14
15
|
export { default as Alert } from './ui/Alert';
|
|
15
16
|
export { default as Avatar } from './ui/Avatar';
|
|
16
17
|
export { default as Badge } from './ui/Badge';
|
|
17
|
-
export { default as BottomSheet
|
|
18
|
+
export { default as BottomSheet } from './ui/BottomSheet';
|
|
18
19
|
export { default as Button } from './ui/Button';
|
|
19
20
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
20
21
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
@@ -22,16 +23,18 @@ export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
|
22
23
|
export { default as Header } from './ui/Header';
|
|
23
24
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
24
25
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
26
|
+
export { default as OutlinedButton } from './ui/OutlinedButton';
|
|
25
27
|
export { default as Placeholder } from './ui/Placeholder';
|
|
28
|
+
export { default as ProfileCard } from './ui/ProfileCard';
|
|
26
29
|
export { default as Prompt } from './ui/Prompt';
|
|
27
30
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
28
31
|
/** Styles **/
|
|
29
32
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
30
33
|
export { default as createScaleFactor } from './styles/createScaleFactor';
|
|
31
34
|
export { default as createStyleSheet } from './styles/createStyleSheet';
|
|
32
|
-
export { default as createTypography
|
|
35
|
+
export { default as createTypography } from './styles/createTypography';
|
|
33
36
|
export { default as getDefaultHeaderHeight } from './styles/getDefaultHeaderHeight';
|
|
34
|
-
export { HeaderStyleContext, HeaderStyleProvider
|
|
37
|
+
export { HeaderStyleContext, HeaderStyleProvider } from './styles/HeaderStyleContext';
|
|
35
38
|
export { default as useHeaderStyle } from './styles/useHeaderStyle';
|
|
36
39
|
/** Theme **/
|
|
37
40
|
export { default as createTheme } from './theme/createTheme';
|
|
@@ -43,3 +46,7 @@ export { default as UIKitThemeProvider } from './theme/UIKitThemeProvider';
|
|
|
43
46
|
export { default as useUIKitTheme } from './theme/useUIKitTheme';
|
|
44
47
|
/** Types **/
|
|
45
48
|
export type { TypoName, UIKitTheme, UIKitTypography, FontAttributes, BaseHeaderProps, UIKitColorScheme, UIKitColors, ComponentColorTree, UIKitPalette, HeaderElement, HeaderPartProps, ComponentColors, Component, GetColorTree, } from './types';
|
|
49
|
+
export type { ActionMenuItem } from './ui/ActionMenu';
|
|
50
|
+
export type { BottomSheetItem } from './ui/BottomSheet';
|
|
51
|
+
export type { UIKitTypographyOverrides } from './styles/createTypography';
|
|
52
|
+
export type { HeaderStyleContextType } from './styles/HeaderStyleContext';
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
HeaderComponent: (props:
|
|
5
|
-
title?: HeaderElement;
|
|
6
|
-
left?: HeaderElement;
|
|
7
|
-
right?: HeaderElement;
|
|
8
|
-
onPressLeft?: () => void;
|
|
9
|
-
onPressRight?: () => void;
|
|
10
|
-
}, {
|
|
11
|
-
clearTitleMargin?: boolean;
|
|
12
|
-
}>) => React.ReactElement | null;
|
|
2
|
+
import type { HeaderProps } from '../ui/Header';
|
|
3
|
+
export type HeaderStyleContextType = {
|
|
4
|
+
HeaderComponent: (props: HeaderProps) => React.ReactElement | null;
|
|
13
5
|
defaultTitleAlign: 'left' | 'center';
|
|
14
6
|
statusBarTranslucent: boolean;
|
|
15
7
|
topInset: number;
|
|
16
8
|
defaultHeight: number;
|
|
17
9
|
};
|
|
18
10
|
export declare const HeaderStyleContext: React.Context<HeaderStyleContextType>;
|
|
19
|
-
|
|
11
|
+
type Props = Pick<HeaderStyleContextType, 'statusBarTranslucent' | 'defaultTitleAlign' | 'HeaderComponent'>;
|
|
20
12
|
export declare const HeaderStyleProvider: ({ children, HeaderComponent, defaultTitleAlign, statusBarTranslucent, }: React.PropsWithChildren<Props>) => JSX.Element;
|
|
21
13
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FontAttributes, UIKitTypography } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type UIKitTypographyOverrides = Partial<UIKitTypography> & {
|
|
3
3
|
shared?: Partial<FontAttributes>;
|
|
4
4
|
};
|
|
5
5
|
declare const createTypography: (overrides?: UIKitTypographyOverrides, scaleFactor?: (dp: number) => number) => UIKitTypography;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { UIKitTheme } from '../types';
|
|
3
|
-
|
|
3
|
+
type Props = React.PropsWithChildren<{
|
|
4
4
|
theme?: UIKitTheme;
|
|
5
5
|
}>;
|
|
6
6
|
declare const UIKitThemeProvider: ({ children, theme }: Props) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UIKitTypographyOverrides } from '../styles/createTypography';
|
|
2
2
|
import type { UIKitColors, UIKitTheme } from '../types';
|
|
3
|
-
|
|
3
|
+
type Options = {
|
|
4
4
|
colorScheme: UIKitTheme['colorScheme'];
|
|
5
5
|
colors: (palette: UIKitTheme['palette']) => UIKitColors;
|
|
6
6
|
palette?: UIKitTheme['palette'];
|
|
@@ -14,9 +14,9 @@ export interface UIKitTypography {
|
|
|
14
14
|
caption3: FontAttributes;
|
|
15
15
|
caption4: FontAttributes;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
17
|
+
export type TypoName = keyof UIKitTypography;
|
|
18
|
+
export type FontAttributes = Pick<TextStyle, 'fontFamily' | 'fontSize' | 'lineHeight' | 'letterSpacing' | 'fontWeight'>;
|
|
19
|
+
export type UIKitColorScheme = 'light' | 'dark';
|
|
20
20
|
export interface UIKitTheme {
|
|
21
21
|
colorScheme: UIKitColorScheme;
|
|
22
22
|
select<V>(options: {
|
|
@@ -26,8 +26,8 @@ export interface UIKitTheme {
|
|
|
26
26
|
colors: UIKitColors;
|
|
27
27
|
typography: UIKitTypography;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
30
|
-
export
|
|
29
|
+
export type Component = 'Header' | 'Button' | 'Dialog' | 'Input' | 'Badge' | 'Placeholder' | 'Message' | 'DateSeparator' | 'GroupChannelPreview' | 'ProfileCard' | 'Reaction';
|
|
30
|
+
export type GetColorTree<Tree extends {
|
|
31
31
|
Variant: {
|
|
32
32
|
[key in Component]: string;
|
|
33
33
|
};
|
|
@@ -38,7 +38,7 @@ export declare type GetColorTree<Tree extends {
|
|
|
38
38
|
[key in Component]: string;
|
|
39
39
|
};
|
|
40
40
|
}> = Tree;
|
|
41
|
-
export
|
|
41
|
+
export type ComponentColorTree = GetColorTree<{
|
|
42
42
|
Variant: {
|
|
43
43
|
Header: 'nav';
|
|
44
44
|
Button: 'contained' | 'text';
|
|
@@ -49,6 +49,8 @@ export declare type ComponentColorTree = GetColorTree<{
|
|
|
49
49
|
Message: 'incoming' | 'outgoing';
|
|
50
50
|
DateSeparator: 'default';
|
|
51
51
|
GroupChannelPreview: 'default';
|
|
52
|
+
ProfileCard: 'default';
|
|
53
|
+
Reaction: 'default' | 'rounded';
|
|
52
54
|
};
|
|
53
55
|
State: {
|
|
54
56
|
Header: 'none';
|
|
@@ -60,6 +62,8 @@ export declare type ComponentColorTree = GetColorTree<{
|
|
|
60
62
|
Message: 'enabled' | 'pressed';
|
|
61
63
|
DateSeparator: 'none';
|
|
62
64
|
GroupChannelPreview: 'none';
|
|
65
|
+
ProfileCard: 'none';
|
|
66
|
+
Reaction: 'enabled' | 'selected';
|
|
63
67
|
};
|
|
64
68
|
ColorPart: {
|
|
65
69
|
Header: 'background' | 'borderBottom';
|
|
@@ -71,9 +75,11 @@ export declare type ComponentColorTree = GetColorTree<{
|
|
|
71
75
|
Message: 'textMsg' | 'textEdited' | 'textSenderName' | 'textTime' | 'background';
|
|
72
76
|
DateSeparator: 'text' | 'background';
|
|
73
77
|
GroupChannelPreview: 'textTitle' | 'textTitleCaption' | 'textBody' | 'memberCount' | 'bodyIcon' | 'background' | 'coverBackground' | 'bodyIconBackground' | 'separator';
|
|
78
|
+
ProfileCard: 'textUsername' | 'textBodyLabel' | 'textBody' | 'background';
|
|
79
|
+
Reaction: 'background' | 'highlight';
|
|
74
80
|
};
|
|
75
81
|
}>;
|
|
76
|
-
export
|
|
82
|
+
export type ComponentColors<T extends Component> = {
|
|
77
83
|
[key in ComponentColorTree['Variant'][T]]: {
|
|
78
84
|
[key in ComponentColorTree['State'][T]]: {
|
|
79
85
|
[key in ComponentColorTree['ColorPart'][T]]: string;
|
|
@@ -113,17 +119,19 @@ export interface UIKitColors {
|
|
|
113
119
|
message: ComponentColors<'Message'>;
|
|
114
120
|
dateSeparator: ComponentColors<'DateSeparator'>;
|
|
115
121
|
groupChannelPreview: ComponentColors<'GroupChannelPreview'>;
|
|
122
|
+
profileCard: ComponentColors<'ProfileCard'>;
|
|
123
|
+
reaction: ComponentColors<'Reaction'>;
|
|
116
124
|
};
|
|
117
125
|
}
|
|
118
|
-
export
|
|
119
|
-
export
|
|
126
|
+
export type HeaderElement = string | ReactElement | null;
|
|
127
|
+
export type HeaderPartProps = {
|
|
120
128
|
title?: HeaderElement;
|
|
121
129
|
right?: HeaderElement;
|
|
122
130
|
left?: HeaderElement;
|
|
123
131
|
onPressLeft?: (...params: any[]) => any;
|
|
124
132
|
onPressRight?: (...params: any[]) => any;
|
|
125
133
|
};
|
|
126
|
-
export
|
|
134
|
+
export type BaseHeaderProps<HeaderParts extends HeaderPartProps = {}, AdditionalProps = {}> = {
|
|
127
135
|
titleAlign?: 'left' | 'center' | 'right';
|
|
128
136
|
children?: ReactNode;
|
|
129
137
|
} & HeaderParts & AdditionalProps;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ActionMenuItem = {
|
|
2
2
|
title?: string;
|
|
3
3
|
menuItems: {
|
|
4
4
|
title: string;
|
|
5
|
+
style?: 'destructive';
|
|
5
6
|
onPress?: (() => Promise<void>) | (() => void);
|
|
6
7
|
onError?: () => void;
|
|
7
8
|
}[];
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
type Props = {
|
|
10
11
|
visible: boolean;
|
|
11
12
|
onHide: () => void;
|
|
12
13
|
onError?: (error: unknown) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AlertButton } from 'react-native';
|
|
2
|
-
export
|
|
2
|
+
export type AlertItem = {
|
|
3
3
|
title?: string;
|
|
4
4
|
message?: string;
|
|
5
5
|
buttons?: AlertButton[];
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Props = {
|
|
8
8
|
visible: boolean;
|
|
9
9
|
onHide: () => void;
|
|
10
10
|
onDismiss?: () => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import AvatarGroup from './AvatarGroup';
|
|
3
3
|
import AvatarIcon from './AvatarIcon';
|
|
4
|
-
|
|
4
|
+
type SubComponents = {
|
|
5
5
|
Group: typeof AvatarGroup;
|
|
6
6
|
Icon: typeof AvatarIcon;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type Props = {
|
|
9
9
|
uri?: string;
|
|
10
10
|
size?: number;
|
|
11
11
|
square?: boolean;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type Icon from '../../components/Icon';
|
|
2
|
-
|
|
2
|
+
type HeaderProps = {
|
|
3
|
+
onClose: () => Promise<void>;
|
|
4
|
+
};
|
|
5
|
+
export type BottomSheetItem = {
|
|
3
6
|
sheetItems: {
|
|
4
7
|
icon?: keyof typeof Icon.Assets;
|
|
5
8
|
iconColor?: string;
|
|
@@ -7,12 +10,13 @@ export declare type BottomSheetItem = {
|
|
|
7
10
|
titleColor?: string;
|
|
8
11
|
onPress: () => void;
|
|
9
12
|
}[];
|
|
13
|
+
HeaderComponent?: (props: HeaderProps) => JSX.Element;
|
|
10
14
|
};
|
|
11
|
-
|
|
15
|
+
type Props = {
|
|
12
16
|
visible: boolean;
|
|
13
17
|
onHide: () => Promise<void>;
|
|
14
18
|
onError?: (error: unknown) => void;
|
|
15
19
|
onDismiss?: () => void;
|
|
16
20
|
} & BottomSheetItem;
|
|
17
|
-
declare const BottomSheet: ({ onDismiss, onHide, visible, sheetItems }: Props) => JSX.Element;
|
|
21
|
+
declare const BottomSheet: ({ onDismiss, onHide, visible, sheetItems, HeaderComponent }: Props) => JSX.Element;
|
|
18
22
|
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 '../../components/Icon';
|
|
4
|
-
|
|
4
|
+
type Props = React.PropsWithChildren<{
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
icon?: keyof typeof Icon.Assets;
|
|
7
7
|
variant?: 'contained' | 'text';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
|
|
3
|
+
type Props = React.PropsWithChildren<{
|
|
4
4
|
style?: StyleProp<ViewStyle>;
|
|
5
5
|
}>;
|
|
6
6
|
declare const DialogBox: ({ style, children }: Props) => JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import Icon from '../../components/Icon';
|
|
4
|
-
|
|
4
|
+
type Props = React.PropsWithChildren<{
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
}>;
|
|
7
7
|
declare const DialogSheet: ((props: Props) => JSX.Element) & {
|
|
8
8
|
Item: typeof SheetItem;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type SheetItemProps = {
|
|
11
11
|
icon?: keyof typeof Icon.Assets;
|
|
12
12
|
iconColor?: string;
|
|
13
13
|
title: string;
|
|
@@ -3,7 +3,7 @@ import type { ActionMenuItem } from '../ActionMenu';
|
|
|
3
3
|
import type { AlertItem } from '../Alert';
|
|
4
4
|
import type { BottomSheetItem } from '../BottomSheet';
|
|
5
5
|
import type { PromptItem } from '../Prompt';
|
|
6
|
-
|
|
6
|
+
type DialogJob = {
|
|
7
7
|
type: 'ActionMenu';
|
|
8
8
|
props: ActionMenuItem;
|
|
9
9
|
} | {
|
|
@@ -16,17 +16,17 @@ declare type DialogJob = {
|
|
|
16
16
|
type: 'BottomSheet';
|
|
17
17
|
props: BottomSheetItem;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type DialogPropsBy<T extends DialogJob['type'], U extends DialogJob = DialogJob> = U extends {
|
|
20
20
|
type: T;
|
|
21
21
|
props: infer P;
|
|
22
22
|
} ? P : never;
|
|
23
|
-
|
|
23
|
+
type DialogContextType = {
|
|
24
24
|
openMenu: (props: DialogPropsBy<'ActionMenu'>) => void;
|
|
25
25
|
alert: (props: DialogPropsBy<'Alert'>) => void;
|
|
26
26
|
openPrompt: (props: DialogPropsBy<'Prompt'>) => void;
|
|
27
27
|
openSheet: (props: DialogPropsBy<'BottomSheet'>) => void;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
type Props = React.PropsWithChildren<{
|
|
30
30
|
defaultLabels?: {
|
|
31
31
|
alert?: {
|
|
32
32
|
ok?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Icon from '../../components/Icon';
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
4
|
customCover?: React.ReactElement;
|
|
5
5
|
coverUrl: string;
|
|
6
6
|
title: string;
|
|
@@ -13,6 +13,9 @@ declare type Props = {
|
|
|
13
13
|
maxBadgeCount?: number;
|
|
14
14
|
frozen?: boolean;
|
|
15
15
|
notificationOff?: boolean;
|
|
16
|
+
broadcast?: boolean;
|
|
17
|
+
mentioned?: boolean;
|
|
18
|
+
mentionTrigger?: string;
|
|
16
19
|
};
|
|
17
|
-
declare const GroupChannelPreview: ({ customCover, coverUrl, memberCount, badgeCount, maxBadgeCount, body, bodyIcon, title, titleCaption, titleCaptionLeft, frozen, notificationOff, }: Props) => JSX.Element;
|
|
20
|
+
declare const GroupChannelPreview: ({ customCover, coverUrl, memberCount, badgeCount, maxBadgeCount, body, bodyIcon, title, titleCaption, titleCaptionLeft, frozen, notificationOff, broadcast, mentioned, mentionTrigger, }: Props) => JSX.Element;
|
|
18
21
|
export default GroupChannelPreview;
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { TouchableOpacityProps } from 'react-native';
|
|
3
3
|
import { TextProps } from '../../components/Text';
|
|
4
4
|
import type { BaseHeaderProps } from '../../index';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type HeaderElement = string | React.ReactElement | null;
|
|
6
|
+
export type HeaderProps = BaseHeaderProps<{
|
|
7
7
|
title?: HeaderElement;
|
|
8
8
|
left?: HeaderElement;
|
|
9
9
|
right?: HeaderElement;
|
|
@@ -11,6 +11,7 @@ declare type HeaderProps = BaseHeaderProps<{
|
|
|
11
11
|
onPressRight?: () => void;
|
|
12
12
|
}, {
|
|
13
13
|
clearTitleMargin?: boolean;
|
|
14
|
+
statusBarTopInsetAs?: 'padding' | 'margin';
|
|
14
15
|
}>;
|
|
15
16
|
declare const Header: ((props: HeaderProps) => JSX.Element) & {
|
|
16
17
|
Button: typeof HeaderButton;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Icon from '../../components/Icon';
|
|
3
|
-
export
|
|
3
|
+
export type MenuBarProps = {
|
|
4
4
|
variant?: 'default' | 'contained';
|
|
5
5
|
onPress: () => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
visible?: boolean;
|
|
7
8
|
icon: keyof typeof Icon.Assets;
|
|
8
9
|
iconColor?: string;
|
|
9
10
|
iconBackgroundColor?: string;
|
|
@@ -11,5 +12,5 @@ export declare type MenuBarProps = {
|
|
|
11
12
|
actionLabel?: string;
|
|
12
13
|
actionItem?: React.ReactNode;
|
|
13
14
|
};
|
|
14
|
-
declare const MenuBar: ({ variant, disabled, onPress, name, icon, iconColor, iconBackgroundColor, actionLabel, actionItem, }: MenuBarProps) => JSX.Element;
|
|
15
|
+
declare const MenuBar: ({ variant, disabled, visible, onPress, name, icon, iconColor, iconBackgroundColor, actionLabel, actionItem, }: MenuBarProps) => JSX.Element | null;
|
|
15
16
|
export default MenuBar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
type OutlinedButtonProps = {
|
|
3
|
+
children: string;
|
|
4
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare const OutlinedButton: ({ children, onPress, containerStyle }: OutlinedButtonProps) => JSX.Element;
|
|
8
|
+
export default OutlinedButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
type Props = {
|
|
3
|
+
uri: string;
|
|
4
|
+
username: string;
|
|
5
|
+
button?: JSX.Element;
|
|
6
|
+
bodyLabel: string;
|
|
7
|
+
body: string;
|
|
8
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
9
|
+
};
|
|
10
|
+
declare const ProfileCard: ({ uri, username, bodyLabel, body, button, containerStyle }: Props) => JSX.Element;
|
|
11
|
+
export default ProfileCard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PromptItem = {
|
|
2
2
|
title: string;
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
defaultValue?: string;
|
|
@@ -7,7 +7,7 @@ export declare type PromptItem = {
|
|
|
7
7
|
onCancel?: () => void;
|
|
8
8
|
cancelLabel?: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type Props = {
|
|
11
11
|
visible: boolean;
|
|
12
12
|
onHide: () => void;
|
|
13
13
|
onDismiss?: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ToastType = 'normal' | 'error' | 'success';
|
|
3
|
+
type Context = {
|
|
4
4
|
show(text: string, type?: ToastType): void;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
type Props = React.PropsWithChildren<{
|
|
7
7
|
top?: number;
|
|
8
8
|
bottom?: number;
|
|
9
9
|
visible: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "react-native-uikit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "jest",
|
|
18
18
|
"build": "bob build",
|
|
19
|
-
"clean": "del lib"
|
|
19
|
+
"clean": "del lib",
|
|
20
|
+
"generate-icons": "node src/assets/bundle-icons.js"
|
|
20
21
|
},
|
|
21
22
|
"keywords": [
|
|
22
23
|
"react-native",
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"access": "public"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@sendbird/uikit-utils": "2.0
|
|
42
|
+
"@sendbird/uikit-utils": "2.2.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/react": "*",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"react-native-builder-bob": "^0.18.0",
|
|
49
50
|
"react-native-fast-image": "^8.5.11",
|
|
50
51
|
"react-native-safe-area-context": "^3.3.2",
|
|
51
|
-
"typescript": "
|
|
52
|
+
"typescript": "4.9.4"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"react": ">=16.13.1",
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
"readmeFile": "./README.md",
|
|
81
82
|
"displayName": "@sendbird/uikit-react-native-foundation"
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "bd7ab217a07e91ba644c0cb69694a92b123326bf"
|
|
84
85
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/assets/icon/index.ts
CHANGED
|
@@ -33,7 +33,7 @@ const IconAssets = {
|
|
|
33
33
|
'leave': require('./icon-leave.png'),
|
|
34
34
|
'members': require('./icon-members.png'),
|
|
35
35
|
'message': require('./icon-message.png'),
|
|
36
|
-
'
|
|
36
|
+
'moderation': require('./icon-moderation.png'),
|
|
37
37
|
'more': require('./icon-more.png'),
|
|
38
38
|
'mute': require('./icon-mute.png'),
|
|
39
39
|
'notifications-filled': require('./icon-notifications-filled.png'),
|
|
@@ -44,6 +44,8 @@ const IconAssets = {
|
|
|
44
44
|
'play': require('./icon-play.png'),
|
|
45
45
|
'plus': require('./icon-plus.png'),
|
|
46
46
|
'question': require('./icon-question.png'),
|
|
47
|
+
'radio-off': require('./icon-radio-off.png'),
|
|
48
|
+
'radio-on': require('./icon-radio-on.png'),
|
|
47
49
|
'refresh': require('./icon-refresh.png'),
|
|
48
50
|
'remove': require('./icon-remove.png'),
|
|
49
51
|
'reply-filled': require('./icon-reply-filled.png'),
|
|
@@ -19,8 +19,9 @@ import createStyleSheet from '../../styles/createStyleSheet';
|
|
|
19
19
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
20
20
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
21
21
|
|
|
22
|
+
type ModalAnimationType = 'slide' | 'slide-no-gesture' | 'fade';
|
|
22
23
|
type Props = {
|
|
23
|
-
type?:
|
|
24
|
+
type?: ModalAnimationType;
|
|
24
25
|
onClose: () => void;
|
|
25
26
|
backgroundStyle?: StyleProp<ViewStyle>;
|
|
26
27
|
disableBackgroundClose?: boolean;
|
|
@@ -66,6 +67,7 @@ const Modal = ({
|
|
|
66
67
|
|
|
67
68
|
return (
|
|
68
69
|
<RNModal
|
|
70
|
+
statusBarTranslucent={statusBarTranslucent}
|
|
69
71
|
transparent
|
|
70
72
|
hardwareAccelerated
|
|
71
73
|
visible={modalVisible}
|
|
@@ -116,12 +118,12 @@ const isHideGesture = (distanceY: number, velocityY: number) => {
|
|
|
116
118
|
return distanceY > 125 || (distanceY > 0 && velocityY > 0.1);
|
|
117
119
|
};
|
|
118
120
|
const useModalPanResponder = (
|
|
119
|
-
type:
|
|
121
|
+
type: ModalAnimationType,
|
|
120
122
|
translateY: Animated.Value,
|
|
121
123
|
show: () => void,
|
|
122
124
|
hide: () => void,
|
|
123
125
|
) => {
|
|
124
|
-
if (type === 'fade') return { panHandlers: {} };
|
|
126
|
+
if (type === 'fade' || type === 'slide-no-gesture') return { panHandlers: {} };
|
|
125
127
|
return React.useRef(
|
|
126
128
|
PanResponder.create({
|
|
127
129
|
onMoveShouldSetPanResponderCapture: (_, { dy }) => dy > 8,
|
|
@@ -136,15 +138,15 @@ const useModalPanResponder = (
|
|
|
136
138
|
).current;
|
|
137
139
|
};
|
|
138
140
|
|
|
139
|
-
const useModalAnimation = (type:
|
|
140
|
-
const initialY = type === '
|
|
141
|
+
const useModalAnimation = (type: ModalAnimationType) => {
|
|
142
|
+
const initialY = type === 'fade' ? 0 : Dimensions.get('window').height;
|
|
141
143
|
const baseAnimBackground = useRef(new Animated.Value(0)).current;
|
|
142
144
|
const baseAnimContent = useRef(new Animated.Value(initialY)).current;
|
|
143
145
|
|
|
144
146
|
const content = {
|
|
145
147
|
opacity: baseAnimBackground.interpolate({
|
|
146
148
|
inputRange: [0, 1],
|
|
147
|
-
outputRange: [type === '
|
|
149
|
+
outputRange: [type === 'fade' ? 0 : 1, 1],
|
|
148
150
|
}),
|
|
149
151
|
translateY: baseAnimContent,
|
|
150
152
|
};
|