@sendbird/uikit-react-native-foundation 3.7.5 → 3.8.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/bundle-icons.js.map +1 -1
- package/lib/commonjs/assets/icon/icon-thread.png +0 -0
- package/lib/commonjs/assets/icon/icon-thread@2x.png +0 -0
- package/lib/commonjs/assets/icon/icon-thread@3x.png +0 -0
- package/lib/commonjs/assets/icon/index.js +1 -2
- package/lib/commonjs/assets/icon/index.js.map +1 -1
- package/lib/commonjs/components/Box/index.js +8 -10
- package/lib/commonjs/components/Box/index.js.map +1 -1
- package/lib/commonjs/components/Divider/index.js +6 -8
- package/lib/commonjs/components/Divider/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +36 -18
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Image/FastImageInternal.js +1 -2
- package/lib/commonjs/components/Image/FastImageInternal.js.map +1 -1
- package/lib/commonjs/components/Image/Image.fastimage.js +14 -17
- package/lib/commonjs/components/Image/Image.fastimage.js.map +1 -1
- package/lib/commonjs/components/Image/Image.reactnative.js +10 -12
- package/lib/commonjs/components/Image/Image.reactnative.js.map +1 -1
- package/lib/commonjs/components/Image/index.js +1 -2
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/components/ImageWithPlaceholder/index.js +5 -7
- package/lib/commonjs/components/ImageWithPlaceholder/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +28 -37
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/PressBox/index.js +17 -20
- package/lib/commonjs/components/PressBox/index.js.map +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +24 -16
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -1
- package/lib/commonjs/components/RegexText/index.js +11 -14
- package/lib/commonjs/components/RegexText/index.js.map +1 -1
- package/lib/commonjs/components/Switch/index.js +19 -19
- package/lib/commonjs/components/Switch/index.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +46 -29
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/TextInput/index.js +38 -18
- package/lib/commonjs/components/TextInput/index.js.map +1 -1
- package/lib/commonjs/components/VideoThumbnail/index.js +11 -13
- package/lib/commonjs/components/VideoThumbnail/index.js.map +1 -1
- package/lib/commonjs/index.js +3 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js +8 -10
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/styles/createScaleFactor.js +3 -6
- package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
- package/lib/commonjs/styles/createSelectByColorScheme.js +1 -2
- package/lib/commonjs/styles/createSelectByColorScheme.js.map +1 -1
- package/lib/commonjs/styles/createStyleSheet.js +9 -4
- package/lib/commonjs/styles/createStyleSheet.js.map +1 -1
- package/lib/commonjs/styles/createTypography.js +2 -5
- package/lib/commonjs/styles/createTypography.js.map +1 -1
- package/lib/commonjs/styles/getDefaultHeaderHeight.js +1 -2
- package/lib/commonjs/styles/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/styles/useHeaderStyle.js +1 -2
- package/lib/commonjs/styles/useHeaderStyle.js.map +1 -1
- package/lib/commonjs/theme/DarkUIKitTheme.js +2 -3
- package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/LightUIKitTheme.js +2 -3
- package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/Palette.js +1 -2
- package/lib/commonjs/theme/Palette.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeContext.js +2 -3
- package/lib/commonjs/theme/UIKitThemeContext.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeProvider.js +6 -8
- package/lib/commonjs/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/createTheme.js +11 -13
- package/lib/commonjs/theme/createTheme.js.map +1 -1
- package/lib/commonjs/theme/useUIKitTheme.js +2 -3
- package/lib/commonjs/theme/useUIKitTheme.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js +17 -17
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js +23 -29
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarGroup.js +13 -15
- package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js +8 -10
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarStack.js +13 -15
- package/lib/commonjs/ui/Avatar/AvatarStack.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js +14 -17
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js +10 -12
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js +30 -39
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js +19 -23
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js +8 -10
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogBox.js +6 -8
- package/lib/commonjs/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js +23 -22
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/Dialog/index.js +11 -12
- package/lib/commonjs/ui/Dialog/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.admin.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/Message.admin.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.image.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.image.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.js +6 -8
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.video.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.video.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js +8 -9
- package/lib/commonjs/ui/GroupChannelMessage/Message.file.voice.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js +5 -7
- package/lib/commonjs/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.js +8 -12
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.og.js +16 -20
- package/lib/commonjs/ui/GroupChannelMessage/Message.user.og.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/MessageBubbleWithText.js +28 -24
- package/lib/commonjs/ui/GroupChannelMessage/MessageBubbleWithText.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/MessageContainer.js +29 -31
- package/lib/commonjs/ui/GroupChannelMessage/MessageContainer.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/MessageOpenGraph.js +38 -43
- package/lib/commonjs/ui/GroupChannelMessage/MessageOpenGraph.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelMessage/index.js +2 -3
- package/lib/commonjs/ui/GroupChannelMessage/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js +55 -61
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +45 -56
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js +14 -18
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js +23 -21
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.js +6 -8
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js +6 -8
- package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.js +28 -20
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js +54 -49
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js +16 -19
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/index.js +2 -3
- package/lib/commonjs/ui/OpenChannelMessage/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelPreview/index.js +25 -30
- package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/OutlinedButton/index.js +7 -9
- package/lib/commonjs/ui/OutlinedButton/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js +9 -11
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/ProfileCard/index.js +11 -12
- package/lib/commonjs/ui/ProfileCard/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js +30 -37
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js +21 -27
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/commonjs/ui/TypingIndicatorBubble/index.js +25 -32
- package/lib/commonjs/ui/TypingIndicatorBubble/index.js.map +1 -1
- package/lib/module/assets/bundle-icons.js.map +1 -1
- package/lib/module/assets/icon/icon-thread.png +0 -0
- package/lib/module/assets/icon/icon-thread@2x.png +0 -0
- package/lib/module/assets/icon/icon-thread@3x.png +0 -0
- package/lib/module/assets/icon/index.js.map +1 -1
- package/lib/module/components/Box/index.js +6 -7
- package/lib/module/components/Box/index.js.map +1 -1
- package/lib/module/components/Divider/index.js +4 -5
- package/lib/module/components/Divider/index.js.map +1 -1
- package/lib/module/components/Icon/index.js +35 -16
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Image/FastImageInternal.js.map +1 -1
- package/lib/module/components/Image/Image.fastimage.js +12 -14
- package/lib/module/components/Image/Image.fastimage.js.map +1 -1
- package/lib/module/components/Image/Image.reactnative.js +8 -9
- package/lib/module/components/Image/Image.reactnative.js.map +1 -1
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/components/ImageWithPlaceholder/index.js +1 -2
- package/lib/module/components/ImageWithPlaceholder/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +24 -32
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/PressBox/index.js +10 -12
- package/lib/module/components/PressBox/index.js.map +1 -1
- package/lib/module/components/ProgressBar/index.js +21 -12
- package/lib/module/components/ProgressBar/index.js.map +1 -1
- package/lib/module/components/RegexText/index.js +9 -11
- package/lib/module/components/RegexText/index.js.map +1 -1
- package/lib/module/components/Switch/index.js +16 -15
- package/lib/module/components/Switch/index.js.map +1 -1
- package/lib/module/components/Text/index.js +45 -27
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/TextInput/index.js +37 -16
- package/lib/module/components/TextInput/index.js.map +1 -1
- package/lib/module/components/VideoThumbnail/index.js +8 -10
- package/lib/module/components/VideoThumbnail/index.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js +6 -7
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/styles/createScaleFactor.js +1 -2
- package/lib/module/styles/createScaleFactor.js.map +1 -1
- package/lib/module/styles/createSelectByColorScheme.js.map +1 -1
- package/lib/module/styles/createStyleSheet.js +8 -2
- package/lib/module/styles/createStyleSheet.js.map +1 -1
- package/lib/module/styles/createTypography.js +1 -3
- package/lib/module/styles/createTypography.js.map +1 -1
- package/lib/module/styles/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/styles/useHeaderStyle.js.map +1 -1
- package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/module/theme/LightUIKitTheme.js.map +1 -1
- package/lib/module/theme/Palette.js.map +1 -1
- package/lib/module/theme/UIKitThemeContext.js.map +1 -1
- package/lib/module/theme/UIKitThemeProvider.js +4 -5
- package/lib/module/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/module/theme/createTheme.js +9 -10
- package/lib/module/theme/createTheme.js.map +1 -1
- package/lib/module/theme/useUIKitTheme.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js +13 -12
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js +21 -26
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarGroup.js +11 -12
- package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js +6 -7
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarStack.js +11 -12
- package/lib/module/ui/Avatar/AvatarStack.js.map +1 -1
- package/lib/module/ui/Avatar/index.js +10 -12
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js +8 -9
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js +28 -36
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js +17 -20
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js +6 -7
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogBox.js +4 -5
- package/lib/module/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js +21 -19
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/Dialog/index.js +8 -9
- package/lib/module/ui/Dialog/index.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.admin.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.image.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.js +4 -5
- package/lib/module/ui/GroupChannelMessage/Message.file.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.video.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.file.voice.js +4 -4
- package/lib/module/ui/GroupChannelMessage/Message.file.voice.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.unknown.js +3 -4
- package/lib/module/ui/GroupChannelMessage/Message.unknown.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.user.js +6 -9
- package/lib/module/ui/GroupChannelMessage/Message.user.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/Message.user.og.js +14 -17
- package/lib/module/ui/GroupChannelMessage/Message.user.og.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/MessageBubbleWithText.js +26 -21
- package/lib/module/ui/GroupChannelMessage/MessageBubbleWithText.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/MessageContainer.js +27 -28
- package/lib/module/ui/GroupChannelMessage/MessageContainer.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/MessageOpenGraph.js +36 -40
- package/lib/module/ui/GroupChannelMessage/MessageOpenGraph.js.map +1 -1
- package/lib/module/ui/GroupChannelMessage/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js +53 -58
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +44 -54
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js +10 -13
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js +21 -18
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.admin.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.image.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.js +4 -5
- package/lib/module/ui/OpenChannelMessage/Message.file.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.unknown.js +4 -5
- package/lib/module/ui/OpenChannelMessage/Message.unknown.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.user.js +26 -17
- package/lib/module/ui/OpenChannelMessage/Message.user.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.user.og.js +52 -46
- package/lib/module/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js +14 -16
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/index.js.map +1 -1
- package/lib/module/ui/OpenChannelPreview/index.js +23 -27
- package/lib/module/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/module/ui/OutlinedButton/index.js +5 -6
- package/lib/module/ui/OutlinedButton/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js +7 -8
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/ProfileCard/index.js +9 -9
- package/lib/module/ui/ProfileCard/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js +26 -32
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js +17 -22
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/module/ui/TypingIndicatorBubble/index.js +21 -27
- package/lib/module/ui/TypingIndicatorBubble/index.js.map +1 -1
- package/lib/typescript/src/components/Box/index.d.ts +12 -2
- package/lib/typescript/src/components/Icon/index.d.ts +2 -1
- package/lib/typescript/src/components/Text/index.d.ts +14 -2
- package/lib/typescript/src/components/TextInput/index.d.ts +2 -1
- package/package.json +3 -3
- package/src/assets/icon/icon-thread.png +0 -0
- package/src/assets/icon/icon-thread@2x.png +0 -0
- package/src/assets/icon/icon-thread@3x.png +0 -0
- package/src/components/Box/index.tsx +16 -5
- package/src/components/Icon/index.tsx +35 -3
- package/src/components/ProgressBar/index.tsx +23 -12
- package/src/components/Switch/index.tsx +10 -6
- package/src/components/Text/index.tsx +48 -7
- package/src/components/TextInput/index.tsx +39 -12
- package/src/styles/createStyleSheet.ts +8 -2
- package/src/ui/ActionMenu/index.tsx +3 -1
- package/src/ui/Alert/index.tsx +4 -4
- package/src/ui/Avatar/AvatarGroup.tsx +6 -6
- package/src/ui/Avatar/AvatarStack.tsx +3 -3
- package/src/ui/BottomSheet/index.tsx +5 -4
- package/src/ui/Button/index.tsx +1 -1
- package/src/ui/Dialog/DialogSheet.tsx +15 -12
- package/src/ui/GroupChannelMessage/Message.file.tsx +1 -1
- package/src/ui/GroupChannelMessage/Message.file.voice.tsx +1 -1
- package/src/ui/GroupChannelMessage/MessageBubbleWithText.tsx +5 -2
- package/src/ui/GroupChannelMessage/MessageContainer.tsx +7 -7
- package/src/ui/GroupChannelPreview/index.tsx +46 -48
- package/src/ui/Header/index.tsx +4 -5
- package/src/ui/MenuBar/index.tsx +9 -6
- package/src/ui/OpenChannelMessage/Message.file.tsx +1 -1
- package/src/ui/OpenChannelMessage/Message.user.og.tsx +43 -29
- package/src/ui/OpenChannelMessage/Message.user.tsx +46 -29
- package/src/ui/OpenChannelMessage/MessageContainer.tsx +4 -4
- package/src/ui/OpenChannelPreview/index.tsx +9 -9
- package/src/ui/ProfileCard/index.tsx +1 -0
- package/src/ui/Prompt/index.tsx +4 -5
- package/src/ui/Toast/index.tsx +1 -1
- package/src/ui/TypingIndicatorBubble/index.tsx +2 -2
|
@@ -9,20 +9,19 @@ import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
|
9
9
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
10
10
|
import Button from '../Button';
|
|
11
11
|
import DialogBox from '../Dialog/DialogBox';
|
|
12
|
-
const Prompt =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
12
|
+
const Prompt = ({
|
|
13
|
+
onDismiss,
|
|
14
|
+
visible,
|
|
15
|
+
onHide,
|
|
16
|
+
autoFocus = true,
|
|
17
|
+
title,
|
|
18
|
+
defaultValue = '',
|
|
19
|
+
placeholder = 'Enter',
|
|
20
|
+
onSubmit = NOOP,
|
|
21
|
+
onCancel = NOOP,
|
|
22
|
+
submitLabel = 'Submit',
|
|
23
|
+
cancelLabel = 'Cancel'
|
|
24
|
+
}) => {
|
|
26
25
|
const {
|
|
27
26
|
statusBarTranslucent
|
|
28
27
|
} = useHeaderStyle();
|
|
@@ -53,8 +52,8 @@ const Prompt = _ref => {
|
|
|
53
52
|
if (autoFocus && visible) {
|
|
54
53
|
setTimeout(() => {
|
|
55
54
|
var _inputRef$current, _inputRef$current2;
|
|
56
|
-
if (Platform.OS === 'android') (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0
|
|
57
|
-
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0
|
|
55
|
+
if (Platform.OS === 'android') (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
|
|
56
|
+
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.focus();
|
|
58
57
|
}, 250);
|
|
59
58
|
}
|
|
60
59
|
}, [autoFocus, visible, `${width}-${height}`]);
|
|
@@ -64,7 +63,7 @@ const Prompt = _ref => {
|
|
|
64
63
|
onClose: onHide,
|
|
65
64
|
onDismiss: () => {
|
|
66
65
|
setText('');
|
|
67
|
-
onDismiss === null || onDismiss === void 0
|
|
66
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
68
67
|
},
|
|
69
68
|
statusBarTranslucent: statusBarTranslucent,
|
|
70
69
|
visible: visible,
|
|
@@ -79,10 +78,7 @@ const Prompt = _ref => {
|
|
|
79
78
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
80
79
|
h1: true,
|
|
81
80
|
color: colors.ui.dialog.default.none.text,
|
|
82
|
-
numberOfLines: 1
|
|
83
|
-
style: {
|
|
84
|
-
flex: 1
|
|
85
|
-
}
|
|
81
|
+
numberOfLines: 1
|
|
86
82
|
}, title)), /*#__PURE__*/React.createElement(View, {
|
|
87
83
|
style: styles.inputContainer
|
|
88
84
|
}, /*#__PURE__*/React.createElement(TextInput, {
|
|
@@ -93,18 +89,17 @@ const Prompt = _ref => {
|
|
|
93
89
|
value: text,
|
|
94
90
|
onChangeText: setText,
|
|
95
91
|
style: {
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
paddingStart: 0,
|
|
93
|
+
paddingEnd: 0,
|
|
98
94
|
paddingTop: 10,
|
|
99
95
|
paddingBottom: 10
|
|
100
96
|
}
|
|
101
97
|
})), /*#__PURE__*/React.createElement(View, {
|
|
102
98
|
style: styles.buttonContainer
|
|
103
|
-
}, buttons.map((
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} = _ref2;
|
|
99
|
+
}, buttons.map(({
|
|
100
|
+
text,
|
|
101
|
+
onPress
|
|
102
|
+
}, index) => {
|
|
108
103
|
return /*#__PURE__*/React.createElement(Button, {
|
|
109
104
|
key: text + index,
|
|
110
105
|
variant: 'text',
|
|
@@ -113,7 +108,7 @@ const Prompt = _ref => {
|
|
|
113
108
|
onPress: () => {
|
|
114
109
|
Keyboard.dismiss();
|
|
115
110
|
try {
|
|
116
|
-
onPress === null || onPress === void 0
|
|
111
|
+
onPress === null || onPress === void 0 || onPress();
|
|
117
112
|
} finally {
|
|
118
113
|
onHide();
|
|
119
114
|
}
|
|
@@ -129,8 +124,7 @@ const styles = createStyleSheet({
|
|
|
129
124
|
marginBottom: 12,
|
|
130
125
|
paddingVertical: 12,
|
|
131
126
|
paddingHorizontal: 24,
|
|
132
|
-
|
|
133
|
-
alignItems: 'center'
|
|
127
|
+
alignItems: 'flex-start'
|
|
134
128
|
},
|
|
135
129
|
inputContainer: {
|
|
136
130
|
paddingHorizontal: 24,
|
|
@@ -143,7 +137,7 @@ const styles = createStyleSheet({
|
|
|
143
137
|
padding: 12
|
|
144
138
|
},
|
|
145
139
|
button: {
|
|
146
|
-
|
|
140
|
+
marginStart: 8
|
|
147
141
|
}
|
|
148
142
|
});
|
|
149
143
|
export default Prompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Keyboard","Platform","View","useWindowDimensions","NOOP","Modal","Text","TextInput","createStyleSheet","useHeaderStyle","useUIKitTheme","Button","DialogBox","Prompt","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Keyboard","Platform","View","useWindowDimensions","NOOP","Modal","Text","TextInput","createStyleSheet","useHeaderStyle","useUIKitTheme","Button","DialogBox","Prompt","onDismiss","visible","onHide","autoFocus","title","defaultValue","placeholder","onSubmit","onCancel","submitLabel","cancelLabel","statusBarTranslucent","colors","inputRef","width","height","buttons","text","onPress","setText","setTimeout","_inputRef$current","_inputRef$current2","OS","current","blur","focus","createElement","enableKeyboardAvoid","disableBackgroundClose","onClose","backgroundStyle","alignItems","justifyContent","style","styles","container","Boolean","titleContainer","h1","color","ui","dialog","default","none","numberOfLines","inputContainer","ref","variant","value","onChangeText","paddingStart","paddingEnd","paddingTop","paddingBottom","buttonContainer","map","index","key","button","contentColor","highlight","dismiss","marginBottom","paddingVertical","paddingHorizontal","flexDirection","padding","marginStart"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Keyboard, Platform, TextInput as RNTextInput, View, useWindowDimensions } from 'react-native';\n\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport Modal from '../../components/Modal';\nimport Text from '../../components/Text';\nimport TextInput from '../../components/TextInput';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useHeaderStyle from '../../styles/useHeaderStyle';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Button from '../Button';\nimport DialogBox from '../Dialog/DialogBox';\n\nexport type PromptItem = {\n title: string;\n placeholder?: string;\n defaultValue?: string;\n onSubmit?: (text: string) => void;\n submitLabel?: string;\n onCancel?: () => void;\n cancelLabel?: string;\n};\n\ntype Props = {\n visible: boolean;\n onHide: () => void;\n onDismiss?: () => void;\n autoFocus?: boolean;\n} & PromptItem;\nconst Prompt = ({\n onDismiss,\n visible,\n onHide,\n autoFocus = true,\n title,\n defaultValue = '',\n placeholder = 'Enter',\n onSubmit = NOOP,\n onCancel = NOOP,\n submitLabel = 'Submit',\n cancelLabel = 'Cancel',\n}: Props) => {\n const { statusBarTranslucent } = useHeaderStyle();\n const { colors } = useUIKitTheme();\n const inputRef = useRef<RNTextInput>(null);\n const { width, height } = useWindowDimensions();\n\n const buttons = [\n { text: cancelLabel, onPress: onCancel },\n { text: submitLabel, onPress: () => onSubmit(text) },\n ];\n\n const [text, setText] = useState(defaultValue);\n\n // FIXME: autoFocus trick with modal\n // Android\n // - InputProps.autoFocus is not trigger keyboard appearing.\n // - InputRef.focus() is trigger keyboard appearing, but position of keyboard selection is always the start of text.\n // iOS\n // - InputProps.autoFocus is trigger weird UI behavior on landscape mode.\n useEffect(() => {\n if (autoFocus && visible) {\n setTimeout(() => {\n if (Platform.OS === 'android') inputRef.current?.blur();\n inputRef.current?.focus();\n }, 250);\n }\n }, [autoFocus, visible, `${width}-${height}`]);\n\n return (\n <Modal\n enableKeyboardAvoid\n disableBackgroundClose\n onClose={onHide}\n onDismiss={() => {\n setText('');\n onDismiss?.();\n }}\n statusBarTranslucent={statusBarTranslucent}\n visible={visible}\n backgroundStyle={{ alignItems: 'center', justifyContent: 'center' }}\n >\n <DialogBox style={styles.container}>\n {Boolean(title) && (\n <View style={styles.titleContainer}>\n <Text h1 color={colors.ui.dialog.default.none.text} numberOfLines={1}>\n {title}\n </Text>\n </View>\n )}\n\n <View style={styles.inputContainer}>\n <TextInput\n autoFocus={autoFocus && Platform.OS === 'android'}\n ref={inputRef}\n placeholder={placeholder}\n variant={'underline'}\n value={text}\n onChangeText={setText}\n style={{ paddingStart: 0, paddingEnd: 0, paddingTop: 10, paddingBottom: 10 }}\n />\n </View>\n\n <View style={styles.buttonContainer}>\n {buttons.map(({ text, onPress }, index) => {\n return (\n <Button\n key={text + index}\n variant={'text'}\n style={styles.button}\n contentColor={colors.ui.dialog.default.none.highlight}\n onPress={() => {\n Keyboard.dismiss();\n try {\n onPress?.();\n } finally {\n onHide();\n }\n }}\n >\n {text}\n </Button>\n );\n })}\n </View>\n </DialogBox>\n </Modal>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n paddingTop: 8,\n },\n titleContainer: {\n marginBottom: 12,\n paddingVertical: 12,\n paddingHorizontal: 24,\n alignItems: 'flex-start',\n },\n inputContainer: {\n paddingHorizontal: 24,\n marginBottom: 12,\n },\n buttonContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-end',\n padding: 12,\n },\n button: {\n marginStart: 8,\n },\n});\n\nexport default Prompt;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,QAAQ,EAAEC,QAAQ,EAA4BC,IAAI,EAAEC,mBAAmB,QAAQ,cAAc;A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,EAAE;IAChBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBjC,UAAU,EAAE;EACd,CAAC;EACDc,cAAc,EAAE;IACdmB,iBAAiB,EAAE,EAAE;IACrBF,YAAY,EAAE;EAChB,CAAC;EACDR,eAAe,EAAE;IACfW,aAAa,EAAE,KAAK;IACpBlC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,UAAU;IAC1BkC,OAAO,EAAE;EACX,CAAC;EACDR,MAAM,EAAE;IACNS,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,eAAerE,MAAM","ignoreList":[]}
|
|
@@ -21,14 +21,13 @@ const useOpacity = () => {
|
|
|
21
21
|
hide: () => transition(0)
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
const Toast =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
24
|
+
const Toast = ({
|
|
25
|
+
visible,
|
|
26
|
+
type,
|
|
27
|
+
children,
|
|
28
|
+
top,
|
|
29
|
+
bottom
|
|
30
|
+
}) => {
|
|
32
31
|
const {
|
|
33
32
|
colors,
|
|
34
33
|
select,
|
|
@@ -83,11 +82,10 @@ const Toast = _ref => {
|
|
|
83
82
|
}, children));
|
|
84
83
|
};
|
|
85
84
|
const VISIBLE_MS = 3000;
|
|
86
|
-
export const ToastProvider =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} = _ref2;
|
|
85
|
+
export const ToastProvider = ({
|
|
86
|
+
children,
|
|
87
|
+
dismissTimeout = VISIBLE_MS
|
|
88
|
+
}) => {
|
|
91
89
|
const [state, setState] = useState({
|
|
92
90
|
visible: false,
|
|
93
91
|
type: 'error',
|
|
@@ -108,14 +106,11 @@ export const ToastProvider = _ref2 => {
|
|
|
108
106
|
});
|
|
109
107
|
return /*#__PURE__*/React.createElement(ToastContext.Provider, {
|
|
110
108
|
value: {
|
|
111
|
-
show:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
visible: true
|
|
117
|
-
});
|
|
118
|
-
}
|
|
109
|
+
show: (text, type = 'normal') => text && setState({
|
|
110
|
+
text,
|
|
111
|
+
type,
|
|
112
|
+
visible: true
|
|
113
|
+
})
|
|
119
114
|
}
|
|
120
115
|
}, children, /*#__PURE__*/React.createElement(KeyboardAvoidingView, {
|
|
121
116
|
behavior: Platform.OS === 'ios' ? 'position' : undefined,
|
|
@@ -144,7 +139,7 @@ const styles = createStyleSheet({
|
|
|
144
139
|
flexDirection: 'row'
|
|
145
140
|
},
|
|
146
141
|
icon: {
|
|
147
|
-
|
|
142
|
+
marginEnd: 4
|
|
148
143
|
},
|
|
149
144
|
text: {
|
|
150
145
|
maxWidth: 240,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","useEffect","useMemo","useRef","useState","Animated","KeyboardAvoidingView","Platform","useSafeAreaInsets","Icon","Text","createStyleSheet","useUIKitTheme","ToastContext","useOpacity","opacity","Value","current","transition","value","timing","toValue","duration","useNativeDriver","start","show","hide","Toast","
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useEffect","useMemo","useRef","useState","Animated","KeyboardAvoidingView","Platform","useSafeAreaInsets","Icon","Text","createStyleSheet","useUIKitTheme","ToastContext","useOpacity","opacity","Value","current","transition","value","timing","toValue","duration","useNativeDriver","start","show","hide","Toast","visible","type","children","top","bottom","colors","select","palette","color","dark","error300","light","error200","secondary300","secondary200","backgroundColor","createElement","View","pointerEvents","style","styles","toast","icon","containerStyle","onBackgroundReverse01","body3","numberOfLines","text","VISIBLE_MS","ToastProvider","dismissTimeout","state","setState","hideTimeout","setTimeout","prev","clearTimeout","Provider","behavior","OS","undefined","keyboardVerticalOffset","toastPosition","useToast","context","Error","position","height","paddingHorizontal","justifyContent","alignItems","alignSelf","borderRadius","flexDirection","marginEnd","maxWidth"],"sources":["index.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { Animated, KeyboardAvoidingView, Platform } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport Icon from '../../components/Icon';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype ToastType = 'normal' | 'error' | 'success';\ntype Context = { show(text: string, type?: ToastType): void };\n\nconst ToastContext = createContext<Context | null>(null);\n\ntype Props = React.PropsWithChildren<{\n top?: number;\n bottom?: number;\n visible: boolean;\n type: ToastType;\n children: string;\n}>;\n\nconst useOpacity = () => {\n const opacity = useRef(new Animated.Value(0)).current;\n const transition = (value: number) => {\n Animated.timing(opacity, { toValue: value, duration: 500, useNativeDriver: true }).start();\n };\n\n return {\n opacity,\n show: () => transition(1),\n hide: () => transition(0),\n };\n};\n\nconst Toast = ({ visible, type, children, top, bottom }: Props) => {\n const { colors, select, palette } = useUIKitTheme();\n const { opacity, show, hide } = useOpacity();\n\n const color = useMemo(() => {\n if (type === 'error') {\n return select({ dark: palette.error300, light: palette.error200 });\n }\n if (type === 'success') {\n return select({ dark: palette.secondary300, light: palette.secondary200 });\n }\n return 'transparent';\n }, [type, select]);\n\n const backgroundColor = useMemo(() => {\n return select({ light: 'rgba(0,0,0,0.64)', dark: 'rgba(255,255,255,0.64)' });\n }, [select]);\n\n useEffect(() => {\n visible ? show() : hide();\n }, [visible]);\n\n return (\n <Animated.View pointerEvents={'none'} style={[styles.toast, { opacity, top, bottom, backgroundColor }]}>\n {type !== 'normal' && (\n <Icon icon={type === 'success' ? 'done' : 'error'} color={color} containerStyle={styles.icon} />\n )}\n <Text color={colors.onBackgroundReverse01} body3 numberOfLines={2} style={styles.text}>\n {children}\n </Text>\n </Animated.View>\n );\n};\n\nconst VISIBLE_MS = 3000;\nexport const ToastProvider = ({\n children,\n dismissTimeout = VISIBLE_MS,\n}: React.PropsWithChildren<{ dismissTimeout?: number }>) => {\n const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });\n const { bottom } = useSafeAreaInsets();\n\n useEffect(() => {\n if (!state.visible) return;\n\n const hideTimeout = setTimeout(() => {\n setState((prev) => ({ ...prev, visible: false }));\n }, dismissTimeout);\n return () => clearTimeout(hideTimeout);\n });\n\n return (\n <ToastContext.Provider value={{ show: (text, type = 'normal') => text && setState({ text, type, visible: true }) }}>\n {children}\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'position' : undefined}\n keyboardVerticalOffset={-bottom}\n pointerEvents={'none'}\n >\n <Toast type={state.type} visible={state.visible} bottom={bottom + styles.toastPosition.bottom}>\n {state.text}\n </Toast>\n </KeyboardAvoidingView>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = () => {\n const context = useContext(ToastContext);\n if (!context) throw new Error('ToastContext is not provided, wrap your app with ToastProvider');\n return context;\n};\n\nconst styles = createStyleSheet({\n toast: {\n position: 'absolute',\n height: 48,\n paddingHorizontal: 12,\n justifyContent: 'center',\n alignItems: 'center',\n alignSelf: 'center',\n borderRadius: 24,\n flexDirection: 'row',\n },\n icon: {\n marginEnd: 4,\n },\n text: {\n maxWidth: 240,\n paddingHorizontal: 4,\n },\n toastPosition: {\n bottom: 60,\n },\n});\n\nexport default Toast;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC9F,SAASC,QAAQ,EAAEC,oBAAoB,EAAEC,QAAQ,QAAQ,cAAc;AACvE,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AAKrD,MAAMC,YAAY,gBAAGd,aAAa,CAAiB,IAAI,CAAC;AAUxD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AChB,CAAC;AAED,MAAMxB,MAAM,GAAGrC,gBAAgB,CAAC;EAC9BsC,KAAK,EAAE;IACLyB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,EAAE;IACVC,iBAAiB,EAAE,EAAE;IACrBC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,QAAQ;IACnBC,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE;EACjB,CAAC;EACD/B,IAAI,EAAE;IACJgC,SAAS,EAAE;EACb,CAAC;EACD3B,IAAI,EAAE;IACJ4B,QAAQ,EAAE,GAAG;IACbP,iBAAiB,EAAE;EACrB,CAAC;EACDN,aAAa,EAAE;IACbtC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAeL,KAAK","ignoreList":[]}
|
|
@@ -4,12 +4,11 @@ import Box from '../../components/Box';
|
|
|
4
4
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
6
|
import Avatar from '../Avatar';
|
|
7
|
-
const TypingIndicatorBubble =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
7
|
+
const TypingIndicatorBubble = ({
|
|
8
|
+
typingUsers,
|
|
9
|
+
containerStyle,
|
|
10
|
+
maxAvatar
|
|
11
|
+
}) => {
|
|
13
12
|
const {
|
|
14
13
|
select,
|
|
15
14
|
palette,
|
|
@@ -32,7 +31,7 @@ const TypingIndicatorBubble = _ref => {
|
|
|
32
31
|
})
|
|
33
32
|
},
|
|
34
33
|
containerStyle: {
|
|
35
|
-
|
|
34
|
+
marginEnd: 12
|
|
36
35
|
}
|
|
37
36
|
}, typingUsers.map((user, index) => /*#__PURE__*/React.createElement(Avatar, {
|
|
38
37
|
key: index,
|
|
@@ -45,24 +44,20 @@ const TypingIndicatorBubble = _ref => {
|
|
|
45
44
|
backgroundColor: colors.onBackground02
|
|
46
45
|
}));
|
|
47
46
|
};
|
|
48
|
-
const TypingDots =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} = _ref2;
|
|
47
|
+
const TypingDots = ({
|
|
48
|
+
dotColor,
|
|
49
|
+
backgroundColor
|
|
50
|
+
}) => {
|
|
53
51
|
const animation = useRef(new Animated.Value(0)).current;
|
|
54
|
-
const dots = matrix.map(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
extrapolate: 'clamp'
|
|
64
|
-
})];
|
|
65
|
-
});
|
|
52
|
+
const dots = matrix.map(([timeline, scale, opacity]) => [animation.interpolate({
|
|
53
|
+
inputRange: timeline,
|
|
54
|
+
outputRange: scale,
|
|
55
|
+
extrapolate: 'clamp'
|
|
56
|
+
}), animation.interpolate({
|
|
57
|
+
inputRange: timeline,
|
|
58
|
+
outputRange: opacity,
|
|
59
|
+
extrapolate: 'clamp'
|
|
60
|
+
})]);
|
|
66
61
|
useEffect(() => {
|
|
67
62
|
const animated = Animated.loop(Animated.timing(animation, {
|
|
68
63
|
toValue: 1.4,
|
|
@@ -81,12 +76,11 @@ const TypingDots = _ref2 => {
|
|
|
81
76
|
paddingHorizontal: 12,
|
|
82
77
|
height: 34,
|
|
83
78
|
backgroundColor: dotColor
|
|
84
|
-
}, dots.map((
|
|
85
|
-
let [scale, opacity] = _ref4;
|
|
79
|
+
}, dots.map(([scale, opacity], index) => {
|
|
86
80
|
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
87
81
|
key: index,
|
|
88
82
|
style: [styles.dot, {
|
|
89
|
-
|
|
83
|
+
marginEnd: index === dots.length - 1 ? 0 : 6,
|
|
90
84
|
opacity: opacity,
|
|
91
85
|
transform: [{
|
|
92
86
|
scale: scale
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","Animated","Easing","Box","createStyleSheet","useUIKitTheme","Avatar","TypingIndicatorBubble","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","Animated","Easing","Box","createStyleSheet","useUIKitTheme","Avatar","TypingIndicatorBubble","typingUsers","containerStyle","maxAvatar","select","palette","colors","length","createElement","flexDirection","justifyContent","alignItems","style","Stack","size","styles","remainsTextColor","onBackground02","remainsBackgroundColor","light","background100","dark","background400","marginEnd","map","user","index","key","uri","profileUrl","TypingDots","dotColor","backgroundColor","animation","Value","current","dots","matrix","timeline","scale","opacity","interpolate","inputRange","outputRange","extrapolate","animated","loop","timing","toValue","duration","easing","linear","useNativeDriver","start","reset","borderRadius","paddingHorizontal","height","View","dot","transform","width"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated, Easing, StyleProp, ViewStyle } from 'react-native';\n\nimport type { SendbirdUser } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\n\ntype Props = {\n typingUsers: SendbirdUser[];\n containerStyle?: StyleProp<ViewStyle>;\n maxAvatar?: number;\n};\n\nconst TypingIndicatorBubble = ({ typingUsers, containerStyle, maxAvatar }: Props) => {\n const { select, palette, colors } = useUIKitTheme();\n\n if (typingUsers.length === 0) return null;\n\n return (\n <Box flexDirection={'row'} justifyContent={'flex-start'} alignItems={'center'} style={containerStyle}>\n <Avatar.Stack\n size={26}\n maxAvatar={maxAvatar}\n styles={{\n remainsTextColor: colors.onBackground02,\n remainsBackgroundColor: select({ light: palette.background100, dark: palette.background400 }),\n }}\n containerStyle={{ marginEnd: 12 }}\n >\n {typingUsers.map((user, index) => (\n <Avatar key={index} uri={user.profileUrl} />\n ))}\n </Avatar.Stack>\n <TypingDots\n dotColor={select({ light: palette.background100, dark: palette.background400 })}\n backgroundColor={colors.onBackground02}\n />\n </Box>\n );\n};\n\ntype TypingDotsProps = {\n dotColor: string;\n backgroundColor: string;\n};\nconst TypingDots = ({ dotColor, backgroundColor }: TypingDotsProps) => {\n const animation = useRef(new Animated.Value(0)).current;\n const dots = matrix.map(([timeline, scale, opacity]) => [\n animation.interpolate({ inputRange: timeline, outputRange: scale, extrapolate: 'clamp' }),\n animation.interpolate({ inputRange: timeline, outputRange: opacity, extrapolate: 'clamp' }),\n ]);\n\n useEffect(() => {\n const animated = Animated.loop(\n Animated.timing(animation, { toValue: 1.4, duration: 1400, easing: Easing.linear, useNativeDriver: true }),\n );\n animated.start();\n return () => animated.reset();\n }, []);\n\n return (\n <Box\n flexDirection={'row'}\n alignItems={'center'}\n justifyContent={'center'}\n borderRadius={16}\n paddingHorizontal={12}\n height={34}\n backgroundColor={dotColor}\n >\n {dots.map(([scale, opacity], index) => {\n return (\n <Animated.View\n key={index}\n style={[\n styles.dot,\n {\n marginEnd: index === dots.length - 1 ? 0 : 6,\n opacity: opacity,\n transform: [{ scale: scale }],\n backgroundColor: backgroundColor,\n },\n ]}\n />\n );\n })}\n </Box>\n );\n};\n\nconst matrix = [\n [\n [0.4, 0.7, 1.0],\n [1.0, 1.2, 1.0],\n [0.12, 0.38, 0.12],\n ],\n [\n [0.6, 0.9, 1.2],\n [1.0, 1.2, 1.0],\n [0.12, 0.38, 0.12],\n ],\n [\n [0.8, 1.1, 1.4],\n [1.0, 1.2, 1.0],\n [0.12, 0.38, 0.12],\n ],\n];\n\nconst styles = createStyleSheet({\n dot: {\n width: 8,\n height: 8,\n borderRadius: 4,\n },\n});\n\nexport default TypingIndicatorBubble;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,QAAQ,EAAEC,MAAM,QAA8B,cAAc;AAIrE,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,MAAM,MAAM,WAAW;AAQ9B,MAAMC,qBAAqB,GAAGA,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Xd,KAAK,EAAE,CACLG,MAAM,CAAC4C,GAAG,EACV;QACEpC,SAAS,EAAEG,KAAK,KAAKU,IAAI,CAAC7B,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;QAC5CiC,OAAO,EAAEA,OAAO;QAChBoB,SAAS,EAAE,CAAC;UAAErB,KAAK,EAAEA;QAAM,CAAC,CAAC;QAC7BP,eAAe,EAAEA;MACnB,CAAC;IACD,CACH,CAAC;EAEN,CAAC,CACE,CAAC;AAEV,CAAC;AAED,MAAMK,MAAM,GAAG,CACb,CACE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACf,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACf,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CACnB,EACD,CACE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACf,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACf,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CACnB,EACD,CACE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACf,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACf,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CACnB,CACF;AAED,MAAMtB,MAAM,GAAGlB,gBAAgB,CAAC;EAC9B8D,GAAG,EAAE;IACHE,KAAK,EAAE,CAAC;IACRJ,MAAM,EAAE,CAAC;IACTF,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAevD,qBAAqB","ignoreList":[]}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewProps, ViewStyle } from 'react-native';
|
|
3
3
|
import type { UIKitColors, UIKitPalette } from '../../types';
|
|
4
|
-
type
|
|
4
|
+
type DeprecatedBoxProps = {
|
|
5
|
+
/** @deprecated Please use `paddingStart` instead **/
|
|
6
|
+
paddingLeft?: ViewStyle['paddingLeft'];
|
|
7
|
+
/** @deprecated Please use `paddingEnd` instead **/
|
|
8
|
+
paddingRight?: ViewStyle['paddingRight'];
|
|
9
|
+
/** @deprecated Please use `marginStart` instead **/
|
|
10
|
+
marginLeft?: ViewStyle['marginLeft'];
|
|
11
|
+
/** @deprecated Please use `marginEnd` instead **/
|
|
12
|
+
marginRight?: ViewStyle['marginRight'];
|
|
13
|
+
};
|
|
14
|
+
type BaseBoxProps = Pick<ViewStyle, 'flex' | 'flexShrink' | 'flexGrow' | 'flexDirection' | 'alignItems' | 'justifyContent' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'borderBottomColor' | 'borderBottomWidth' | 'margin' | 'marginHorizontal' | 'marginVertical' | 'marginStart' | 'marginEnd' | 'marginTop' | 'marginBottom' | 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingStart' | 'paddingEnd' | 'paddingTop' | 'paddingBottom' | 'overflow' | 'width' | 'height'> & {
|
|
5
15
|
backgroundColor?: string | ((theme: {
|
|
6
16
|
colors: UIKitColors;
|
|
7
17
|
palette: UIKitPalette;
|
|
8
18
|
}) => string);
|
|
9
19
|
};
|
|
10
|
-
type BoxProps = BaseBoxProps & ViewProps;
|
|
20
|
+
type BoxProps = BaseBoxProps & DeprecatedBoxProps & ViewProps;
|
|
11
21
|
declare const Box: ({ style, children, ...props }: BoxProps) => React.JSX.Element;
|
|
12
22
|
export default Box;
|
|
@@ -9,8 +9,9 @@ type Props = {
|
|
|
9
9
|
size?: number;
|
|
10
10
|
style?: StyleProp<ImageStyle>;
|
|
11
11
|
containerStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
direction?: 'ltr' | 'rtl';
|
|
12
13
|
};
|
|
13
|
-
declare const _default: (({ icon, color, size, containerStyle, style }: Props) => React.JSX.Element) & {
|
|
14
|
+
declare const _default: (({ icon, color, size, containerStyle, style, direction, }: Props) => React.JSX.Element) & {
|
|
14
15
|
Assets: {
|
|
15
16
|
'chat-hide': any;
|
|
16
17
|
'chat-show': any;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextProps as RNTextProps } from 'react-native';
|
|
3
3
|
import type { TypoName, UIKitTheme } from '../../types';
|
|
4
|
+
export interface RTLTextAlignSupportProps {
|
|
5
|
+
/**
|
|
6
|
+
* If `I18nManager.isRTL` is `true` and this value is enabled, the text will be aligned according to RTL if it starts in an RTL language.
|
|
7
|
+
* In the case of the `Text` component, the alignment value is calculated based on `I18nManager.doLeftAndRightSwapInRTL`.
|
|
8
|
+
* For the `TextInput` component, the alignment value is calculated as a physical alignment, unaffected by `I18nManager.doLeftAndRightSwapInRTL`.
|
|
9
|
+
*/
|
|
10
|
+
supportRTLAlign?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* If you want to enable `supportRTLAlign` but are using nested `Text` components that are not simple text under the `Text` component, pass the original text here.
|
|
13
|
+
*/
|
|
14
|
+
originalText?: string;
|
|
15
|
+
}
|
|
4
16
|
type TypographyProps = Partial<Record<TypoName, boolean>>;
|
|
5
17
|
export type TextProps = RNTextProps & TypographyProps & {
|
|
6
18
|
color?: ((colors: UIKitTheme['colors']) => string) | string;
|
|
7
|
-
};
|
|
8
|
-
declare const Text: ({ children, color, style, ...props }: TextProps) => React.JSX.Element;
|
|
19
|
+
} & RTLTextAlignSupportProps;
|
|
20
|
+
declare const Text: ({ children, color, style, supportRTLAlign, originalText, ...props }: TextProps) => React.JSX.Element;
|
|
9
21
|
export default Text;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInput as RNTextInput, TextInputProps } from 'react-native';
|
|
3
|
+
import { RTLTextAlignSupportProps } from '../Text';
|
|
3
4
|
declare const TextInput: React.ForwardRefExoticComponent<{
|
|
4
5
|
variant?: "default" | "underline" | undefined;
|
|
5
|
-
} & TextInputProps & React.RefAttributes<RNTextInput>>;
|
|
6
|
+
} & TextInputProps & RTLTextAlignSupportProps & React.RefAttributes<RNTextInput>>;
|
|
6
7
|
export default TextInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "A foundational UI kit for building chat-enabled React Native apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sendbird",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sendbird/uikit-utils": "3.
|
|
51
|
+
"@sendbird/uikit-utils": "3.8.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react": "*",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
]
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "bec311112e7b16076db18c6597c73f6ffb3489ad"
|
|
89
89
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,6 +6,17 @@ import { isFunction } from '@sendbird/uikit-utils';
|
|
|
6
6
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
7
|
import type { UIKitColors, UIKitPalette } from '../../types';
|
|
8
8
|
|
|
9
|
+
type DeprecatedBoxProps = {
|
|
10
|
+
/** @deprecated Please use `paddingStart` instead **/
|
|
11
|
+
paddingLeft?: ViewStyle['paddingLeft'];
|
|
12
|
+
/** @deprecated Please use `paddingEnd` instead **/
|
|
13
|
+
paddingRight?: ViewStyle['paddingRight'];
|
|
14
|
+
/** @deprecated Please use `marginStart` instead **/
|
|
15
|
+
marginLeft?: ViewStyle['marginLeft'];
|
|
16
|
+
/** @deprecated Please use `marginEnd` instead **/
|
|
17
|
+
marginRight?: ViewStyle['marginRight'];
|
|
18
|
+
};
|
|
19
|
+
|
|
9
20
|
type BaseBoxProps = Pick<
|
|
10
21
|
ViewStyle,
|
|
11
22
|
| 'flex'
|
|
@@ -22,15 +33,15 @@ type BaseBoxProps = Pick<
|
|
|
22
33
|
| 'margin'
|
|
23
34
|
| 'marginHorizontal'
|
|
24
35
|
| 'marginVertical'
|
|
25
|
-
| '
|
|
26
|
-
| '
|
|
36
|
+
| 'marginStart'
|
|
37
|
+
| 'marginEnd'
|
|
27
38
|
| 'marginTop'
|
|
28
39
|
| 'marginBottom'
|
|
29
40
|
| 'padding'
|
|
30
41
|
| 'paddingHorizontal'
|
|
31
42
|
| 'paddingVertical'
|
|
32
|
-
| '
|
|
33
|
-
| '
|
|
43
|
+
| 'paddingStart'
|
|
44
|
+
| 'paddingEnd'
|
|
34
45
|
| 'paddingTop'
|
|
35
46
|
| 'paddingBottom'
|
|
36
47
|
| 'overflow'
|
|
@@ -40,7 +51,7 @@ type BaseBoxProps = Pick<
|
|
|
40
51
|
backgroundColor?: string | ((theme: { colors: UIKitColors; palette: UIKitPalette }) => string);
|
|
41
52
|
};
|
|
42
53
|
|
|
43
|
-
type BoxProps = BaseBoxProps & ViewProps;
|
|
54
|
+
type BoxProps = BaseBoxProps & DeprecatedBoxProps & ViewProps;
|
|
44
55
|
const Box = ({ style, children, ...props }: BoxProps) => {
|
|
45
56
|
const boxStyle = useBoxStyle(props);
|
|
46
57
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image, ImageStyle, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
2
|
+
import { I18nManager, Image, ImageStyle, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { FileType, convertFileTypeToMessageType, getFileIconFromMessageType } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
@@ -10,23 +10,55 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
|
10
10
|
type IconNames = keyof typeof IconAssets;
|
|
11
11
|
type SizeFactor = keyof typeof sizeStyles;
|
|
12
12
|
|
|
13
|
+
const mirroredIcons: Partial<Record<IconNames, boolean>> = {
|
|
14
|
+
create: true,
|
|
15
|
+
send: true,
|
|
16
|
+
reply: true,
|
|
17
|
+
'reply-filled': true,
|
|
18
|
+
thread: true,
|
|
19
|
+
chat: true,
|
|
20
|
+
'chat-filled': true,
|
|
21
|
+
message: true,
|
|
22
|
+
broadcast: true,
|
|
23
|
+
'file-audio': true,
|
|
24
|
+
'arrow-left': true,
|
|
25
|
+
leave: true,
|
|
26
|
+
'chevron-right': true,
|
|
27
|
+
};
|
|
28
|
+
|
|
13
29
|
type Props = {
|
|
14
30
|
icon: IconNames;
|
|
15
31
|
color?: string;
|
|
16
32
|
size?: number;
|
|
17
33
|
style?: StyleProp<ImageStyle>;
|
|
18
34
|
containerStyle?: StyleProp<ViewStyle>;
|
|
35
|
+
direction?: 'ltr' | 'rtl';
|
|
19
36
|
};
|
|
20
37
|
|
|
21
|
-
const Icon = ({
|
|
38
|
+
const Icon = ({
|
|
39
|
+
icon,
|
|
40
|
+
color,
|
|
41
|
+
size = 24,
|
|
42
|
+
containerStyle,
|
|
43
|
+
style,
|
|
44
|
+
direction = I18nManager.isRTL ? 'rtl' : 'ltr',
|
|
45
|
+
}: Props) => {
|
|
22
46
|
const sizeStyle = sizeStyles[size as SizeFactor] ?? { width: size, height: size };
|
|
23
47
|
const { colors } = useUIKitTheme();
|
|
48
|
+
|
|
49
|
+
const shouldMirror = direction === 'rtl' && mirroredIcons[icon];
|
|
50
|
+
|
|
24
51
|
return (
|
|
25
52
|
<View style={[containerStyle, containerStyles.container]}>
|
|
26
53
|
<Image
|
|
27
54
|
resizeMode={'contain'}
|
|
28
55
|
source={IconAssets[icon]}
|
|
29
|
-
style={[
|
|
56
|
+
style={[
|
|
57
|
+
{ tintColor: color ?? colors.primary },
|
|
58
|
+
sizeStyle,
|
|
59
|
+
shouldMirror && { transform: [{ scaleX: -1 }] },
|
|
60
|
+
style,
|
|
61
|
+
]}
|
|
30
62
|
/>
|
|
31
63
|
</View>
|
|
32
64
|
);
|