react-native-ui-lib 8.3.4-snapshot.7813 → 8.3.4-snapshot.7824

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.
Files changed (132) hide show
  1. package/ReactNativeUiLib.podspec +22 -0
  2. package/lib/components/HighlighterOverlayView/index.d.ts +2 -2
  3. package/lib/components/HighlighterOverlayView/index.web.d.ts +2 -2
  4. package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.ts +1 -1
  5. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.js +1 -5
  6. package/lib/components/Keyboard/KeyboardAccessoryView/index.d.ts +2 -2
  7. package/lib/components/Keyboard/KeyboardAccessoryView/index.js +1 -3
  8. package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.js +1 -3
  9. package/lib/components/Keyboard/KeyboardTrackingView/index.d.ts +2 -6
  10. package/lib/components/Keyboard/KeyboardTrackingView/index.js +4 -5
  11. package/lib/components/Keyboard/index.d.ts +1 -2
  12. package/lib/package.json +21 -20
  13. package/lib/react-native.config.js +1 -1
  14. package/package.json +163 -161
  15. package/src/commons/asBaseComponent.js +1 -2
  16. package/src/commons/baseComponent.js +8 -0
  17. package/src/commons/forwardRef.js +4 -1
  18. package/src/commons/modifiers.d.ts +6 -0
  19. package/src/commons/modifiers.js +18 -0
  20. package/src/commons/withScrollEnabler.js +4 -0
  21. package/src/commons/withScrollReached.js +4 -0
  22. package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +7 -0
  23. package/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +6 -0
  24. package/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +6 -0
  25. package/src/components/WheelPicker/WheelPicker.driver.d.ts +2 -2
  26. package/src/components/WheelPicker/index.d.ts +2 -2
  27. package/src/components/WheelPicker/index.js +1 -1
  28. package/src/components/WheelPicker/usePresenter.d.ts +1 -1
  29. package/src/components/actionSheet/index.d.ts +1 -1
  30. package/src/components/animatedImage/index.d.ts +1 -1
  31. package/src/components/animatedScanner/index.js +37 -0
  32. package/src/components/avatar/index.d.ts +1 -1
  33. package/src/components/badge/index.d.ts +4 -4
  34. package/src/components/baseInput/index.d.ts +1 -0
  35. package/src/components/baseInput/index.js +49 -1
  36. package/src/components/button/index.d.ts +4 -4
  37. package/src/components/button/types.d.ts +2 -2
  38. package/src/components/carousel/index.d.ts +8 -8
  39. package/src/components/carousel/types.d.ts +1 -4
  40. package/src/components/carousel/types.js +2 -0
  41. package/src/components/checkbox/index.d.ts +1 -1
  42. package/src/components/chip/index.d.ts +1 -1
  43. package/src/components/colorPalette/index.d.ts +1 -1
  44. package/src/components/dateTimePicker/index.d.ts +2 -2
  45. package/src/components/dateTimePicker/index.js +2 -2
  46. package/src/components/dialog/types.d.ts +4 -4
  47. package/src/components/dialog/useDialogContent.d.ts +1 -1
  48. package/src/components/drawer/index.d.ts +1 -1
  49. package/src/components/expandableSection/index.d.ts +2 -2
  50. package/src/components/fadedScrollView/index.js +1 -1
  51. package/src/components/featureHighlight/index.js +7 -5
  52. package/src/components/floatingButton/floatingButton.api.json +10 -15
  53. package/src/components/floatingButton/index.d.ts +13 -39
  54. package/src/components/floatingButton/index.js +57 -167
  55. package/src/components/gridListItem/index.d.ts +7 -7
  56. package/src/components/gridView/index.d.ts +1 -1
  57. package/src/components/hint/HintBubble.d.ts +1 -1
  58. package/src/components/hint/HintOld.d.ts +10 -10
  59. package/src/components/hint/hooks/useHintLayout.d.ts +1 -1
  60. package/src/components/hint/index.d.ts +2 -2
  61. package/src/components/hint/types.d.ts +2 -2
  62. package/src/components/icon/index.js +3 -0
  63. package/src/components/image/index.d.ts +1 -1
  64. package/src/components/image/index.js +17 -20
  65. package/src/components/loaderScreen/index.d.ts +1 -1
  66. package/src/components/loaderScreen/types.d.ts +1 -1
  67. package/src/components/maskedInput/index.d.ts +4 -21
  68. package/src/components/maskedInput/index.js +16 -78
  69. package/src/components/maskedInput/maskedInput.api.json +1 -0
  70. package/src/components/maskedInput/new.d.ts +22 -0
  71. package/src/components/maskedInput/new.js +85 -0
  72. package/src/components/maskedInput/old.js +95 -0
  73. package/src/components/modal/index.d.ts +3 -3
  74. package/src/components/numberInput/index.js +2 -2
  75. package/src/components/overlay/index.d.ts +1 -1
  76. package/src/components/picker/PickerDialog.android.js +15 -0
  77. package/src/components/picker/PickerDialog.js +7 -0
  78. package/src/components/picker/helpers/useImperativePickerHandle.d.ts +1 -1
  79. package/src/components/picker/helpers/useImperativePickerHandle.js +1 -1
  80. package/src/components/picker/types.d.ts +9 -9
  81. package/src/components/progressBar/index.d.ts +2 -2
  82. package/src/components/screenFooter/index.js +10 -7
  83. package/src/components/screenFooter/screenFooter.api.json +9 -21
  84. package/src/components/screenFooter/types.d.ts +6 -1
  85. package/src/components/scrollBar/index.d.ts +4 -11
  86. package/src/components/searchInput/index.js +1 -1
  87. package/src/components/searchInput/types.d.ts +2 -2
  88. package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +2 -2
  89. package/src/components/skeletonView/index.d.ts +4 -4
  90. package/src/components/slider/Thumb.d.ts +1 -1
  91. package/src/components/slider/types.d.ts +1 -1
  92. package/src/components/stackAggregator/index.d.ts +1 -1
  93. package/src/components/tabController/TabBarItem.d.ts +2 -2
  94. package/src/components/tabController/TabBarItem.js +1 -1
  95. package/src/components/tabController/TabPage.d.ts +2 -2
  96. package/src/components/tabController/useScrollToItem.d.ts +1 -1
  97. package/src/components/text/Text.driver.d.ts +1 -1
  98. package/src/components/textArea/index.js +6 -0
  99. package/src/components/textField/TextField.driver.new.js +12 -7
  100. package/src/components/textField/index.js +31 -9
  101. package/src/components/textField/types.d.ts +4 -4
  102. package/src/components/textField/useImperativeInputHandle.d.ts +1 -1
  103. package/src/components/textField/useImperativeInputHandle.js +1 -1
  104. package/src/components/textField/usePreset.d.ts +36 -36
  105. package/src/components/textFieldOld/index.d.ts +71 -0
  106. package/src/components/textFieldOld/index.js +807 -0
  107. package/src/components/timeline/index.js +1 -1
  108. package/src/components/toast/index.js +69 -0
  109. package/src/components/wizard/index.d.ts +1 -1
  110. package/src/components/wizard/types.d.ts +1 -1
  111. package/src/components/wizard/wizard.api.json +1 -1
  112. package/src/helpers/DocsGenerator.js +61 -0
  113. package/src/hooks/useCombinedRefs/index.js +2 -1
  114. package/src/hooks/useDebounce/index.js +1 -1
  115. package/src/hooks/useHiddenLocation/index.js +2 -2
  116. package/src/hooks/useHiddenLocation/index.web.js +2 -2
  117. package/src/hooks/useMeasure/index.d.ts +1 -1
  118. package/src/hooks/useMeasure/index.js +1 -1
  119. package/src/hooks/useScrollTo/index.d.ts +2 -2
  120. package/src/incubator/calendar/index.js +1 -1
  121. package/src/incubator/calendar/types.d.ts +2 -2
  122. package/src/incubator/expandableOverlay/index.d.ts +2 -2
  123. package/src/incubator/slider/Track.d.ts +1 -1
  124. package/src/incubator/slider/index.d.ts +1 -1
  125. package/src/incubator/toast/helpers/useToastTimer.js +1 -1
  126. package/src/incubator/toast/index.js +1 -1
  127. package/src/incubator/toast/types.d.ts +2 -2
  128. package/src/testkit/Component.driver.d.ts +1 -1
  129. package/src/testkit/drivers/TestingLibraryDriver.d.ts +1 -1
  130. package/src/typings/module.d.ts +3 -12
  131. package/textFieldOld.d.ts +2 -0
  132. package/textFieldOld.js +1 -0
@@ -8,6 +8,6 @@ declare const useDialogContent: (props: InternalDialogCloseButtonProps) => {
8
8
  containerStyle: false | "" | import("react-native").ViewStyle | import("react-native").RegisteredStyle<import("react-native").ViewStyle> | import("react-native").RecursiveArray<import("react-native").ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").ViewStyle>> | (import("react-native").StyleProp<import("react-native").ViewStyle> | {
9
9
  backgroundColor: string;
10
10
  })[] | null | undefined;
11
- containerProps: Omit<import("../../components/view").ViewProps, "style" | "ref" | "animated" | "onLayout" | "testID" | "reanimated"> | undefined;
11
+ containerProps: Omit<import("../../components/view").ViewProps, "style" | "testID" | "ref" | "onLayout" | "animated" | "reanimated"> | undefined;
12
12
  };
13
13
  export default useDialogContent;
@@ -126,7 +126,7 @@ declare class Drawer extends PureComponent<DrawerProps> {
126
126
  };
127
127
  leftRender: SwipeableProps['renderLeftActions'];
128
128
  rightRender: SwipeableProps['renderLeftActions'];
129
- _swipeableRow: RefObject<Swipeable | null>;
129
+ _swipeableRow: RefObject<Swipeable>;
130
130
  animationOptions: SwipeableProps['animationOptions'];
131
131
  leftActionX: Animated.Value;
132
132
  constructor(props: DrawerProps);
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  export type ExpandableSectionProps = {
3
3
  /**
4
4
  * expandableSection header element
@@ -36,5 +36,5 @@ export type ExpandableSectionProps = {
36
36
  * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ExpandableSectionScreen.tsx
37
37
  * @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/ExpandableSection/ExpandableSection.gif?raw=true
38
38
  */
39
- declare function ExpandableSection(props: ExpandableSectionProps): JSX.Element;
39
+ declare function ExpandableSection(props: ExpandableSectionProps): React.JSX.Element;
40
40
  export default ExpandableSection;
@@ -20,7 +20,7 @@ const FadedScrollView = props => {
20
20
  ...others
21
21
  } = props;
22
22
  const ScrollView = useGesture ? GestureScrollView : RNScrollView;
23
- const scrollViewRef = useRef(undefined);
23
+ const scrollViewRef = useRef();
24
24
  const horizontal = propsHorizontal ?? false;
25
25
  const {
26
26
  onContentSizeChange,
@@ -200,12 +200,16 @@ class FeatureHighlight extends Component {
200
200
  {title && <Text text60 style={[styles.title, {
201
201
  color,
202
202
  marginBottom: message ? titleBottomMargin : messageBottomMargin
203
- }, titleStyle]} numberOfLines={titleNumberOfLines} pointerEvents={'none'}>
203
+ }, titleStyle]} numberOfLines={titleNumberOfLines}
204
+ // @ts-expect-error
205
+ pointerEvents={'none'}>
204
206
  {title}
205
207
  </Text>}
206
208
  {message && <Text text70 style={[styles.message, {
207
209
  color
208
- }, messageStyle]} numberOfLines={messageNumberOfLines} pointerEvents={'none'}>
210
+ }, messageStyle]} numberOfLines={messageNumberOfLines}
211
+ // @ts-expect-error
212
+ pointerEvents={'none'}>
209
213
  {message}
210
214
  </Text>}
211
215
  <Button label={defaultButtonLabel} size={ButtonSize.medium} labelStyle={{
@@ -240,9 +244,7 @@ class FeatureHighlight extends Component {
240
244
  {pageControlProps ? <View flex bottom>
241
245
  <PageControl {...pageControlProps} containerStyle={{
242
246
  marginBottom: 24
243
- }} ref={r => {
244
- this.viewRef = r;
245
- }} />
247
+ }} ref={r => this.viewRef = r} />
246
248
  <View accessible accessibilityLabel={'dismiss button'} />
247
249
  </View> : <View flex accessible accessibilityLabel={'dismiss'} accessibilityRole={'button'} />}
248
250
  </TouchableWithoutFeedback>
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "name": "FloatingButton",
3
3
  "category": "overlays",
4
- "description": "Hovering button with gradient background",
5
- "modifiers": [
6
- "margin",
7
- "background",
8
- "color"
9
- ],
4
+ "description": "Hovering button with gradient background, backed by ScreenFooter",
5
+ "modifiers": ["margin", "background", "color"],
10
6
  "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/FloatingButtonScreen.tsx",
11
7
  "images": [
12
8
  "https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/FloatingButton/FloatingButton.gif?raw=true"
@@ -58,6 +54,12 @@
58
54
  "type": "boolean",
59
55
  "description": "Whether to show background overlay"
60
56
  },
57
+ {
58
+ "name": "hoisted",
59
+ "type": "boolean",
60
+ "description": "Whether the footer should be hoisted above the keyboard. When true, uses KeyboardAccessoryView for keyboard-aware positioning. When false, uses sticky positioning.",
61
+ "default": "true"
62
+ },
61
63
  {
62
64
  "name": "testID",
63
65
  "type": "string",
@@ -96,11 +98,7 @@
96
98
  },
97
99
  {
98
100
  "type": "table",
99
- "columns": [
100
- "Property",
101
- "Default",
102
- "Full Width"
103
- ],
101
+ "columns": ["Property", "Default", "Full Width"],
104
102
  "items": [
105
103
  {
106
104
  "title": "Main button",
@@ -130,10 +128,7 @@
130
128
  },
131
129
  {
132
130
  "type": "table",
133
- "columns": [
134
- "Layout",
135
- "Component"
136
- ],
131
+ "columns": ["Layout", "Component"],
137
132
  "items": [
138
133
  {
139
134
  "title": "Horizontal",
@@ -1,5 +1,4 @@
1
- import React, { PropsWithChildren, PureComponent } from 'react';
2
- import { Animated } from 'react-native';
1
+ import React, { PropsWithChildren } from 'react';
3
2
  import { ButtonProps } from '../button';
4
3
  export declare enum FloatingButtonLayouts {
5
4
  VERTICAL = "Vertical",
@@ -23,7 +22,7 @@ export interface FloatingButtonProps {
23
22
  */
24
23
  bottomMargin?: number;
25
24
  /**
26
- * Whether the buttons get the container's full with (vertical layout only)
25
+ * Whether the buttons get the container's full width (vertical layout only)
27
26
  */
28
27
  fullWidth?: boolean;
29
28
  /**
@@ -42,6 +41,12 @@ export interface FloatingButtonProps {
42
41
  * Whether to show background overlay
43
42
  */
44
43
  hideBackgroundOverlay?: boolean;
44
+ /**
45
+ * Whether the footer should be hoisted above the keyboard.
46
+ * When true (default), uses KeyboardAccessoryView for keyboard-aware positioning.
47
+ * When false, uses sticky positioning.
48
+ */
49
+ hoisted?: boolean;
45
50
  /**
46
51
  * Used as testing identifier
47
52
  * <TestID> - the floatingButton container
@@ -50,40 +55,9 @@ export interface FloatingButtonProps {
50
55
  */
51
56
  testID?: string;
52
57
  }
53
- /**
54
- * @description: Hovering button with gradient background
55
- * @modifiers: margin, background, color
56
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/FloatingButtonScreen.tsx
57
- * @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/FloatingButton/FloatingButton.gif?raw=true
58
- */
59
- declare class FloatingButton extends PureComponent<FloatingButtonProps> {
60
- static displayName: string;
61
- static floatingButtonLayouts: typeof FloatingButtonLayouts;
62
- static defaultProps: {
63
- duration: number;
64
- buttonLayout: FloatingButtonLayouts;
65
- };
66
- initialVisibility?: boolean;
67
- firstLoad: boolean;
68
- visibleAnimated: Animated.Value;
69
- constructor(props: FloatingButtonProps);
70
- componentDidUpdate(prevProps: FloatingButtonProps): void;
71
- getAnimatedStyle: () => {
72
- opacity: Animated.Value;
73
- transform: {
74
- translateY: Animated.AnimatedInterpolation<string | number>;
75
- }[];
76
- };
77
- get isSecondaryOnly(): boolean;
78
- get isHorizontalLayout(): boolean;
79
- get isSecondaryHorizontal(): boolean | undefined;
80
- get isSecondaryVertical(): boolean | undefined;
81
- renderButton(): React.JSX.Element | undefined;
82
- renderOverlay: () => React.JSX.Element | undefined;
83
- renderSecondaryButton(): React.JSX.Element | undefined;
84
- renderHorizontalLayout(): React.JSX.Element;
85
- renderVerticalLayout(): React.JSX.Element;
86
- render(): false | React.JSX.Element | undefined;
87
- }
88
- declare const _default: React.ForwardRefExoticComponent<FloatingButtonProps & React.RefAttributes<any>> & typeof FloatingButton;
58
+ declare const _default: React.ForwardRefExoticComponent<FloatingButtonProps & React.RefAttributes<any>> & {
59
+ (props: FloatingButtonProps): React.JSX.Element | null;
60
+ displayName: string;
61
+ floatingButtonLayouts: typeof FloatingButtonLayouts;
62
+ };
89
63
  export default _default;
@@ -1,190 +1,80 @@
1
- import React, { PureComponent } from 'react';
2
- import { StyleSheet, Animated } from 'react-native';
3
- import { Constants, asBaseComponent } from "../../commons/new";
4
- import { Colors, Shadows, Spacings } from "../../style";
5
- import View from "../view";
6
- import Image from "../image";
1
+ import React, { useEffect, useMemo } from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import { asBaseComponent } from "../../commons/new";
4
+ import { LogService } from "../../services";
5
+ import { Colors, Shadows } from "../../style";
7
6
  import Button from "../button";
7
+ import ScreenFooter, { ScreenFooterLayouts, ScreenFooterBackgrounds, KeyboardBehavior, ItemsFit } from "../screenFooter";
8
8
  export let FloatingButtonLayouts = /*#__PURE__*/function (FloatingButtonLayouts) {
9
9
  FloatingButtonLayouts["VERTICAL"] = "Vertical";
10
10
  FloatingButtonLayouts["HORIZONTAL"] = "Horizontal";
11
11
  return FloatingButtonLayouts;
12
12
  }({});
13
- const gradientImage = () => require("./gradient.png");
14
-
15
13
  /**
16
- * @description: Hovering button with gradient background
14
+ * @description: Hovering button with gradient background, backed by ScreenFooter
17
15
  * @modifiers: margin, background, color
18
16
  * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/FloatingButtonScreen.tsx
19
17
  * @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/FloatingButton/FloatingButton.gif?raw=true
20
18
  */
21
- class FloatingButton extends PureComponent {
22
- static displayName = 'FloatingButton';
23
- static floatingButtonLayouts = FloatingButtonLayouts;
24
- static defaultProps = {
25
- duration: 300,
26
- buttonLayout: FloatingButtonLayouts.VERTICAL
27
- };
28
- constructor(props) {
29
- super(props);
30
- this.initialVisibility = props.visible;
31
- this.firstLoad = true;
32
- this.visibleAnimated = new Animated.Value(Number(!!props.visible));
33
- }
34
- componentDidUpdate(prevProps) {
35
- const {
36
- visible,
37
- duration
38
- } = this.props;
39
- if (prevProps.visible !== visible) {
40
- Animated.timing(this.visibleAnimated, {
41
- toValue: Number(!!visible),
42
- duration,
43
- useNativeDriver: true
44
- }).start();
45
- }
46
- }
47
- getAnimatedStyle = () => {
48
- return {
49
- opacity: this.visibleAnimated,
50
- transform: [{
51
- translateY: this.visibleAnimated.interpolate({
52
- inputRange: [0, 1],
53
- outputRange: [Constants.screenHeight / 2, 0]
54
- })
55
- }]
56
- };
57
- };
58
- get isSecondaryOnly() {
59
- const {
60
- secondaryButton,
61
- button
62
- } = this.props;
63
- return !!secondaryButton && !button;
64
- }
65
- get isHorizontalLayout() {
66
- const {
67
- buttonLayout
68
- } = this.props;
69
- return buttonLayout === FloatingButtonLayouts.HORIZONTAL || this.isSecondaryOnly;
70
- }
71
- get isSecondaryHorizontal() {
72
- const {
73
- secondaryButton
74
- } = this.props;
75
- return secondaryButton && this.isHorizontalLayout;
76
- }
77
- get isSecondaryVertical() {
78
- const {
79
- secondaryButton
80
- } = this.props;
81
- return secondaryButton && !this.isHorizontalLayout;
82
- }
83
- renderButton() {
84
- const {
85
- bottomMargin,
86
- button,
87
- fullWidth,
88
- testID
89
- } = this.props;
90
- if (button) {
91
- const shadowStyle = button && !button.outline && !button.link ? styles.shadow : undefined;
92
- const marginStyle = {
93
- marginTop: Spacings.s4,
94
- marginBottom: this.isSecondaryVertical ? Spacings.s4 : bottomMargin || Spacings.s8,
95
- marginLeft: this.isSecondaryHorizontal || fullWidth ? Spacings.s4 : undefined,
96
- marginRight: this.isSecondaryHorizontal ? Spacings.s5 : fullWidth ? Spacings.s4 : undefined
19
+ const FloatingButton = props => {
20
+ const {
21
+ visible = false,
22
+ button,
23
+ secondaryButton,
24
+ bottomMargin,
25
+ fullWidth,
26
+ buttonLayout = FloatingButtonLayouts.VERTICAL,
27
+ duration = 300,
28
+ withoutAnimation,
29
+ hideBackgroundOverlay,
30
+ hoisted = true,
31
+ testID
32
+ } = props;
33
+ useEffect(() => {
34
+ // eslint-disable-next-line max-len
35
+ 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
+ const footerContentContainerStyle = useMemo(() => {
38
+ if (bottomMargin !== undefined) {
39
+ return {
40
+ paddingBottom: bottomMargin
97
41
  };
98
- const shouldFlex = this.isSecondaryHorizontal || fullWidth && this.isHorizontalLayout;
99
- return <Button size={Button.sizes.large} flex={!!shouldFlex} style={[shadowStyle, marginStyle]} testID={`${testID}.button`} {...button} />;
100
42
  }
43
+ return undefined;
44
+ }, [bottomMargin]);
45
+ const isSecondaryOnly = !!secondaryButton && !button;
46
+ const isHorizontal = buttonLayout === FloatingButtonLayouts.HORIZONTAL || isSecondaryOnly;
47
+ if (!button && !secondaryButton) {
48
+ return null;
101
49
  }
102
- renderOverlay = () => {
103
- if (!this.props.hideBackgroundOverlay) {
104
- return <View pointerEvents={'none'} style={styles.image}>
105
- <Image style={styles.image} source={gradientImage()} resizeMode={'stretch'} tintColor={Colors.$backgroundDefault} />
106
- </View>;
50
+ const renderPrimaryButton = () => {
51
+ if (!button) {
52
+ return null;
107
53
  }
54
+ const shadowStyle = !button.outline && !button.link ? styles.shadow : undefined;
55
+ const shouldFlex = isHorizontal && !!secondaryButton || fullWidth && isHorizontal;
56
+ return <Button key="primary" size={Button.sizes.large} flex={!!shouldFlex} style={shadowStyle} testID={testID ? `${testID}.button` : undefined} {...button} />;
108
57
  };
109
- renderSecondaryButton() {
110
- const {
111
- secondaryButton,
112
- bottomMargin,
113
- testID,
114
- fullWidth,
115
- button
116
- } = this.props;
117
- if (secondaryButton) {
118
- const bgColor = secondaryButton.backgroundColor || Colors.$backgroundDefault;
119
- const shouldFlex = this.isHorizontalLayout && !!button || fullWidth && this.isSecondaryOnly;
120
- const buttonStyle = this.isHorizontalLayout ? [styles.shadow, styles.horizontalSecondaryMargin, {
121
- backgroundColor: bgColor
122
- }] : {
123
- marginBottom: bottomMargin || Spacings.s7
124
- };
125
- return <Button outline={this.isHorizontalLayout} flex={shouldFlex} link={!this.isHorizontalLayout} size={Button.sizes.large} testID={`${testID}.secondaryButton`} {...secondaryButton} style={buttonStyle} enableShadow={false} />;
126
- }
127
- }
128
- renderHorizontalLayout() {
129
- return <>
130
- {this.renderOverlay()}
131
- {this.renderSecondaryButton()}
132
- {this.renderButton()}
133
- </>;
134
- }
135
- renderVerticalLayout() {
136
- return <>
137
- {this.renderOverlay()}
138
- {this.renderButton()}
139
- {this.renderSecondaryButton()}
140
- </>;
141
- }
142
- render() {
143
- // NOTE: keep this.firstLoad as true as long as the visibility changed to true
144
- const {
145
- withoutAnimation,
146
- visible,
147
- fullWidth,
148
- testID,
149
- button,
150
- secondaryButton
151
- } = this.props;
152
- this.firstLoad && !visible ? this.firstLoad = true : this.firstLoad = false;
153
-
154
- // NOTE: On first load, don't show if it should not be visible
155
- if (this.firstLoad === true && !this.initialVisibility) {
156
- return false;
58
+ const renderSecondaryButton = () => {
59
+ if (!secondaryButton) {
60
+ return null;
157
61
  }
158
- if (!visible && withoutAnimation) {
159
- return false;
160
- }
161
- if (button || secondaryButton) {
162
- const hasBothButtons = !!(button && secondaryButton);
163
- const shouldCenter = !fullWidth || this.isHorizontalLayout && hasBothButtons;
164
- return <View row={this.isHorizontalLayout} center={shouldCenter} pointerEvents="box-none" animated style={[styles.container, this.getAnimatedStyle()]} testID={testID}>
165
- {this.isHorizontalLayout ? this.renderHorizontalLayout() : this.renderVerticalLayout()}
166
- </View>;
167
- }
168
- }
169
- }
62
+ const shouldFlex = isHorizontal && !!button || fullWidth && isSecondaryOnly;
63
+ const bgColor = secondaryButton.backgroundColor || Colors.$backgroundDefault;
64
+ return <Button key="secondary" outline={isHorizontal} link={!isHorizontal} flex={shouldFlex} size={Button.sizes.large} testID={testID ? `${testID}.secondaryButton` : undefined} {...secondaryButton} style={isHorizontal ? [styles.shadow, {
65
+ backgroundColor: bgColor
66
+ }] : undefined} enableShadow={false} />;
67
+ };
68
+ 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}>
70
+ {children}
71
+ </ScreenFooter>;
72
+ };
73
+ FloatingButton.displayName = 'FloatingButton';
74
+ FloatingButton.floatingButtonLayouts = FloatingButtonLayouts;
170
75
  const styles = StyleSheet.create({
171
- container: {
172
- // ...StyleSheet.absoluteFillObject, // TODO: this is breaking scenarios where the FloatingButton is inside a KeyboardTrackingView
173
- top: undefined,
174
- zIndex: 99
175
- },
176
- image: {
177
- ...StyleSheet.absoluteFillObject,
178
- width: '100%',
179
- height: '100%'
180
- },
181
76
  shadow: {
182
77
  ...Shadows.sh20.bottom
183
- },
184
- horizontalSecondaryMargin: {
185
- marginTop: Spacings.s4,
186
- marginBottom: Spacings.s7,
187
- marginLeft: Spacings.s5
188
78
  }
189
79
  });
190
80
  export default asBaseComponent(FloatingButton);
@@ -21,7 +21,7 @@ export interface GridListItemProps {
21
21
  /**
22
22
  * Custom GridListItem to be rendered in the GridView
23
23
  */
24
- renderCustomItem?: () => React.ReactElement<any>;
24
+ renderCustomItem?: () => React.ReactElement;
25
25
  /**
26
26
  * The item size
27
27
  */
@@ -29,7 +29,7 @@ export interface GridListItemProps {
29
29
  /**
30
30
  * Title content text
31
31
  */
32
- title?: string | React.ReactElement<any>;
32
+ title?: string | React.ReactElement;
33
33
  /**
34
34
  * Title content typography
35
35
  */
@@ -45,7 +45,7 @@ export interface GridListItemProps {
45
45
  /**
46
46
  * Subtitle content text
47
47
  */
48
- subtitle?: string | React.ReactElement<any>;
48
+ subtitle?: string | React.ReactElement;
49
49
  /**
50
50
  * Subtitle content typography
51
51
  */
@@ -61,7 +61,7 @@ export interface GridListItemProps {
61
61
  /**
62
62
  * Description content text
63
63
  */
64
- description?: string | React.ReactElement<any>;
64
+ description?: string | React.ReactElement;
65
65
  /**
66
66
  * Description content typography
67
67
  */
@@ -101,12 +101,12 @@ export interface GridListItemProps {
101
101
  /**
102
102
  * Renders an overlay on top of the image
103
103
  */
104
- renderOverlay?: () => React.ReactElement<any>;
104
+ renderOverlay?: () => React.ReactElement;
105
105
  /**
106
106
  * Test ID for component
107
107
  */
108
108
  testID?: string;
109
- children?: React.ReactElement<any> | React.ReactElement<any>[];
109
+ children?: React.ReactElement | React.ReactElement[];
110
110
  }
111
111
  /**
112
112
  * @description: A single grid view/list item component
@@ -122,7 +122,7 @@ declare class GridListItem extends Component<GridListItemProps> {
122
122
  onItemPress: () => void;
123
123
  getItemSizeObj(): ImageSize;
124
124
  getContainerHorizontalAlignment: (this: any, horizontalAlignment: any) => "center" | "flex-start" | "flex-end" | undefined;
125
- renderContent(text: string | React.ReactElement<any> | undefined, textProps: Partial<TextProps>): React.JSX.Element | undefined;
125
+ renderContent(text: string | React.ReactElement | undefined, textProps: Partial<TextProps>): React.JSX.Element | undefined;
126
126
  render(): React.JSX.Element;
127
127
  }
128
128
  export default GridListItem;
@@ -39,7 +39,7 @@ export interface GridViewProps {
39
39
  /**
40
40
  * Pass to render a custom item
41
41
  */
42
- renderCustomItem?: (item: GridListItemProps) => React.ReactElement<any>;
42
+ renderCustomItem?: (item: GridListItemProps) => React.ReactElement;
43
43
  }
44
44
  interface GridViewState {
45
45
  viewWidth: number;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { View as RNView, LayoutChangeEvent } from 'react-native';
3
3
  import { HintProps } from './types';
4
4
  interface HintBubbleProps extends Pick<HintProps, 'testID' | 'visible' | 'message' | 'messageStyle' | 'color' | 'removePaddings' | 'enableShadow' | 'borderRadius' | 'iconStyle' | 'icon' | 'customContent'> {
5
- hintRef: React.RefObject<RNView | null>;
5
+ hintRef: React.RefObject<RNView>;
6
6
  setHintLayout: (layoutChangeEvent: LayoutChangeEvent) => void;
7
7
  hintPositionStyle: {
8
8
  left: number;
@@ -1,4 +1,4 @@
1
- import React, { Component, ReactElement, ElementRef, type JSX } from 'react';
1
+ import React, { Component, ReactElement, ElementRef } from 'react';
2
2
  import { Animated, GestureResponderEvent, ImageSourcePropType, ImageStyle, StyleProp, TextStyle, ViewStyle, LayoutChangeEvent, View as RNView } from 'react-native';
3
3
  declare enum TARGET_POSITIONS {
4
4
  LEFT = "left",
@@ -18,7 +18,7 @@ interface HintTargetFrame {
18
18
  type Position = Pick<ViewStyle, 'top' | 'bottom' | 'left' | 'right'>;
19
19
  type HintPositionStyle = Position & Pick<ViewStyle, 'alignItems'>;
20
20
  type Paddings = Pick<ViewStyle, 'paddingLeft' | 'paddingRight' | 'paddingVertical' | 'paddingHorizontal'>;
21
- type ContentType = string | ReactElement<any>;
21
+ type ContentType = string | ReactElement;
22
22
  export interface HintProps {
23
23
  /**
24
24
  * Control the visibility of the hint
@@ -130,7 +130,7 @@ declare class Hint extends Component<HintProps, HintState> {
130
130
  };
131
131
  static positions: typeof HintPositions;
132
132
  targetRef: ElementRef<typeof RNView> | null;
133
- hintRef: React.RefObject<RNView | null>;
133
+ hintRef: React.RefObject<RNView>;
134
134
  animationDuration: number;
135
135
  state: {
136
136
  targetLayoutInWindow: {
@@ -183,14 +183,14 @@ declare class Hint extends Component<HintProps, HintState> {
183
183
  getTipPosition(): Position;
184
184
  getHintOffsetForShortMessage: () => number;
185
185
  isUsingModal: () => boolean | undefined;
186
- renderOverlay(): JSX.Element | undefined;
187
- renderHintTip(): JSX.Element;
188
- renderHint(): JSX.Element;
189
- renderHintContainer(): JSX.Element | undefined;
190
- renderHintAnchor(): JSX.Element;
191
- renderMockChildren(): JSX.Element | undefined;
186
+ renderOverlay(): React.JSX.Element | undefined;
187
+ renderHintTip(): React.JSX.Element;
188
+ renderHint(): React.JSX.Element;
189
+ renderHintContainer(): React.JSX.Element | undefined;
190
+ renderHintAnchor(): React.JSX.Element;
191
+ renderMockChildren(): React.JSX.Element | undefined;
192
192
  renderChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
193
- render(): string | number | bigint | true | JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
193
+ render(): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
194
194
  }
195
195
  declare const _default: React.ForwardRefExoticComponent<HintProps & React.RefAttributes<any>> & typeof Hint;
196
196
  export default _default;
@@ -6,7 +6,7 @@ export default function useHintLayout({ onBackgroundPress, targetFrame }: UseHin
6
6
  targetLayoutState: LayoutRectangle | undefined;
7
7
  targetLayoutInWindowState: LayoutRectangle | undefined;
8
8
  hintMessageWidth: number | undefined;
9
- targetRef: import("react").RefObject<RNView | null>;
9
+ targetRef: import("react").MutableRefObject<RNView | null>;
10
10
  onTargetLayout: ({ nativeEvent: { layout } }: LayoutChangeEvent) => void;
11
11
  setHintLayout: ({ nativeEvent: { layout } }: LayoutChangeEvent) => void;
12
12
  };
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { HintPositions, HintProps } from './types';
3
3
  declare const Hint: {
4
- (props: HintProps): string | number | bigint | true | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
4
+ (props: HintProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
5
  displayName: string;
6
6
  positions: typeof HintPositions;
7
7
  };
8
8
  export { HintProps, Hint };
9
9
  declare const _default: React.ForwardRefExoticComponent<HintProps & React.RefAttributes<any>> & {
10
- (props: HintProps): string | number | bigint | true | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
10
+ (props: HintProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
11
11
  displayName: string;
12
12
  positions: typeof HintPositions;
13
13
  };
@@ -1,9 +1,9 @@
1
- import type { ReactElement, JSX } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  import type { GestureResponderEvent, ImageSourcePropType, ImageStyle, LayoutRectangle, StyleProp, TextStyle, ViewStyle } from 'react-native';
3
3
  export type PositionStyle = Pick<ViewStyle, 'top' | 'bottom' | 'left' | 'right'>;
4
4
  export type LayoutStyle = PositionStyle & Pick<ViewStyle, 'alignItems'>;
5
5
  export type PaddingsStyle = Pick<ViewStyle, 'paddingLeft' | 'paddingRight' | 'paddingVertical' | 'paddingHorizontal'>;
6
- export type ContentType = string | ReactElement<any>;
6
+ export type ContentType = string | ReactElement;
7
7
  export declare enum TargetAlignments {
8
8
  LEFT = "left",
9
9
  RIGHT = "right",
@@ -74,6 +74,9 @@ const Icon = forwardRef((props, ref) => {
74
74
  </>;
75
75
  });
76
76
  Icon.displayName = 'Icon';
77
+ Icon.defaultProps = {
78
+ assetGroup: 'icons'
79
+ };
77
80
  export default asBaseComponent(Icon, {
78
81
  modifiersOptions: {
79
82
  margins: true
@@ -50,7 +50,7 @@ export type ImageProps = Omit<RNImageProps, 'source'> & Pick<ImageBackgroundProp
50
50
  /**
51
51
  * Render an overlay with custom content
52
52
  */
53
- customOverlayContent?: React.ReactElement<any> | React.ReactElement<any>[];
53
+ customOverlayContent?: React.ReactElement | React.ReactElement[];
54
54
  /**
55
55
  * Default image source in case of an error
56
56
  */