Kaynağa Gözat

Merge branch 'release/1.0.0-pre-alpha.15'

lfabl 1 ay önce
ebeveyn
işleme
3a224c72a3

+ 2 - 1
eslint.config.mjs

@@ -15,7 +15,8 @@ export default tseslint.config(
             "node_modules",
             "dist",
             "lib",
-            ".history"
+            ".history",
+            "version.mjs"
         ]
     },
     js.configs.recommended,

+ 129 - 121
example/src/pages/home/index.tsx

@@ -1,4 +1,5 @@
 import {
+    Fragment,
     useState,
     useRef
 } from "react";
@@ -8,6 +9,7 @@ import {
 import stylesheet from "./stylesheet";
 import {
     NCoreUIKitBottomSheet,
+    NotificationIndicator,
     getNCoreUIKitVersion,
     type IBottomSheetRef,
     NCoreUIKitSnackBar,
@@ -25,8 +27,7 @@ import {
     Button,
     Dialog,
     Switch,
-    Text,
-    NotificationIndicator
+    Text
 } from "ncore-ui-kit-mobile";
 import {
     useNavigation
@@ -232,13 +233,136 @@ const Home = () => {
         scrollViewStyle={stylesheet.container}
         scrollViewProps={{
             contentContainerStyle: {
-                backgroundColor: colors.content.container.default
+                backgroundColor: colors.content.container.default,
+                ...stylesheet.contentContainer
             }
         }}
+        renderOverlays={() => {
+            return <Fragment>
+                <Dialog
+                    isVisible={isDialogActive}
+                    content="etgweı09gı9w0eg"
+                    title="Merhaba Dünya!"
+                    modalProps={{
+                        isWorkWithPortal: false
+                    }}
+                    onOverlayPress={({
+                        closeAnimation
+                    }) => {
+                        closeAnimation(() => setIsDialogActive(false));
+                    }}
+                    variant="info"
+                    secondaryButtonProps={{
+                        title: "sdfgsdg",
+                        onPress: () => {
+
+                        }
+                    }}
+                    primaryButtonProps={{
+                        onPress: ({
+                            closeAnimation
+                        }) => {
+                            closeAnimation(() => setIsDialogActive(false));
+                        }
+                    }}
+                />
+                <BottomSheet
+                    ref={bottomSheetRef}
+                    renderHeader={() => {
+                        return <View
+                            style={[
+                                {
+                                    backgroundColor: "blue",
+                                    padding: 20
+                                }
+                            ]}
+                        >
+                            <Text>Burası header.</Text>
+                        </View>;
+                    }}
+                    isCanFullScreenOnSwipe={true}
+                    isWorkWithPortal={false}
+                    snapPoint={300}
+                    key="ahmet"
+                >
+                    <Button
+                        title="Open Toast"
+                        variant="filled"
+                        type="warning"
+                        onPress={() => {
+                            NCoreUIKitToast.open({
+                                title: "sdgfsdgsdg",
+                                type: "danger"
+                            });
+                        }}
+                    />
+                    <Button
+                        onPress={() => {
+                            navigation.navigate("TestSubPage");
+                        }}
+                        title="Git."
+                    />
+                    {[
+                        0,
+                        1,
+                        2,
+                        3,
+                        4,
+                        5,
+                        6,
+                        7,
+                        8,
+                        9,
+                        10,
+                        11,
+                        12,
+                        13,
+                        14,
+                        15,
+                        16,
+                        17,
+                        18,
+                        19,
+                        20,
+                        21,
+                        22,
+                        23,
+                        24,
+                        25,
+                        26,
+                        27,
+                        28,
+                        29,
+                        30,
+                        31,
+                        32,
+                        33,
+                        34,
+                        35
+                    ].map((it) => {
+                        return <View
+                            key={`fds-${it}`}
+                            style={{
+                                backgroundColor: `rgb(${it * 10}, ${it > 30 ? it * 5 : "0"}, ${it > 20 ? it * 4 : "0"})`,
+                                height: 150
+                            }}
+                        />;
+                    })}
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                    <Text>Deneme 123</Text>
+                </BottomSheet>
+            </Fragment>;
+        }}
     >
         <NotificationIndicator
             type="danger"
-            title={153}
+            title={53}
         >
             <Button
                 size="small"
@@ -315,6 +439,7 @@ const Home = () => {
             hintText="Test deneme"
             isShowSubTitle={true}
             isMultipleSelect={true}
+            isWorkWithRealtime={false}
             maxChoice={-1}
             minChoice={0}
             initialSelectedItems={[{
@@ -434,123 +559,6 @@ const Home = () => {
                 });
             }}
         />
-        <Dialog
-            isVisible={isDialogActive}
-            content="etgweı09gı9w0eg"
-            title="Merhaba Dünya!"
-            modalProps={{
-                isWorkWithPortal: false
-            }}
-            onOverlayPress={({
-                closeAnimation
-            }) => {
-                closeAnimation(() => setIsDialogActive(false));
-            }}
-            variant="info"
-            secondaryButtonProps={{
-                title: "sdfgsdg",
-                onPress: () => {
-
-                }
-            }}
-            primaryButtonProps={{
-                onPress: ({
-                    closeAnimation
-                }) => {
-                    closeAnimation(() => setIsDialogActive(false));
-                }
-            }}
-        />
-        <BottomSheet
-            ref={bottomSheetRef}
-            renderHeader={() => {
-                return <View
-                    style={[
-                        {
-                            backgroundColor: "blue",
-                            padding: 20
-                        }
-                    ]}
-                >
-                    <Text>Burası header.</Text>
-                </View>;
-            }}
-            isCanFullScreenOnSwipe={true}
-            snapPoint={300}
-            key="ahmet"
-        >
-            <Button
-                title="Open Toast"
-                variant="filled"
-                type="warning"
-                onPress={() => {
-                    NCoreUIKitToast.open({
-                        title: "sdgfsdgsdg",
-                        type: "danger"
-                    });
-                }}
-            />
-            <Button
-                onPress={() => {
-                    navigation.navigate("TestSubPage");
-                }}
-                title="Git."
-            />
-            {[
-                0,
-                1,
-                2,
-                3,
-                4,
-                5,
-                6,
-                7,
-                8,
-                9,
-                10,
-                11,
-                12,
-                13,
-                14,
-                15,
-                16,
-                17,
-                18,
-                19,
-                20,
-                21,
-                22,
-                23,
-                24,
-                25,
-                26,
-                27,
-                28,
-                29,
-                30,
-                31,
-                32,
-                33,
-                34,
-                35
-            ].map((it) => {
-                return <View
-                    key={`fds-${it}`}
-                    style={{
-                        backgroundColor: `rgb(${it * 10}, ${it > 30 ? it * 5 : "0"}, ${it > 20 ? it * 4 : "0"})`,
-                        height: 150
-                    }}
-                />;
-            })}
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-            <Text>Deneme 123</Text>
-        </BottomSheet>
     </PageContainer>;
 };
 export default Home;

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
     "name": "ncore-ui-kit-mobile",
-    "version": "1.0.0-pre-alpha.14",
+    "version": "1.0.0-pre-alpha.15",
     "description": "NİBGAT® | NCore - UI Kit for React-Native Mobile Apps.",
     "main": "./lib/module/index.js",
     "types": "./lib/typescript/src/index.d.ts",
@@ -35,7 +35,7 @@
         "example": "yarn workspace ncore-ui-kit-mobile-example",
         "clean": "del-cli lib",
         "lint": "eslint . --ext .ts,.tsx --fix",
-        "prepare": "bob build && copyfiles -u 1 \"src/variants/**/*.json\" lib/typescript/src/",
+        "prepare": "bob build && copyfiles -u 1 \"src/variants/**/*.json\" lib/typescript/src/ && node version.mjs",
         "typecheck": "tsc",
         "release": "release-it --only-version",
         "build": "yarn clean && yarn lint && yarn typecheck && yarn prepare && npm publish"

+ 15 - 17
src/components/button/index.tsx

@@ -167,22 +167,20 @@ const Button: FC<IButtonProps> = ({
         />;
     };
 
-    return (
-        <TouchableOpacity
-            {...props}
-            onPress={isDisabled || isLoading ? () => null : onPress}
-            disabled={isDisabled || isLoading}
-            style={[
-                style,
-                stylesheet.container,
-                containerDynamicStyle
-            ]}
-        >
-            {renderIcon()}
-            {renderTitle()}
-
-            {renderOverlay()}
-        </TouchableOpacity>
-    );
+    return <TouchableOpacity
+        {...props}
+        onPress={isDisabled || isLoading ? () => null : onPress}
+        disabled={isDisabled || isLoading}
+        style={[
+            style,
+            stylesheet.container,
+            containerDynamicStyle
+        ]}
+    >
+        {renderIcon()}
+        {renderTitle()}
+
+        {renderOverlay()}
+    </TouchableOpacity>;
 };
 export default Button;

+ 1 - 1
src/components/notificationIndicator/index.tsx

@@ -19,9 +19,9 @@ import Text from "../text";
 const NotificationIndicator: FC<INotificationIndicatorProps> = ({
     floorBackgroundColor = "default",
     titleVariant = "labelSmallSize",
+    spreadBehaviour = "baseline",
     isDisabled = false,
     type = "neutral",
-    spreadBehaviour,
     customTheme,
     titleStyle,
     isLoading,

+ 0 - 1
src/components/notificationIndicator/stylesheet.ts

@@ -65,7 +65,6 @@ const stylesheet = StyleSheet.create({
     container: {
         backgroundColor: "transparent",
         borderColor: "transparent",
-        alignSelf: "baseline",
         position: "relative"
     },
     indicatorContainer: {

+ 7 - 1
src/components/pageContainer/index.tsx

@@ -1,4 +1,5 @@
 import {
+    Fragment,
     type FC
 } from "react";
 import {
@@ -22,6 +23,7 @@ const PageContainer: FC<IPageContainerProps> = ({
     safeAreaViewStyle,
     scrollViewStyle,
     scrollViewProps,
+    renderOverlays,
     customTheme,
     children,
     style,
@@ -97,6 +99,7 @@ const PageContainer: FC<IPageContainerProps> = ({
             ]}
         >
             {isScrollable ? renderScrollview() : renderView()}
+            {renderOverlays ? renderOverlays() : null}
         </SafeAreaView>;
     };
 
@@ -105,7 +108,10 @@ const PageContainer: FC<IPageContainerProps> = ({
     };
 
     const renderSafeareaContext = () => {
-        return isWrapSafeareaContext ? renderWithSafeareaView() : renderWithoutSafeareaView();
+        return isWrapSafeareaContext ? renderWithSafeareaView() : <Fragment>
+            {renderWithoutSafeareaView()}
+            {renderOverlays ? renderOverlays() : null}
+        </Fragment>;
     };
 
     return renderSafeareaContext();

+ 1 - 0
src/components/pageContainer/type.ts

@@ -13,6 +13,7 @@ interface IPageContainerProps {
     safeAreaViewStyle?: StyleProp<ViewStyle>;
     scrollViewStyle?: StyleProp<ViewStyle>;
     scrollViewProps?: ScrollViewProps;
+    renderOverlays?: () => ReactNode;
     isWrapSafeareaContext?: boolean;
     style?: StyleProp<ViewStyle>;
     isScrollable?: boolean;

+ 4 - 1
tsconfig.json

@@ -32,5 +32,8 @@
         "strict": true,
         "target": "ESNext",
         "verbatimModuleSyntax": true
-    }
+    },
+    "exclude": [
+        "version.mjs"
+    ]
 }

+ 26 - 0
version.mjs

@@ -0,0 +1,26 @@
+import fs from "fs";
+
+const rootPkg = JSON.parse(fs.readFileSync("./package.json"), "utf-8");
+const version = rootPkg.version;
+
+const targets = [
+    "./lib/module/package.json",
+    "./lib/typescript/package.json"
+];
+
+targets.forEach(target => {
+    if (fs.existsSync(target)) {
+        const pkg = JSON.parse(fs.readFileSync(target, "utf-8"));
+
+        pkg.version = version;
+
+        fs.writeFileSync(target, JSON.stringify(pkg, null, 2));
+        console.log(`✅ ${target} güncellendi: version ${version} eklendi.`);
+    }
+});
+
+fs.writeFileSync("./lib/package.json", JSON.stringify({
+    version: version,
+    type: "module"
+}, null, 4));
+console.log(`✅ Main package.json eklendi.`);