@particle-network/ui-native 0.4.2-beta.1 → 0.4.2-beta.2
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/components/UXTabSwitch/index.d.ts +15 -0
- package/dist/components/UXTabSwitch/index.js +29 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/locales/en.d.ts +4 -0
- package/dist/locales/en.js +4 -0
- package/dist/locales/index.d.ts +12 -0
- package/dist/locales/zh.js +4 -0
- package/package.json +8 -8
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type UXTabsProps } from '../UXTabs';
|
|
3
|
+
interface UXTabSwitchProps {
|
|
4
|
+
size?: UXTabsProps['size'];
|
|
5
|
+
color?: UXTabsProps['color'];
|
|
6
|
+
onTitle?: string;
|
|
7
|
+
onIcon?: React.ReactNode;
|
|
8
|
+
offTitle?: string;
|
|
9
|
+
offIcon?: React.ReactNode;
|
|
10
|
+
isSelected?: boolean;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
onValueChange?: (isSelected: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const UXTabSwitch: React.FC<UXTabSwitchProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { useI18n } from "../../hooks/useI18n.js";
|
|
4
|
+
import { UXTab, UXTabs } from "../UXTabs/index.js";
|
|
5
|
+
const UXTabSwitch = (props)=>{
|
|
6
|
+
const { size, color, onTitle, onIcon, offTitle, offIcon, isSelected = false, isDisabled = false, onValueChange } = props;
|
|
7
|
+
const i18n = useI18n();
|
|
8
|
+
return /*#__PURE__*/ jsxs(UXTabs, {
|
|
9
|
+
size: size,
|
|
10
|
+
variant: "switch",
|
|
11
|
+
color: color,
|
|
12
|
+
isDisabled: isDisabled,
|
|
13
|
+
selectedKey: isSelected.toString(),
|
|
14
|
+
onSelectionChange: (key)=>{
|
|
15
|
+
onValueChange?.('true' === key);
|
|
16
|
+
},
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ jsx(UXTab, {
|
|
19
|
+
title: offTitle || i18n.switch.off,
|
|
20
|
+
icon: offIcon
|
|
21
|
+
}, "false"),
|
|
22
|
+
/*#__PURE__*/ jsx(UXTab, {
|
|
23
|
+
title: onTitle || i18n.switch.on,
|
|
24
|
+
icon: onIcon
|
|
25
|
+
}, "true")
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export { UXTabSwitch };
|
package/dist/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from "./UXRadio/index.js";
|
|
|
16
16
|
export * from "./UXSpinner/index.js";
|
|
17
17
|
export * from "./UXSwitch/index.js";
|
|
18
18
|
export * from "./UXTabs/index.js";
|
|
19
|
+
export * from "./UXTabSwitch/index.js";
|
|
19
20
|
export * from "./UXToast/index.js";
|
|
20
21
|
export * from "./UXTooltip/index.js";
|
|
21
22
|
export * from "./UXTouchableOpacity/index.js";
|
package/dist/locales/en.d.ts
CHANGED
package/dist/locales/en.js
CHANGED
package/dist/locales/index.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ export declare const locales: {
|
|
|
41
41
|
warning: string;
|
|
42
42
|
info: string;
|
|
43
43
|
};
|
|
44
|
+
switch: {
|
|
45
|
+
on: string;
|
|
46
|
+
off: string;
|
|
47
|
+
};
|
|
44
48
|
};
|
|
45
49
|
zh: {
|
|
46
50
|
datePicker: {
|
|
@@ -81,6 +85,10 @@ export declare const locales: {
|
|
|
81
85
|
warning: string;
|
|
82
86
|
info: string;
|
|
83
87
|
};
|
|
88
|
+
switch: {
|
|
89
|
+
on: string;
|
|
90
|
+
off: string;
|
|
91
|
+
};
|
|
84
92
|
};
|
|
85
93
|
};
|
|
86
94
|
export declare function getLocaleText(locale: Locale): {
|
|
@@ -122,4 +130,8 @@ export declare function getLocaleText(locale: Locale): {
|
|
|
122
130
|
warning: string;
|
|
123
131
|
info: string;
|
|
124
132
|
};
|
|
133
|
+
switch: {
|
|
134
|
+
on: string;
|
|
135
|
+
off: string;
|
|
136
|
+
};
|
|
125
137
|
};
|
package/dist/locales/zh.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-native",
|
|
3
|
-
"version": "0.4.2-beta.
|
|
3
|
+
"version": "0.4.2-beta.2",
|
|
4
4
|
"main": "./entry.js",
|
|
5
5
|
"react-native": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"react-native-paper": "^5.14.5",
|
|
45
45
|
"react-native-size-matters": "^0.4.2",
|
|
46
46
|
"react-native-toast-message": "^2.3.3",
|
|
47
|
-
"@particle-network/
|
|
48
|
-
"@particle-network/
|
|
47
|
+
"@particle-network/icons": "0.4.2-beta.2",
|
|
48
|
+
"@particle-network/ui-shared": "0.3.2-beta.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/core": "^7.24.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"expo-constants": "~18.0.8",
|
|
76
76
|
"expo-status-bar": "~3.0.8",
|
|
77
77
|
"lucide-react-native": "^0.541.0",
|
|
78
|
-
"react": "19.1.
|
|
79
|
-
"react-dom": "19.1.
|
|
78
|
+
"react": "19.1.0",
|
|
79
|
+
"react-dom": "19.1.0",
|
|
80
80
|
"react-native": "0.81.5",
|
|
81
81
|
"react-native-gesture-handler": "~2.28.0",
|
|
82
82
|
"react-native-reanimated": "~4.1.0",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"unfetch": "^4.2.0",
|
|
89
89
|
"vite": "^6.3.5",
|
|
90
90
|
"zustand": "^5.0.8",
|
|
91
|
-
"@particle-network/
|
|
91
|
+
"@particle-network/eslint-config": "0.3.0",
|
|
92
92
|
"@particle-network/lintstaged-config": "0.1.0",
|
|
93
|
-
"@particle-network/
|
|
93
|
+
"@particle-network/icons": "0.4.2-beta.2"
|
|
94
94
|
},
|
|
95
95
|
"overrides": {
|
|
96
96
|
"react-docgen-typescript": "2.2.2",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"storybook:build": "storybook build",
|
|
112
112
|
"storybook:preview": "serve storybook-static",
|
|
113
113
|
"storybook:generate": "sb-rn-get-stories",
|
|
114
|
-
"type-check": "npx
|
|
114
|
+
"type-check": "npx tsc --noEmit -p ./tsconfig.json",
|
|
115
115
|
"dev": "rslib build --watch",
|
|
116
116
|
"build": "rslib build",
|
|
117
117
|
"lint": "eslint . --no-error-on-unmatched-pattern --quiet",
|