@niibase/uniwind 1.0.0 → 1.0.11
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/common/components/react-native-gesture-handler/index.js +122 -0
- package/dist/common/components/react-native-gesture-handler/native/BaseButton.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/BorderlessButton.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/DrawerLayoutAndroid.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/FlatList.js +30 -0
- package/dist/common/components/react-native-gesture-handler/native/GestureHandlerRootView.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/Pressable.js +29 -0
- package/dist/common/components/react-native-gesture-handler/native/PureNativeButton.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/RawButton.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/RectButton.js +18 -0
- package/dist/common/components/react-native-gesture-handler/native/RefreshControl.js +27 -0
- package/dist/common/components/react-native-gesture-handler/native/ScrollView.js +23 -0
- package/dist/common/components/react-native-gesture-handler/native/Switch.js +32 -0
- package/dist/common/components/react-native-gesture-handler/native/Text.js +36 -0
- package/dist/common/components/react-native-gesture-handler/native/TextInput.js +53 -0
- package/dist/common/components/react-native-gesture-handler/native/TouchableNativeFeedback.js +32 -0
- package/dist/common/components/react-native-gesture-handler/native/TouchableOpacity.js +32 -0
- package/dist/common/components/react-native-gesture-handler/native/TouchableWithoutFeedback.js +32 -0
- package/dist/common/components/react-native-svg/index.js +14 -0
- package/dist/common/components/react-native-svg/native/Svg.js +18 -0
- package/dist/common/components/react-native-svg/web/Svg.js +17 -0
- package/dist/common/core/native/runtime.js +2 -1
- package/dist/common/core/native/store.js +33 -3
- package/dist/metro/index.cjs +22 -6
- package/dist/metro/index.mjs +20 -4
- package/dist/metro/metro-transformer.cjs +56 -19
- package/dist/metro/metro-transformer.mjs +56 -19
- package/dist/module/components/react-native-gesture-handler/index.d.ts +0 -0
- package/dist/module/components/react-native-gesture-handler/index.js +120 -0
- package/dist/module/components/react-native-gesture-handler/native/BaseButton.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/BaseButton.js +15 -0
- package/dist/module/components/react-native-gesture-handler/native/BorderlessButton.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/BorderlessButton.js +18 -0
- package/dist/module/components/react-native-gesture-handler/native/DrawerLayoutAndroid.d.ts +5 -0
- package/dist/module/components/react-native-gesture-handler/native/DrawerLayoutAndroid.js +18 -0
- package/dist/module/components/react-native-gesture-handler/native/FlatList.d.ts +4 -0
- package/dist/module/components/react-native-gesture-handler/native/FlatList.js +27 -0
- package/dist/module/components/react-native-gesture-handler/native/GestureHandlerRootView.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/GestureHandlerRootView.js +18 -0
- package/dist/module/components/react-native-gesture-handler/native/Pressable.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/Pressable.js +29 -0
- package/dist/module/components/react-native-gesture-handler/native/PureNativeButton.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/PureNativeButton.js +15 -0
- package/dist/module/components/react-native-gesture-handler/native/RawButton.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/RawButton.js +15 -0
- package/dist/module/components/react-native-gesture-handler/native/RectButton.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/RectButton.js +15 -0
- package/dist/module/components/react-native-gesture-handler/native/RefreshControl.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/RefreshControl.js +24 -0
- package/dist/module/components/react-native-gesture-handler/native/ScrollView.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/ScrollView.js +20 -0
- package/dist/module/components/react-native-gesture-handler/native/Switch.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/Switch.js +26 -0
- package/dist/module/components/react-native-gesture-handler/native/Text.d.ts +2 -0
- package/dist/module/components/react-native-gesture-handler/native/Text.js +33 -0
- package/dist/module/components/react-native-gesture-handler/native/TextInput.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/TextInput.js +50 -0
- package/dist/module/components/react-native-gesture-handler/native/TouchableNativeFeedback.d.ts +2 -0
- package/dist/module/components/react-native-gesture-handler/native/TouchableNativeFeedback.js +32 -0
- package/dist/module/components/react-native-gesture-handler/native/TouchableOpacity.d.ts +3 -0
- package/dist/module/components/react-native-gesture-handler/native/TouchableOpacity.js +32 -0
- package/dist/module/components/react-native-gesture-handler/native/TouchableWithoutFeedback.d.ts +4 -0
- package/dist/module/components/react-native-gesture-handler/native/TouchableWithoutFeedback.js +34 -0
- package/dist/module/components/react-native-svg/index.d.ts +1 -0
- package/dist/module/components/react-native-svg/index.js +10 -0
- package/dist/module/components/react-native-svg/native/Svg.d.ts +3 -0
- package/dist/module/components/react-native-svg/native/Svg.js +15 -0
- package/dist/module/components/react-native-svg/web/Svg.d.ts +3 -0
- package/dist/module/components/react-native-svg/web/Svg.js +14 -0
- package/dist/module/core/native/runtime.js +2 -6
- package/dist/module/core/native/store.d.ts +2 -0
- package/dist/module/core/native/store.js +30 -3
- package/dist/module/core/types.d.ts +10 -0
- package/package.json +6 -1
- package/readme.md +3 -0
- package/src/components/react-native-gesture-handler/index.ts +121 -0
- package/src/components/react-native-gesture-handler/native/BaseButton.tsx +18 -0
- package/src/components/react-native-gesture-handler/native/BorderlessButton.tsx +19 -0
- package/src/components/react-native-gesture-handler/native/DrawerLayoutAndroid.tsx +20 -0
- package/src/components/react-native-gesture-handler/native/FlatList.tsx +29 -0
- package/src/components/react-native-gesture-handler/native/GestureHandlerRootView.tsx +20 -0
- package/src/components/react-native-gesture-handler/native/Pressable.tsx +31 -0
- package/src/components/react-native-gesture-handler/native/PureNativeButton.tsx +16 -0
- package/src/components/react-native-gesture-handler/native/RawButton.tsx +16 -0
- package/src/components/react-native-gesture-handler/native/RectButton.tsx +16 -0
- package/src/components/react-native-gesture-handler/native/RefreshControl.tsx +26 -0
- package/src/components/react-native-gesture-handler/native/ScrollView.tsx +22 -0
- package/src/components/react-native-gesture-handler/native/Switch.tsx +29 -0
- package/src/components/react-native-gesture-handler/native/Text.tsx +40 -0
- package/src/components/react-native-gesture-handler/native/TextInput.tsx +53 -0
- package/src/components/react-native-gesture-handler/native/TouchableNativeFeedback.tsx +35 -0
- package/src/components/react-native-gesture-handler/native/TouchableOpacity.tsx +34 -0
- package/src/components/react-native-gesture-handler/native/TouchableWithoutFeedback.tsx +37 -0
- package/src/components/react-native-svg/index.ts +12 -0
- package/src/components/react-native-svg/native/Svg.tsx +16 -0
- package/src/components/react-native-svg/web/Svg.tsx +14 -0
- package/src/core/native/runtime.ts +2 -6
- package/src/core/native/store.ts +51 -5
- package/src/core/types.ts +10 -0
- package/src/metro/compileVirtual.ts +5 -1
- package/src/metro/processor/mq.ts +15 -10
- package/src/metro/processor/processor.ts +55 -16
- package/src/metro/resolvers.ts +25 -3
- package/src/metro/types.ts +3 -2
- package/src/metro/withUniwindConfig.ts +1 -1
- package/types.d.ts +38 -0
- package/uniwind.css +1 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BorderlessButton as RNGHBorderlessButton } from "react-native-gesture-handler";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const BorderlessButton = copyComponentProperties(
|
|
6
|
+
RNGHBorderlessButton,
|
|
7
|
+
(props) => {
|
|
8
|
+
const style = useStyle(props.className);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
RNGHBorderlessButton,
|
|
11
|
+
{
|
|
12
|
+
...props,
|
|
13
|
+
style: [style, props.style]
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
export default BorderlessButton;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DrawerLayoutAndroidProps } from 'react-native';
|
|
2
|
+
export declare const DrawerLayoutAndroid: import("react").ForwardRefExoticComponent<DrawerLayoutAndroidProps & {
|
|
3
|
+
children?: React.ReactNode | undefined;
|
|
4
|
+
} & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>>;
|
|
5
|
+
export default DrawerLayoutAndroid;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DrawerLayoutAndroid as RNGHDrawerLayoutAndroid } from "react-native-gesture-handler";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const DrawerLayoutAndroid = copyComponentProperties(
|
|
6
|
+
RNGHDrawerLayoutAndroid,
|
|
7
|
+
(props) => {
|
|
8
|
+
const style = useStyle(props.className);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
RNGHDrawerLayoutAndroid,
|
|
11
|
+
{
|
|
12
|
+
...props,
|
|
13
|
+
style: [style, props.style]
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
export default DrawerLayoutAndroid;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FlatListProps } from 'react-native';
|
|
2
|
+
import { FlatList as RNGHFlatList } from 'react-native-gesture-handler';
|
|
3
|
+
export declare const FlatList: <ItemT = any>(props: import("react").PropsWithChildren<Omit<FlatListProps<ItemT>, "renderScrollComponent"> & import("react").RefAttributes<RNGHFlatList<ItemT>> & import("react-native-gesture-handler").NativeViewGestureHandlerProps>, ref?: import("react").ForwardedRef<RNGHFlatList<ItemT>>) => import("react").ReactElement | null;
|
|
4
|
+
export default FlatList;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FlatList as RNGHFlatList } from "react-native-gesture-handler";
|
|
3
|
+
import { useUniwindAccent } from "../../../hooks/index.js";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const FlatList = copyComponentProperties(RNGHFlatList, (props) => {
|
|
7
|
+
const style = useStyle(props.className);
|
|
8
|
+
const styleColumnWrapper = useStyle(props.columnWrapperClassName);
|
|
9
|
+
const styleContentContainer = useStyle(props.contentContainerClassName);
|
|
10
|
+
const styleListFooterComponent = useStyle(props.ListFooterComponentClassName);
|
|
11
|
+
const styleListHeaderComponent = useStyle(props.ListHeaderComponentClassName);
|
|
12
|
+
const endFillColor = useUniwindAccent(props.endFillColorClassName);
|
|
13
|
+
const hasSingleColumn = !("numColumns" in props) || props.numColumns === 1;
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
RNGHFlatList,
|
|
16
|
+
{
|
|
17
|
+
...props,
|
|
18
|
+
style: [style, props.style],
|
|
19
|
+
columnWrapperStyle: hasSingleColumn ? void 0 : [styleColumnWrapper, props.columnWrapperStyle],
|
|
20
|
+
contentContainerStyle: [styleContentContainer, props.contentContainerStyle],
|
|
21
|
+
ListFooterComponentStyle: [styleListFooterComponent, props.ListFooterComponentStyle],
|
|
22
|
+
ListHeaderComponentStyle: [styleListHeaderComponent, props.ListHeaderComponentStyle],
|
|
23
|
+
endFillColor: props.endFillColor ?? endFillColor
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
export default FlatList;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { GestureHandlerRootView as RNGestureHandlerRootView } from "react-native-gesture-handler";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const GestureHandlerRootView = copyComponentProperties(
|
|
6
|
+
RNGestureHandlerRootView,
|
|
7
|
+
(props) => {
|
|
8
|
+
const style = useStyle(props.className);
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
RNGestureHandlerRootView,
|
|
11
|
+
{
|
|
12
|
+
...props,
|
|
13
|
+
style: [style, props.style]
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
export default GestureHandlerRootView;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable as RNGHPressable } from "react-native-gesture-handler";
|
|
3
|
+
import { UniwindStore } from "../../../core/native/index.js";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const Pressable = copyComponentProperties(RNGHPressable, (props) => {
|
|
7
|
+
const style = useStyle(props.className, {
|
|
8
|
+
isDisabled: Boolean(props.disabled)
|
|
9
|
+
});
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
RNGHPressable,
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
style: (state) => {
|
|
15
|
+
if (state.pressed) {
|
|
16
|
+
return [
|
|
17
|
+
UniwindStore.getStyles(
|
|
18
|
+
props.className,
|
|
19
|
+
{ isDisabled: Boolean(props.disabled), isPressed: true }
|
|
20
|
+
).styles,
|
|
21
|
+
typeof props.style === "function" ? props.style(state) : props.style
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
return [style, typeof props.style === "function" ? props.style(state) : props.style];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
export default Pressable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PureNativeButton as RNGHPureNativeButton } from "react-native-gesture-handler";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const PureNativeButton = copyComponentProperties(RNGHPureNativeButton, (props) => {
|
|
6
|
+
const style = useStyle(props.className);
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
RNGHPureNativeButton,
|
|
9
|
+
{
|
|
10
|
+
...props,
|
|
11
|
+
style: [style, props.style]
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
export default PureNativeButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RawButtonProps } from 'react-native-gesture-handler';
|
|
2
|
+
export declare const RawButton: import("react").ForwardRefExoticComponent<RawButtonProps & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>>;
|
|
3
|
+
export default RawButton;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RawButton as RNGHRawButton } from "react-native-gesture-handler";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const RawButton = copyComponentProperties(RNGHRawButton, (props) => {
|
|
6
|
+
const style = useStyle(props.className);
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
RNGHRawButton,
|
|
9
|
+
{
|
|
10
|
+
...props,
|
|
11
|
+
style: [style, props.style]
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
export default RawButton;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RectButton as RNGHRectButton } from "react-native-gesture-handler";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const RectButton = copyComponentProperties(RNGHRectButton, (props) => {
|
|
6
|
+
const style = useStyle(props.className);
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
RNGHRectButton,
|
|
9
|
+
{
|
|
10
|
+
...props,
|
|
11
|
+
style: [style, props.style]
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
export default RectButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RefreshControlProps } from 'react-native';
|
|
2
|
+
export declare const RefreshControl: import("react").ForwardRefExoticComponent<RefreshControlProps & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>>;
|
|
3
|
+
export default RefreshControl;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshControl as RNGHRefreshControl } from "react-native-gesture-handler";
|
|
3
|
+
import { useUniwindAccent } from "../../../hooks/index.js";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const RefreshControl = copyComponentProperties(RNGHRefreshControl, (props) => {
|
|
7
|
+
const style = useStyle(props.className);
|
|
8
|
+
const color = useUniwindAccent(props.colorsClassName);
|
|
9
|
+
const tintColor = useUniwindAccent(props.tintColorClassName);
|
|
10
|
+
const titleColor = useUniwindAccent(props.titleColorClassName);
|
|
11
|
+
const progressBackgroundColor = useUniwindAccent(props.progressBackgroundColorClassName);
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
RNGHRefreshControl,
|
|
14
|
+
{
|
|
15
|
+
...props,
|
|
16
|
+
style: [style, props.style],
|
|
17
|
+
colors: props.colors ?? (color !== void 0 ? [color] : void 0),
|
|
18
|
+
tintColor: props.tintColor ?? tintColor,
|
|
19
|
+
titleColor: props.titleColor ?? titleColor,
|
|
20
|
+
progressBackgroundColor: props.progressBackgroundColor ?? progressBackgroundColor
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
export default RefreshControl;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ScrollViewProps } from 'react-native';
|
|
2
|
+
export declare const ScrollView: import("react").ForwardRefExoticComponent<ScrollViewProps & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react-native").ScrollView>>;
|
|
3
|
+
export default ScrollView;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollView as RNGHScrollView } from "react-native-gesture-handler";
|
|
3
|
+
import { useUniwindAccent } from "../../../hooks/index.js";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const ScrollView = copyComponentProperties(RNGHScrollView, (props) => {
|
|
7
|
+
const style = useStyle(props.className);
|
|
8
|
+
const contentContainerStyle = useStyle(props.contentContainerClassName);
|
|
9
|
+
const endFillColor = useUniwindAccent(props.endFillColorClassName);
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
RNGHScrollView,
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
style: [style, props.style],
|
|
15
|
+
contentContainerStyle: [contentContainerStyle, props.contentContainerStyle],
|
|
16
|
+
endFillColor: props.endFillColor ?? endFillColor
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
export default ScrollView;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SwitchProps } from 'react-native';
|
|
2
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>>;
|
|
3
|
+
export default Switch;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as RNGHSwitch } from "react-native-gesture-handler";
|
|
3
|
+
import { useUniwindAccent } from "../../../hooks/useUniwindAccent.native.js";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const Switch = copyComponentProperties(RNGHSwitch, (props) => {
|
|
7
|
+
const state = {
|
|
8
|
+
isDisabled: Boolean(props.disabled)
|
|
9
|
+
};
|
|
10
|
+
const style = useStyle(props.className, state);
|
|
11
|
+
const trackColorOn = useUniwindAccent(props.trackColorOnClassName, state);
|
|
12
|
+
const trackColorOff = useUniwindAccent(props.trackColorOffClassName, state);
|
|
13
|
+
const thumbColor = useUniwindAccent(props.thumbColorClassName, state);
|
|
14
|
+
const ios_backgroundColor = useUniwindAccent(props.ios_backgroundColorClassName, state);
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
RNGHSwitch,
|
|
17
|
+
{
|
|
18
|
+
...props,
|
|
19
|
+
style: [style, props.style],
|
|
20
|
+
thumbColor: props.thumbColor ?? thumbColor,
|
|
21
|
+
trackColor: { true: props.trackColor?.true ?? trackColorOn, false: props.trackColor?.false ?? trackColorOff },
|
|
22
|
+
ios_backgroundColor: props.ios_backgroundColor ?? ios_backgroundColor
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
export default Switch;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Text as RNGHText } from "react-native-gesture-handler";
|
|
4
|
+
import { useUniwindAccent } from "../../../hooks/useUniwindAccent.native.js";
|
|
5
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
6
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
7
|
+
export const Text = copyComponentProperties(RNGHText, (props) => {
|
|
8
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
9
|
+
const state = {
|
|
10
|
+
isPressed,
|
|
11
|
+
isDisabled: Boolean(props.disabled)
|
|
12
|
+
};
|
|
13
|
+
const style = useStyle(props.className, state);
|
|
14
|
+
const selectionColor = useUniwindAccent(props.selectionColorClassName, state);
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
RNGHText,
|
|
17
|
+
{
|
|
18
|
+
...props,
|
|
19
|
+
style: [style, props.style],
|
|
20
|
+
selectionColor: props.selectionColor ?? selectionColor,
|
|
21
|
+
numberOfLines: style.WebkitLineClamp ?? props.numberOfLines,
|
|
22
|
+
onPressIn: (event) => {
|
|
23
|
+
setIsPressed(true);
|
|
24
|
+
props.onPressIn?.(event);
|
|
25
|
+
},
|
|
26
|
+
onPressOut: (event) => {
|
|
27
|
+
setIsPressed(false);
|
|
28
|
+
props.onPressOut?.(event);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
export default Text;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TextInputProps } from 'react-native';
|
|
2
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react-native-gesture-handler").NativeViewGestureHandlerProps & import("react").RefAttributes<import("react").ComponentType<any>>>;
|
|
3
|
+
export default TextInput;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { TextInput as RNGHTextInput } from "react-native-gesture-handler";
|
|
4
|
+
import { useUniwindAccent } from "../../../hooks/useUniwindAccent.native.js";
|
|
5
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
6
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
7
|
+
export const TextInput = copyComponentProperties(RNGHTextInput, (props) => {
|
|
8
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
9
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
10
|
+
const state = {
|
|
11
|
+
isDisabled: props.editable === false,
|
|
12
|
+
isFocused,
|
|
13
|
+
isPressed
|
|
14
|
+
};
|
|
15
|
+
const style = useStyle(props.className, state);
|
|
16
|
+
const cursorColor = useUniwindAccent(props.cursorColorClassName, state);
|
|
17
|
+
const selectionColor = useUniwindAccent(props.selectionColorClassName, state);
|
|
18
|
+
const placeholderTextColor = useUniwindAccent(props.placeholderTextColorClassName, state);
|
|
19
|
+
const selectionHandleColor = useUniwindAccent(props.selectionHandleColorClassName, state);
|
|
20
|
+
const underlineColorAndroid = useUniwindAccent(props.underlineColorAndroidClassName, state);
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
RNGHTextInput,
|
|
23
|
+
{
|
|
24
|
+
...props,
|
|
25
|
+
style: [style, props.style],
|
|
26
|
+
cursorColor: props.cursorColor ?? cursorColor,
|
|
27
|
+
selectionColor: props.selectionColor ?? selectionColor,
|
|
28
|
+
placeholderTextColor: props.placeholderTextColor ?? placeholderTextColor,
|
|
29
|
+
selectionHandleColor: props.selectionHandleColor ?? selectionHandleColor,
|
|
30
|
+
underlineColorAndroid: props.underlineColorAndroid ?? underlineColorAndroid,
|
|
31
|
+
onFocus: (event) => {
|
|
32
|
+
setIsFocused(true);
|
|
33
|
+
props.onFocus?.(event);
|
|
34
|
+
},
|
|
35
|
+
onBlur: (event) => {
|
|
36
|
+
setIsFocused(false);
|
|
37
|
+
props.onBlur?.(event);
|
|
38
|
+
},
|
|
39
|
+
onPressIn: (event) => {
|
|
40
|
+
setIsPressed(true);
|
|
41
|
+
props.onPressIn?.(event);
|
|
42
|
+
},
|
|
43
|
+
onPressOut: (event) => {
|
|
44
|
+
setIsPressed(false);
|
|
45
|
+
props.onPressOut?.(event);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
export default TextInput;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { TouchableNativeFeedback as RNGHTouchableNativeFeedback } from "react-native-gesture-handler";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const TouchableNativeFeedback = copyComponentProperties(
|
|
7
|
+
RNGHTouchableNativeFeedback,
|
|
8
|
+
(props) => {
|
|
9
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
10
|
+
const state = {
|
|
11
|
+
isDisabled: Boolean(props.disabled),
|
|
12
|
+
isPressed
|
|
13
|
+
};
|
|
14
|
+
const style = useStyle(props.className, state);
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
RNGHTouchableNativeFeedback,
|
|
17
|
+
{
|
|
18
|
+
...props,
|
|
19
|
+
style: [style, props.style],
|
|
20
|
+
onPressIn: (event) => {
|
|
21
|
+
setIsPressed(true);
|
|
22
|
+
props.onPressIn?.(event);
|
|
23
|
+
},
|
|
24
|
+
onPressOut: (event) => {
|
|
25
|
+
setIsPressed(false);
|
|
26
|
+
props.onPressOut?.(event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
export default TouchableNativeFeedback;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { TouchableOpacity as RNGHTouchableOpacity } from "react-native-gesture-handler";
|
|
4
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
5
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
6
|
+
export const TouchableOpacity = copyComponentProperties(
|
|
7
|
+
RNGHTouchableOpacity,
|
|
8
|
+
(props) => {
|
|
9
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
10
|
+
const state = {
|
|
11
|
+
isDisabled: Boolean(props.disabled),
|
|
12
|
+
isPressed
|
|
13
|
+
};
|
|
14
|
+
const style = useStyle(props.className, state);
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
RNGHTouchableOpacity,
|
|
17
|
+
{
|
|
18
|
+
...props,
|
|
19
|
+
style: [style, props.style],
|
|
20
|
+
onPressIn: () => {
|
|
21
|
+
setIsPressed(true);
|
|
22
|
+
props.onPressIn?.();
|
|
23
|
+
},
|
|
24
|
+
onPressOut: () => {
|
|
25
|
+
setIsPressed(false);
|
|
26
|
+
props.onPressOut?.();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
export default TouchableOpacity;
|
package/dist/module/components/react-native-gesture-handler/native/TouchableWithoutFeedback.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const TouchableWithoutFeedback: import("react").ForwardRefExoticComponent<import("react-native-gesture-handler/lib/typescript/components/touchables/GenericTouchableProps").GenericTouchableProps & {
|
|
2
|
+
children?: React.ReactNode | undefined;
|
|
3
|
+
} & import("react").RefAttributes<import("react-native-gesture-handler/lib/typescript/components/touchables/GenericTouchable").default>>;
|
|
4
|
+
export default TouchableWithoutFeedback;
|
package/dist/module/components/react-native-gesture-handler/native/TouchableWithoutFeedback.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
TouchableWithoutFeedback as RNGHTouchableWithoutFeedback
|
|
5
|
+
} from "react-native-gesture-handler";
|
|
6
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
7
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
8
|
+
export const TouchableWithoutFeedback = copyComponentProperties(
|
|
9
|
+
RNGHTouchableWithoutFeedback,
|
|
10
|
+
(props) => {
|
|
11
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
12
|
+
const state = {
|
|
13
|
+
isDisabled: Boolean(props.disabled),
|
|
14
|
+
isPressed
|
|
15
|
+
};
|
|
16
|
+
const style = useStyle(props.className, state);
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
RNGHTouchableWithoutFeedback,
|
|
19
|
+
{
|
|
20
|
+
...props,
|
|
21
|
+
style: [style, props.style],
|
|
22
|
+
onPressIn: () => {
|
|
23
|
+
setIsPressed(true);
|
|
24
|
+
props.onPressIn?.();
|
|
25
|
+
},
|
|
26
|
+
onPressOut: () => {
|
|
27
|
+
setIsPressed(false);
|
|
28
|
+
props.onPressOut?.();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
export default TouchableWithoutFeedback;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Svg as RNSvg } from "react-native-svg";
|
|
3
|
+
import { useStyle } from "../../native/useStyle.js";
|
|
4
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
5
|
+
export const Svg = copyComponentProperties(RNSvg, (props) => {
|
|
6
|
+
const style = useStyle(props.className);
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
RNSvg,
|
|
9
|
+
{
|
|
10
|
+
...props,
|
|
11
|
+
style: [style, props.style]
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
export default Svg;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Svg as RNSvg } from "react-native-svg";
|
|
3
|
+
import { copyComponentProperties } from "../../utils.js";
|
|
4
|
+
import { toRNWClassName } from "../../web/rnw.js";
|
|
5
|
+
export const Svg = copyComponentProperties(RNSvg, (props) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
RNSvg,
|
|
8
|
+
{
|
|
9
|
+
...props,
|
|
10
|
+
style: [toRNWClassName(props.className), props.style]
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
});
|
|
14
|
+
export default Svg;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Appearance, Dimensions, I18nManager, PixelRatio, StyleSheet } from "react-native";
|
|
2
|
+
import { initialWindowMetrics } from "react-native-safe-area-context";
|
|
2
3
|
import { ColorScheme, Orientation } from "../../types.js";
|
|
3
4
|
import { colorMix, lightDark } from "./native-utils.js";
|
|
4
5
|
const window = Dimensions.get("window");
|
|
@@ -14,12 +15,7 @@ export const UniwindRuntime = {
|
|
|
14
15
|
fontScale: (value) => value * PixelRatio.getFontScale(),
|
|
15
16
|
hairlineWidth: StyleSheet.hairlineWidth,
|
|
16
17
|
rtl: I18nManager.isRTL,
|
|
17
|
-
insets: {
|
|
18
|
-
top: 0,
|
|
19
|
-
left: 0,
|
|
20
|
-
bottom: 0,
|
|
21
|
-
right: 0
|
|
22
|
-
},
|
|
18
|
+
insets: initialWindowMetrics?.insets ?? { top: 0, left: 0, bottom: 0, right: 0 },
|
|
23
19
|
colorMix,
|
|
24
20
|
pixelRatio: (value) => value * PixelRatio.get(),
|
|
25
21
|
cubicBezier: () => "",
|
|
@@ -9,10 +9,12 @@ declare class UniwindStoreBuilder {
|
|
|
9
9
|
vars: Record<string, unknown>;
|
|
10
10
|
runtimeThemeVariables: Map<string, CSSVariables>;
|
|
11
11
|
private stylesheet;
|
|
12
|
+
private varsWithMediaQueries;
|
|
12
13
|
private cache;
|
|
13
14
|
private generateStyleSheetCallbackResult;
|
|
14
15
|
getStyles(className?: string, state?: ComponentState): StylesResult;
|
|
15
16
|
reinit: (generateStyleSheetCallback?: GenerateStyleSheetsCallback) => void;
|
|
17
|
+
private resolveMediaQueryVars;
|
|
16
18
|
private resolveStyles;
|
|
17
19
|
}
|
|
18
20
|
export declare const UniwindStore: UniwindStoreBuilder;
|