@neko-os/ui 0.0.7 → 0.0.9
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/dist/NekoUI.js +1 -1
- package/dist/abstractions/ActivityIndicator.native.js +1 -1
- package/dist/abstractions/ActivityIndicator.web.js +1 -0
- package/dist/abstractions/AnimatedView.js +1 -1
- package/dist/abstractions/BlurView.js +1 -0
- package/dist/abstractions/BlurView.native.js +1 -0
- package/dist/abstractions/BlurView.web.js +1 -0
- package/dist/abstractions/FlatList.js +1 -0
- package/dist/abstractions/FlatList.native.js +1 -0
- package/dist/abstractions/FlatList.web.js +1 -0
- package/dist/abstractions/GradientView.js +1 -0
- package/dist/abstractions/GradientView.native.js +1 -0
- package/dist/abstractions/Icon.native.js +1 -1
- package/dist/abstractions/ImageBackground.js +1 -0
- package/dist/abstractions/ImageBackground.native.js +1 -0
- package/dist/abstractions/ImageBackground.web.js +1 -0
- package/dist/abstractions/Pressable.js +1 -0
- package/dist/abstractions/Pressable.native.js +1 -0
- package/dist/abstractions/Pressable.web.js +1 -0
- package/dist/abstractions/ScrollView.js +1 -0
- package/dist/abstractions/ScrollView.native.js +1 -0
- package/dist/abstractions/ScrollView.web.js +1 -0
- package/dist/abstractions/TextInput.js +1 -1
- package/dist/abstractions/helpers/storage.js +1 -0
- package/dist/abstractions/helpers/storage.native.js +1 -0
- package/dist/components/actions/Button.js +1 -1
- package/dist/components/actions/Dropdown.js +1 -1
- package/dist/components/actions/Link.js +1 -1
- package/dist/components/actions/Pressable.js +1 -0
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/menu/HorizontalMenu.js +1 -1
- package/dist/components/actions/menu/VerticalMenu.js +1 -1
- package/dist/components/animations/ReanimatedView.js +1 -0
- package/dist/components/calendar/CalendarNav.js +1 -0
- package/dist/components/calendar/WeekDaysBar.js +1 -0
- package/dist/components/calendar/_helpers/calendarDays.js +1 -1
- package/dist/components/calendar/_helpers/dateDisabled.js +1 -0
- package/dist/components/calendar/index.js +0 -1
- package/dist/components/feedback/alerter.js +1 -0
- package/dist/components/feedback/confirmer.js +1 -0
- package/dist/components/feedback/index.js +1 -1
- package/dist/components/feedback/notifications/Notification.js +1 -1
- package/dist/components/feedback/notifications/NotificationsHandler.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/inputs/DateInput.js +1 -0
- package/dist/components/inputs/InputWrapper.js +1 -1
- package/dist/components/inputs/LinkInput.js +1 -0
- package/dist/components/inputs/MaskInput.js +1 -0
- package/dist/components/inputs/TextInput.js +1 -1
- package/dist/components/inputs/_DateInput.native.js +1 -0
- package/dist/components/inputs/datePicker/DatePicker.js +1 -0
- package/dist/components/inputs/datePicker/DayPicker.js +1 -0
- package/dist/components/inputs/datePicker/MonthPicker.js +1 -0
- package/dist/components/inputs/datePicker/QuarterPicker.js +1 -0
- package/dist/components/inputs/datePicker/WeekPicker.js +1 -0
- package/dist/components/inputs/datePicker/YearPicker.js +1 -0
- package/dist/components/inputs/index.js +1 -1
- package/dist/components/layout/Layout.js +1 -1
- package/dist/components/list/FlatList.js +1 -0
- package/dist/components/list/ScrollView.js +1 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/presentation/ImageBackground.js +1 -0
- package/dist/components/presentation/Result.js +1 -1
- package/dist/components/presentation/index.js +1 -1
- package/dist/components/state/LoadingView.js +1 -1
- package/dist/components/structure/Accordion.js +1 -1
- package/dist/components/structure/BlurView.js +1 -0
- package/dist/components/structure/GradientView.js +1 -0
- package/dist/components/structure/View.js +1 -1
- package/dist/components/structure/bottomDrawer/index.js +1 -0
- package/dist/components/structure/bottomDrawer/index.native.js +1 -0
- package/dist/components/structure/bottomDrawer/index.web.js +1 -0
- package/dist/components/structure/bottomDrawer/native/BottomDrawer.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerContext.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerHandle.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerScrollView.js +1 -0
- package/dist/components/structure/bottomDrawer/native/utils.js +1 -0
- package/dist/components/structure/bottomDrawer/web/BottomDrawer.js +1 -0
- package/dist/components/structure/drawer/Drawer.js +1 -0
- package/dist/components/structure/drawer/Drawer.native.js +1 -0
- package/dist/components/structure/drawer/index.js +1 -0
- package/dist/components/structure/index.js +1 -1
- package/dist/components/structure/modal/Modal.js +1 -0
- package/dist/components/structure/modal/Modal.native.js +1 -0
- package/dist/components/structure/modal/ModalBackdrop.js +1 -0
- package/dist/components/structure/modal/ModalContent.js +1 -0
- package/dist/components/structure/modal/ModalFooter.js +1 -0
- package/dist/components/structure/modal/ModalHeader.js +1 -0
- package/dist/components/structure/modal/handler/ModalsHandler.js +1 -0
- package/dist/components/structure/modal/index.js +1 -0
- package/dist/components/structure/overlay/OverlayWrapper.js +1 -1
- package/dist/components/structure/popover/Popover.js +1 -1
- package/dist/components/structure/popover/Popover.native.js +1 -1
- package/dist/components/theme/ThemePicker.js +1 -0
- package/dist/components/theme/ThemePickerDrawer.js +1 -0
- package/dist/components/theme/ThemeStatusBar.js +1 -0
- package/dist/components/theme/ThemeStatusBar.native.js +1 -0
- package/dist/components/theme/ThemeThumb.js +1 -0
- package/dist/components/theme/index.js +1 -0
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/storage.js +1 -0
- package/dist/modifiers/animations/animatedEffects.js +1 -1
- package/dist/modifiers/animations/animatedEffects.native.js +1 -1
- package/dist/modifiers/animations/fadeEffect.js +1 -1
- package/dist/modifiers/animations/scaleEffect.js +1 -0
- package/dist/modifiers/animations/scaleEffect.native.js +1 -0
- package/dist/modifiers/animations/slideEffect.js +1 -1
- package/dist/modifiers/background.js +1 -1
- package/dist/modifiers/cursor.js +1 -0
- package/dist/modifiers/display.js +1 -1
- package/dist/modifiers/fullColor.js +1 -1
- package/dist/modifiers/hover.js +1 -0
- package/dist/modifiers/position.js +1 -1
- package/dist/modifiers/size.js +1 -1
- package/dist/modifiers/state.js +1 -1
- package/dist/responsive/responsiveHooks.js +1 -1
- package/dist/theme/ThemeHandler.js +1 -1
- package/dist/theme/default/base.js +1 -1
- package/dist/theme/default/blackTheme.js +1 -0
- package/dist/theme/default/cyberpunkTheme.js +1 -1
- package/dist/theme/default/darkTheme.js +1 -1
- package/dist/theme/default/deepWoodsTheme.js +1 -1
- package/dist/theme/default/forestTheme.js +1 -1
- package/dist/theme/default/hackerTheme.js +1 -1
- package/dist/theme/default/lightTheme.js +1 -1
- package/dist/theme/default/midnightTheme.js +1 -1
- package/dist/theme/default/msdosTheme.js +1 -1
- package/dist/theme/default/oceanTheme.js +1 -1
- package/dist/theme/default/paperTheme.js +1 -0
- package/dist/theme/default/pastelTheme.js +1 -1
- package/dist/theme/default/sunsetTheme.js +1 -1
- package/dist/theme/default/themes.js +1 -1
- package/dist/theme/format/formatTheme.js +1 -1
- package/dist/theme/helpers/contrastColor.js +1 -1
- package/package.json +8 -3
- package/src/NekoUI.js +18 -3
- package/src/abstractions/ActivityIndicator.native.js +3 -4
- package/src/abstractions/ActivityIndicator.web.js +43 -0
- package/src/abstractions/AnimatedView.js +3 -3
- package/src/abstractions/BlurView.js +43 -0
- package/src/abstractions/BlurView.native.js +39 -0
- package/src/abstractions/BlurView.web.js +39 -0
- package/src/abstractions/FlatList.js +39 -0
- package/src/abstractions/FlatList.native.js +32 -0
- package/src/abstractions/FlatList.web.js +3 -0
- package/src/abstractions/GradientView.js +5 -0
- package/src/abstractions/GradientView.native.js +32 -0
- package/src/abstractions/Icon.native.js +4 -2
- package/src/abstractions/ImageBackground.js +17 -0
- package/src/abstractions/ImageBackground.native.js +27 -0
- package/src/abstractions/ImageBackground.web.js +7 -0
- package/src/abstractions/Pressable.js +4 -0
- package/src/abstractions/Pressable.native.js +3 -0
- package/src/abstractions/Pressable.web.js +3 -0
- package/src/abstractions/ScrollView.js +3 -0
- package/src/abstractions/ScrollView.native.js +5 -0
- package/src/abstractions/ScrollView.web.js +3 -0
- package/src/abstractions/Text.web.js +15 -0
- package/src/abstractions/TextInput.js +2 -2
- package/src/abstractions/helpers/storage.js +32 -0
- package/src/abstractions/helpers/storage.native.js +34 -0
- package/src/components/actions/Button.js +8 -0
- package/src/components/actions/Dropdown.js +18 -2
- package/src/components/actions/Link.js +16 -2
- package/src/components/actions/Pressable.js +38 -0
- package/src/components/actions/index.js +1 -0
- package/src/components/actions/menu/HorizontalMenu.js +2 -1
- package/src/components/actions/menu/VerticalMenu.js +5 -4
- package/src/components/animations/ReanimatedView.js +40 -0
- package/src/components/calendar/CalendarNav.js +67 -0
- package/src/components/calendar/WeekDaysBar.js +18 -0
- package/src/components/calendar/_helpers/calendarDays.js +1 -3
- package/src/components/calendar/_helpers/dateDisabled.js +24 -0
- package/src/components/calendar/index.js +1 -1
- package/src/components/feedback/alerter.js +31 -0
- package/src/components/feedback/confirmer.js +70 -0
- package/src/components/feedback/index.js +2 -0
- package/src/components/feedback/notifications/Notification.js +1 -1
- package/src/components/feedback/notifications/NotificationsHandler.js +3 -3
- package/src/components/index.js +2 -0
- package/src/components/inputs/DateInput.js +111 -0
- package/src/components/inputs/InputWrapper.js +18 -6
- package/src/components/inputs/LinkInput.js +17 -0
- package/src/components/inputs/MaskInput.js +67 -0
- package/src/components/inputs/TextInput.js +2 -2
- package/src/components/inputs/_DateInput.native.js +89 -0
- package/src/components/inputs/datePicker/DatePicker.js +24 -0
- package/src/components/inputs/datePicker/DayPicker.js +65 -0
- package/src/components/inputs/datePicker/MonthPicker.js +62 -0
- package/src/components/inputs/datePicker/QuarterPicker.js +65 -0
- package/src/components/inputs/datePicker/WeekPicker.js +74 -0
- package/src/components/inputs/datePicker/YearPicker.js +67 -0
- package/src/components/inputs/index.js +4 -0
- package/src/components/layout/Layout.js +1 -1
- package/src/components/list/FlatList.js +54 -0
- package/src/components/list/ScrollView.js +58 -0
- package/src/components/list/index.js +2 -0
- package/src/components/presentation/ImageBackground.js +38 -0
- package/src/components/presentation/Result.js +2 -2
- package/src/components/presentation/index.js +1 -0
- package/src/components/state/LoadingView.js +10 -1
- package/src/components/structure/Accordion.js +1 -1
- package/src/components/structure/BlurView.js +58 -0
- package/src/components/structure/GradientView.js +42 -0
- package/src/components/structure/View.js +2 -0
- package/src/components/structure/bottomDrawer/index.js +1 -0
- package/src/components/structure/bottomDrawer/index.native.js +4 -0
- package/src/components/structure/bottomDrawer/index.web.js +4 -0
- package/src/components/structure/bottomDrawer/native/BottomDrawer.js +242 -0
- package/src/components/structure/bottomDrawer/native/DrawerContext.js +21 -0
- package/src/components/structure/bottomDrawer/native/DrawerHandle.js +12 -0
- package/src/components/structure/bottomDrawer/native/DrawerScrollView.js +83 -0
- package/src/components/structure/bottomDrawer/native/utils.js +58 -0
- package/src/components/structure/bottomDrawer/web/BottomDrawer.js +3 -0
- package/src/components/structure/drawer/Drawer.js +5 -0
- package/src/components/structure/drawer/Drawer.native.js +3 -0
- package/src/components/structure/drawer/index.js +1 -0
- package/src/components/structure/index.js +5 -0
- package/src/components/structure/modal/Modal.js +84 -0
- package/src/components/structure/modal/Modal.native.js +83 -0
- package/src/components/structure/modal/ModalBackdrop.js +58 -0
- package/src/components/structure/modal/ModalContent.js +28 -0
- package/src/components/structure/modal/ModalFooter.js +31 -0
- package/src/components/structure/modal/ModalHeader.js +50 -0
- package/src/components/structure/modal/handler/ModalsHandler.js +61 -0
- package/src/components/structure/modal/index.js +6 -0
- package/src/components/structure/overlay/OverlayWrapper.js +1 -1
- package/src/components/structure/popover/Popover.js +37 -2
- package/src/components/structure/popover/Popover.native.js +46 -16
- package/src/components/theme/ThemePicker.js +49 -0
- package/src/components/theme/ThemePickerDrawer.js +13 -0
- package/src/components/theme/ThemeStatusBar.js +3 -0
- package/src/components/theme/ThemeStatusBar.native.js +9 -0
- package/src/components/theme/ThemeThumb.js +98 -0
- package/src/components/theme/index.js +3 -0
- package/src/helpers/index.js +1 -0
- package/src/helpers/storage.js +54 -0
- package/src/modifiers/animations/animatedEffects.js +2 -0
- package/src/modifiers/animations/animatedEffects.native.js +3 -1
- package/src/modifiers/animations/fadeEffect.js +4 -2
- package/src/modifiers/animations/scaleEffect.js +45 -0
- package/src/modifiers/animations/scaleEffect.native.js +33 -0
- package/src/modifiers/animations/slideEffect.js +3 -1
- package/src/modifiers/background.js +16 -4
- package/src/modifiers/cursor.js +21 -0
- package/src/modifiers/display.js +2 -2
- package/src/modifiers/fullColor.js +2 -2
- package/src/modifiers/hover.js +28 -0
- package/src/modifiers/position.js +24 -3
- package/src/modifiers/size.js +2 -1
- package/src/modifiers/state.js +1 -1
- package/src/responsive/responsiveHooks.js +7 -0
- package/src/theme/ThemeHandler.js +18 -2
- package/src/theme/default/base.js +6 -6
- package/src/theme/default/blackTheme.js +35 -0
- package/src/theme/default/cyberpunkTheme.js +4 -1
- package/src/theme/default/darkTheme.js +4 -1
- package/src/theme/default/deepWoodsTheme.js +5 -2
- package/src/theme/default/forestTheme.js +4 -1
- package/src/theme/default/hackerTheme.js +4 -1
- package/src/theme/default/lightTheme.js +4 -1
- package/src/theme/default/midnightTheme.js +4 -1
- package/src/theme/default/msdosTheme.js +19 -4
- package/src/theme/default/oceanTheme.js +5 -2
- package/src/theme/default/paperTheme.js +35 -0
- package/src/theme/default/pastelTheme.js +5 -2
- package/src/theme/default/sunsetTheme.js +7 -4
- package/src/theme/default/themes.js +9 -10
- package/src/theme/format/formatTheme.js +9 -3
- package/src/theme/helpers/contrastColor.js +49 -11
- package/dist/abstractions/TouchableOpacity.web.js +0 -1
- package/dist/components/calendar/DayPicker.js +0 -1
- package/src/abstractions/TouchableOpacity.web.js +0 -3
- package/src/components/calendar/DayPicker.js +0 -94
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neko-os/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"author": "Christian Storch <ccstorch@gmail.com>",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@remixicon/react": "^4.6.0",
|
|
25
|
+
"expo-linear-gradient": "~14.1.5",
|
|
25
26
|
"dayjs": "*",
|
|
26
27
|
"ramda": "^0.31.3",
|
|
27
28
|
"react": "*",
|
|
@@ -32,10 +33,14 @@
|
|
|
32
33
|
"react-native-web": "*",
|
|
33
34
|
"react-native-safe-area-context": "*"
|
|
34
35
|
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"react-native-safe-area-context": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
35
41
|
"dependencies": {
|
|
36
|
-
"dayjs": "
|
|
42
|
+
"dayjs": "1.11.18",
|
|
37
43
|
"prop-types": "^15.8.1",
|
|
38
|
-
"react-native-safe-area-context": "^5.6.1",
|
|
39
44
|
"react-native-web": "^0.21.0",
|
|
40
45
|
"tinycolor2": "^1.6.0"
|
|
41
46
|
},
|
package/src/NekoUI.js
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
|
+
import { ModalsHandler } from './components/structure/modal/handler/ModalsHandler'
|
|
1
2
|
import { NotificationsHandler } from './components/feedback/notifications/NotificationsHandler'
|
|
2
3
|
import { OverlayHandler } from './components/structure/overlay/OverlayHandler'
|
|
3
4
|
import { PortalHandler } from './components/helpers/PortalHandler'
|
|
4
5
|
import { ResponsiveHandler } from './responsive/ResponsiveHandler'
|
|
5
6
|
import { ThemeHandler } from './theme/ThemeHandler'
|
|
7
|
+
import { ThemePickerDrawer } from './components/theme'
|
|
8
|
+
import { useThemeHandler } from './theme'
|
|
6
9
|
|
|
7
10
|
export function NekoUI({ children, ...props }) {
|
|
8
11
|
return (
|
|
9
12
|
<ThemeHandler {...props}>
|
|
10
13
|
<ResponsiveHandler>
|
|
11
14
|
<PortalHandler>
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
+
<ModalsHandler>
|
|
16
|
+
<NotificationsHandler>
|
|
17
|
+
<OverlayHandler>
|
|
18
|
+
{children}
|
|
19
|
+
<FixedComponents />
|
|
20
|
+
</OverlayHandler>
|
|
21
|
+
</NotificationsHandler>
|
|
22
|
+
</ModalsHandler>
|
|
15
23
|
</PortalHandler>
|
|
16
24
|
</ResponsiveHandler>
|
|
17
25
|
</ThemeHandler>
|
|
18
26
|
)
|
|
19
27
|
}
|
|
28
|
+
|
|
29
|
+
// TODO: Move to ModalRouter when its ready
|
|
30
|
+
function FixedComponents() {
|
|
31
|
+
const { themePickerOpen, setThemePickerOpen } = useThemeHandler()
|
|
32
|
+
|
|
33
|
+
return <ThemePickerDrawer open={themePickerOpen} onClose={() => setThemePickerOpen(false)} />
|
|
34
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Animated, Easing } from 'react-native'
|
|
1
|
+
import { Animated, Easing, Platform } from 'react-native'
|
|
3
2
|
import React from 'react'
|
|
3
|
+
import tinycolor from 'tinycolor2'
|
|
4
4
|
|
|
5
5
|
export function AbsActivityIndicator({ size = 20, color, style }) {
|
|
6
6
|
const spinValue = React.useRef(new Animated.Value(0)).current
|
|
@@ -12,7 +12,7 @@ export function AbsActivityIndicator({ size = 20, color, style }) {
|
|
|
12
12
|
toValue: 1,
|
|
13
13
|
duration: 1000,
|
|
14
14
|
easing: Easing.linear,
|
|
15
|
-
useNativeDriver:
|
|
15
|
+
useNativeDriver: Platform.OS !== 'web',
|
|
16
16
|
})
|
|
17
17
|
)
|
|
18
18
|
spinAnimation.start()
|
|
@@ -26,7 +26,6 @@ export function AbsActivityIndicator({ size = 20, color, style }) {
|
|
|
26
26
|
|
|
27
27
|
const borderWidth = size / 8
|
|
28
28
|
|
|
29
|
-
console.log(color, bg)
|
|
30
29
|
return (
|
|
31
30
|
<Animated.View
|
|
32
31
|
style={{
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import tinycolor from 'tinycolor2'
|
|
2
|
+
import { Animated, Easing } from 'react-native'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export function AbsActivityIndicator({ size = 20, color, style }) {
|
|
6
|
+
const spinValue = React.useRef(new Animated.Value(0)).current
|
|
7
|
+
const bg = tinycolor(color).setAlpha(0.2).toString()
|
|
8
|
+
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const spinAnimation = Animated.loop(
|
|
11
|
+
Animated.timing(spinValue, {
|
|
12
|
+
toValue: 1,
|
|
13
|
+
duration: 1000,
|
|
14
|
+
easing: Easing.linear,
|
|
15
|
+
useNativeDriver: false,
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
spinAnimation.start()
|
|
19
|
+
return () => spinAnimation.stop()
|
|
20
|
+
}, [spinValue])
|
|
21
|
+
|
|
22
|
+
const spin = spinValue.interpolate({
|
|
23
|
+
inputRange: [0, 1],
|
|
24
|
+
outputRange: ['0deg', '360deg'],
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const borderWidth = size / 8
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Animated.View
|
|
31
|
+
style={{
|
|
32
|
+
width: size,
|
|
33
|
+
height: size,
|
|
34
|
+
borderRadius: size / 2,
|
|
35
|
+
borderWidth: borderWidth,
|
|
36
|
+
borderColor: `${bg}`,
|
|
37
|
+
borderTopColor: color,
|
|
38
|
+
transform: [{ rotate: spin }],
|
|
39
|
+
...style,
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { AbsView } from './View'
|
|
2
|
+
|
|
3
|
+
export const AbsAnimatedView = AbsView
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AbsView } from './View'
|
|
2
|
+
|
|
3
|
+
const tintMap = {
|
|
4
|
+
light: 'rgba(255,255,255,0.3)',
|
|
5
|
+
dark: 'rgba(0,0,0,0.3)',
|
|
6
|
+
default: 'rgba(255,255,255,0.2)',
|
|
7
|
+
extraLight: 'rgba(255,255,255,0.5)',
|
|
8
|
+
regular: 'rgba(255,255,255,0.3)',
|
|
9
|
+
prominent: 'rgba(255,255,255,0.7)',
|
|
10
|
+
systemUltraThinMaterial: 'rgba(255,255,255,0.1)',
|
|
11
|
+
systemThinMaterial: 'rgba(255,255,255,0.2)',
|
|
12
|
+
systemMaterial: 'rgba(255,255,255,0.3)',
|
|
13
|
+
systemThickMaterial: 'rgba(255,255,255,0.4)',
|
|
14
|
+
systemChromeMaterial: 'rgba(255,255,255,0.5)',
|
|
15
|
+
systemUltraThinMaterialLight: 'rgba(255,255,255,0.1)',
|
|
16
|
+
systemThinMaterialLight: 'rgba(255,255,255,0.2)',
|
|
17
|
+
systemMaterialLight: 'rgba(255,255,255,0.3)',
|
|
18
|
+
systemThickMaterialLight: 'rgba(255,255,255,0.4)',
|
|
19
|
+
systemChromeMaterialLight: 'rgba(255,255,255,0.5)',
|
|
20
|
+
systemUltraThinMaterialDark: 'rgba(0,0,0,0.1)',
|
|
21
|
+
systemThinMaterialDark: 'rgba(0,0,0,0.2)',
|
|
22
|
+
systemMaterialDark: 'rgba(0,0,0,0.3)',
|
|
23
|
+
systemThickMaterialDark: 'rgba(0,0,0,0.4)',
|
|
24
|
+
systemChromeMaterialDark: 'rgba(0,0,0,0.5)',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const AbsBlurView = ({ tint, intensity, style, ...props }) => {
|
|
28
|
+
const blurPx = Math.round((intensity / 100) * 25)
|
|
29
|
+
let backgroundColor = tintMap[tint] || tintMap.default
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<AbsView
|
|
33
|
+
{...props}
|
|
34
|
+
style={{
|
|
35
|
+
width: '100%',
|
|
36
|
+
backgroundColor,
|
|
37
|
+
...style,
|
|
38
|
+
backdropFilter: `blur(${blurPx}px)`,
|
|
39
|
+
WebkitBackdropFilter: `blur(${blurPx}px)`,
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AbsView } from './View'
|
|
2
|
+
|
|
3
|
+
let AbsBlurView
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const { BlurView } = require('expo-blur') || {}
|
|
7
|
+
AbsBlurView = ({ intensity, tint, disabledForAndroid, style, children, ...props }) => {
|
|
8
|
+
return (
|
|
9
|
+
<BlurView
|
|
10
|
+
intensity={intensity}
|
|
11
|
+
tint={tint}
|
|
12
|
+
style={[style, { overflow: 'hidden' }]}
|
|
13
|
+
experimentalBlurMethod={disabledForAndroid ? 'none' : 'dimezisBlurView'}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</BlurView>
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
// return (
|
|
20
|
+
// <AbsView style={[style, { overflow: 'hidden' }]} {...props}>
|
|
21
|
+
// <BlurView
|
|
22
|
+
// intensity={intensity}
|
|
23
|
+
// tint={tint}
|
|
24
|
+
// style={[style, { width: '100%' }]}
|
|
25
|
+
// experimentalBlurMethod={disabledForAndroid ? 'none' : 'dimezisBlurView'}
|
|
26
|
+
// >
|
|
27
|
+
// {children}
|
|
28
|
+
// </BlurView>
|
|
29
|
+
// </AbsView>
|
|
30
|
+
// )
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
AbsBlurView = (props) => {
|
|
34
|
+
console.warn('expo-blur not instaled.')
|
|
35
|
+
return <AbsView {...props} />
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { AbsBlurView }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AbsView } from './View'
|
|
2
|
+
|
|
3
|
+
let AbsBlurView
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const { BlurView } = require('expo-blur') || {}
|
|
7
|
+
AbsBlurView = ({ intensity, tint, disabledForAndroid, style, children, ...props }) => {
|
|
8
|
+
return (
|
|
9
|
+
<BlurView
|
|
10
|
+
intensity={intensity}
|
|
11
|
+
tint={tint}
|
|
12
|
+
style={[style, { overflow: 'hidden' }]}
|
|
13
|
+
experimentalBlurMethod={disabledForAndroid ? 'none' : 'dimezisBlurView'}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</BlurView>
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
// return (
|
|
20
|
+
// <AbsView style={[style, { overflow: 'hidden' }]} {...props}>
|
|
21
|
+
// <BlurView
|
|
22
|
+
// intensity={intensity}
|
|
23
|
+
// tint={tint}
|
|
24
|
+
// style={[style, { width: '100%' }]}
|
|
25
|
+
// experimentalBlurMethod={disabledForAndroid ? 'none' : 'dimezisBlurView'}
|
|
26
|
+
// >
|
|
27
|
+
// {children}
|
|
28
|
+
// </BlurView>
|
|
29
|
+
// </AbsView>
|
|
30
|
+
// )
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
AbsBlurView = (props) => {
|
|
34
|
+
console.warn('expo-blur not instaled.')
|
|
35
|
+
return <AbsView {...props} />
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { AbsBlurView }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { AbsView } from './View'
|
|
3
|
+
|
|
4
|
+
const defaultRender = () => false
|
|
5
|
+
|
|
6
|
+
export function AbsFlatList({
|
|
7
|
+
data,
|
|
8
|
+
renderItem,
|
|
9
|
+
ListEmptyComponent,
|
|
10
|
+
Empty,
|
|
11
|
+
renderEmpty,
|
|
12
|
+
ListFooterComponent,
|
|
13
|
+
Footer,
|
|
14
|
+
renderFooter,
|
|
15
|
+
ListHeaderComponent,
|
|
16
|
+
Header,
|
|
17
|
+
renderHeader,
|
|
18
|
+
keyExtractor,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
ListEmptyComponent = ListEmptyComponent || Empty || defaultRender
|
|
22
|
+
ListFooterComponent = ListFooterComponent || Footer || renderFooter || defaultRender
|
|
23
|
+
ListHeaderComponent = ListHeaderComponent || Header || renderHeader || defaultRender
|
|
24
|
+
keyExtractor = keyExtractor || ((item, index) => index)
|
|
25
|
+
renderItem = renderItem || defaultRender
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<AbsView {...props}>
|
|
29
|
+
<ListHeaderComponent />
|
|
30
|
+
|
|
31
|
+
{!data?.length && <ListEmptyComponent />}
|
|
32
|
+
{data?.map?.((item, index) => (
|
|
33
|
+
<React.Fragment key={keyExtractor(item, index)}>{renderItem({ item, index })}</React.Fragment>
|
|
34
|
+
))}
|
|
35
|
+
|
|
36
|
+
<ListFooterComponent />
|
|
37
|
+
</AbsView>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FlatList } from 'react-native'
|
|
2
|
+
|
|
3
|
+
export const AbsFlatList = ({
|
|
4
|
+
style: { height, width, ...style },
|
|
5
|
+
ListEmptyComponent,
|
|
6
|
+
Empty,
|
|
7
|
+
renderEmpty,
|
|
8
|
+
ListFooterComponent,
|
|
9
|
+
Footer,
|
|
10
|
+
renderFooter,
|
|
11
|
+
ListHeaderComponent,
|
|
12
|
+
Header,
|
|
13
|
+
renderHeader,
|
|
14
|
+
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
ListEmptyComponent = ListEmptyComponent || Empty || defaultRender
|
|
18
|
+
ListFooterComponent = ListFooterComponent || Footer || renderFooter || defaultRender
|
|
19
|
+
ListHeaderComponent = ListHeaderComponent || Header || renderHeader || defaultRender
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<FlatList
|
|
23
|
+
height={height}
|
|
24
|
+
width={width}
|
|
25
|
+
{...props}
|
|
26
|
+
ListEmptyComponent={ListEmptyComponent}
|
|
27
|
+
ListFooterComponent={ListFooterComponent}
|
|
28
|
+
ListHeaderComponent={ListHeaderComponent}
|
|
29
|
+
contentContainerStyle={style}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AbsView } from './View'
|
|
2
|
+
|
|
3
|
+
function angleToPoints(angle) {
|
|
4
|
+
const a = (angle % 360) * (Math.PI / 180)
|
|
5
|
+
const x = Math.cos(a)
|
|
6
|
+
const y = Math.sin(a)
|
|
7
|
+
|
|
8
|
+
// Normaliza de [-1, 1] para [0, 1]
|
|
9
|
+
return {
|
|
10
|
+
start: { x: 0.5 - x / 2, y: 0.5 - y / 2 },
|
|
11
|
+
end: { x: 0.5 + x / 2, y: 0.5 + y / 2 },
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let AbsGradientView
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const { LinearGradient } = require('expo-linear-gradient') || {}
|
|
19
|
+
AbsGradientView = ({ angle = 45, colors, ...props }) => {
|
|
20
|
+
const { start, end } = angleToPoints(angle)
|
|
21
|
+
|
|
22
|
+
if (!colors?.length) return <AbsView {...props} />
|
|
23
|
+
return <LinearGradient start={start} end={end} colors={colors} {...props} />
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
AbsGradientView = (props) => {
|
|
27
|
+
console.warn('expo-linear-gradient not instaled.')
|
|
28
|
+
return <AbsView {...props} />
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { AbsGradientView }
|
|
@@ -2,10 +2,12 @@ let AbsIcon
|
|
|
2
2
|
|
|
3
3
|
try {
|
|
4
4
|
const RmIcon = require('react-native-remix-icon')?.default
|
|
5
|
-
console.log(RmIcon)
|
|
6
5
|
AbsIcon = (props) => <RmIcon {...props} />
|
|
7
6
|
} catch {
|
|
8
|
-
AbsIcon = () =>
|
|
7
|
+
AbsIcon = () => {
|
|
8
|
+
console.warn('react-native-remix-icon not instaled.')
|
|
9
|
+
return false
|
|
10
|
+
}
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export { AbsIcon }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function AbsImageBackground({ src, resizeMode = 'cover', style, ...props }) {
|
|
2
|
+
const objectFitMap = {
|
|
3
|
+
cover: 'cover',
|
|
4
|
+
contain: 'contain',
|
|
5
|
+
stretch: 'fill',
|
|
6
|
+
center: 'none',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const objectFit = objectFitMap[resizeMode] || 'cover'
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
style={{ backgroundSize: objectFit, backgroundPosition: 'center', backgroundImage: `url(${src})`, ...style }}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { pick } from 'ramda'
|
|
2
|
+
import { ImageBackground as RNImageBackground } from 'react-native'
|
|
3
|
+
|
|
4
|
+
import { AbsView } from './View'
|
|
5
|
+
|
|
6
|
+
const allBorderRadiusProps = [
|
|
7
|
+
'borderRadius',
|
|
8
|
+
'borderTopLeftRadius',
|
|
9
|
+
'borderTopRightRadius',
|
|
10
|
+
'borderBottomLeftRadius',
|
|
11
|
+
'borderBottomRightRadius',
|
|
12
|
+
'borderTopStartRadius',
|
|
13
|
+
'borderTopEndRadius',
|
|
14
|
+
'borderBottomStartRadius',
|
|
15
|
+
'borderBottomEndRadius',
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
export function AbsImageBackground({ src, source, resizeMode = 'cover', style, children, ...props }) {
|
|
19
|
+
if (!source && !!src) source = { uri: src }
|
|
20
|
+
const imageStyle = pick(allBorderRadiusProps, style)
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<RNImageBackground source={source} resizeMode={resizeMode} style={style} imageStyle={imageStyle} {...props}>
|
|
24
|
+
{children}
|
|
25
|
+
</RNImageBackground>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ImageBackground as RNImageBackground } from 'react-native'
|
|
2
|
+
|
|
3
|
+
export function AbsImageBackground({ src, source, resizeMode = 'cover', ...props }) {
|
|
4
|
+
if (!source && !!src) source = { uri: src }
|
|
5
|
+
|
|
6
|
+
return <RNImageBackground source={source} resizeMode={resizeMode} {...props} />
|
|
7
|
+
}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// export const AbsText = ({ numberOfLines, style, ...props }) => {
|
|
2
|
+
// style = style || {}
|
|
3
|
+
|
|
4
|
+
// const limitLinesStyle = !!numberOfLines
|
|
5
|
+
// ? {
|
|
6
|
+
// display: '-webkit-box',
|
|
7
|
+
// WebkitLineClamp: numberOfLines,
|
|
8
|
+
// WebkitBoxOrient: 'vertical',
|
|
9
|
+
// overflow: 'hidden',
|
|
10
|
+
// }
|
|
11
|
+
// : {}
|
|
12
|
+
|
|
13
|
+
// return <AbsText {...props} style={[limitLinesStyle, style]} />
|
|
14
|
+
// }
|
|
15
|
+
|
|
1
16
|
import { Text as RNText } from 'react-native'
|
|
2
17
|
|
|
3
18
|
export const AbsText = RNText
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export function AbsTextInput(props) {
|
|
2
|
-
return <input type="text" {...props} />
|
|
1
|
+
export function AbsTextInput({ onChange, ...props }) {
|
|
2
|
+
return <input type="text" onChange={(e) => onChange?.(e?.target?.value, e)} {...props} />
|
|
3
3
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function set(key, value) {
|
|
2
|
+
return localStorage.setItem(key, value)
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function setAsync(key, value) {
|
|
6
|
+
return Promise.resulve(set(key, value))
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function get(key) {
|
|
10
|
+
return localStorage.getItem(key)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function getAsync(key) {
|
|
14
|
+
return Promise.resulve(get(key))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function remove(key) {
|
|
18
|
+
return localStorage.removeItem(key)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function removeAsync(key) {
|
|
22
|
+
return Promise.resulve(remove(key))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const AbsStorage = {
|
|
26
|
+
set,
|
|
27
|
+
setAsync,
|
|
28
|
+
get,
|
|
29
|
+
getAsync,
|
|
30
|
+
remove,
|
|
31
|
+
removeAsync,
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
let set = () => console.warn('expo-sqlite not installed. Neko Storage needs expo-sqlite to work properly')
|
|
2
|
+
let setAsync = () => Promise.resolve(set())
|
|
3
|
+
|
|
4
|
+
let get = () => console.warn('expo-sqlite not installed. Neko Storage needs expo-sqlite to work properly')
|
|
5
|
+
let getAsync = () => Promise.resolve(get())
|
|
6
|
+
|
|
7
|
+
let remove = () => console.warn('expo-sqlite not installed. Neko Storage needs expo-sqlite to work properly')
|
|
8
|
+
let removeAsync = () => Promise.resolve(remove())
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const StorageModule = require('expo-sqlite/kv-store')
|
|
12
|
+
if (StorageModule?.default) {
|
|
13
|
+
const Storage = StorageModule.default
|
|
14
|
+
set = Storage.setItemSync.bind(Storage)
|
|
15
|
+
setAsync = Storage.setItem.bind(Storage)
|
|
16
|
+
|
|
17
|
+
get = Storage.getItemSync.bind(Storage)
|
|
18
|
+
getAsync = Storage.getItem.bind(Storage)
|
|
19
|
+
|
|
20
|
+
remove = Storage.removeItemSync.bind(Storage)
|
|
21
|
+
removeAsync = Storage.removeItem.bind(Storage)
|
|
22
|
+
}
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.log('expo-sqlite not available:', e)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const AbsStorage = {
|
|
28
|
+
set,
|
|
29
|
+
setAsync,
|
|
30
|
+
get,
|
|
31
|
+
getAsync,
|
|
32
|
+
remove,
|
|
33
|
+
removeAsync,
|
|
34
|
+
}
|
|
@@ -5,11 +5,13 @@ import { IconLabel } from '../presentation/IconLabel'
|
|
|
5
5
|
import { useBackgroundModifier } from '../../modifiers/background'
|
|
6
6
|
import { useBorderModifier } from '../../modifiers/border'
|
|
7
7
|
import { useColorConverter } from '../../modifiers/colorConverter'
|
|
8
|
+
import { useCursorModifier } from '../../modifiers/cursor'
|
|
8
9
|
import { useDefaultModifier } from '../../modifiers/default'
|
|
9
10
|
import { useDisplayModifier } from '../../modifiers/display'
|
|
10
11
|
import { useFlexModifier } from '../../modifiers/flex'
|
|
11
12
|
import { useFlexWrapperModifier } from '../../modifiers/flexWrapper'
|
|
12
13
|
import { useFullColorModifier } from '../../modifiers/fullColor'
|
|
14
|
+
import { useHoverConverter } from '../../modifiers/hover'
|
|
13
15
|
import { useMarginModifier } from '../../modifiers/margin'
|
|
14
16
|
import { usePaddingModifier } from '../../modifiers/padding'
|
|
15
17
|
import { usePositionModifier } from '../../modifiers/position'
|
|
@@ -25,6 +27,10 @@ const DEFAULT_PROPS = ([{ sizeCode }]) => ({
|
|
|
25
27
|
br: sizeCode,
|
|
26
28
|
border: 1,
|
|
27
29
|
center: true,
|
|
30
|
+
pointer: true,
|
|
31
|
+
hover: {
|
|
32
|
+
opacity: 0.7,
|
|
33
|
+
},
|
|
28
34
|
})
|
|
29
35
|
|
|
30
36
|
export function Button(rootProps) {
|
|
@@ -33,6 +39,8 @@ export function Button(rootProps) {
|
|
|
33
39
|
useSizeConverter('elementHeights', 'md'),
|
|
34
40
|
useThemeComponentModifier('Button'),
|
|
35
41
|
useDefaultModifier(DEFAULT_PROPS),
|
|
42
|
+
useHoverConverter,
|
|
43
|
+
useCursorModifier,
|
|
36
44
|
useFullColorModifier,
|
|
37
45
|
useDisplayModifier,
|
|
38
46
|
useStateModifier,
|
|
@@ -31,6 +31,8 @@ export function Dropdown({ items, ...rootProps }) {
|
|
|
31
31
|
popoverProps,
|
|
32
32
|
iconLabelProps,
|
|
33
33
|
children,
|
|
34
|
+
placement,
|
|
35
|
+
gap,
|
|
34
36
|
...props
|
|
35
37
|
} = formattedProps
|
|
36
38
|
|
|
@@ -38,16 +40,29 @@ export function Dropdown({ items, ...rootProps }) {
|
|
|
38
40
|
<View className="neko-dropdown" {...props}>
|
|
39
41
|
<Popover
|
|
40
42
|
useParentMinWidth
|
|
41
|
-
placement=
|
|
43
|
+
placement={placement || 'bottomLeft'}
|
|
42
44
|
trigger={trigger}
|
|
43
45
|
padding="xs"
|
|
46
|
+
useBottomDrawer={{ native: true, sm: true, md: true }}
|
|
47
|
+
bottomDrawerProps={{
|
|
48
|
+
bg: 'mainBG',
|
|
49
|
+
contentProps: { bg: 'overlayBG', br: 'lg', margin: 'md' },
|
|
50
|
+
}}
|
|
44
51
|
{...popoverProps}
|
|
45
52
|
renderContent={({ onClose }) => {
|
|
46
53
|
const handleChange = (...params) => {
|
|
47
54
|
if (onChange) onChange(...params)
|
|
48
55
|
onClose()
|
|
49
56
|
}
|
|
50
|
-
return
|
|
57
|
+
return (
|
|
58
|
+
<Menu
|
|
59
|
+
vertical
|
|
60
|
+
items={items}
|
|
61
|
+
onChange={handleChange}
|
|
62
|
+
_linkPaddingV="lg"
|
|
63
|
+
_linkProps={{ borderB: true, padding: 'lg', borderL: 0, brColor: 'divider' }}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
51
66
|
}}
|
|
52
67
|
>
|
|
53
68
|
{children || (
|
|
@@ -58,6 +73,7 @@ export function Dropdown({ items, ...rootProps }) {
|
|
|
58
73
|
strong={strong}
|
|
59
74
|
color={color}
|
|
60
75
|
invert
|
|
76
|
+
gap={gap}
|
|
61
77
|
{...iconLabelProps}
|
|
62
78
|
/>
|
|
63
79
|
</Link>
|