@particle-network/ui-native 0.4.2-beta.14 → 0.4.2-beta.16

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.
@@ -1,17 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type UXTabsProps } from '../UXTabs';
3
- interface UXTabSwitchProps {
4
- style?: UXTabsProps['style'];
5
- tabStyle?: UXTabsProps['tabStyle'];
6
- containerStyle?: UXTabsProps['containerStyle'];
7
- size?: UXTabsProps['size'];
8
- color?: UXTabsProps['color'];
3
+ interface UXTabSwitchProps extends Omit<UXTabsProps, 'variant' | 'selectedKey' | 'onSelectionChange'> {
9
4
  onTitle?: string;
10
5
  onIcon?: React.ReactNode;
11
6
  offTitle?: string;
12
7
  offIcon?: React.ReactNode;
13
8
  isSelected?: boolean;
14
- isDisabled?: boolean;
15
9
  onValueChange?: (isSelected: boolean) => void;
16
10
  }
17
11
  export declare const UXTabSwitch: React.FC<UXTabSwitchProps>;
@@ -3,20 +3,15 @@ import "react";
3
3
  import { useI18n } from "../../hooks/useI18n.js";
4
4
  import { UXTab, UXTabs } from "../UXTabs/index.js";
5
5
  const UXTabSwitch = (props)=>{
6
- const { style, tabStyle, containerStyle, size, color, onTitle, onIcon, offTitle, offIcon, isSelected = false, isDisabled = false, onValueChange } = props;
6
+ const { onTitle, onIcon, offTitle, offIcon, isSelected = false, onValueChange, ...restProps } = props;
7
7
  const i18n = useI18n();
8
8
  return /*#__PURE__*/ jsxs(UXTabs, {
9
- style: style,
10
- tabStyle: tabStyle,
11
- containerStyle: containerStyle,
12
- size: size,
13
9
  variant: "switch",
14
- color: color,
15
- isDisabled: isDisabled,
16
10
  selectedKey: isSelected.toString(),
17
11
  onSelectionChange: (key)=>{
18
12
  onValueChange?.('true' === key);
19
13
  },
14
+ ...restProps,
20
15
  children: [
21
16
  /*#__PURE__*/ jsx(UXTab, {
22
17
  title: offTitle || i18n.switch.off,
@@ -5,7 +5,7 @@ export declare const useStyles: (props: Partial<UXTabsProps> & {
5
5
  tabsWrapper: {
6
6
  backgroundColor: string | undefined;
7
7
  gap: import("@particle-network/ui-shared").SpacingType;
8
- flexGrow: number | undefined;
8
+ flex: number | undefined;
9
9
  justifyContent: "flex-start" | "space-between";
10
10
  borderRadius: number | undefined;
11
11
  height: number;
@@ -14,7 +14,7 @@ export declare const useStyles: (props: Partial<UXTabsProps> & {
14
14
  };
15
15
  tab: {
16
16
  flexDirection: "column";
17
- flexGrow: number | undefined;
17
+ flex: number | undefined;
18
18
  height: "100%";
19
19
  alignItems: "center";
20
20
  justifyContent: "center";
@@ -81,7 +81,7 @@ const useStyles = (props)=>{
81
81
  ]);
82
82
  const wrapperBackgroundColor = useMemo(()=>{
83
83
  if ('switch' === variant) return getColor('bg-200');
84
- if ('solid' === variant) return getColor('bg-400');
84
+ if ('solid' === variant) return getColor('bg-200');
85
85
  return 'transparent';
86
86
  }, [
87
87
  variant,
@@ -153,7 +153,7 @@ const useStyles = (props)=>{
153
153
  tabsWrapper: {
154
154
  backgroundColor: wrapperBackgroundColor,
155
155
  gap: gapValue,
156
- flexGrow: fullWidth || w ? 1 : void 0,
156
+ flex: fullWidth || w ? 1 : void 0,
157
157
  justifyContent: fullWidth || w ? 'space-between' : 'flex-start',
158
158
  borderRadius: wrapperBorderRadius,
159
159
  height,
@@ -162,11 +162,10 @@ const useStyles = (props)=>{
162
162
  },
163
163
  tab: {
164
164
  flexDirection: 'column',
165
- flexGrow: [
166
- 'text',
167
- 'light',
168
- 'underlined'
169
- ].includes(variant) ? void 0 : 1,
165
+ flex: [
166
+ 'solid',
167
+ 'switch'
168
+ ].includes(variant) ? 1 : void 0,
170
169
  height: '100%',
171
170
  alignItems: 'center',
172
171
  justifyContent: 'center',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.4.2-beta.14",
3
+ "version": "0.4.2-beta.16",
4
4
  "main": "./entry.js",
5
5
  "react-native": "./dist/index.js",
6
6
  "module": "./dist/index.js",