@particle-network/ui-native 0.4.2-beta.0 → 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.
@@ -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 };
@@ -16,6 +16,7 @@ export * from './UXRadio';
16
16
  export * from './UXSpinner';
17
17
  export * from './UXSwitch';
18
18
  export * from './UXTabs';
19
+ export * from './UXTabSwitch';
19
20
  export * from './UXToast';
20
21
  export * from './UXTooltip';
21
22
  export * from './UXTouchableOpacity';
@@ -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";
@@ -37,5 +37,9 @@ export declare const en: {
37
37
  warning: string;
38
38
  info: string;
39
39
  };
40
+ switch: {
41
+ on: string;
42
+ off: string;
43
+ };
40
44
  };
41
45
  export type LocaleText = typeof en;
@@ -36,6 +36,10 @@ const en = {
36
36
  error: 'Error',
37
37
  warning: 'Warning',
38
38
  info: 'Info'
39
+ },
40
+ switch: {
41
+ on: 'On',
42
+ off: 'Off'
39
43
  }
40
44
  };
41
45
  export { en };
@@ -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
  };
@@ -36,6 +36,10 @@ const zh = {
36
36
  error: '错误',
37
37
  warning: '警告',
38
38
  info: '提示'
39
+ },
40
+ switch: {
41
+ on: '开',
42
+ off: '关'
39
43
  }
40
44
  };
41
45
  export { zh };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.4.2-beta.0",
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/icons": "0.4.2-beta.0",
48
- "@particle-network/ui-shared": "0.3.2-beta.0"
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.2",
79
- "react-dom": "19.1.2",
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",
@@ -89,8 +89,8 @@
89
89
  "vite": "^6.3.5",
90
90
  "zustand": "^5.0.8",
91
91
  "@particle-network/eslint-config": "0.3.0",
92
- "@particle-network/icons": "0.4.2-beta.0",
93
- "@particle-network/lintstaged-config": "0.1.0"
92
+ "@particle-network/lintstaged-config": "0.1.0",
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 tsgo --noEmit -p ./tsconfig.json",
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",