@particle-network/ui-native 0.0.33 → 0.0.35

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.
@@ -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-300');
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-300');
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: "always",
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.33",
3
+ "version": "0.0.35",
4
4
  "license": "MIT",
5
5
  "main": "./entry.js",
6
6
  "react-native": "./dist/index.js",