@sendbird/uikit-react-native-foundation 1.1.2 → 2.0.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/{ui → components}/Divider/index.js +0 -0
- package/lib/commonjs/{ui → components}/Divider/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Icon/index.js +0 -0
- package/lib/commonjs/{ui → components}/Icon/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Modal/index.js +0 -0
- package/lib/commonjs/{ui → components}/Modal/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Switch/index.js +0 -0
- package/lib/commonjs/{ui → components}/Switch/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Text/index.js +0 -0
- package/lib/commonjs/{ui → components}/Text/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/TextInput/index.js +0 -0
- package/lib/commonjs/{ui → components}/TextInput/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/URLParsedText/index.js +0 -0
- package/lib/commonjs/{ui → components}/URLParsedText/index.js.map +0 -0
- package/lib/commonjs/index.js +14 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js +4 -4
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js +4 -4
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js +2 -2
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js +2 -2
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js +2 -2
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js +2 -2
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js +4 -4
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js +2 -2
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js +5 -4
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js +4 -4
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +2 -2
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js +2 -2
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js +5 -5
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js +4 -4
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js +6 -6
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js +4 -4
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/module/{ui → components}/Divider/index.js +0 -0
- package/lib/module/{ui → components}/Divider/index.js.map +0 -0
- package/lib/module/{ui → components}/Icon/index.js +0 -0
- package/lib/module/{ui → components}/Icon/index.js.map +0 -0
- package/lib/module/{ui → components}/Modal/index.js +0 -0
- package/lib/module/{ui → components}/Modal/index.js.map +0 -0
- package/lib/module/{ui → components}/Switch/index.js +0 -0
- package/lib/module/{ui → components}/Switch/index.js.map +0 -0
- package/lib/module/{ui → components}/Text/index.js +0 -0
- package/lib/module/{ui → components}/Text/index.js.map +0 -0
- package/lib/module/{ui → components}/TextInput/index.js +0 -0
- package/lib/module/{ui → components}/TextInput/index.js.map +0 -0
- package/lib/module/{ui → components}/URLParsedText/index.js +0 -0
- package/lib/module/{ui → components}/URLParsedText/index.js.map +0 -0
- package/lib/module/index.js +7 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js +2 -2
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js +2 -2
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/index.js +1 -1
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js +1 -1
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js +1 -1
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js +2 -2
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js +3 -2
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js +2 -2
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +1 -1
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js +1 -1
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js +3 -3
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js +2 -2
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js +3 -3
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js +2 -2
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/typescript/src/{ui → components}/Divider/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Icon/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Modal/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Switch/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Text/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/TextInput/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/URLParsedText/index.d.ts +0 -0
- package/lib/typescript/src/index.d.ts +7 -7
- package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +1 -1
- package/lib/typescript/src/ui/BottomSheet/index.d.ts +1 -1
- package/lib/typescript/src/ui/Button/index.d.ts +1 -1
- package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +1 -1
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +1 -1
- package/lib/typescript/src/ui/Header/index.d.ts +1 -1
- package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
- package/lib/typescript/src/ui/Placeholder/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/{ui → components}/Divider/index.tsx +0 -0
- package/src/{ui → components}/Icon/index.tsx +0 -0
- package/src/{ui → components}/Modal/index.tsx +0 -0
- package/src/{ui → components}/Switch/index.tsx +0 -0
- package/src/{ui → components}/Text/index.tsx +0 -0
- package/src/{ui → components}/TextInput/index.tsx +0 -0
- package/src/{ui → components}/URLParsedText/index.tsx +0 -0
- package/src/index.ts +8 -7
- package/src/ui/ActionMenu/index.tsx +2 -2
- package/src/ui/Alert/index.tsx +2 -2
- package/src/ui/Avatar/AvatarIcon.tsx +1 -1
- package/src/ui/Avatar/index.tsx +1 -1
- package/src/ui/Badge/index.tsx +1 -1
- package/src/ui/BottomSheet/index.tsx +2 -2
- package/src/ui/Button/index.tsx +2 -2
- package/src/ui/ChannelFrozenBanner/index.tsx +1 -1
- package/src/ui/Dialog/DialogSheet.tsx +3 -2
- package/src/ui/GroupChannelPreview/index.tsx +2 -2
- package/src/ui/Header/index.tsx +1 -1
- package/src/ui/LoadingSpinner/index.tsx +1 -1
- package/src/ui/MenuBar/index.tsx +3 -3
- package/src/ui/Placeholder/index.tsx +2 -2
- package/src/ui/Prompt/index.tsx +3 -3
- package/src/ui/Toast/index.tsx +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import Text from '../Text';
|
|
8
8
|
const ToastContext = /*#__PURE__*/createContext(null);
|
|
9
9
|
|
|
10
10
|
const useOpacity = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","Animated","useSafeAreaInsets","
|
|
1
|
+
{"version":3,"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","Animated","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","styles","toast","icon","onBackgroundReverse01","text","VISIBLE_MS","ToastProvider","dismissTimeout","state","setState","hideTimeout","setTimeout","prev","clearTimeout","toastPosition","useToast","context","Error","position","height","paddingHorizontal","justifyContent","alignItems","alignSelf","borderRadius","flexDirection","marginRight","maxWidth"],"sources":["index.tsx"],"sourcesContent":["import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { Animated } 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 = useCallback(\n (value: number) => 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 <Toast type={state.type} visible={state.visible} bottom={bottom + styles.toastPosition.bottom}>\n {state.text}\n </Toast>\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 marginRight: 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,KAAP,IAAgBC,aAAhB,EAA+BC,WAA/B,EAA4CC,UAA5C,EAAwDC,SAAxD,EAAmEC,OAAnE,EAA4EC,MAA5E,EAAoFC,QAApF,QAAoG,OAApG;AACA,SAASC,QAAT,QAAyB,cAAzB;AACA,SAASC,iBAAT,QAAkC,gCAAlC;AAEA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AAKA,MAAMC,YAAY,gBAAGb,aAAa,CAAiB,IAAjB,CAAlC;;AAUA,MAAMc,UAAU,GAAG,MAAM;EACvB,MAAMC,OAAO,GAAGV,MAAM,CAAC,IAAIE,QAAQ,CAACS,KAAb,CAAmB,CAAnB,CAAD,CAAN,CAA8BC,OAA9C;EACA,MAAMC,UAAU,GAAGjB,WAAW,CAC3BkB,KAAD,IAAmBZ,QAAQ,CAACa,MAAT,CAAgBL,OAAhB,EAAyB;IAAEM,OAAO,EAAEF,KAAX;IAAkBG,QAAQ,EAAE,GAA5B;IAAiCC,eAAe,EAAE;EAAlD,CAAzB,EAAmFC,KAAnF,EADS,EAE5B,EAF4B,CAA9B;EAIA,OAAO;IACLT,OADK;IAELU,IAAI,EAAE,MAAMP,U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OAA2BmB,IAAI,IAAIK,QAAQ,CAAC;UAAEL,IAAF;UAAQnB,IAAR;UAAcD,OAAO,EAAE;QAAvB,CAAD,CAA3C;MAAA;IAAR;EAA9B,GACGE,QADH,eAEE,oBAAC,KAAD;IAAO,IAAI,EAAEsB,KAAK,CAACvB,IAAnB;IAAyB,OAAO,EAAEuB,KAAK,CAACxB,OAAxC;IAAiD,MAAM,EAAEI,MAAM,GAAGY,MAAM,CAACc,aAAP,CAAqB1B;EAAvF,GACGoB,KAAK,CAACJ,IADT,CAFF,CADF;AAQD,CAxBM;AA0BP,OAAO,MAAMW,QAAQ,GAAG,MAAM;EAC5B,MAAMC,OAAO,GAAG1D,UAAU,CAACW,YAAD,CAA1B;EACA,IAAI,CAAC+C,OAAL,EAAc,MAAM,IAAIC,KAAJ,CAAU,gEAAV,CAAN;EACd,OAAOD,OAAP;AACD,CAJM;AAMP,MAAMhB,MAAM,GAAGjC,gBAAgB,CAAC;EAC9BkC,KAAK,EAAE;IACLiB,QAAQ,EAAE,UADL;IAELC,MAAM,EAAE,EAFH;IAGLC,iBAAiB,EAAE,EAHd;IAILC,cAAc,EAAE,QAJX;IAKLC,UAAU,EAAE,QALP;IAMLC,SAAS,EAAE,QANN;IAOLC,YAAY,EAAE,EAPT;IAQLC,aAAa,EAAE;EARV,CADuB;EAW9BvB,IAAI,EAAE;IACJwB,WAAW,EAAE;EADT,CAXwB;EAc9BtB,IAAI,EAAE;IACJuB,QAAQ,EAAE,GADN;IAEJP,iBAAiB,EAAE;EAFf,CAdwB;EAkB9BN,aAAa,EAAE;IACb1B,MAAM,EAAE;EADK;AAlBe,CAAD,CAA/B;AAuBA,eAAeL,KAAf"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/** Assets **/
|
|
2
2
|
export { default as IconAssets } from './assets/icon';
|
|
3
3
|
/** Component **/
|
|
4
|
+
export { default as Divider } from './components/Divider';
|
|
5
|
+
export { default as Icon } from './components/Icon';
|
|
4
6
|
export { default as Image } from './components/Image';
|
|
7
|
+
export { default as Modal } from './components/Modal';
|
|
8
|
+
export { default as Switch } from './components/Switch';
|
|
9
|
+
export { default as Text } from './components/Text';
|
|
10
|
+
export { default as TextInput } from './components/TextInput';
|
|
11
|
+
export { default as URLParsedText } from './components/URLParsedText';
|
|
5
12
|
/** UI **/
|
|
6
13
|
export { default as ActionMenu, ActionMenuItem } from './ui/ActionMenu';
|
|
7
14
|
export { default as Alert } from './ui/Alert';
|
|
@@ -11,20 +18,13 @@ export { default as BottomSheet, BottomSheetItem } from './ui/BottomSheet';
|
|
|
11
18
|
export { default as Button } from './ui/Button';
|
|
12
19
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
13
20
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
14
|
-
export { default as Divider } from './ui/Divider';
|
|
15
21
|
export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
16
22
|
export { default as Header } from './ui/Header';
|
|
17
|
-
export { default as Icon } from './ui/Icon';
|
|
18
23
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
19
24
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
20
|
-
export { default as Modal } from './ui/Modal';
|
|
21
25
|
export { default as Placeholder } from './ui/Placeholder';
|
|
22
26
|
export { default as Prompt } from './ui/Prompt';
|
|
23
|
-
export { default as Switch } from './ui/Switch';
|
|
24
|
-
export { default as Text } from './ui/Text';
|
|
25
|
-
export { default as TextInput } from './ui/TextInput';
|
|
26
27
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
27
|
-
export { default as URLParsedText } from './ui/URLParsedText';
|
|
28
28
|
/** Styles **/
|
|
29
29
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
30
30
|
export { default as createScaleFactor } from './styles/createScaleFactor';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import Icon from '
|
|
3
|
+
import Icon from '../../components/Icon';
|
|
4
4
|
declare type Props = React.PropsWithChildren<{
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
icon?: keyof typeof Icon.Assets;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TouchableOpacityProps } from 'react-native';
|
|
3
|
+
import { TextProps } from '../../components/Text';
|
|
3
4
|
import type { BaseHeaderProps } from '../../index';
|
|
4
|
-
import { TextProps } from '../Text';
|
|
5
5
|
declare type HeaderElement = string | React.ReactElement | null;
|
|
6
6
|
declare type HeaderProps = BaseHeaderProps<{
|
|
7
7
|
title?: HeaderElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "react-native-uikit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@sendbird/uikit-utils": "
|
|
41
|
+
"@sendbird/uikit-utils": "2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "*",
|
|
45
45
|
"@types/react-native": "*",
|
|
46
46
|
"react": "17.0.2",
|
|
47
|
-
"react-native": "0.
|
|
47
|
+
"react-native": "0.67.4",
|
|
48
48
|
"react-native-builder-bob": "^0.18.0",
|
|
49
49
|
"react-native-fast-image": "^8.5.11",
|
|
50
50
|
"react-native-safe-area-context": "^3.3.2",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"readmeFile": "./README.md",
|
|
81
81
|
"displayName": "@sendbird/uikit-react-native-foundation"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "955f7adf0891976d8553d9c3b4c171225c775bc9"
|
|
84
84
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/** Assets **/
|
|
2
2
|
export { default as IconAssets } from './assets/icon';
|
|
3
|
+
|
|
3
4
|
/** Component **/
|
|
5
|
+
export { default as Divider } from './components/Divider';
|
|
6
|
+
export { default as Icon } from './components/Icon';
|
|
4
7
|
export { default as Image } from './components/Image';
|
|
8
|
+
export { default as Modal } from './components/Modal';
|
|
9
|
+
export { default as Switch } from './components/Switch';
|
|
10
|
+
export { default as Text } from './components/Text';
|
|
11
|
+
export { default as TextInput } from './components/TextInput';
|
|
12
|
+
export { default as URLParsedText } from './components/URLParsedText';
|
|
5
13
|
|
|
6
14
|
/** UI **/
|
|
7
15
|
export { default as ActionMenu, ActionMenuItem } from './ui/ActionMenu';
|
|
@@ -12,20 +20,13 @@ export { default as BottomSheet, BottomSheetItem } from './ui/BottomSheet';
|
|
|
12
20
|
export { default as Button } from './ui/Button';
|
|
13
21
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
14
22
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
15
|
-
export { default as Divider } from './ui/Divider';
|
|
16
23
|
export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
17
24
|
export { default as Header } from './ui/Header';
|
|
18
|
-
export { default as Icon } from './ui/Icon';
|
|
19
25
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
20
26
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
21
|
-
export { default as Modal } from './ui/Modal';
|
|
22
27
|
export { default as Placeholder } from './ui/Placeholder';
|
|
23
28
|
export { default as Prompt } from './ui/Prompt';
|
|
24
|
-
export { default as Switch } from './ui/Switch';
|
|
25
|
-
export { default as Text } from './ui/Text';
|
|
26
|
-
export { default as TextInput } from './ui/TextInput';
|
|
27
29
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
28
|
-
export { default as URLParsedText } from './ui/URLParsedText';
|
|
29
30
|
|
|
30
31
|
/** Styles **/
|
|
31
32
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
@@ -3,13 +3,13 @@ import { TouchableOpacity, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { Logger } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Modal from '../../components/Modal';
|
|
7
|
+
import Text from '../../components/Text';
|
|
6
8
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
9
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
8
10
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
11
|
import DialogBox from '../Dialog/DialogBox';
|
|
10
12
|
import LoadingSpinner from '../LoadingSpinner';
|
|
11
|
-
import Modal from '../Modal';
|
|
12
|
-
import Text from '../Text';
|
|
13
13
|
|
|
14
14
|
export type ActionMenuItem = {
|
|
15
15
|
title?: string;
|
package/src/ui/Alert/index.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AlertButton, View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Modal from '../../components/Modal';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
6
8
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
9
|
import Button from '../Button';
|
|
8
10
|
import DialogBox from '../Dialog/DialogBox';
|
|
9
|
-
import Modal from '../Modal';
|
|
10
|
-
import Text from '../Text';
|
|
11
11
|
|
|
12
12
|
export type AlertItem = {
|
|
13
13
|
title?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
4
5
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
6
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
icon: keyof typeof Icon.Assets;
|
package/src/ui/Avatar/index.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Icon from '../../components/Icon';
|
|
6
7
|
import Image from '../../components/Image';
|
|
7
8
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
8
9
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
10
|
import AvatarGroup from './AvatarGroup';
|
|
11
11
|
import AvatarIcon from './AvatarIcon';
|
|
12
12
|
|
package/src/ui/Badge/index.tsx
CHANGED
|
@@ -3,9 +3,9 @@ import { Platform, StyleProp, View, ViewStyle } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { truncatedBadgeCount } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Text from '../../components/Text';
|
|
6
7
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
8
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
|
-
import Text from '../Text';
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
11
|
count: number;
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { TouchableOpacity, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
+
import type Icon from '../../components/Icon';
|
|
6
|
+
import Modal from '../../components/Modal';
|
|
5
7
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
6
8
|
import DialogSheet from '../Dialog/DialogSheet';
|
|
7
|
-
import type Icon from '../Icon';
|
|
8
|
-
import Modal from '../Modal';
|
|
9
9
|
|
|
10
10
|
export type BottomSheetItem = {
|
|
11
11
|
sheetItems: {
|
package/src/ui/Button/index.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import Text from '../Text';
|
|
8
8
|
|
|
9
9
|
type Props = React.PropsWithChildren<{
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Text from '../../components/Text';
|
|
4
5
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
6
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Text from '../Text';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import Text from '../Text';
|
|
8
8
|
|
|
9
9
|
type Props = React.PropsWithChildren<{
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
@@ -64,6 +64,7 @@ const styles = createStyleSheet({
|
|
|
64
64
|
marginLeft: 16,
|
|
65
65
|
},
|
|
66
66
|
sheetItemText: {
|
|
67
|
+
flex: 1,
|
|
67
68
|
marginHorizontal: 24,
|
|
68
69
|
},
|
|
69
70
|
});
|
|
@@ -3,12 +3,12 @@ import { View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Icon from '../../components/Icon';
|
|
6
7
|
import Image from '../../components/Image';
|
|
8
|
+
import Text from '../../components/Text';
|
|
7
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
8
10
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
11
|
import Badge from '../Badge';
|
|
10
|
-
import Icon from '../Icon';
|
|
11
|
-
import Text from '../Text';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
customCover?: React.ReactElement;
|
package/src/ui/Header/index.tsx
CHANGED
|
@@ -4,11 +4,11 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
4
4
|
|
|
5
5
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
6
6
|
|
|
7
|
+
import Text, { TextProps } from '../../components/Text';
|
|
7
8
|
import type { BaseHeaderProps } from '../../index';
|
|
8
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
9
10
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
10
11
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
11
|
-
import Text, { TextProps } from '../Text';
|
|
12
12
|
|
|
13
13
|
type HeaderElement = string | React.ReactElement | null;
|
|
14
14
|
type HeaderProps = BaseHeaderProps<
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { Animated, Easing, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
4
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
5
|
-
import Icon from '../Icon';
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
size?: number;
|
package/src/ui/MenuBar/index.tsx
CHANGED
|
@@ -3,11 +3,11 @@ import { Pressable, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Divider from '../../components/Divider';
|
|
7
|
+
import Icon from '../../components/Icon';
|
|
8
|
+
import Text from '../../components/Text';
|
|
6
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
10
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
|
-
import Divider from '../Divider';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
|
-
import Text from '../Text';
|
|
11
11
|
|
|
12
12
|
export type MenuBarProps = {
|
|
13
13
|
variant?: 'default' | 'contained';
|
|
@@ -3,12 +3,12 @@ import { View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Icon from '../../components/Icon';
|
|
7
|
+
import Text from '../../components/Text';
|
|
6
8
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
9
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
10
|
import Button from '../Button';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
11
|
import LoadingSpinner from '../LoadingSpinner';
|
|
11
|
-
import Text from '../Text';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
loading?: boolean;
|
package/src/ui/Prompt/index.tsx
CHANGED
|
@@ -3,14 +3,14 @@ import { Keyboard, Platform, TextInput as RNTextInput, View, useWindowDimensions
|
|
|
3
3
|
|
|
4
4
|
import { NOOP } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Modal from '../../components/Modal';
|
|
7
|
+
import Text from '../../components/Text';
|
|
8
|
+
import TextInput from '../../components/TextInput';
|
|
6
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
10
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
8
11
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
12
|
import Button from '../Button';
|
|
10
13
|
import DialogBox from '../Dialog/DialogBox';
|
|
11
|
-
import Modal from '../Modal';
|
|
12
|
-
import Text from '../Text';
|
|
13
|
-
import TextInput from '../TextInput';
|
|
14
14
|
|
|
15
15
|
export type PromptItem = {
|
|
16
16
|
title: string;
|
package/src/ui/Toast/index.tsx
CHANGED
|
@@ -2,10 +2,10 @@ import React, { createContext, useCallback, useContext, useEffect, useMemo, useR
|
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
+
import Icon from '../../components/Icon';
|
|
6
|
+
import Text from '../../components/Text';
|
|
5
7
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
6
8
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
|
-
import Icon from '../Icon';
|
|
8
|
-
import Text from '../Text';
|
|
9
9
|
|
|
10
10
|
type ToastType = 'normal' | 'error' | 'success';
|
|
11
11
|
type Context = { show(text: string, type?: ToastType): void };
|