react-native-ui-lib 8.4.0 → 8.4.1-snapshot.7901

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.
package/lib/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "lodash": "^4.17.21",
13
+ "lodash": "4.18.1",
14
14
  "prop-types": "^15.5.10"
15
15
  },
16
16
  "devDependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "8.4.0",
3
+ "version": "8.4.1-snapshot.7901",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -34,7 +34,7 @@
34
34
  "date-fns": "^2.29.3",
35
35
  "deprecated-react-native-prop-types": "^2.3.0",
36
36
  "hoist-non-react-statics": "^3.0.0",
37
- "lodash": "^4.17.21",
37
+ "lodash": "4.18.1",
38
38
  "memoize-one": "^5.0.5",
39
39
  "prop-types": "^15.5.10",
40
40
  "react-freeze": "^1.0.0",
@@ -66,7 +66,7 @@
66
66
  "@react-native/metro-config": "0.77.3",
67
67
  "@react-native/typescript-config": "0.77.3",
68
68
  "@shopify/flash-list": "1.7.6",
69
- "@testing-library/react-native": "^11.5.1",
69
+ "@testing-library/react-native": "12.9.0",
70
70
  "@types/hoist-non-react-statics": "^3.3.1",
71
71
  "@types/jest": "^29.5.13",
72
72
  "@types/lodash": "^4.0.0",
@@ -82,7 +82,7 @@
82
82
  "light-date": "^1.2.0",
83
83
  "moment": "^2.24.0",
84
84
  "object-hash": "^3.0.0",
85
- "postcss": "^8.4.21",
85
+ "postcss": "^8.5.8",
86
86
  "postcss-js": "^4.0.0",
87
87
  "prettier": "^3.2.5",
88
88
  "react": "18.3.1",
@@ -112,7 +112,6 @@
112
112
  "react-native": ">=0.77.3",
113
113
  "react-native-gesture-handler": ">=2.24.0",
114
114
  "react-native-reanimated": ">=3.17.5",
115
- "react-native-safe-area-context": ">=5.6.2",
116
115
  "uilib-native": "^5.0.1"
117
116
  },
118
117
  "jest": {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { WheelPickerItemValue } from './types';
3
2
  import { WheelPickerItemProps } from './Item';
4
3
  type PropTypes<T> = {
@@ -5,6 +5,8 @@ export declare enum ChipsInputChangeReason {
5
5
  Added = "added",
6
6
  Removed = "removed"
7
7
  }
8
+ type ChipsInputChangeReasonUnion = `${ChipsInputChangeReason}`;
9
+ export type ChipsInputChangeReasonProps = ChipsInputChangeReasonUnion | ChipsInputChangeReason;
8
10
  export type ChipsInputChipProps = ChipProps & {
9
11
  invalid?: boolean;
10
12
  };
@@ -12,5 +12,5 @@ export declare function getValidColorString(text?: string): {
12
12
  valid: boolean;
13
13
  hex?: undefined;
14
14
  };
15
- export declare function getHexString(color: HSLColor): string;
15
+ export declare function getHexString(color: HSLColor): Uppercase<string>;
16
16
  export declare function getTextColor(color: string): string;
@@ -1,10 +1,11 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
2
  import { ButtonProps } from '../button';
3
+ import { ScreenFooterProps } from '../screenFooter';
3
4
  export declare enum FloatingButtonLayouts {
4
5
  VERTICAL = "Vertical",
5
6
  HORIZONTAL = "Horizontal"
6
7
  }
7
- export interface FloatingButtonProps {
8
+ export interface FloatingButtonProps extends Pick<ScreenFooterProps, 'isAndroidEdgeToEdge'> {
8
9
  /**
9
10
  * Whether the button is visible
10
11
  */
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useMemo } from 'react';
2
2
  import { StyleSheet } from 'react-native';
3
- import { asBaseComponent } from "../../commons/new";
3
+ import { asBaseComponent, Constants } from "../../commons/new";
4
4
  import { LogService } from "../../services";
5
- import { Colors, Shadows } from "../../style";
5
+ import { Colors, Shadows, Spacings } from "../../style";
6
6
  import Button from "../button";
7
7
  import ScreenFooter, { ScreenFooterLayouts, ScreenFooterBackgrounds, KeyboardBehavior, ItemsFit } from "../screenFooter";
8
8
  export let FloatingButtonLayouts = /*#__PURE__*/function (FloatingButtonLayouts) {
@@ -27,23 +27,27 @@ const FloatingButton = props => {
27
27
  duration = 300,
28
28
  withoutAnimation,
29
29
  hideBackgroundOverlay,
30
- hoisted = true,
30
+ hoisted = Constants.isAndroid,
31
+ isAndroidEdgeToEdge,
31
32
  testID
32
33
  } = props;
33
34
  useEffect(() => {
34
35
  // eslint-disable-next-line max-len
35
36
  LogService.warn('RNUILib FloatingButton now uses ScreenFooter internally, which requires a SafeAreaProvider. If you experience safe area issues, please wrap your app (or the relevant screen) with <SafeAreaProvider>.');
36
37
  }, []);
38
+ const isSecondaryOnly = !!secondaryButton && !button;
39
+ const isHorizontal = buttonLayout === FloatingButtonLayouts.HORIZONTAL || isSecondaryOnly;
37
40
  const footerContentContainerStyle = useMemo(() => {
38
41
  if (bottomMargin !== undefined) {
39
42
  return {
40
43
  paddingBottom: bottomMargin
41
44
  };
42
45
  }
43
- return undefined;
44
- }, [bottomMargin]);
45
- const isSecondaryOnly = !!secondaryButton && !button;
46
- const isHorizontal = buttonLayout === FloatingButtonLayouts.HORIZONTAL || isSecondaryOnly;
46
+ const isSecondaryAtBottom = !!secondaryButton && (isSecondaryOnly || !isHorizontal);
47
+ return {
48
+ paddingBottom: isSecondaryAtBottom ? Spacings.s7 : Spacings.s8
49
+ };
50
+ }, [bottomMargin, secondaryButton, isSecondaryOnly, isHorizontal]);
47
51
  if (!button && !secondaryButton) {
48
52
  return null;
49
53
  }
@@ -66,7 +70,7 @@ const FloatingButton = props => {
66
70
  }] : undefined} enableShadow={false} />;
67
71
  };
68
72
  const children = isHorizontal ? [renderSecondaryButton(), renderPrimaryButton()] : [renderPrimaryButton(), renderSecondaryButton()];
69
- return <ScreenFooter visible={visible} layout={isHorizontal ? ScreenFooterLayouts.HORIZONTAL : ScreenFooterLayouts.VERTICAL} backgroundType={hideBackgroundOverlay ? ScreenFooterBackgrounds.TRANSPARENT : ScreenFooterBackgrounds.FADING} keyboardBehavior={hoisted ? KeyboardBehavior.HOISTED : KeyboardBehavior.STICKY} animationDuration={withoutAnimation ? 0 : duration} itemsFit={fullWidth ? ItemsFit.STRETCH : undefined} contentContainerStyle={footerContentContainerStyle} testID={testID}>
73
+ return <ScreenFooter visible={visible} layout={isHorizontal ? ScreenFooterLayouts.HORIZONTAL : ScreenFooterLayouts.VERTICAL} backgroundType={hideBackgroundOverlay ? ScreenFooterBackgrounds.TRANSPARENT : ScreenFooterBackgrounds.FADING} keyboardBehavior={hoisted ? KeyboardBehavior.HOISTED : KeyboardBehavior.STICKY} isAndroidEdgeToEdge={isAndroidEdgeToEdge} animationDuration={withoutAnimation ? 0 : duration} itemsFit={fullWidth ? ItemsFit.STRETCH : undefined} contentContainerStyle={footerContentContainerStyle} testID={testID}>
70
74
  {children}
71
75
  </ScreenFooter>;
72
76
  };
@@ -11,6 +11,7 @@ import { asBaseComponent, Constants } from "../../commons/new";
11
11
  import { useKeyboardHeight } from "../../hooks";
12
12
  import { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterShadow } from "./types";
13
13
  export { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterShadow };
14
+ const androidVersion = Constants.getAndroidVersion();
14
15
  const ScreenFooter = props => {
15
16
  const {
16
17
  testID,
@@ -27,9 +28,13 @@ const ScreenFooter = props => {
27
28
  animationDuration = 200,
28
29
  shadow = ScreenFooterShadow.SH20,
29
30
  hideDivider = false,
31
+ isAndroidEdgeToEdge = !!androidVersion && androidVersion >= 35 ? true : undefined,
30
32
  contentContainerStyle: contentContainerStyleOverride
31
33
  } = props;
32
- const keyboard = useAnimatedKeyboard();
34
+ const keyboard = useAnimatedKeyboard({
35
+ isNavigationBarTranslucentAndroid: isAndroidEdgeToEdge,
36
+ isStatusBarTranslucentAndroid: isAndroidEdgeToEdge
37
+ });
33
38
  const [height, setHeight] = useState(0);
34
39
  const visibilityTranslateY = useSharedValue(0);
35
40
 
@@ -82,6 +82,11 @@
82
82
  "description": "If true, hides the top divider for solid background. Only applies when backgroundType is 'solid'",
83
83
  "default": "false"
84
84
  },
85
+ {
86
+ "name": "isAndroidEdgeToEdge",
87
+ "type": "boolean",
88
+ "description": "Indicates if the device is an Android device that supports edge-to-edge. Defaults to true for Android with version 35 and above, undefined for others."
89
+ },
85
90
  {
86
91
  "name": "contentContainerStyle",
87
92
  "type": "StyleProp<ViewStyle>",
@@ -102,4 +102,9 @@ export interface ScreenFooterProps extends PropsWithChildren<{}> {
102
102
  * Can be used to override default padding, gap, or other layout properties.
103
103
  */
104
104
  contentContainerStyle?: StyleProp<ViewStyle>;
105
+ /**
106
+ * Is this an Android device that supports edge-to-edge
107
+ * Defaults to true for Android with version 35 and above, undefined for others
108
+ */
109
+ isAndroidEdgeToEdge?: boolean;
105
110
  }
@@ -2,7 +2,7 @@ export declare function getInitialsTypography(size: number): import("react-nativ
2
2
  export declare function hashStringToNumber(str?: string): number;
3
3
  export declare function getAvatarColors(): string[];
4
4
  export declare function getColorById(id: string, avatarColors?: string[]): string;
5
- export declare function getInitials(name?: string, limit?: number): string;
5
+ export declare function getInitials(name?: string, limit?: number): Uppercase<string>;
6
6
  export declare function getBackgroundColor(name?: string, avatarColors?: string[], hashFunction?: (name?: string) => number, defaultColor?: string): string | undefined;
7
7
  export declare function isGravatarUrl(url: string): boolean;
8
8
  export declare function isBlankGravatarUrl(url: string): boolean;
@@ -40,7 +40,7 @@ const Thumb = props => {
40
40
  height: THUMB_SIZE
41
41
  });
42
42
  const lastOffset = useSharedValue(0);
43
- const gesture = Gesture.Pan().onBegin(() => {
43
+ const gesture = Gesture.Pan().hitSlop(hitSlop).onBegin(() => {
44
44
  onSeekStart?.();
45
45
  isPressed.value = true;
46
46
  lastOffset.value = offset.value;
package/src/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export { default as Button, ButtonProps, ButtonSize, ButtonAnimationDirection }
23
23
  export { default as Card, CardProps, CardSectionProps, CardSelectionOptions } from './components/card';
24
24
  export { default as Carousel, CarouselProps, PageControlPosition } from './components/carousel';
25
25
  export { default as Checkbox, CheckboxProps, CheckboxRef } from './components/checkbox';
26
- export { default as ChipsInput, ChipsInputProps, ChipsInputChipProps } from './components/chipsInput';
26
+ export { default as ChipsInput, ChipsInputProps, ChipsInputChipProps, ChipsInputChangeReason, ChipsInputChangeReasonProps } from './components/chipsInput';
27
27
  export { default as Chip, ChipProps } from './components/chip';
28
28
  export { default as ColorPicker, ColorPickerProps } from './components/colorPicker';
29
29
  export { default as ColorPalette, ColorPaletteProps } from './components/colorPalette';
package/src/index.js CHANGED
@@ -61,6 +61,8 @@ var _exportNames = {
61
61
  ChipsInput: true,
62
62
  ChipsInputProps: true,
63
63
  ChipsInputChipProps: true,
64
+ ChipsInputChangeReason: true,
65
+ ChipsInputChangeReasonProps: true,
64
66
  Chip: true,
65
67
  ChipProps: true,
66
68
  ColorPicker: true,
@@ -432,6 +434,18 @@ Object.defineProperty(exports, "ChipsInput", {
432
434
  return _chipsInput().default;
433
435
  }
434
436
  });
437
+ Object.defineProperty(exports, "ChipsInputChangeReason", {
438
+ enumerable: true,
439
+ get: function () {
440
+ return _chipsInput().ChipsInputChangeReason;
441
+ }
442
+ });
443
+ Object.defineProperty(exports, "ChipsInputChangeReasonProps", {
444
+ enumerable: true,
445
+ get: function () {
446
+ return _chipsInput().ChipsInputChangeReasonProps;
447
+ }
448
+ });
435
449
  Object.defineProperty(exports, "ChipsInputChipProps", {
436
450
  enumerable: true,
437
451
  get: function () {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DragData, UniDriver, UniDriverClass } from './UniDriver';
3
2
  export type ComponentDriverArgs = {
4
3
  testID: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DragData, UniDriver } from '../UniDriver';
3
2
  import { ReactTestInstance } from 'react-test-renderer';
4
3
  export declare class TestingLibraryDriver<Props> implements UniDriver<Props> {