@particle-network/ui-native 0.1.3-beta.7 → 0.1.3

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,7 +6,7 @@ import { Box, useBoxStyle } from "../layout/Box/index.js";
6
6
  import { HStack } from "../layout/HStack.js";
7
7
  import { useTextStyles } from "./text.style.js";
8
8
  const text_Text = /*#__PURE__*/ forwardRef((props, ref)=>{
9
- const { variant = 'body2Bold', fontWeight, color = 'default', lineHeight, align, style, h1, h2, h3, body1, body1Bold, body2, body2Bold, body3, body3Bold, caption1, caption1Bold, underlineStyle, fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, ...restProps } = props;
9
+ const { variant = 'body2Bold', fontWeight, color = 'default', lineHeight, align, style, h1, h2, h3, body1, body1Bold, body2, body2Bold, body3, body3Bold, caption1, caption1Bold, underlineStyle, fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, shadow, ...restProps } = props;
10
10
  const [textWidth, setTextWidth] = useState(0);
11
11
  const { getColor } = useColors();
12
12
  const boxStyle = useBoxStyle({
@@ -71,7 +71,8 @@ const text_Text = /*#__PURE__*/ forwardRef((props, ref)=>{
71
71
  bgOpacity,
72
72
  opacity,
73
73
  zIndex,
74
- overflow
74
+ overflow,
75
+ shadow
75
76
  });
76
77
  const { styles } = useTextStyles({
77
78
  variant,
@@ -3,7 +3,7 @@ import react, { forwardRef } from "react";
3
3
  import { View } from "react-native";
4
4
  import { useBoxStyle } from "./useBox.style.js";
5
5
  const Box = /*#__PURE__*/ forwardRef((props, ref)=>{
6
- const { as, style, fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, ...restProps } = props;
6
+ const { as, style, fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, shadow, ...restProps } = props;
7
7
  const boxStyle = useBoxStyle({
8
8
  fullWidth,
9
9
  fullHeight,
@@ -66,7 +66,8 @@ const Box = /*#__PURE__*/ forwardRef((props, ref)=>{
66
66
  bgOpacity,
67
67
  opacity,
68
68
  zIndex,
69
- overflow
69
+ overflow,
70
+ shadow
70
71
  });
71
72
  if (as) return /*#__PURE__*/ react.cloneElement(as, {
72
73
  ...restProps,
@@ -1,10 +1,12 @@
1
1
  import { useColors, useMs, useRadius, useSpacing } from "../../../hooks/index.js";
2
+ import { useShadow } from "../../../hooks/useShadow.js";
2
3
  const useBoxStyle = (props)=>{
3
- const { fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow } = props;
4
+ const { fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, shadow } = props;
4
5
  const { ms: uxms } = useMs();
5
6
  const { getColor } = useColors();
6
7
  const { getSpacing } = useSpacing();
7
8
  const { getRadius } = useRadius();
9
+ const { getShadow } = useShadow();
8
10
  const borderFunc = (value)=>{
9
11
  if ('number' == typeof value) return uxms(value);
10
12
  return value;
@@ -69,6 +71,7 @@ const useBoxStyle = (props)=>{
69
71
  styleObj.opacity = opacity;
70
72
  styleObj.zIndex = zIndex;
71
73
  styleObj.overflow = overflow;
74
+ styleObj.boxShadow = getShadow(shadow);
72
75
  const boxStyle = styleObj;
73
76
  return boxStyle;
74
77
  };
@@ -289,4 +289,5 @@ export interface UseBoxProps {
289
289
  * Shorthand for the `overflow` style property.
290
290
  */
291
291
  overflow?: ViewStyle['overflow'];
292
+ shadow?: 'default' | true;
292
293
  }
@@ -0,0 +1,3 @@
1
+ export declare function useShadow(): {
2
+ getShadow: (shadow: "default" | true | undefined) => string | undefined;
3
+ };
@@ -0,0 +1,12 @@
1
+ import { useTheme } from "./useTheme.js";
2
+ function useShadow() {
3
+ const theme = useTheme();
4
+ return {
5
+ getShadow: (shadow)=>{
6
+ if (!shadow) return;
7
+ if (true === shadow) return theme.shadow.default;
8
+ return theme.shadow[shadow];
9
+ }
10
+ };
11
+ }
12
+ export { useShadow };
@@ -0,0 +1,3 @@
1
+ export declare const createShadow: (theme: "light" | "dark") => {
2
+ default: string;
3
+ };
@@ -0,0 +1,9 @@
1
+ const createShadow = (theme)=>{
2
+ if ('light' === theme) return {
3
+ default: '0px 2px 12px 0px rgba(23, 23, 28, 0.15)'
4
+ };
5
+ return {
6
+ default: '0px 2px 12px 0px rgba(0, 0, 0, 0.5)'
7
+ };
8
+ };
9
+ export { createShadow };
@@ -1,5 +1,6 @@
1
1
  import { createColors } from "./colors.js";
2
2
  import { createRadius } from "./radius.js";
3
+ import { createShadow } from "./shadow.js";
3
4
  import { createSpacing } from "./spacing.js";
4
5
  function createTheme(theme, dynamicColors, msFactor) {
5
6
  return {
@@ -7,6 +8,7 @@ function createTheme(theme, dynamicColors, msFactor) {
7
8
  colors: createColors(theme, dynamicColors),
8
9
  spacing: createSpacing(msFactor),
9
10
  radius: createRadius(msFactor),
11
+ shadow: createShadow(theme),
10
12
  msFactor
11
13
  };
12
14
  }
@@ -49,6 +49,9 @@ export interface Theme {
49
49
  colors: ThemeColors;
50
50
  spacing: SpacingScale;
51
51
  radius: RadiusScale;
52
+ shadow: {
53
+ default: string;
54
+ };
52
55
  msFactor?: number;
53
56
  }
54
57
  export interface ThemeContextValue {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.1.3-beta.7",
3
+ "version": "0.1.3",
4
4
  "main": "./entry.js",
5
5
  "react-native": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -46,7 +46,7 @@
46
46
  "react-native-paper": "^5.14.5",
47
47
  "react-native-size-matters": "^0.4.2",
48
48
  "react-native-toast-message": "^2.3.3",
49
- "@particle-network/ui-shared": "0.1.1-beta.0"
49
+ "@particle-network/ui-shared": "0.1.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@babel/core": "^7.24.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/eslint-config": "0.2.0",
92
- "@particle-network/lintstaged-config": "0.0.0",
93
- "@particle-network/icons": "0.1.2-beta.7"
91
+ "@particle-network/icons": "0.1.2",
92
+ "@particle-network/eslint-config": "0.3.0",
93
+ "@particle-network/lintstaged-config": "0.1.0"
94
94
  },
95
95
  "overrides": {
96
96
  "react-docgen-typescript": "2.2.2",