@bigbinary/neetoui-rn 2.3.4 → 3.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/README.md +118 -0
- package/lib/typescript/src/components/Alert/Alert.d.ts +32 -0
- package/lib/typescript/src/components/Alert/Alert.d.ts.map +1 -0
- package/lib/typescript/src/components/Alert/index.d.ts +2 -0
- package/lib/typescript/src/components/Alert/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Avatar/Avatar.d.ts +21 -0
- package/lib/typescript/src/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/src/components/Avatar/index.d.ts +2 -0
- package/lib/typescript/src/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +61 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +2 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheetMenu/BottomSheetMenu.d.ts +28 -0
- package/lib/typescript/src/components/BottomSheetMenu/BottomSheetMenu.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheetMenu/index.d.ts +2 -0
- package/lib/typescript/src/components/BottomSheetMenu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/Button.d.ts +79 -0
- package/lib/typescript/src/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/index.d.ts +2 -0
- package/lib/typescript/src/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts +11 -0
- package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/ChatInput.d.ts +78 -0
- package/lib/typescript/src/components/ChatInput/ChatInput.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/IconButton.d.ts +16 -0
- package/lib/typescript/src/components/ChatInput/IconButton.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts +13 -0
- package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/constants.d.ts +9 -0
- package/lib/typescript/src/components/ChatInput/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/index.d.ts +4 -0
- package/lib/typescript/src/components/ChatInput/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/mentions.d.ts +26 -0
- package/lib/typescript/src/components/ChatInput/mentions.d.ts.map +1 -0
- package/lib/typescript/src/components/CheckBox/CheckBox.d.ts +13 -0
- package/lib/typescript/src/components/CheckBox/CheckBox.d.ts.map +1 -0
- package/lib/typescript/src/components/CheckBox/index.d.ts +2 -0
- package/lib/typescript/src/components/CheckBox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Container/Container.d.ts +9 -0
- package/lib/typescript/src/components/Container/Container.d.ts.map +1 -0
- package/lib/typescript/src/components/Container/index.d.ts +2 -0
- package/lib/typescript/src/components/Container/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider/Divider.d.ts +7 -0
- package/lib/typescript/src/components/Divider/Divider.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider/index.d.ts +2 -0
- package/lib/typescript/src/components/Divider/index.d.ts.map +1 -0
- package/lib/typescript/src/components/EmptyView/EmptyView.d.ts +26 -0
- package/lib/typescript/src/components/EmptyView/EmptyView.d.ts.map +1 -0
- package/lib/typescript/src/components/EmptyView/index.d.ts +2 -0
- package/lib/typescript/src/components/EmptyView/index.d.ts.map +1 -0
- package/lib/typescript/src/components/FlashList/FlashList.d.ts +14 -0
- package/lib/typescript/src/components/FlashList/FlashList.d.ts.map +1 -0
- package/lib/typescript/src/components/FlashList/index.d.ts +2 -0
- package/lib/typescript/src/components/FlashList/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Header/BaseHeader.d.ts +5 -0
- package/lib/typescript/src/components/Header/BaseHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/Header/Header.d.ts +21 -0
- package/lib/typescript/src/components/Header/Header.d.ts.map +1 -0
- package/lib/typescript/src/components/Header/ScreenHeader.d.ts +11 -0
- package/lib/typescript/src/components/Header/ScreenHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/Header/index.d.ts +4 -0
- package/lib/typescript/src/components/Header/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/Input.d.ts +15 -0
- package/lib/typescript/src/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/index.d.ts +2 -0
- package/lib/typescript/src/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Loader/Loader.d.ts +12 -0
- package/lib/typescript/src/components/Loader/Loader.d.ts.map +1 -0
- package/lib/typescript/src/components/Loader/index.d.ts +2 -0
- package/lib/typescript/src/components/Loader/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NeetoUIProvider/NeetoUIProvider.d.ts +16 -0
- package/lib/typescript/src/components/NeetoUIProvider/NeetoUIProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/NeetoUIProvider/index.d.ts +2 -0
- package/lib/typescript/src/components/NeetoUIProvider/index.d.ts.map +1 -0
- package/lib/typescript/src/components/OnBoarding/OnBoarding.d.ts +22 -0
- package/lib/typescript/src/components/OnBoarding/OnBoarding.d.ts.map +1 -0
- package/lib/typescript/src/components/OnBoarding/index.d.ts +2 -0
- package/lib/typescript/src/components/OnBoarding/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ParentView/ParentView.d.ts +13 -0
- package/lib/typescript/src/components/ParentView/ParentView.d.ts.map +1 -0
- package/lib/typescript/src/components/ParentView/index.d.ts +2 -0
- package/lib/typescript/src/components/ParentView/index.d.ts.map +1 -0
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +12 -0
- package/lib/typescript/src/components/RadioButton/RadioButton.d.ts.map +1 -0
- package/lib/typescript/src/components/RadioButton/index.d.ts +2 -0
- package/lib/typescript/src/components/RadioButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/ScrollView/ScrollView.d.ts +8 -0
- package/lib/typescript/src/components/ScrollView/ScrollView.d.ts.map +1 -0
- package/lib/typescript/src/components/ScrollView/index.d.ts +2 -0
- package/lib/typescript/src/components/ScrollView/index.d.ts.map +1 -0
- package/lib/typescript/src/components/SearchBar/SearchBar.d.ts +12 -0
- package/lib/typescript/src/components/SearchBar/SearchBar.d.ts.map +1 -0
- package/lib/typescript/src/components/SearchBar/index.d.ts +2 -0
- package/lib/typescript/src/components/SearchBar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton/Skeleton.d.ts +41 -0
- package/lib/typescript/src/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/src/components/Skeleton/index.d.ts +2 -0
- package/lib/typescript/src/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/TextWithUrl/TextWithUrl.d.ts +11 -0
- package/lib/typescript/src/components/TextWithUrl/TextWithUrl.d.ts.map +1 -0
- package/lib/typescript/src/components/TextWithUrl/index.d.ts +2 -0
- package/lib/typescript/src/components/TextWithUrl/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Toast/Toast.d.ts +13 -0
- package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -0
- package/lib/typescript/src/components/Toast/ToastGlyph.d.ts +4 -0
- package/lib/typescript/src/components/Toast/ToastGlyph.d.ts.map +1 -0
- package/lib/typescript/src/components/Toast/index.d.ts +2 -0
- package/lib/typescript/src/components/Toast/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Touchable/Touchable.d.ts +23 -0
- package/lib/typescript/src/components/Touchable/Touchable.d.ts.map +1 -0
- package/lib/typescript/src/components/Touchable/index.d.ts +2 -0
- package/lib/typescript/src/components/Touchable/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Typography/Typography.d.ts +64 -0
- package/lib/typescript/src/components/Typography/Typography.d.ts.map +1 -0
- package/lib/typescript/src/components/Typography/index.d.ts +2 -0
- package/lib/typescript/src/components/Typography/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/index.d.ts +4 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useDebounce.d.ts +2 -0
- package/lib/typescript/src/hooks/useDebounce.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useNeetoTheme.d.ts +8 -0
- package/lib/typescript/src/hooks/useNeetoTheme.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useRefreshByUser.d.ts +5 -0
- package/lib/typescript/src/hooks/useRefreshByUser.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +31 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/palette.d.ts +28 -0
- package/lib/typescript/src/theme/palette.d.ts.map +1 -0
- package/lib/typescript/src/theme/palette.generated.d.ts +134 -0
- package/lib/typescript/src/theme/palette.generated.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens.d.ts +184 -0
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -0
- package/lib/typescript/src/unistyles-init.d.ts +2 -0
- package/lib/typescript/src/unistyles-init.d.ts.map +1 -0
- package/lib/typescript/src/unistyles.d.ts +21 -0
- package/lib/typescript/src/unistyles.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +18 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/scale.d.ts +2 -0
- package/lib/typescript/src/utils/scale.d.ts.map +1 -0
- package/package.json +125 -51
- package/src/components/Alert/Alert.tsx +222 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/Avatar/Avatar.tsx +123 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/BottomSheet/BottomSheet.tsx +468 -0
- package/src/components/BottomSheet/index.ts +5 -0
- package/src/components/BottomSheetMenu/BottomSheetMenu.tsx +150 -0
- package/src/components/BottomSheetMenu/index.ts +5 -0
- package/src/components/Button/Button.tsx +134 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/ChatInput/AttachmentsView.tsx +68 -0
- package/src/components/ChatInput/ChatInput.tsx +393 -0
- package/src/components/ChatInput/IconButton.tsx +52 -0
- package/src/components/ChatInput/MentionsInput.tsx +126 -0
- package/src/components/ChatInput/constants.ts +18 -0
- package/src/components/ChatInput/index.ts +11 -0
- package/src/components/ChatInput/mentions.ts +91 -0
- package/src/components/CheckBox/CheckBox.tsx +86 -0
- package/src/components/CheckBox/index.ts +1 -0
- package/src/components/Container/Container.tsx +14 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/Divider/Divider.tsx +32 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/EmptyView/EmptyView.tsx +80 -0
- package/src/components/EmptyView/index.ts +1 -0
- package/src/components/FlashList/FlashList.tsx +162 -0
- package/src/components/FlashList/index.ts +1 -0
- package/src/components/Header/BaseHeader.tsx +19 -0
- package/src/components/Header/Header.tsx +114 -0
- package/src/components/Header/ScreenHeader.tsx +34 -0
- package/src/components/Header/index.ts +3 -0
- package/src/components/Input/Input.tsx +122 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Loader/Loader.tsx +93 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/NeetoUIProvider/NeetoUIProvider.tsx +43 -0
- package/src/components/NeetoUIProvider/index.ts +1 -0
- package/src/components/OnBoarding/OnBoarding.tsx +177 -0
- package/src/components/OnBoarding/index.ts +5 -0
- package/src/components/ParentView/ParentView.tsx +98 -0
- package/src/components/ParentView/index.ts +1 -0
- package/src/components/RadioButton/RadioButton.tsx +80 -0
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/ScrollView/ScrollView.tsx +30 -0
- package/src/components/ScrollView/index.ts +1 -0
- package/src/components/SearchBar/SearchBar.tsx +122 -0
- package/src/components/SearchBar/index.ts +1 -0
- package/src/components/Skeleton/Skeleton.tsx +121 -0
- package/src/components/Skeleton/index.ts +1 -0
- package/src/components/TextWithUrl/TextWithUrl.tsx +54 -0
- package/src/components/TextWithUrl/index.ts +1 -0
- package/src/components/Toast/Toast.tsx +157 -0
- package/src/components/Toast/ToastGlyph.tsx +53 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Touchable/Touchable.tsx +54 -0
- package/src/components/Touchable/index.ts +1 -0
- package/src/components/Typography/Typography.tsx +76 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useDebounce.ts +17 -0
- package/src/hooks/useNeetoTheme.ts +10 -0
- package/src/hooks/useRefreshByUser.ts +17 -0
- package/src/index.ts +68 -0
- package/src/theme/palette.generated.ts +141 -0
- package/src/theme/palette.ts +34 -0
- package/src/theme/tokens.ts +205 -0
- package/src/types/neeto-icons-rn.d.ts +33 -0
- package/src/unistyles-init.ts +16 -0
- package/src/unistyles.ts +34 -0
- package/src/utils/index.ts +41 -0
- package/src/utils/scale.ts +16 -0
- package/components/Accordion.js +0 -1
- package/components/ActionIcon.js +0 -1
- package/components/Alert.js +0 -1
- package/components/Avatar.js +0 -1
- package/components/Badge.js +0 -1
- package/components/BottomSheet.js +0 -1
- package/components/BottomTabBar.js +0 -1
- package/components/Button.js +0 -1
- package/components/ButtonGroup.js +0 -1
- package/components/Calendar.js +0 -1
- package/components/Card.js +0 -1
- package/components/Carousel.js +0 -1
- package/components/ChatInput/AttachmentsView.js +0 -1
- package/components/ChatInput/Badge.js +0 -1
- package/components/ChatInput/ChatInput.js +0 -1
- package/components/ChatInput/EmailFields.js +0 -1
- package/components/ChatInput/IconButton.js +0 -1
- package/components/ChatInput/MentionsInputWrapper.js +0 -1
- package/components/CheckBox.js +0 -1
- package/components/Chip.js +0 -1
- package/components/Container.js +0 -1
- package/components/Divider.js +0 -1
- package/components/FAB.js +0 -1
- package/components/FlashList.js +0 -1
- package/components/FlatList.js +0 -1
- package/components/Input.js +0 -1
- package/components/InputEmailChip.js +0 -1
- package/components/LineLoader.js +0 -1
- package/components/ListItem.js +0 -1
- package/components/Loader.js +0 -1
- package/components/MultiSelect.js +0 -1
- package/components/NotificationIcon.js +0 -1
- package/components/NotificationPreferenceList.js +0 -1
- package/components/OnBoarding.js +0 -1
- package/components/OrganizationItem.js +0 -1
- package/components/OtpInputs.js +0 -1
- package/components/ParentView.js +0 -1
- package/components/Popover.js +0 -1
- package/components/RadioButton.js +0 -1
- package/components/RichTextEditor.js +0 -1
- package/components/Ripple.js +0 -1
- package/components/ScrollView.js +0 -1
- package/components/SearchBar.js +0 -1
- package/components/SegmentedTopBar/Indicator.js +0 -1
- package/components/SegmentedTopBar/Tab.js +0 -1
- package/components/SegmentedTopBar/index.js +0 -1
- package/components/SocialButton.js +0 -1
- package/components/Toast.js +0 -1
- package/components/ToggleSwitch.js +0 -1
- package/components/TopBar.js +0 -1
- package/components/Touchable.js +0 -1
- package/components/TouchableWithoutFeedback.js +0 -1
- package/components/Typography.js +0 -1
- package/components/index.js +0 -1
- package/config/index.js +0 -1
- package/config/toasterConfig.js +0 -1
- package/contexts/index.js +0 -1
- package/hooks/index.js +0 -1
- package/hooks/useDebounce.js +0 -1
- package/hooks/useKeyboard.js +0 -1
- package/hooks/useRefreshByUser.js +0 -1
- package/index.d.ts +0 -630
- package/index.js +0 -1
- package/react-native.config.js +0 -10
- package/theme/index.js +0 -1
- package/utils/index.js +0 -1
- package/utils/scale.js +0 -1
package/package.json
CHANGED
|
@@ -1,66 +1,140 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neetoui-rn",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "neeto UI component library for React Native — v3 (Unistyles, TypeScript, New Architecture)",
|
|
5
5
|
"author": "BigBinary",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
7
|
+
"repository": "https://github.com/neetozone/neeto-ui-rn",
|
|
8
|
+
"main": "./src/index.ts",
|
|
9
|
+
"react-native": "./src/index.ts",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
14
|
+
"react-native": "./src/index.ts",
|
|
15
|
+
"default": "./src/index.ts"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"src",
|
|
21
|
+
"lib",
|
|
22
|
+
"assets",
|
|
23
|
+
"!**/__tests__",
|
|
24
|
+
"!**/*.stories.tsx",
|
|
25
|
+
"!**/.*"
|
|
26
|
+
],
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"./src/unistyles-init.ts",
|
|
29
|
+
"./.storybook/unistyles-setup.ts"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "bob build",
|
|
33
|
+
"test": "jest",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
36
|
+
"format": "prettier --write .",
|
|
37
|
+
"generate:tokens": "node scripts/generate-tokens.mjs && prettier --write src/theme/palette.generated.ts",
|
|
38
|
+
"prepare": "husky install",
|
|
39
|
+
"storybook": "storybook dev -p 6006",
|
|
40
|
+
"build-storybook": "storybook build",
|
|
41
|
+
"prepack": "bob build"
|
|
42
|
+
},
|
|
43
|
+
"lint-staged": {
|
|
44
|
+
"*.{ts,tsx}": [
|
|
45
|
+
"prettier --write",
|
|
46
|
+
"eslint --fix"
|
|
47
|
+
],
|
|
48
|
+
"*.{js,json,md}": [
|
|
49
|
+
"prettier --write"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
8
52
|
"peerDependencies": {
|
|
9
|
-
"@
|
|
10
|
-
"
|
|
11
|
-
"react
|
|
12
|
-
"react-native
|
|
13
|
-
"react-native-
|
|
14
|
-
"react-native-
|
|
53
|
+
"@gorhom/bottom-sheet": "^5.0.0",
|
|
54
|
+
"@shopify/flash-list": ">=2.0.0",
|
|
55
|
+
"react": ">=19.0.0",
|
|
56
|
+
"react-native": ">=0.78.0",
|
|
57
|
+
"react-native-edge-to-edge": "*",
|
|
58
|
+
"react-native-gesture-handler": ">=2.16.1",
|
|
59
|
+
"react-native-nitro-modules": "*",
|
|
60
|
+
"react-native-reanimated": ">=3.16.0",
|
|
61
|
+
"react-native-safe-area-context": ">=4.0.0",
|
|
62
|
+
"react-native-svg": ">=15.0.0",
|
|
63
|
+
"react-native-toast-message": "^2.0.0",
|
|
64
|
+
"react-native-unistyles": ">=3.2.0"
|
|
15
65
|
},
|
|
16
|
-
"
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"react-
|
|
22
|
-
"
|
|
23
|
-
"react-native-
|
|
24
|
-
"react-native
|
|
25
|
-
"
|
|
26
|
-
"react
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@babel/core": "^7.26.0",
|
|
68
|
+
"@babel/preset-env": "^7.26.0",
|
|
69
|
+
"@gorhom/bottom-sheet": "^5",
|
|
70
|
+
"@react-native/babel-preset": "0.80.3",
|
|
71
|
+
"@react-native/normalize-colors": "0.80.3",
|
|
72
|
+
"@shopify/flash-list": "^2.3.2",
|
|
73
|
+
"@storybook/react-native-web-vite": "^10.5.5",
|
|
74
|
+
"@testing-library/react-native": "^14.0.1",
|
|
75
|
+
"@types/jest": "^29.5.14",
|
|
76
|
+
"@types/react": "^19.1.0",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
78
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
79
|
+
"eslint": "^8.57.0",
|
|
80
|
+
"eslint-config-prettier": "^9.1.0",
|
|
81
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
82
|
+
"eslint-plugin-react": "^7.37.0",
|
|
83
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
84
|
+
"eslint-plugin-react-native": "^4.1.0",
|
|
85
|
+
"eslint-plugin-unused-imports": "^3.2.0",
|
|
86
|
+
"husky": "^8.0.1",
|
|
87
|
+
"jest": "^29.7.0",
|
|
88
|
+
"lint-staged": "^15.2.0",
|
|
89
|
+
"prettier": "^3.3.3",
|
|
90
|
+
"react": "19.1.0",
|
|
91
|
+
"react-dom": "19.1.0",
|
|
92
|
+
"react-native": "0.80.3",
|
|
93
|
+
"react-native-builder-bob": "^0.43.0",
|
|
94
|
+
"react-native-edge-to-edge": "^1.8.1",
|
|
95
|
+
"react-native-gesture-handler": "^2.28.0",
|
|
96
|
+
"react-native-nitro-modules": "0.35.7",
|
|
97
|
+
"react-native-reanimated": "^3.19.0",
|
|
98
|
+
"react-native-safe-area-context": "^5.8.0",
|
|
99
|
+
"react-native-svg": "^15.15.5",
|
|
100
|
+
"react-native-toast-message": "^2",
|
|
101
|
+
"react-native-unistyles": "3.2.5",
|
|
102
|
+
"react-native-web": "^0.21.2",
|
|
103
|
+
"storybook": "^10.5.5",
|
|
104
|
+
"test-renderer": "^1.0.0",
|
|
105
|
+
"typescript": "^5.3.3",
|
|
106
|
+
"vite": "^6"
|
|
32
107
|
},
|
|
33
108
|
"jest": {
|
|
34
109
|
"preset": "react-native",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
110
|
+
"setupFiles": [
|
|
111
|
+
"./jest.setup.js"
|
|
37
112
|
],
|
|
38
113
|
"transformIgnorePatterns": [
|
|
39
|
-
"node_modules/(?!react-native)/"
|
|
114
|
+
"node_modules/(?!(@react-native|@bigbinary|@gorhom|@shopify|react-native|react-native-[^/]+)/)"
|
|
40
115
|
],
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"keywords": [
|
|
48
|
-
"components",
|
|
49
|
-
"ui",
|
|
50
|
-
"styles",
|
|
51
|
-
"layouts",
|
|
52
|
-
"react-native"
|
|
53
|
-
],
|
|
54
|
-
"config": {
|
|
55
|
-
"react-native-storybook-loader": {
|
|
56
|
-
"searchDir": [
|
|
57
|
-
"storybook/stories"
|
|
58
|
-
],
|
|
59
|
-
"pattern": "**/*.stories.js",
|
|
60
|
-
"outputFile": "./storybook/storyLoader.js"
|
|
116
|
+
"testPathIgnorePatterns": [
|
|
117
|
+
"/node_modules/",
|
|
118
|
+
"/lib/"
|
|
119
|
+
],
|
|
120
|
+
"moduleNameMapper": {
|
|
121
|
+
"^@bigbinary/neeto-icons-rn$": "<rootDir>/node_modules/@bigbinary/neeto-icons-rn/dist/icons/index.js"
|
|
61
122
|
}
|
|
62
123
|
},
|
|
63
|
-
"
|
|
64
|
-
"
|
|
124
|
+
"react-native-builder-bob": {
|
|
125
|
+
"source": "src",
|
|
126
|
+
"output": "lib",
|
|
127
|
+
"targets": [
|
|
128
|
+
[
|
|
129
|
+
"typescript",
|
|
130
|
+
{
|
|
131
|
+
"project": "tsconfig.build.json"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"dependencies": {
|
|
137
|
+
"@bigbinary/neeto-icons-rn": "^1.20.74",
|
|
138
|
+
"react-native-controlled-mentions": "^3.1.0"
|
|
65
139
|
}
|
|
66
|
-
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { Pressable, View } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
BottomSheetBackdrop,
|
|
5
|
+
BottomSheetModal,
|
|
6
|
+
BottomSheetView,
|
|
7
|
+
type BottomSheetBackdropProps,
|
|
8
|
+
} from "@gorhom/bottom-sheet";
|
|
9
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
10
|
+
|
|
11
|
+
import { moderateScale } from "../../utils/scale";
|
|
12
|
+
import { Button, type ButtonProps } from "../Button";
|
|
13
|
+
import { Typography } from "../Typography";
|
|
14
|
+
|
|
15
|
+
export type AlertButton = {
|
|
16
|
+
label: string;
|
|
17
|
+
variant?: ButtonProps["variant"];
|
|
18
|
+
onPress?: () => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type AlertParams = {
|
|
22
|
+
title: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
/** When true (default), backdrop tap / swipe-down dismiss the sheet. */
|
|
25
|
+
isCancelable?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* First button is the full-width primary action; the rest render as
|
|
28
|
+
* muted rows below it (neeto-invoice-rn ConfirmSheet layout).
|
|
29
|
+
* Defaults to a single OK.
|
|
30
|
+
*/
|
|
31
|
+
buttons?: AlertButton[];
|
|
32
|
+
/** Called once the sheet has closed, whichever path closed it. */
|
|
33
|
+
onDismiss?: () => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type AlertHost = { show: (params: AlertParams) => void };
|
|
37
|
+
|
|
38
|
+
let hostRef: AlertHost | null = null;
|
|
39
|
+
|
|
40
|
+
const DEFAULT_BUTTON: AlertButton = { label: "OK", variant: "solid" };
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Imperative confirm sheet (locked decision 2026-07-28: no centered
|
|
44
|
+
* Modal dialogs in v3 — the fleet's confirm UX is the bottom sheet that
|
|
45
|
+
* commons/invoice ship, so Alert.show presents one). The v2 Alert.show
|
|
46
|
+
* signature is unchanged. NeetoUIProvider mounts the host automatically;
|
|
47
|
+
* the bare export remains for incremental adoption.
|
|
48
|
+
*/
|
|
49
|
+
export const Alert = () => {
|
|
50
|
+
const sheetRef = useRef<BottomSheetModal>(null);
|
|
51
|
+
const hasPresentedRef = useRef(false);
|
|
52
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
53
|
+
const [params, setParams] = useState<AlertParams>({ title: "" });
|
|
54
|
+
|
|
55
|
+
const {
|
|
56
|
+
title,
|
|
57
|
+
description,
|
|
58
|
+
isCancelable = true,
|
|
59
|
+
buttons = [],
|
|
60
|
+
onDismiss,
|
|
61
|
+
} = params;
|
|
62
|
+
|
|
63
|
+
// gorhom reports the dismissal after the close animation, by which point
|
|
64
|
+
// the render that triggered it has already cleared isVisible — reading
|
|
65
|
+
// the callback from a ref keeps it reachable from that later tick.
|
|
66
|
+
const onDismissRef = useRef(onDismiss);
|
|
67
|
+
onDismissRef.current = onDismiss;
|
|
68
|
+
|
|
69
|
+
const show = useCallback((nextParams: AlertParams) => {
|
|
70
|
+
setParams(nextParams);
|
|
71
|
+
setIsVisible(true);
|
|
72
|
+
}, []);
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
hostRef = { show };
|
|
76
|
+
|
|
77
|
+
return () => {
|
|
78
|
+
hostRef = null;
|
|
79
|
+
};
|
|
80
|
+
}, [show]);
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (isVisible) {
|
|
84
|
+
hasPresentedRef.current = true;
|
|
85
|
+
sheetRef.current?.present();
|
|
86
|
+
} else if (hasPresentedRef.current) {
|
|
87
|
+
sheetRef.current?.dismiss();
|
|
88
|
+
}
|
|
89
|
+
}, [isVisible]);
|
|
90
|
+
|
|
91
|
+
const hide = () => setIsVisible(false);
|
|
92
|
+
|
|
93
|
+
// Fires for every close path — button press, backdrop tap, swipe down and
|
|
94
|
+
// Android back — so onDismiss is a reliable "the sheet is gone" signal.
|
|
95
|
+
const handleDismiss = () => {
|
|
96
|
+
hasPresentedRef.current = false;
|
|
97
|
+
setIsVisible(false);
|
|
98
|
+
onDismissRef.current?.();
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const renderBackdrop = useCallback(
|
|
102
|
+
(backdropProps: BottomSheetBackdropProps) => (
|
|
103
|
+
<BottomSheetBackdrop
|
|
104
|
+
{...backdropProps}
|
|
105
|
+
appearsOnIndex={0}
|
|
106
|
+
disappearsOnIndex={-1}
|
|
107
|
+
pressBehavior={isCancelable ? "close" : "none"}
|
|
108
|
+
/>
|
|
109
|
+
),
|
|
110
|
+
[isCancelable]
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const [primary = DEFAULT_BUTTON, ...secondary] = buttons;
|
|
114
|
+
|
|
115
|
+
const handleButtonPress = (button: AlertButton) => {
|
|
116
|
+
button.onPress?.();
|
|
117
|
+
hide();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<BottomSheetModal
|
|
122
|
+
backdropComponent={renderBackdrop}
|
|
123
|
+
backgroundStyle={styles.sheetBackground}
|
|
124
|
+
enablePanDownToClose={isCancelable}
|
|
125
|
+
handleIndicatorStyle={styles.handleIndicator}
|
|
126
|
+
ref={sheetRef}
|
|
127
|
+
onDismiss={handleDismiss}
|
|
128
|
+
>
|
|
129
|
+
<BottomSheetView style={styles.content}>
|
|
130
|
+
<View style={styles.titleContainer}>
|
|
131
|
+
<Typography size="l" style={styles.title} weight="semibold">
|
|
132
|
+
{title}
|
|
133
|
+
</Typography>
|
|
134
|
+
</View>
|
|
135
|
+
{!!description && (
|
|
136
|
+
<Typography size="s" style={styles.description}>
|
|
137
|
+
{description}
|
|
138
|
+
</Typography>
|
|
139
|
+
)}
|
|
140
|
+
<View style={styles.buttonContainer}>
|
|
141
|
+
<Button
|
|
142
|
+
label={primary.label}
|
|
143
|
+
style={styles.primaryButton}
|
|
144
|
+
variant={primary.variant ?? "solid"}
|
|
145
|
+
onPress={() => handleButtonPress(primary)}
|
|
146
|
+
/>
|
|
147
|
+
{secondary.map(button => (
|
|
148
|
+
<Pressable
|
|
149
|
+
accessibilityRole="button"
|
|
150
|
+
key={button.label}
|
|
151
|
+
style={styles.secondaryButton}
|
|
152
|
+
onPress={() => handleButtonPress(button)}
|
|
153
|
+
>
|
|
154
|
+
<Typography size="m" weight="semibold">
|
|
155
|
+
{button.label}
|
|
156
|
+
</Typography>
|
|
157
|
+
</Pressable>
|
|
158
|
+
))}
|
|
159
|
+
</View>
|
|
160
|
+
</BottomSheetView>
|
|
161
|
+
</BottomSheetModal>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// v2 static, unchanged signature.
|
|
166
|
+
Alert.show = (params: AlertParams) => {
|
|
167
|
+
if (!hostRef) {
|
|
168
|
+
if (__DEV__) {
|
|
169
|
+
// eslint-disable-next-line no-console
|
|
170
|
+
console.error(
|
|
171
|
+
"Alert.show: no host mounted. Wrap the app in <NeetoUIProvider> (or render <Alert /> at root)."
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
hostRef.show(params);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const styles = StyleSheet.create(theme => ({
|
|
181
|
+
sheetBackground: {
|
|
182
|
+
backgroundColor: theme.colors.background.primary,
|
|
183
|
+
borderTopLeftRadius: moderateScale(20),
|
|
184
|
+
borderTopRightRadius: moderateScale(20),
|
|
185
|
+
},
|
|
186
|
+
handleIndicator: {
|
|
187
|
+
backgroundColor: theme.colors.palette.grey200,
|
|
188
|
+
width: moderateScale(40),
|
|
189
|
+
},
|
|
190
|
+
content: {
|
|
191
|
+
paddingBottom: moderateScale(24),
|
|
192
|
+
},
|
|
193
|
+
titleContainer: {
|
|
194
|
+
borderBottomColor: theme.colors.palette.grey200,
|
|
195
|
+
borderBottomWidth: moderateScale(1.5),
|
|
196
|
+
paddingBottom: moderateScale(12),
|
|
197
|
+
paddingHorizontal: moderateScale(16),
|
|
198
|
+
},
|
|
199
|
+
title: {
|
|
200
|
+
textAlign: "center",
|
|
201
|
+
},
|
|
202
|
+
description: {
|
|
203
|
+
color: theme.colors.text.muted,
|
|
204
|
+
paddingHorizontal: moderateScale(16),
|
|
205
|
+
paddingTop: moderateScale(16),
|
|
206
|
+
},
|
|
207
|
+
buttonContainer: {
|
|
208
|
+
gap: moderateScale(8),
|
|
209
|
+
paddingHorizontal: moderateScale(16),
|
|
210
|
+
paddingTop: moderateScale(16),
|
|
211
|
+
},
|
|
212
|
+
primaryButton: {
|
|
213
|
+
minHeight: moderateScale(44),
|
|
214
|
+
},
|
|
215
|
+
secondaryButton: {
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
backgroundColor: theme.colors.palette.grey100,
|
|
218
|
+
borderRadius: theme.radii.lg,
|
|
219
|
+
justifyContent: "center",
|
|
220
|
+
paddingVertical: moderateScale(14),
|
|
221
|
+
},
|
|
222
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert, type AlertButton, type AlertParams } from "./Alert";
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Image, View, type ViewProps } from "react-native";
|
|
3
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
4
|
+
|
|
5
|
+
import { moderateScale } from "../../utils/scale";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
|
|
8
|
+
// Promoted from neeto-cal-rn's getAvatarColor helper (identical hash + pairs);
|
|
9
|
+
// neeto-planner-rn's AssigneesCard used the same idea. Deterministic per name.
|
|
10
|
+
const AVATAR_PALETTE = [
|
|
11
|
+
{ bgColor: "#D1FAE5", fontColor: "#065F46" },
|
|
12
|
+
{ bgColor: "#CCFBF1", fontColor: "#134E4A" },
|
|
13
|
+
{ bgColor: "#FED7AA", fontColor: "#9A3412" },
|
|
14
|
+
{ bgColor: "#DBEAFE", fontColor: "#1E40AF" },
|
|
15
|
+
{ bgColor: "#E9D5FF", fontColor: "#6B21A8" },
|
|
16
|
+
{ bgColor: "#FECDD3", fontColor: "#9F1239" },
|
|
17
|
+
{ bgColor: "#FEF08A", fontColor: "#854D0E" },
|
|
18
|
+
{ bgColor: "#A7F3D0", fontColor: "#064E3B" },
|
|
19
|
+
{ bgColor: "#C7D2FE", fontColor: "#3730A3" },
|
|
20
|
+
{ bgColor: "#FBCFE8", fontColor: "#9D174D" },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export const getAvatarColor = (name?: string) => {
|
|
24
|
+
if (!name) return AVATAR_PALETTE[0]!;
|
|
25
|
+
|
|
26
|
+
const hash = name
|
|
27
|
+
.split("")
|
|
28
|
+
.reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
|
29
|
+
|
|
30
|
+
return AVATAR_PALETTE[hash % AVATAR_PALETTE.length]!;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const SIZES = {
|
|
34
|
+
"extra-small": [moderateScale(24), moderateScale(8)],
|
|
35
|
+
small: [moderateScale(36), moderateScale(12)],
|
|
36
|
+
medium: [moderateScale(48), moderateScale(14)],
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
39
|
+
export type AvatarProps = ViewProps & {
|
|
40
|
+
name?: string;
|
|
41
|
+
variant?: keyof typeof SIZES;
|
|
42
|
+
/** Explicit color override. Default: the name-hash palette. */
|
|
43
|
+
bgColor?: string;
|
|
44
|
+
fontColor?: string;
|
|
45
|
+
imageUrl?: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Avatar = ({
|
|
49
|
+
name,
|
|
50
|
+
variant = "medium",
|
|
51
|
+
bgColor,
|
|
52
|
+
fontColor,
|
|
53
|
+
imageUrl,
|
|
54
|
+
style,
|
|
55
|
+
...rest
|
|
56
|
+
}: AvatarProps) => {
|
|
57
|
+
const [loadedImageUrl, setLoadedImageUrl] = useState<string | undefined>();
|
|
58
|
+
|
|
59
|
+
// Tracked as a URL rather than a boolean: FlashList recycles a mounted
|
|
60
|
+
// Avatar into a row with a different (or absent) imageUrl, and a sticky
|
|
61
|
+
// `true` would hide the acronym while no image is there to replace it.
|
|
62
|
+
const isImageLoaded = !!imageUrl && loadedImageUrl === imageUrl;
|
|
63
|
+
|
|
64
|
+
// v2 defaulted unknown variants to medium (switch default) — apps pass
|
|
65
|
+
// arbitrary strings through JS, so keep that safety despite the types.
|
|
66
|
+
const [avatarSize, fontSize] = SIZES[variant] ?? SIZES.medium;
|
|
67
|
+
const hashColors = getAvatarColor(name);
|
|
68
|
+
const backgroundColor = bgColor ?? hashColors.bgColor;
|
|
69
|
+
const textColor = fontColor ?? hashColors.fontColor;
|
|
70
|
+
|
|
71
|
+
const acronym = (name ?? "")
|
|
72
|
+
.split(/\s/)
|
|
73
|
+
.reduce((response, word) => response + word.slice(0, 1), "")
|
|
74
|
+
.slice(0, 2)
|
|
75
|
+
.toUpperCase();
|
|
76
|
+
|
|
77
|
+
const shape = {
|
|
78
|
+
backgroundColor,
|
|
79
|
+
borderRadius: avatarSize / 2,
|
|
80
|
+
height: avatarSize,
|
|
81
|
+
width: avatarSize,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<View {...rest} style={[styles.container, shape, style]}>
|
|
86
|
+
{!isImageLoaded && (
|
|
87
|
+
<Typography color={textColor} style={{ fontSize }}>
|
|
88
|
+
{acronym}
|
|
89
|
+
</Typography>
|
|
90
|
+
)}
|
|
91
|
+
{!!imageUrl && (
|
|
92
|
+
<Image
|
|
93
|
+
accessibilityLabel={name}
|
|
94
|
+
source={{ uri: imageUrl }}
|
|
95
|
+
style={[
|
|
96
|
+
styles.image,
|
|
97
|
+
{
|
|
98
|
+
borderRadius: avatarSize / 2,
|
|
99
|
+
height: avatarSize,
|
|
100
|
+
width: avatarSize,
|
|
101
|
+
},
|
|
102
|
+
!isImageLoaded && styles.imageHidden,
|
|
103
|
+
]}
|
|
104
|
+
onLoad={() => setLoadedImageUrl(imageUrl)}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
</View>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const styles = StyleSheet.create({
|
|
112
|
+
container: {
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
justifyContent: "center",
|
|
115
|
+
overflow: "hidden",
|
|
116
|
+
},
|
|
117
|
+
image: {
|
|
118
|
+
position: "absolute",
|
|
119
|
+
},
|
|
120
|
+
imageHidden: {
|
|
121
|
+
opacity: 0,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar, getAvatarColor, type AvatarProps } from "./Avatar";
|