@particle-network/ui-native 0.0.34 → 0.0.36
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.
|
@@ -16,10 +16,10 @@ export interface TextProps extends RNTextProps, UseBoxProps {
|
|
|
16
16
|
* | body1Bold | 14px | 500 |
|
|
17
17
|
* | body2 | 12px | 400 |
|
|
18
18
|
* | body2Bold | 12px | 500 |
|
|
19
|
-
* | body3 |
|
|
20
|
-
* | body3Bold |
|
|
21
|
-
* | caption1 |
|
|
22
|
-
* | caption1Bold |
|
|
19
|
+
* | body3 | 11px | 400 |
|
|
20
|
+
* | body3Bold | 11px | 500 |
|
|
21
|
+
* | caption1 | 10px | 400 |
|
|
22
|
+
* | caption1Bold | 10px | 500 |
|
|
23
23
|
*/
|
|
24
24
|
variant?: TextVariant;
|
|
25
25
|
/**
|
|
@@ -6,12 +6,13 @@ import { Text } from "../Text/index.js";
|
|
|
6
6
|
import { useStyles } from "./styles.js";
|
|
7
7
|
const UXChip = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
8
8
|
const { chip: chipConfig } = useComponentConfig();
|
|
9
|
-
const { style, size, gap = 2, radius = chipConfig.defaultProps?.radius, color, variant, isDisabled, startContent, endContent, children, ...restProps } = props;
|
|
9
|
+
const { style, size, gap = 2, radius = chipConfig.defaultProps?.radius, color, bg, variant, isDisabled, startContent, endContent, children, ...restProps } = props;
|
|
10
10
|
const styles = useStyles({
|
|
11
11
|
size,
|
|
12
12
|
color,
|
|
13
13
|
variant,
|
|
14
|
-
isDisabled
|
|
14
|
+
isDisabled,
|
|
15
|
+
bg
|
|
15
16
|
});
|
|
16
17
|
const content = useMemo(()=>{
|
|
17
18
|
if ('string' == typeof children || 'number' == typeof children) return /*#__PURE__*/ jsx(Text, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UXChipProps } from './types';
|
|
2
|
-
export declare const useStyles: ({ size, color, variant, isDisabled }: UXChipProps) => {
|
|
2
|
+
export declare const useStyles: ({ size, color, variant, isDisabled, bg }: UXChipProps) => {
|
|
3
3
|
chip: {
|
|
4
4
|
height: number;
|
|
5
5
|
backgroundColor: string | undefined;
|
|
@@ -2,7 +2,7 @@ import { useMemo } from "react";
|
|
|
2
2
|
import { StyleSheet } from "react-native";
|
|
3
3
|
import { useColors, useMs } from "../../hooks/index.js";
|
|
4
4
|
import { disabledOpacity } from "../../theme/index.js";
|
|
5
|
-
const useStyles = ({ size = 'md', color = 'default', variant = 'flat', isDisabled })=>{
|
|
5
|
+
const useStyles = ({ size = 'md', color = 'default', variant = 'flat', isDisabled, bg })=>{
|
|
6
6
|
const { getColor } = useColors();
|
|
7
7
|
const { ms } = useMs();
|
|
8
8
|
const sizeMap = {
|
|
@@ -32,25 +32,27 @@ const useStyles = ({ size = 'md', color = 'default', variant = 'flat', isDisable
|
|
|
32
32
|
variant
|
|
33
33
|
]);
|
|
34
34
|
const backgroundColor = useMemo(()=>{
|
|
35
|
+
if (bg) return getColor(bg);
|
|
35
36
|
if ('solid' === variant) {
|
|
36
37
|
if ([
|
|
37
38
|
'default',
|
|
38
39
|
'secondary'
|
|
39
|
-
].includes(color)) return getColor('bg-
|
|
40
|
+
].includes(color)) return getColor('bg-200');
|
|
40
41
|
return getColor(color);
|
|
41
42
|
}
|
|
42
43
|
if ('flat' === variant) {
|
|
43
44
|
if ([
|
|
44
45
|
'default',
|
|
45
46
|
'secondary'
|
|
46
|
-
].includes(color)) return getColor('bg-
|
|
47
|
+
].includes(color)) return getColor('bg-200');
|
|
47
48
|
return `${getColor(color)}20`;
|
|
48
49
|
}
|
|
49
50
|
return 'transparent';
|
|
50
51
|
}, [
|
|
51
52
|
color,
|
|
52
53
|
getColor,
|
|
53
|
-
variant
|
|
54
|
+
variant,
|
|
55
|
+
bg
|
|
54
56
|
]);
|
|
55
57
|
const paddingHorizontal = useMemo(()=>{
|
|
56
58
|
if ('sm' === size) return ms(4);
|
|
@@ -266,7 +266,7 @@ const UXModal = /*#__PURE__*/ forwardRef((props, scrollViewRef)=>{
|
|
|
266
266
|
scrollEventThrottle: 16,
|
|
267
267
|
showsHorizontalScrollIndicator: false,
|
|
268
268
|
showsVerticalScrollIndicator: false,
|
|
269
|
-
keyboardShouldPersistTaps: "
|
|
269
|
+
keyboardShouldPersistTaps: "handled",
|
|
270
270
|
style: [
|
|
271
271
|
styles.content,
|
|
272
272
|
contentStyle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./entry.js",
|
|
6
6
|
"react-native": "./dist/index.js",
|
|
@@ -44,8 +44,7 @@
|
|
|
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/ui-shared": "0.0.7"
|
|
48
|
-
"@particle-network/icons": "0.0.17"
|
|
47
|
+
"@particle-network/ui-shared": "0.0.7"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@babel/core": "^7.24.0",
|
|
@@ -87,7 +86,8 @@
|
|
|
87
86
|
"unfetch": "^4.2.0",
|
|
88
87
|
"vite": "^6.3.5",
|
|
89
88
|
"zustand": "^5.0.8",
|
|
90
|
-
"@particle-network/eslint-config": "0.0.5"
|
|
89
|
+
"@particle-network/eslint-config": "0.0.5",
|
|
90
|
+
"@particle-network/icons": "0.0.18"
|
|
91
91
|
},
|
|
92
92
|
"overrides": {
|
|
93
93
|
"react-docgen-typescript": "2.2.2",
|