@sendbird/uikit-react-native-foundation 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js +10 -2
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/styles/createScaleFactor.js +2 -1
- package/lib/commonjs/styles/createScaleFactor.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 +15 -11
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +3 -8
- 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 +10 -3
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/styles/createScaleFactor.js +2 -1
- package/lib/module/styles/createScaleFactor.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 +15 -9
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +4 -8
- 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 +2 -1
- package/lib/typescript/src/styles/getDefaultHeaderHeight.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 +3 -2
- 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 +8 -3
- package/src/styles/createScaleFactor.ts +2 -1
- 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 +18 -9
- package/src/ui/Header/index.tsx +9 -17
- 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
package/src/ui/MenuBar/index.tsx
CHANGED
|
@@ -23,7 +23,7 @@ export type MenuBarProps = {
|
|
|
23
23
|
actionLabel?: string;
|
|
24
24
|
actionItem?: React.ReactNode;
|
|
25
25
|
};
|
|
26
|
-
const MenuBar
|
|
26
|
+
const MenuBar = ({
|
|
27
27
|
variant = 'default',
|
|
28
28
|
disabled,
|
|
29
29
|
onPress,
|
|
@@ -33,7 +33,7 @@ const MenuBar: React.FC<MenuBarProps> = ({
|
|
|
33
33
|
iconBackgroundColor,
|
|
34
34
|
actionLabel,
|
|
35
35
|
actionItem = null,
|
|
36
|
-
}) => {
|
|
36
|
+
}: MenuBarProps) => {
|
|
37
37
|
const { palette, colors } = useUIKitTheme();
|
|
38
38
|
|
|
39
39
|
return (
|
package/src/ui/Modal/index.tsx
CHANGED
|
@@ -34,7 +34,7 @@ type Props = {
|
|
|
34
34
|
* Modal Close: Triggered by Modal.props.onClose() call
|
|
35
35
|
* - Modal.props.onClose() -> visible false -> animation start -> modalVisible false
|
|
36
36
|
* */
|
|
37
|
-
const Modal
|
|
37
|
+
const Modal = ({
|
|
38
38
|
children,
|
|
39
39
|
onClose,
|
|
40
40
|
backgroundStyle,
|
|
@@ -45,7 +45,7 @@ const Modal: React.FC<Props> = ({
|
|
|
45
45
|
enableKeyboardAvoid = false,
|
|
46
46
|
statusBarTranslucent,
|
|
47
47
|
...props
|
|
48
|
-
}) => {
|
|
48
|
+
}: Props) => {
|
|
49
49
|
const { palette } = useUIKitTheme();
|
|
50
50
|
const { content, backdrop, showTransition, hideTransition } = useModalAnimation(type);
|
|
51
51
|
const panResponder = useModalPanResponder(type, content.translateY, showTransition, onClose);
|
|
@@ -19,7 +19,7 @@ type Props = {
|
|
|
19
19
|
onPressRetry?: () => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const Placeholder
|
|
22
|
+
const Placeholder = ({ icon, loading = false, message = '', errorRetryLabel, onPressRetry }: Props) => {
|
|
23
23
|
const { colors } = useUIKitTheme();
|
|
24
24
|
|
|
25
25
|
// loading ? styles.containerLoading : errorRetryLabel ? styles.containerError : styles.container
|
package/src/ui/Prompt/index.tsx
CHANGED
|
@@ -28,7 +28,7 @@ type Props = {
|
|
|
28
28
|
onDismiss?: () => void;
|
|
29
29
|
autoFocus?: boolean;
|
|
30
30
|
} & PromptItem;
|
|
31
|
-
const Prompt
|
|
31
|
+
const Prompt = ({
|
|
32
32
|
onDismiss,
|
|
33
33
|
visible,
|
|
34
34
|
onHide,
|
|
@@ -40,7 +40,7 @@ const Prompt: React.FC<Props> = ({
|
|
|
40
40
|
onCancel = NOOP,
|
|
41
41
|
submitLabel = 'Submit',
|
|
42
42
|
cancelLabel = 'Cancel',
|
|
43
|
-
}) => {
|
|
43
|
+
}: Props) => {
|
|
44
44
|
const { statusBarTranslucent } = useHeaderStyle();
|
|
45
45
|
const { colors } = useUIKitTheme();
|
|
46
46
|
const inputRef = useRef<RNTextInput>(null);
|
package/src/ui/Switch/index.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Animated, Platform, Pressable } from 'react-native';
|
|
|
4
4
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
type SwitchProps = React.PropsWithChildren<{
|
|
8
8
|
trackColor?: string;
|
|
9
9
|
thumbColor?: string;
|
|
10
10
|
inactiveThumbColor?: string;
|
|
@@ -12,15 +12,15 @@ interface SwitchProps {
|
|
|
12
12
|
|
|
13
13
|
value: boolean;
|
|
14
14
|
onChangeValue: (val: boolean) => void;
|
|
15
|
-
}
|
|
16
|
-
const Switch
|
|
15
|
+
}>;
|
|
16
|
+
const Switch = ({
|
|
17
17
|
value,
|
|
18
18
|
onChangeValue,
|
|
19
19
|
inactiveThumbColor,
|
|
20
20
|
inactiveTrackColor,
|
|
21
21
|
trackColor,
|
|
22
22
|
thumbColor,
|
|
23
|
-
}) => {
|
|
23
|
+
}: SwitchProps) => {
|
|
24
24
|
const { select, palette, colors } = useUIKitTheme();
|
|
25
25
|
const position = useRef(new Animated.Value(0)).current;
|
|
26
26
|
|
package/src/ui/Text/index.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { TypoName, UIKitTheme } from '../../types';
|
|
|
6
6
|
|
|
7
7
|
type TypographyProps = Partial<Record<TypoName, boolean>>;
|
|
8
8
|
export type TextProps = RNTextProps & TypographyProps & { color?: ((colors: UIKitTheme['colors']) => string) | string };
|
|
9
|
-
const Text
|
|
9
|
+
const Text = ({ children, color, style, ...props }: TextProps) => {
|
|
10
10
|
const { colors } = useUIKitTheme();
|
|
11
11
|
const typoStyle = useTypographyFilter(props);
|
|
12
12
|
return (
|
package/src/ui/Toast/index.tsx
CHANGED
|
@@ -12,13 +12,13 @@ type Context = { show(text: string, type?: ToastType): void };
|
|
|
12
12
|
|
|
13
13
|
const ToastContext = createContext<Context | null>(null);
|
|
14
14
|
|
|
15
|
-
type Props = {
|
|
15
|
+
type Props = React.PropsWithChildren<{
|
|
16
16
|
top?: number;
|
|
17
17
|
bottom?: number;
|
|
18
18
|
visible: boolean;
|
|
19
19
|
type: ToastType;
|
|
20
20
|
children: string;
|
|
21
|
-
}
|
|
21
|
+
}>;
|
|
22
22
|
|
|
23
23
|
const useOpacity = () => {
|
|
24
24
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
@@ -32,7 +32,8 @@ const useOpacity = () => {
|
|
|
32
32
|
hide: () => transition(0),
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
const Toast = ({ visible, type, children, top, bottom }: Props) => {
|
|
36
37
|
const { colors, select, palette } = useUIKitTheme();
|
|
37
38
|
const { opacity, show, hide } = useOpacity();
|
|
38
39
|
|
|
@@ -67,7 +68,10 @@ const Toast: React.FC<Props> = ({ visible, type, children, top, bottom }) => {
|
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
const VISIBLE_MS = 3000;
|
|
70
|
-
export const ToastProvider
|
|
71
|
+
export const ToastProvider = ({
|
|
72
|
+
children,
|
|
73
|
+
dismissTimeout = VISIBLE_MS,
|
|
74
|
+
}: React.PropsWithChildren<{ dismissTimeout?: number }>) => {
|
|
71
75
|
const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });
|
|
72
76
|
const { bottom } = useSafeAreaInsets();
|
|
73
77
|
|
|
@@ -18,7 +18,7 @@ type Props = TextProps & {
|
|
|
18
18
|
onPressUrl?: OnPressUrl;
|
|
19
19
|
strict?: boolean;
|
|
20
20
|
};
|
|
21
|
-
const URLParsedText
|
|
21
|
+
const URLParsedText = ({ children, onPressUrl = openUrl, strict, ...props }: Props) => {
|
|
22
22
|
const parsedChildren = useMemo((): React.ReactNode => {
|
|
23
23
|
return React.Children.map(React.Children.toArray(children), (child) => {
|
|
24
24
|
if (typeof child === 'string') {
|