@sendbird/uikit-react-native-foundation 2.0.3 → 2.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.
- 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/index.js +1 -1
- package/lib/commonjs/assets/icon/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +1 -0
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/index.js +19 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/theme/DarkUIKitTheme.js +10 -0
- package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/LightUIKitTheme.js +10 -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/GroupChannelPreview/index.js +11 -2
- 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/index.js +1 -1
- package/lib/module/assets/icon/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +1 -0
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/index.js +6 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/theme/DarkUIKitTheme.js +10 -0
- package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/module/theme/LightUIKitTheme.js +10 -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/GroupChannelPreview/index.js +11 -2
- 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 +1 -1
- package/lib/typescript/src/index.d.ts +10 -4
- package/lib/typescript/src/styles/HeaderStyleContext.d.ts +2 -10
- package/lib/typescript/src/types.d.ts +5 -1
- package/lib/typescript/src/ui/ActionMenu/index.d.ts +1 -0
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +2 -1
- package/lib/typescript/src/ui/Header/index.d.ts +2 -1
- package/lib/typescript/src/ui/MenuBar/index.d.ts +2 -1
- package/lib/typescript/src/ui/OutlinedButton/index.d.ts +8 -0
- package/lib/typescript/src/ui/ProfileCard/index.d.ts +11 -0
- package/package.json +3 -3
- 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/index.ts +1 -1
- package/src/components/Modal/index.tsx +1 -0
- package/src/index.ts +10 -4
- package/src/styles/HeaderStyleContext.tsx +2 -13
- package/src/theme/DarkUIKitTheme.ts +10 -0
- package/src/theme/LightUIKitTheme.ts +10 -0
- package/src/types.ts +7 -1
- package/src/ui/ActionMenu/index.tsx +10 -1
- package/src/ui/GroupChannelPreview/index.tsx +13 -0
- 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
|
@@ -10,11 +10,11 @@ export { default as Text } from './components/Text';
|
|
|
10
10
|
export { default as TextInput } from './components/TextInput';
|
|
11
11
|
export { default as URLParsedText } from './components/URLParsedText';
|
|
12
12
|
/** UI **/
|
|
13
|
-
export { default as ActionMenu
|
|
13
|
+
export { default as ActionMenu } from './ui/ActionMenu';
|
|
14
14
|
export { default as Alert } from './ui/Alert';
|
|
15
15
|
export { default as Avatar } from './ui/Avatar';
|
|
16
16
|
export { default as Badge } from './ui/Badge';
|
|
17
|
-
export { default as BottomSheet
|
|
17
|
+
export { default as BottomSheet } from './ui/BottomSheet';
|
|
18
18
|
export { default as Button } from './ui/Button';
|
|
19
19
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
20
20
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
@@ -22,16 +22,18 @@ export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
|
22
22
|
export { default as Header } from './ui/Header';
|
|
23
23
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
24
24
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
25
|
+
export { default as OutlinedButton } from './ui/OutlinedButton';
|
|
25
26
|
export { default as Placeholder } from './ui/Placeholder';
|
|
27
|
+
export { default as ProfileCard } from './ui/ProfileCard';
|
|
26
28
|
export { default as Prompt } from './ui/Prompt';
|
|
27
29
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
28
30
|
/** Styles **/
|
|
29
31
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
30
32
|
export { default as createScaleFactor } from './styles/createScaleFactor';
|
|
31
33
|
export { default as createStyleSheet } from './styles/createStyleSheet';
|
|
32
|
-
export { default as createTypography
|
|
34
|
+
export { default as createTypography } from './styles/createTypography';
|
|
33
35
|
export { default as getDefaultHeaderHeight } from './styles/getDefaultHeaderHeight';
|
|
34
|
-
export { HeaderStyleContext, HeaderStyleProvider
|
|
36
|
+
export { HeaderStyleContext, HeaderStyleProvider } from './styles/HeaderStyleContext';
|
|
35
37
|
export { default as useHeaderStyle } from './styles/useHeaderStyle';
|
|
36
38
|
/** Theme **/
|
|
37
39
|
export { default as createTheme } from './theme/createTheme';
|
|
@@ -43,3 +45,7 @@ export { default as UIKitThemeProvider } from './theme/UIKitThemeProvider';
|
|
|
43
45
|
export { default as useUIKitTheme } from './theme/useUIKitTheme';
|
|
44
46
|
/** Types **/
|
|
45
47
|
export type { TypoName, UIKitTheme, UIKitTypography, FontAttributes, BaseHeaderProps, UIKitColorScheme, UIKitColors, ComponentColorTree, UIKitPalette, HeaderElement, HeaderPartProps, ComponentColors, Component, GetColorTree, } from './types';
|
|
48
|
+
export type { ActionMenuItem } from './ui/ActionMenu';
|
|
49
|
+
export type { BottomSheetItem } from './ui/BottomSheet';
|
|
50
|
+
export type { UIKitTypographyOverrides } from './styles/createTypography';
|
|
51
|
+
export type { HeaderStyleContextType } from './styles/HeaderStyleContext';
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HeaderProps } from '../ui/Header';
|
|
3
3
|
export declare type HeaderStyleContextType = {
|
|
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;
|
|
4
|
+
HeaderComponent: (props: HeaderProps) => React.ReactElement | null;
|
|
13
5
|
defaultTitleAlign: 'left' | 'center';
|
|
14
6
|
statusBarTranslucent: boolean;
|
|
15
7
|
topInset: number;
|
|
@@ -26,7 +26,7 @@ export interface UIKitTheme {
|
|
|
26
26
|
colors: UIKitColors;
|
|
27
27
|
typography: UIKitTypography;
|
|
28
28
|
}
|
|
29
|
-
export declare type Component = 'Header' | 'Button' | 'Dialog' | 'Input' | 'Badge' | 'Placeholder' | 'Message' | 'DateSeparator' | 'GroupChannelPreview';
|
|
29
|
+
export declare type Component = 'Header' | 'Button' | 'Dialog' | 'Input' | 'Badge' | 'Placeholder' | 'Message' | 'DateSeparator' | 'GroupChannelPreview' | 'ProfileCard';
|
|
30
30
|
export declare type GetColorTree<Tree extends {
|
|
31
31
|
Variant: {
|
|
32
32
|
[key in Component]: string;
|
|
@@ -49,6 +49,7 @@ export declare type ComponentColorTree = GetColorTree<{
|
|
|
49
49
|
Message: 'incoming' | 'outgoing';
|
|
50
50
|
DateSeparator: 'default';
|
|
51
51
|
GroupChannelPreview: 'default';
|
|
52
|
+
ProfileCard: 'default';
|
|
52
53
|
};
|
|
53
54
|
State: {
|
|
54
55
|
Header: 'none';
|
|
@@ -60,6 +61,7 @@ export declare type ComponentColorTree = GetColorTree<{
|
|
|
60
61
|
Message: 'enabled' | 'pressed';
|
|
61
62
|
DateSeparator: 'none';
|
|
62
63
|
GroupChannelPreview: 'none';
|
|
64
|
+
ProfileCard: 'none';
|
|
63
65
|
};
|
|
64
66
|
ColorPart: {
|
|
65
67
|
Header: 'background' | 'borderBottom';
|
|
@@ -71,6 +73,7 @@ export declare type ComponentColorTree = GetColorTree<{
|
|
|
71
73
|
Message: 'textMsg' | 'textEdited' | 'textSenderName' | 'textTime' | 'background';
|
|
72
74
|
DateSeparator: 'text' | 'background';
|
|
73
75
|
GroupChannelPreview: 'textTitle' | 'textTitleCaption' | 'textBody' | 'memberCount' | 'bodyIcon' | 'background' | 'coverBackground' | 'bodyIconBackground' | 'separator';
|
|
76
|
+
ProfileCard: 'textUsername' | 'textBodyLabel' | 'textBody' | 'background';
|
|
74
77
|
};
|
|
75
78
|
}>;
|
|
76
79
|
export declare type ComponentColors<T extends Component> = {
|
|
@@ -113,6 +116,7 @@ export interface UIKitColors {
|
|
|
113
116
|
message: ComponentColors<'Message'>;
|
|
114
117
|
dateSeparator: ComponentColors<'DateSeparator'>;
|
|
115
118
|
groupChannelPreview: ComponentColors<'GroupChannelPreview'>;
|
|
119
|
+
profileCard: ComponentColors<'ProfileCard'>;
|
|
116
120
|
};
|
|
117
121
|
}
|
|
118
122
|
export declare type HeaderElement = string | ReactElement | null;
|
|
@@ -13,6 +13,7 @@ declare type Props = {
|
|
|
13
13
|
maxBadgeCount?: number;
|
|
14
14
|
frozen?: boolean;
|
|
15
15
|
notificationOff?: boolean;
|
|
16
|
+
broadcast?: boolean;
|
|
16
17
|
};
|
|
17
|
-
declare const GroupChannelPreview: ({ customCover, coverUrl, memberCount, badgeCount, maxBadgeCount, body, bodyIcon, title, titleCaption, titleCaptionLeft, frozen, notificationOff, }: Props) => JSX.Element;
|
|
18
|
+
declare const GroupChannelPreview: ({ customCover, coverUrl, memberCount, badgeCount, maxBadgeCount, body, bodyIcon, title, titleCaption, titleCaptionLeft, frozen, notificationOff, broadcast, }: Props) => JSX.Element;
|
|
18
19
|
export default GroupChannelPreview;
|
|
@@ -3,7 +3,7 @@ import { TouchableOpacityProps } from 'react-native';
|
|
|
3
3
|
import { TextProps } from '../../components/Text';
|
|
4
4
|
import type { BaseHeaderProps } from '../../index';
|
|
5
5
|
declare type HeaderElement = string | React.ReactElement | null;
|
|
6
|
-
declare type HeaderProps = BaseHeaderProps<{
|
|
6
|
+
export declare 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;
|
|
@@ -4,6 +4,7 @@ export declare 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
|
+
declare 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
|
+
declare 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;
|
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.1.0",
|
|
4
4
|
"description": "react-native-uikit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@sendbird/uikit-utils": "2.0
|
|
41
|
+
"@sendbird/uikit-utils": "2.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "*",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"readmeFile": "./README.md",
|
|
81
81
|
"displayName": "@sendbird/uikit-react-native-foundation"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "c778a84a632487047fe532db188b32dfa6e93a7f"
|
|
84
84
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
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'),
|
package/src/index.ts
CHANGED
|
@@ -12,11 +12,11 @@ export { default as TextInput } from './components/TextInput';
|
|
|
12
12
|
export { default as URLParsedText } from './components/URLParsedText';
|
|
13
13
|
|
|
14
14
|
/** UI **/
|
|
15
|
-
export { default as ActionMenu
|
|
15
|
+
export { default as ActionMenu } from './ui/ActionMenu';
|
|
16
16
|
export { default as Alert } from './ui/Alert';
|
|
17
17
|
export { default as Avatar } from './ui/Avatar';
|
|
18
18
|
export { default as Badge } from './ui/Badge';
|
|
19
|
-
export { default as BottomSheet
|
|
19
|
+
export { default as BottomSheet } from './ui/BottomSheet';
|
|
20
20
|
export { default as Button } from './ui/Button';
|
|
21
21
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
22
22
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
@@ -24,7 +24,9 @@ export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
|
24
24
|
export { default as Header } from './ui/Header';
|
|
25
25
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
26
26
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
27
|
+
export { default as OutlinedButton } from './ui/OutlinedButton';
|
|
27
28
|
export { default as Placeholder } from './ui/Placeholder';
|
|
29
|
+
export { default as ProfileCard } from './ui/ProfileCard';
|
|
28
30
|
export { default as Prompt } from './ui/Prompt';
|
|
29
31
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
30
32
|
|
|
@@ -32,9 +34,9 @@ export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
|
32
34
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
33
35
|
export { default as createScaleFactor } from './styles/createScaleFactor';
|
|
34
36
|
export { default as createStyleSheet } from './styles/createStyleSheet';
|
|
35
|
-
export { default as createTypography
|
|
37
|
+
export { default as createTypography } from './styles/createTypography';
|
|
36
38
|
export { default as getDefaultHeaderHeight } from './styles/getDefaultHeaderHeight';
|
|
37
|
-
export { HeaderStyleContext, HeaderStyleProvider
|
|
39
|
+
export { HeaderStyleContext, HeaderStyleProvider } from './styles/HeaderStyleContext';
|
|
38
40
|
export { default as useHeaderStyle } from './styles/useHeaderStyle';
|
|
39
41
|
|
|
40
42
|
/** Theme **/
|
|
@@ -63,3 +65,7 @@ export type {
|
|
|
63
65
|
Component,
|
|
64
66
|
GetColorTree,
|
|
65
67
|
} from './types';
|
|
68
|
+
export type { ActionMenuItem } from './ui/ActionMenu';
|
|
69
|
+
export type { BottomSheetItem } from './ui/BottomSheet';
|
|
70
|
+
export type { UIKitTypographyOverrides } from './styles/createTypography';
|
|
71
|
+
export type { HeaderStyleContextType } from './styles/HeaderStyleContext';
|
|
@@ -2,22 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { StatusBar, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type { HeaderProps } from '../ui/Header';
|
|
6
6
|
import getDefaultHeaderHeight from './getDefaultHeaderHeight';
|
|
7
7
|
|
|
8
8
|
export type HeaderStyleContextType = {
|
|
9
|
-
HeaderComponent: (
|
|
10
|
-
props: BaseHeaderProps<
|
|
11
|
-
{
|
|
12
|
-
title?: HeaderElement;
|
|
13
|
-
left?: HeaderElement;
|
|
14
|
-
right?: HeaderElement;
|
|
15
|
-
onPressLeft?: () => void;
|
|
16
|
-
onPressRight?: () => void;
|
|
17
|
-
},
|
|
18
|
-
{ clearTitleMargin?: boolean }
|
|
19
|
-
>,
|
|
20
|
-
) => React.ReactElement | null;
|
|
9
|
+
HeaderComponent: (props: HeaderProps) => React.ReactElement | null;
|
|
21
10
|
defaultTitleAlign: 'left' | 'center';
|
|
22
11
|
statusBarTranslucent: boolean;
|
|
23
12
|
topInset: number;
|
|
@@ -169,6 +169,16 @@ const DarkUIKitTheme = createTheme({
|
|
|
169
169
|
},
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
|
+
profileCard: {
|
|
173
|
+
default: {
|
|
174
|
+
none: {
|
|
175
|
+
textUsername: palette.onBackgroundDark01,
|
|
176
|
+
textBodyLabel: palette.onBackgroundDark02,
|
|
177
|
+
textBody: palette.onBackgroundDark01,
|
|
178
|
+
background: palette.background500,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
172
182
|
},
|
|
173
183
|
}),
|
|
174
184
|
});
|
|
@@ -169,6 +169,16 @@ const LightUIKitTheme = createTheme({
|
|
|
169
169
|
},
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
|
+
profileCard: {
|
|
173
|
+
default: {
|
|
174
|
+
none: {
|
|
175
|
+
textUsername: palette.onBackgroundLight01,
|
|
176
|
+
textBodyLabel: palette.onBackgroundLight02,
|
|
177
|
+
textBody: palette.onBackgroundLight01,
|
|
178
|
+
background: palette.background50,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
172
182
|
},
|
|
173
183
|
}),
|
|
174
184
|
});
|
package/src/types.ts
CHANGED
|
@@ -39,7 +39,9 @@ export type Component =
|
|
|
39
39
|
| 'Placeholder'
|
|
40
40
|
| 'Message'
|
|
41
41
|
| 'DateSeparator'
|
|
42
|
-
| 'GroupChannelPreview'
|
|
42
|
+
| 'GroupChannelPreview'
|
|
43
|
+
| 'ProfileCard';
|
|
44
|
+
|
|
43
45
|
export type GetColorTree<
|
|
44
46
|
Tree extends {
|
|
45
47
|
Variant: {
|
|
@@ -65,6 +67,7 @@ export type ComponentColorTree = GetColorTree<{
|
|
|
65
67
|
Message: 'incoming' | 'outgoing';
|
|
66
68
|
DateSeparator: 'default';
|
|
67
69
|
GroupChannelPreview: 'default';
|
|
70
|
+
ProfileCard: 'default';
|
|
68
71
|
};
|
|
69
72
|
State: {
|
|
70
73
|
Header: 'none';
|
|
@@ -76,6 +79,7 @@ export type ComponentColorTree = GetColorTree<{
|
|
|
76
79
|
Message: 'enabled' | 'pressed';
|
|
77
80
|
DateSeparator: 'none';
|
|
78
81
|
GroupChannelPreview: 'none';
|
|
82
|
+
ProfileCard: 'none';
|
|
79
83
|
};
|
|
80
84
|
ColorPart: {
|
|
81
85
|
Header: 'background' | 'borderBottom';
|
|
@@ -96,6 +100,7 @@ export type ComponentColorTree = GetColorTree<{
|
|
|
96
100
|
| 'coverBackground'
|
|
97
101
|
| 'bodyIconBackground'
|
|
98
102
|
| 'separator';
|
|
103
|
+
ProfileCard: 'textUsername' | 'textBodyLabel' | 'textBody' | 'background';
|
|
99
104
|
};
|
|
100
105
|
}>;
|
|
101
106
|
export type ComponentColors<T extends Component> = {
|
|
@@ -139,6 +144,7 @@ export interface UIKitColors {
|
|
|
139
144
|
message: ComponentColors<'Message'>;
|
|
140
145
|
dateSeparator: ComponentColors<'DateSeparator'>;
|
|
141
146
|
groupChannelPreview: ComponentColors<'GroupChannelPreview'>;
|
|
147
|
+
profileCard: ComponentColors<'ProfileCard'>;
|
|
142
148
|
};
|
|
143
149
|
}
|
|
144
150
|
|
|
@@ -15,6 +15,7 @@ export type ActionMenuItem = {
|
|
|
15
15
|
title?: string;
|
|
16
16
|
menuItems: {
|
|
17
17
|
title: string;
|
|
18
|
+
style?: 'destructive';
|
|
18
19
|
onPress?: (() => Promise<void>) | (() => void);
|
|
19
20
|
onError?: () => void;
|
|
20
21
|
}[];
|
|
@@ -83,7 +84,15 @@ const ActionMenu = ({ visible, onHide, onError, onDismiss, title, menuItems }: P
|
|
|
83
84
|
}
|
|
84
85
|
}}
|
|
85
86
|
>
|
|
86
|
-
<Text
|
|
87
|
+
<Text
|
|
88
|
+
subtitle2
|
|
89
|
+
color={
|
|
90
|
+
item.style === 'destructive'
|
|
91
|
+
? colors.ui.dialog.default.none.destructive
|
|
92
|
+
: colors.ui.dialog.default.none.text
|
|
93
|
+
}
|
|
94
|
+
numberOfLines={1}
|
|
95
|
+
>
|
|
87
96
|
{item.title}
|
|
88
97
|
</Text>
|
|
89
98
|
</TouchableOpacity>
|
|
@@ -28,6 +28,7 @@ type Props = {
|
|
|
28
28
|
|
|
29
29
|
frozen?: boolean;
|
|
30
30
|
notificationOff?: boolean;
|
|
31
|
+
broadcast?: boolean;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
const GroupChannelPreview = ({
|
|
@@ -43,6 +44,7 @@ const GroupChannelPreview = ({
|
|
|
43
44
|
titleCaptionLeft,
|
|
44
45
|
frozen,
|
|
45
46
|
notificationOff,
|
|
47
|
+
broadcast,
|
|
46
48
|
}: Props) => {
|
|
47
49
|
const { colors } = useUIKitTheme();
|
|
48
50
|
const color = colors.ui.groupChannelPreview;
|
|
@@ -65,6 +67,14 @@ const GroupChannelPreview = ({
|
|
|
65
67
|
<View style={styles.rightSection}>
|
|
66
68
|
<View style={styles.rightTopSection}>
|
|
67
69
|
<View style={styles.channelInfoContainer}>
|
|
70
|
+
{broadcast && (
|
|
71
|
+
<Icon
|
|
72
|
+
size={16}
|
|
73
|
+
icon={'broadcast'}
|
|
74
|
+
color={colors.secondary}
|
|
75
|
+
containerStyle={styles.channelInfoBroadcast}
|
|
76
|
+
/>
|
|
77
|
+
)}
|
|
68
78
|
<Text numberOfLines={1} subtitle1 style={styles.channelInfoTitle} color={color.default.none.textTitle}>
|
|
69
79
|
{title}
|
|
70
80
|
</Text>
|
|
@@ -148,6 +158,9 @@ const styles = createStyleSheet({
|
|
|
148
158
|
alignItems: 'center',
|
|
149
159
|
flexDirection: 'row',
|
|
150
160
|
},
|
|
161
|
+
channelInfoBroadcast: {
|
|
162
|
+
marginRight: 4,
|
|
163
|
+
},
|
|
151
164
|
channelInfoTitle: {
|
|
152
165
|
flexShrink: 1,
|
|
153
166
|
marginRight: 4,
|
package/src/ui/Header/index.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
|
11
11
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
12
12
|
|
|
13
13
|
type HeaderElement = string | React.ReactElement | null;
|
|
14
|
-
type HeaderProps = BaseHeaderProps<
|
|
14
|
+
export type HeaderProps = BaseHeaderProps<
|
|
15
15
|
{
|
|
16
16
|
title?: HeaderElement;
|
|
17
17
|
left?: HeaderElement;
|
|
@@ -19,7 +19,10 @@ type HeaderProps = BaseHeaderProps<
|
|
|
19
19
|
onPressLeft?: () => void;
|
|
20
20
|
onPressRight?: () => void;
|
|
21
21
|
},
|
|
22
|
-
{
|
|
22
|
+
{
|
|
23
|
+
clearTitleMargin?: boolean;
|
|
24
|
+
statusBarTopInsetAs?: 'padding' | 'margin';
|
|
25
|
+
}
|
|
23
26
|
>;
|
|
24
27
|
|
|
25
28
|
const AlignMapper = { left: 'flex-start', center: 'center', right: 'flex-end' } as const;
|
|
@@ -36,8 +39,10 @@ const Header: ((props: HeaderProps) => JSX.Element) & {
|
|
|
36
39
|
onPressLeft,
|
|
37
40
|
onPressRight,
|
|
38
41
|
clearTitleMargin = false,
|
|
42
|
+
statusBarTopInsetAs = 'padding',
|
|
39
43
|
}) => {
|
|
40
44
|
const { topInset, defaultTitleAlign, defaultHeight } = useHeaderStyle();
|
|
45
|
+
|
|
41
46
|
const { colors } = useUIKitTheme();
|
|
42
47
|
const { left: paddingLeft, right: paddingRight } = useSafeAreaInsets();
|
|
43
48
|
|
|
@@ -54,9 +59,9 @@ const Header: ((props: HeaderProps) => JSX.Element) & {
|
|
|
54
59
|
style={[
|
|
55
60
|
styles.container,
|
|
56
61
|
{
|
|
62
|
+
[statusBarTopInsetAs === 'padding' ? 'paddingTop' : 'marginTop']: topInset,
|
|
57
63
|
paddingLeft: paddingLeft + styles.container.paddingHorizontal,
|
|
58
64
|
paddingRight: paddingRight + styles.container.paddingHorizontal,
|
|
59
|
-
paddingTop: topInset,
|
|
60
65
|
backgroundColor: colors.ui.header.nav.none.background,
|
|
61
66
|
borderBottomColor: colors.ui.header.nav.none.borderBottom,
|
|
62
67
|
},
|
package/src/ui/MenuBar/index.tsx
CHANGED
|
@@ -14,6 +14,7 @@ export type MenuBarProps = {
|
|
|
14
14
|
|
|
15
15
|
onPress: () => void;
|
|
16
16
|
disabled?: boolean;
|
|
17
|
+
visible?: boolean;
|
|
17
18
|
|
|
18
19
|
icon: keyof typeof Icon.Assets;
|
|
19
20
|
iconColor?: string;
|
|
@@ -26,6 +27,7 @@ export type MenuBarProps = {
|
|
|
26
27
|
const MenuBar = ({
|
|
27
28
|
variant = 'default',
|
|
28
29
|
disabled,
|
|
30
|
+
visible = true,
|
|
29
31
|
onPress,
|
|
30
32
|
name,
|
|
31
33
|
icon,
|
|
@@ -36,6 +38,8 @@ const MenuBar = ({
|
|
|
36
38
|
}: MenuBarProps) => {
|
|
37
39
|
const { palette, colors } = useUIKitTheme();
|
|
38
40
|
|
|
41
|
+
if (!visible) return null;
|
|
42
|
+
|
|
39
43
|
return (
|
|
40
44
|
<View>
|
|
41
45
|
<Pressable disabled={disabled} onPress={onPress} style={styles.container}>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import Text from '../../components/Text';
|
|
5
|
+
import createStyleSheet from '../../styles/createStyleSheet';
|
|
6
|
+
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
|
+
|
|
8
|
+
type OutlinedButtonProps = {
|
|
9
|
+
children: string;
|
|
10
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const OutlinedButton = ({ children, onPress, containerStyle }: OutlinedButtonProps) => {
|
|
15
|
+
const { colors } = useUIKitTheme();
|
|
16
|
+
return (
|
|
17
|
+
<Pressable
|
|
18
|
+
onPress={onPress}
|
|
19
|
+
style={[styles.outlinedButton, { borderColor: colors.onBackground01 }, containerStyle]}
|
|
20
|
+
>
|
|
21
|
+
<Text button color={colors.onBackground01} numberOfLines={1} style={styles.outlinedButtonText}>
|
|
22
|
+
{children}
|
|
23
|
+
</Text>
|
|
24
|
+
</Pressable>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const styles = createStyleSheet({
|
|
29
|
+
outlinedButton: {
|
|
30
|
+
borderRadius: 4,
|
|
31
|
+
padding: 16,
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
},
|
|
36
|
+
outlinedButtonText: {
|
|
37
|
+
textAlign: 'center',
|
|
38
|
+
width: '100%',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default OutlinedButton;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import Divider from '../../components/Divider';
|
|
5
|
+
import Text from '../../components/Text';
|
|
6
|
+
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
|
+
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
|
+
import Avatar from '../Avatar';
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
uri: string;
|
|
12
|
+
username: string;
|
|
13
|
+
|
|
14
|
+
button?: JSX.Element;
|
|
15
|
+
|
|
16
|
+
bodyLabel: string;
|
|
17
|
+
body: string;
|
|
18
|
+
|
|
19
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const ProfileCard = ({ uri, username, bodyLabel, body, button, containerStyle }: Props) => {
|
|
23
|
+
const { colors } = useUIKitTheme();
|
|
24
|
+
const color = colors.ui.profileCard.default.none;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View style={[styles.container, { backgroundColor: color.background }, containerStyle]}>
|
|
28
|
+
<View style={styles.profileContainer}>
|
|
29
|
+
<Avatar uri={uri} size={80} containerStyle={styles.profileAvatar} />
|
|
30
|
+
<Text h1 color={color.textUsername} numberOfLines={1}>
|
|
31
|
+
{username}
|
|
32
|
+
</Text>
|
|
33
|
+
</View>
|
|
34
|
+
{button && <View style={styles.messageButtonArea}>{button}</View>}
|
|
35
|
+
<Divider space={16} />
|
|
36
|
+
<View style={styles.profileInfoContainer}>
|
|
37
|
+
<Text body2 color={color.textBodyLabel} style={styles.profileInfoBodyLabel}>
|
|
38
|
+
{bodyLabel}
|
|
39
|
+
</Text>
|
|
40
|
+
<Text body3 numberOfLines={1} color={color.textBody}>
|
|
41
|
+
{body}
|
|
42
|
+
</Text>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const styles = createStyleSheet({
|
|
49
|
+
container: {
|
|
50
|
+
paddingTop: 32,
|
|
51
|
+
width: '100%',
|
|
52
|
+
},
|
|
53
|
+
profileContainer: {
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
paddingHorizontal: 16,
|
|
56
|
+
marginBottom: 24,
|
|
57
|
+
},
|
|
58
|
+
profileAvatar: {
|
|
59
|
+
marginBottom: 8,
|
|
60
|
+
},
|
|
61
|
+
profileInfoContainer: {
|
|
62
|
+
padding: 16,
|
|
63
|
+
},
|
|
64
|
+
profileInfoBodyLabel: {
|
|
65
|
+
marginBottom: 4,
|
|
66
|
+
},
|
|
67
|
+
messageButtonArea: {
|
|
68
|
+
marginHorizontal: 24,
|
|
69
|
+
marginBottom: 24,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export default ProfileCard;
|