react-native-ui-lib 8.4.3 → 8.5.0-snapshot.7950
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/components/HighlighterOverlayView/index.d.ts +2 -2
- package/lib/components/HighlighterOverlayView/index.web.d.ts +2 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.ts +1 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.js +5 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.ts +2 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/index.js +3 -1
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.js +3 -1
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.ts +6 -2
- package/lib/components/Keyboard/KeyboardTrackingView/index.js +5 -4
- package/lib/components/Keyboard/index.d.ts +2 -1
- package/lib/package.json +20 -21
- package/lib/react-native.config.js +1 -1
- package/package.json +161 -164
- package/src/commons/asBaseComponent.js +2 -1
- package/src/commons/baseComponent.js +0 -8
- package/src/commons/forwardRef.js +1 -4
- package/src/commons/modifiers.d.ts +0 -6
- package/src/commons/modifiers.js +0 -18
- package/src/commons/withScrollEnabler.js +0 -4
- package/src/commons/withScrollReached.js +0 -4
- package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +0 -7
- package/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +0 -6
- package/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +0 -6
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +2 -2
- package/src/components/WheelPicker/index.d.ts +2 -2
- package/src/components/WheelPicker/index.js +1 -1
- package/src/components/WheelPicker/usePresenter.d.ts +1 -1
- package/src/components/actionSheet/index.d.ts +1 -1
- package/src/components/animatedImage/index.d.ts +1 -1
- package/src/components/animatedScanner/index.js +0 -37
- package/src/components/avatar/index.d.ts +1 -1
- package/src/components/badge/index.d.ts +4 -4
- package/src/components/baseInput/index.d.ts +0 -1
- package/src/components/baseInput/index.js +1 -49
- package/src/components/button/index.d.ts +4 -4
- package/src/components/button/types.d.ts +2 -2
- package/src/components/carousel/index.d.ts +8 -8
- package/src/components/carousel/types.d.ts +4 -1
- package/src/components/carousel/types.js +0 -2
- package/src/components/checkbox/index.d.ts +1 -1
- package/src/components/chip/index.d.ts +1 -1
- package/src/components/chipsInput/index.d.ts +2 -0
- package/src/components/colorPalette/index.d.ts +1 -1
- package/src/components/dateTimePicker/index.d.ts +2 -2
- package/src/components/dateTimePicker/index.js +2 -2
- package/src/components/dialog/types.d.ts +4 -4
- package/src/components/dialog/useDialogContent.d.ts +1 -1
- package/src/components/drawer/index.d.ts +1 -1
- package/src/components/expandableSection/index.d.ts +2 -2
- package/src/components/fadedScrollView/index.js +1 -1
- package/src/components/featureHighlight/index.js +5 -7
- package/src/components/floatingButton/index.d.ts +1 -1
- package/src/components/floatingButton/index.js +10 -6
- package/src/components/gridListItem/index.d.ts +7 -7
- package/src/components/gridView/index.d.ts +1 -1
- package/src/components/hint/HintBubble.d.ts +1 -1
- package/src/components/hint/HintOld.d.ts +10 -10
- package/src/components/hint/hooks/useHintLayout.d.ts +1 -1
- package/src/components/hint/index.d.ts +2 -2
- package/src/components/hint/types.d.ts +2 -2
- package/src/components/icon/index.js +0 -3
- package/src/components/image/index.d.ts +1 -1
- package/src/components/image/index.js +20 -17
- package/src/components/loaderScreen/index.d.ts +1 -1
- package/src/components/loaderScreen/types.d.ts +1 -1
- package/src/components/maskedInput/index.d.ts +21 -4
- package/src/components/maskedInput/index.js +78 -16
- package/src/components/maskedInput/maskedInput.api.json +0 -1
- package/src/components/modal/index.d.ts +3 -3
- package/src/components/numberInput/index.js +2 -2
- package/src/components/overlay/index.d.ts +1 -1
- package/src/components/picker/PickerDialog.android.js +0 -15
- package/src/components/picker/PickerDialog.js +0 -7
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +1 -1
- package/src/components/picker/helpers/useImperativePickerHandle.js +1 -1
- package/src/components/picker/types.d.ts +9 -9
- package/src/components/progressBar/index.d.ts +2 -2
- package/src/components/screenFooter/index.d.ts +2 -2
- package/src/components/screenFooter/index.js +32 -63
- package/src/components/screenFooter/screenFooter.api.json +13 -2
- package/src/components/screenFooter/types.d.ts +23 -6
- package/src/components/screenFooter/types.js +6 -0
- package/src/components/screenFooter/useAnimatedFooterStyle.d.ts +14 -0
- package/src/components/screenFooter/useAnimatedFooterStyle.js +72 -0
- package/src/components/scrollBar/index.d.ts +11 -4
- package/src/components/searchInput/index.js +1 -1
- package/src/components/searchInput/types.d.ts +2 -2
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +2 -2
- package/src/components/skeletonView/index.d.ts +4 -4
- package/src/components/slider/Thumb.d.ts +1 -1
- package/src/components/slider/types.d.ts +1 -1
- package/src/components/stackAggregator/index.d.ts +1 -1
- package/src/components/tabController/TabBarItem.d.ts +2 -2
- package/src/components/tabController/TabBarItem.js +1 -1
- package/src/components/tabController/TabPage.d.ts +2 -2
- package/src/components/tabController/useScrollToItem.d.ts +1 -1
- package/src/components/text/Text.driver.d.ts +1 -1
- package/src/components/textArea/index.js +0 -6
- package/src/components/textField/types.d.ts +4 -4
- package/src/components/textField/useImperativeInputHandle.d.ts +1 -1
- package/src/components/textField/useImperativeInputHandle.js +1 -1
- package/src/components/textField/usePreset.d.ts +36 -36
- package/src/components/timeline/index.js +1 -1
- package/src/components/toast/index.js +0 -69
- package/src/components/wizard/index.d.ts +1 -1
- package/src/components/wizard/types.d.ts +1 -1
- package/src/components/wizard/wizard.api.json +1 -1
- package/src/hooks/useCombinedRefs/index.js +1 -2
- package/src/hooks/useDebounce/index.js +1 -1
- package/src/hooks/useHiddenLocation/index.js +2 -2
- package/src/hooks/useHiddenLocation/index.web.js +2 -2
- package/src/hooks/useMeasure/index.d.ts +1 -1
- package/src/hooks/useMeasure/index.js +1 -1
- package/src/hooks/useScrollTo/index.d.ts +2 -2
- package/src/incubator/calendar/index.js +1 -1
- package/src/incubator/calendar/types.d.ts +2 -2
- package/src/incubator/expandableOverlay/index.d.ts +2 -2
- package/src/incubator/index.d.ts +1 -0
- package/src/incubator/index.js +2 -1
- package/src/{components → incubator}/marquee/index.js +2 -2
- package/src/{components → incubator}/marquee/marquee.api.json +1 -1
- package/src/{components → incubator}/marquee/types.d.ts +2 -2
- package/src/incubator/slider/Thumb.js +1 -1
- package/src/incubator/slider/Track.d.ts +1 -1
- package/src/incubator/slider/index.d.ts +1 -1
- package/src/incubator/toast/helpers/useToastTimer.js +1 -1
- package/src/incubator/toast/index.js +1 -1
- package/src/incubator/toast/types.d.ts +2 -2
- package/src/index.d.ts +3 -4
- package/src/index.js +25 -18
- package/src/testkit/Component.driver.d.ts +1 -1
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +1 -1
- package/src/typings/module.d.ts +12 -3
- package/ReactNativeUiLib.podspec +0 -22
- package/marquee.d.ts +0 -2
- package/marquee.js +0 -1
- package/src/components/maskedInput/new.d.ts +0 -22
- package/src/components/maskedInput/new.js +0 -85
- package/src/components/maskedInput/old.js +0 -95
- package/src/components/textFieldOld/index.d.ts +0 -71
- package/src/components/textFieldOld/index.js +0 -807
- package/src/helpers/DocsGenerator.js +0 -61
- package/textFieldOld.d.ts +0 -2
- package/textFieldOld.js +0 -1
- /package/src/{components → incubator}/marquee/index.d.ts +0 -0
- /package/src/{components → incubator}/marquee/types.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
1
|
+
import { PropsWithChildren, ReactNode, type JSX } from 'react';
|
|
2
2
|
import { FlatListProps, StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
3
|
import { ExpandableOverlayProps, ExpandableOverlayMethods } from '../../incubator/expandableOverlay';
|
|
4
4
|
import { ModalTopBarProps } from '../modal/TopBar';
|
|
@@ -19,7 +19,7 @@ export type PickerSingleValue = string | number;
|
|
|
19
19
|
export type PickerMultiValue = PickerSingleValue[];
|
|
20
20
|
export type PickerValue = PickerSingleValue | PickerMultiValue | undefined;
|
|
21
21
|
type PickerFilteredItems = ReactNode | Pick<PickerItemProps, 'label' | 'value' | 'disabled'>[] | undefined;
|
|
22
|
-
type RenderPickerOverloads<ValueType> = ValueType extends PickerValue ? (value?: ValueType, label?: string) => React.ReactElement : never;
|
|
22
|
+
type RenderPickerOverloads<ValueType> = ValueType extends PickerValue ? (value?: ValueType, label?: string) => React.ReactElement<any> : never;
|
|
23
23
|
type RenderPicker = RenderPickerOverloads<PickerValue>;
|
|
24
24
|
export type RenderCustomModalProps = {
|
|
25
25
|
visible: boolean;
|
|
@@ -55,7 +55,7 @@ type PickerPropsDeprecation = {
|
|
|
55
55
|
renderCustomDialogHeader?: (callbacks: {
|
|
56
56
|
onDone?: () => void;
|
|
57
57
|
onCancel?: () => void;
|
|
58
|
-
}) => React.ReactElement
|
|
58
|
+
}) => React.ReactElement<any>;
|
|
59
59
|
/**
|
|
60
60
|
* @deprecated
|
|
61
61
|
* Render custom picker input (the value will be passed)
|
|
@@ -69,7 +69,7 @@ type PickerPropsDeprecation = {
|
|
|
69
69
|
* Render custom picker overlay (e.g ({visible, children, toggleModal}) => {...})
|
|
70
70
|
* instead use renderOverlay
|
|
71
71
|
*/
|
|
72
|
-
renderCustomModal?: (modalProps: RenderCustomModalProps) => React.ReactElement
|
|
72
|
+
renderCustomModal?: (modalProps: RenderCustomModalProps) => React.ReactElement<any>;
|
|
73
73
|
/**
|
|
74
74
|
* @deprecated
|
|
75
75
|
* Pass props to the picker modal
|
|
@@ -97,7 +97,7 @@ type PickerSearchProps = {
|
|
|
97
97
|
/**
|
|
98
98
|
* Render custom search input (only when passing showSearch)
|
|
99
99
|
*/
|
|
100
|
-
renderCustomSearch?: (props: PickerItemsListProps) => React.ReactElement
|
|
100
|
+
renderCustomSearch?: (props: PickerItemsListProps) => React.ReactElement<any>;
|
|
101
101
|
};
|
|
102
102
|
type PickerListProps = PickerSearchProps & {
|
|
103
103
|
/**
|
|
@@ -106,7 +106,7 @@ type PickerListProps = PickerSearchProps & {
|
|
|
106
106
|
renderHeader?: (callbacks: {
|
|
107
107
|
onDone?: () => void;
|
|
108
108
|
onCancel?: () => void;
|
|
109
|
-
}) => React.ReactElement
|
|
109
|
+
}) => React.ReactElement<any>;
|
|
110
110
|
/**
|
|
111
111
|
* Pass props to the list component that wraps the picker items (allows to control FlatList behavior)
|
|
112
112
|
*/
|
|
@@ -128,7 +128,7 @@ type PickerExpandableOverlayProps = {
|
|
|
128
128
|
/**
|
|
129
129
|
* Render custom picker overlay (e.g ({visible, children, toggleModal}) => {...})
|
|
130
130
|
*/
|
|
131
|
-
renderOverlay?: (modalProps: RenderCustomModalProps) => React.ReactElement
|
|
131
|
+
renderOverlay?: (modalProps: RenderCustomModalProps) => React.ReactElement<any>;
|
|
132
132
|
/**
|
|
133
133
|
* Add blur effect to picker modal (iOS only)
|
|
134
134
|
*/
|
|
@@ -213,11 +213,11 @@ export type PickerBaseProps = Omit<TextFieldProps, 'value' | 'onChange'> & Picke
|
|
|
213
213
|
renderItem?: (value: PickerValue, itemProps: PickerItemProps & {
|
|
214
214
|
isSelected: boolean;
|
|
215
215
|
isItemDisabled: boolean;
|
|
216
|
-
}, label?: string) => React.ReactElement
|
|
216
|
+
}, label?: string) => React.ReactElement<any>;
|
|
217
217
|
/**
|
|
218
218
|
* Render custom top element
|
|
219
219
|
*/
|
|
220
|
-
renderCustomTopElement?: (value?: PickerValue) => React.ReactElement
|
|
220
|
+
renderCustomTopElement?: (value?: PickerValue) => React.ReactElement<any>;
|
|
221
221
|
/**
|
|
222
222
|
* Selection status bar props
|
|
223
223
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
1
|
+
import React, { PureComponent, type JSX } from 'react';
|
|
2
2
|
import { Animated, StyleProp, ViewStyle, LayoutChangeEvent } from 'react-native';
|
|
3
3
|
/**
|
|
4
4
|
* @description: Progress bar
|
|
@@ -67,7 +67,7 @@ declare class ProgressBar extends PureComponent<Props, State> {
|
|
|
67
67
|
borderTopRightRadius: number;
|
|
68
68
|
};
|
|
69
69
|
renderCustomElement(): React.FunctionComponentElement<any> | undefined;
|
|
70
|
-
render():
|
|
70
|
+
render(): JSX.Element;
|
|
71
71
|
}
|
|
72
72
|
export { ProgressBar };
|
|
73
73
|
declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>> & typeof ProgressBar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterShadow } from './types';
|
|
3
|
-
export { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterShadow };
|
|
2
|
+
import { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterAnimationTypeProp, ScreenFooterShadow } from './types';
|
|
3
|
+
export { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterAnimationTypeProp, ScreenFooterShadow };
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<ScreenFooterProps & React.RefAttributes<any>> & {
|
|
5
5
|
(props: ScreenFooterProps): React.JSX.Element;
|
|
6
6
|
displayName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
|
-
import Animated
|
|
3
|
+
import Animated from 'react-native-reanimated';
|
|
4
4
|
import { Keyboard } from 'uilib-native';
|
|
5
5
|
import { SafeAreaContextPackage } from "../../optionalDependencies";
|
|
6
6
|
import View from "../view";
|
|
@@ -9,9 +9,9 @@ import Assets from "../../assets";
|
|
|
9
9
|
import { Colors, Shadows, Spacings } from "../../style";
|
|
10
10
|
import { asBaseComponent, Constants } from "../../commons/new";
|
|
11
11
|
import { useKeyboardHeight } from "../../hooks";
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import useAnimatedFooterStyle from "./useAnimatedFooterStyle";
|
|
13
|
+
import { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterAnimationTypeProp, ScreenFooterShadow } from "./types";
|
|
14
|
+
export { ScreenFooterProps, ScreenFooterLayouts, ScreenFooterBackgrounds, FooterAlignment, HorizontalItemsDistribution, ItemsFit, KeyboardBehavior, ScreenFooterAnimationTypeProp, ScreenFooterShadow };
|
|
15
15
|
const ScreenFooter = props => {
|
|
16
16
|
const {
|
|
17
17
|
testID,
|
|
@@ -25,44 +25,24 @@ const ScreenFooter = props => {
|
|
|
25
25
|
itemWidth,
|
|
26
26
|
horizontalItemsDistribution: distribution,
|
|
27
27
|
visible = true,
|
|
28
|
-
animationDuration
|
|
28
|
+
animationDuration,
|
|
29
|
+
animationType,
|
|
29
30
|
shadow = ScreenFooterShadow.SH20,
|
|
30
31
|
hideDivider = false,
|
|
31
|
-
isAndroidEdgeToEdge
|
|
32
|
+
isAndroidEdgeToEdge,
|
|
33
|
+
containerStyle: containerStyleOverride,
|
|
32
34
|
contentContainerStyle: contentContainerStyleOverride
|
|
33
35
|
} = props;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
visibilityTranslateY.value = withTiming(visible ? 0 : height, {
|
|
45
|
-
duration: animationDuration
|
|
46
|
-
});
|
|
47
|
-
}, [visible, height, animationDuration, visibilityTranslateY]);
|
|
48
|
-
|
|
49
|
-
// Animated style for STICKY behavior (counters Android system offset + visibility)
|
|
50
|
-
const stickyAnimatedStyle = useAnimatedStyle(() => {
|
|
51
|
-
const counterSystemOffset = Constants.isAndroid ? keyboard.height.value : 0;
|
|
52
|
-
return {
|
|
53
|
-
transform: [{
|
|
54
|
-
translateY: counterSystemOffset + visibilityTranslateY.value
|
|
55
|
-
}]
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// Animated style for HOISTED behavior (visibility only, keyboard handled by KeyboardAccessoryView)
|
|
60
|
-
const hoistedAnimatedStyle = useAnimatedStyle(() => {
|
|
61
|
-
return {
|
|
62
|
-
transform: [{
|
|
63
|
-
translateY: visibilityTranslateY.value
|
|
64
|
-
}]
|
|
65
|
-
};
|
|
36
|
+
const {
|
|
37
|
+
containerStyle,
|
|
38
|
+
setHeight
|
|
39
|
+
} = useAnimatedFooterStyle({
|
|
40
|
+
animationDuration,
|
|
41
|
+
animationType,
|
|
42
|
+
keyboardBehavior,
|
|
43
|
+
visible,
|
|
44
|
+
isAndroidEdgeToEdge,
|
|
45
|
+
containerStyle: containerStyleOverride
|
|
66
46
|
});
|
|
67
47
|
const onLayout = useCallback(event => {
|
|
68
48
|
setHeight(event.nativeEvent.layout.height);
|
|
@@ -163,13 +143,13 @@ const ScreenFooter = props => {
|
|
|
163
143
|
maxWidth: '100%'
|
|
164
144
|
};
|
|
165
145
|
return <View key={index} style={fixedStyle}>
|
|
166
|
-
|
|
167
|
-
|
|
146
|
+
{child}
|
|
147
|
+
</View>;
|
|
168
148
|
}
|
|
169
149
|
if (isHorizontal && React.isValidElement(child) && itemsFit === ItemsFit.STRETCH) {
|
|
170
150
|
return <View flex row centerH key={index}>
|
|
171
|
-
|
|
172
|
-
|
|
151
|
+
{child}
|
|
152
|
+
</View>;
|
|
173
153
|
}
|
|
174
154
|
return child;
|
|
175
155
|
}, [itemsFit, itemWidth, isHorizontal]);
|
|
@@ -182,30 +162,19 @@ const ScreenFooter = props => {
|
|
|
182
162
|
</View>
|
|
183
163
|
</>;
|
|
184
164
|
}, [renderBackground, testID, contentContainerStyle, childrenArray]);
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}, [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
<Keyboard.KeyboardAccessoryView renderContent={renderFooterContent} kbInputRef={undefined} scrollBehavior={Keyboard.KeyboardAccessoryView.scrollBehaviors.FIXED_OFFSET} useSafeArea={false} manageScrollView={false} revealKeyboardInteractive onHeightChanged={setHeight} />
|
|
195
|
-
</Container>;
|
|
196
|
-
}
|
|
197
|
-
return <Animated.View testID={testID} onLayout={onLayout} style={[styles.container, stickyAnimatedStyle]}>
|
|
198
|
-
{renderFooterContent()}
|
|
165
|
+
const renderKeyboardAwareFooter = useCallback(() => {
|
|
166
|
+
if (keyboardBehavior === 'hoisted') {
|
|
167
|
+
return <Keyboard.KeyboardAccessoryView renderContent={renderFooterContent} kbInputRef={undefined} scrollBehavior={Keyboard.KeyboardAccessoryView.scrollBehaviors.FIXED_OFFSET} useSafeArea={false} manageScrollView={false} revealKeyboardInteractive onHeightChanged={setHeight} />;
|
|
168
|
+
} else {
|
|
169
|
+
return renderFooterContent();
|
|
170
|
+
}
|
|
171
|
+
}, [keyboardBehavior, renderFooterContent]);
|
|
172
|
+
return <Animated.View testID={testID} style={containerStyle} onLayout={keyboardBehavior === 'hoisted' ? undefined : onLayout} pointerEvents={!visible ? 'none' : keyboardBehavior === 'hoisted' ? 'box-none' : 'auto'}>
|
|
173
|
+
{renderKeyboardAwareFooter()}
|
|
199
174
|
</Animated.View>;
|
|
200
175
|
};
|
|
201
176
|
ScreenFooter.displayName = 'ScreenFooter';
|
|
202
177
|
const styles = StyleSheet.create({
|
|
203
|
-
container: {
|
|
204
|
-
position: 'absolute',
|
|
205
|
-
bottom: 0,
|
|
206
|
-
left: 0,
|
|
207
|
-
right: 0
|
|
208
|
-
},
|
|
209
178
|
contentContainer: {
|
|
210
179
|
paddingTop: Spacings.s4,
|
|
211
180
|
paddingHorizontal: Spacings.s5,
|
|
@@ -55,13 +55,19 @@
|
|
|
55
55
|
{
|
|
56
56
|
"name": "visible",
|
|
57
57
|
"type": "boolean",
|
|
58
|
-
"description": "If true, the footer is visible. If false,
|
|
58
|
+
"description": "If true, the footer is visible. If false, the footer is hidden using the configured animation type",
|
|
59
59
|
"default": "true"
|
|
60
60
|
},
|
|
61
|
+
{
|
|
62
|
+
"name": "animationType",
|
|
63
|
+
"type": "ScreenFooterAnimationTypeProp",
|
|
64
|
+
"description": "The animation type for showing/hiding the footer [slide, fade, none]",
|
|
65
|
+
"default": "'slide'"
|
|
66
|
+
},
|
|
61
67
|
{
|
|
62
68
|
"name": "animationDuration",
|
|
63
69
|
"type": "number",
|
|
64
|
-
"description": "Duration of the show/hide animation in ms",
|
|
70
|
+
"description": "Duration of the show/hide animation in ms (sending 0 will disable the animation)",
|
|
65
71
|
"default": "200"
|
|
66
72
|
},
|
|
67
73
|
{
|
|
@@ -87,6 +93,11 @@
|
|
|
87
93
|
"type": "boolean",
|
|
88
94
|
"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
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"name": "containerStyle",
|
|
98
|
+
"type": "StyleProp<ViewStyle>",
|
|
99
|
+
"description": "Custom style for the outer container of the footer. Can be used to override zIndex or other container-level properties."
|
|
100
|
+
},
|
|
90
101
|
{
|
|
91
102
|
"name": "contentContainerStyle",
|
|
92
103
|
"type": "StyleProp<ViewStyle>",
|
|
@@ -32,7 +32,25 @@ export declare enum ScreenFooterShadow {
|
|
|
32
32
|
SH20 = "sh20",
|
|
33
33
|
SH30 = "sh30"
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export declare enum ScreenFooterAnimation {
|
|
36
|
+
NONE = "none",
|
|
37
|
+
SLIDE = "slide",
|
|
38
|
+
FADE = "fade"
|
|
39
|
+
}
|
|
40
|
+
export type ScreenFooterAnimationTypeProp = ScreenFooterAnimation | `${ScreenFooterAnimation}`;
|
|
41
|
+
export interface AnimatedFooterStyleProps {
|
|
42
|
+
/**
|
|
43
|
+
* The type of animation to use when showing or hiding the footer.
|
|
44
|
+
* @default 'slide'
|
|
45
|
+
*/
|
|
46
|
+
animationType?: ScreenFooterAnimationTypeProp;
|
|
47
|
+
/**
|
|
48
|
+
* Duration of the show/hide animation in ms (sending 0 will disable the animation).
|
|
49
|
+
* @default 200
|
|
50
|
+
*/
|
|
51
|
+
animationDuration?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ScreenFooterProps extends AnimatedFooterStyleProps, PropsWithChildren<{}> {
|
|
36
54
|
/**
|
|
37
55
|
* Used as testing identifier
|
|
38
56
|
*/
|
|
@@ -78,11 +96,6 @@ export interface ScreenFooterProps extends PropsWithChildren<{}> {
|
|
|
78
96
|
* If true, the footer is visible. If false, it slides down.
|
|
79
97
|
*/
|
|
80
98
|
visible?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Duration of the show/hide animation in ms.
|
|
83
|
-
* @default 200
|
|
84
|
-
*/
|
|
85
|
-
animationDuration?: number;
|
|
86
99
|
/**
|
|
87
100
|
* If true, the footer will respect the safe area (add bottom padding)
|
|
88
101
|
*/
|
|
@@ -97,6 +110,10 @@ export interface ScreenFooterProps extends PropsWithChildren<{}> {
|
|
|
97
110
|
* Only applies when backgroundType is 'solid'
|
|
98
111
|
*/
|
|
99
112
|
hideDivider?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Custom style for the outer container of the footer.
|
|
115
|
+
*/
|
|
116
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
100
117
|
/**
|
|
101
118
|
* Custom style for the content container that wraps the footer's children.
|
|
102
119
|
* Can be used to override default padding, gap, or other layout properties.
|
|
@@ -36,4 +36,10 @@ export let ScreenFooterShadow = /*#__PURE__*/function (ScreenFooterShadow) {
|
|
|
36
36
|
ScreenFooterShadow["SH20"] = "sh20";
|
|
37
37
|
ScreenFooterShadow["SH30"] = "sh30";
|
|
38
38
|
return ScreenFooterShadow;
|
|
39
|
+
}({});
|
|
40
|
+
export let ScreenFooterAnimation = /*#__PURE__*/function (ScreenFooterAnimation) {
|
|
41
|
+
ScreenFooterAnimation["NONE"] = "none";
|
|
42
|
+
ScreenFooterAnimation["SLIDE"] = "slide";
|
|
43
|
+
ScreenFooterAnimation["FADE"] = "fade";
|
|
44
|
+
return ScreenFooterAnimation;
|
|
39
45
|
}({});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
import { AnimatedFooterStyleProps, ScreenFooterProps } from './types';
|
|
4
|
+
declare const useAnimatedFooterStyle: (props: AnimatedFooterStyleProps & Pick<ScreenFooterProps, 'keyboardBehavior' | 'visible' | 'isAndroidEdgeToEdge' | 'containerStyle'>) => {
|
|
5
|
+
containerStyle: (import("react-native").StyleProp<ViewStyle> | {
|
|
6
|
+
position: "absolute";
|
|
7
|
+
bottom: number;
|
|
8
|
+
left: number;
|
|
9
|
+
right: number;
|
|
10
|
+
zIndex: number;
|
|
11
|
+
})[];
|
|
12
|
+
setHeight: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
13
|
+
};
|
|
14
|
+
export default useAnimatedFooterStyle;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useAnimatedKeyboard, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { Constants } from "../../commons/new";
|
|
4
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
5
|
+
const androidVersion = Constants.getAndroidVersion();
|
|
6
|
+
const useAnimatedFooterStyle = props => {
|
|
7
|
+
const {
|
|
8
|
+
animationType: animationTypeProp = 'slide',
|
|
9
|
+
animationDuration: animationDurationProp = 200,
|
|
10
|
+
keyboardBehavior,
|
|
11
|
+
visible,
|
|
12
|
+
isAndroidEdgeToEdge = !!androidVersion && androidVersion >= 35 ? true : undefined,
|
|
13
|
+
containerStyle: containerStyleOverride
|
|
14
|
+
} = props;
|
|
15
|
+
const animationType = animationDurationProp === 0 ? 'none' : animationTypeProp;
|
|
16
|
+
const animationDuration = animationType === 'none' ? 0 : animationDurationProp;
|
|
17
|
+
const keyboard = useAnimatedKeyboard({
|
|
18
|
+
isNavigationBarTranslucentAndroid: isAndroidEdgeToEdge,
|
|
19
|
+
isStatusBarTranslucentAndroid: isAndroidEdgeToEdge
|
|
20
|
+
});
|
|
21
|
+
const [height, setHeight] = useState(0);
|
|
22
|
+
const animatedValue = useSharedValue(animationType === 'fade' && visible ? 1 : 0);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (animationType === 'slide') {
|
|
25
|
+
animatedValue.value = withTiming(visible ? 0 : height, {
|
|
26
|
+
duration: animationDuration
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
animatedValue.value = withTiming(visible ? 1 : 0, {
|
|
30
|
+
duration: animationDuration
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}, [visible, height, animationDuration, animatedValue, animationType]);
|
|
34
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
35
|
+
let style = {};
|
|
36
|
+
let translateY = 0;
|
|
37
|
+
if (animationType === 'slide') {
|
|
38
|
+
translateY = animatedValue.value;
|
|
39
|
+
} else {
|
|
40
|
+
style = {
|
|
41
|
+
opacity: animatedValue.value
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (keyboardBehavior === 'sticky' && Constants.isAndroid) {
|
|
45
|
+
translateY += keyboard.height.value;
|
|
46
|
+
}
|
|
47
|
+
if (animationType === 'slide' || translateY !== 0) {
|
|
48
|
+
style.transform = [{
|
|
49
|
+
translateY
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
return style;
|
|
53
|
+
});
|
|
54
|
+
const containerStyle = useMemo(() => {
|
|
55
|
+
return [styles.container, animatedStyle, containerStyleOverride];
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
+
}, [containerStyleOverride]);
|
|
58
|
+
return {
|
|
59
|
+
containerStyle,
|
|
60
|
+
setHeight
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export default useAnimatedFooterStyle;
|
|
64
|
+
const styles = StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
position: 'absolute',
|
|
67
|
+
bottom: 0,
|
|
68
|
+
left: 0,
|
|
69
|
+
right: 0,
|
|
70
|
+
zIndex: 50
|
|
71
|
+
}
|
|
72
|
+
});
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { Animated, FlatListProps, ImageSourcePropType, NativeSyntheticEvent, NativeScrollEvent, LayoutChangeEvent } from 'react-native';
|
|
2
|
+
import { Animated, FlatListProps, ScrollViewProps, ImageSourcePropType, NativeSyntheticEvent, NativeScrollEvent, LayoutChangeEvent } from 'react-native';
|
|
3
3
|
import { ForwardRefInjectedProps } from '../../commons/new';
|
|
4
4
|
import { ComponentStatics } from '../../typings/common';
|
|
5
|
-
export
|
|
5
|
+
export type ListProps = (FlatListProps<any> & {
|
|
6
6
|
/**
|
|
7
7
|
* Whether to use a FlatList. NOTE: you must pass 'data' and 'renderItem' props as well
|
|
8
8
|
*/
|
|
9
|
-
useList
|
|
9
|
+
useList: true;
|
|
10
|
+
}) | (ScrollViewProps & {
|
|
11
|
+
/**
|
|
12
|
+
* Whether to use a ScrollView. NOTE: you must pass 'contentContainerStyle' prop as well
|
|
13
|
+
*/
|
|
14
|
+
useList?: false;
|
|
15
|
+
});
|
|
16
|
+
export type ScrollBarProps = ListProps & {
|
|
10
17
|
/**
|
|
11
18
|
* The element to use as a container, instead of a View
|
|
12
19
|
*/
|
|
@@ -44,7 +51,7 @@ export interface ScrollBarProps extends FlatListProps<any> {
|
|
|
44
51
|
* The index to currently focus on
|
|
45
52
|
*/
|
|
46
53
|
focusIndex?: number;
|
|
47
|
-
}
|
|
54
|
+
};
|
|
48
55
|
type Props = ScrollBarProps & ForwardRefInjectedProps;
|
|
49
56
|
type State = {
|
|
50
57
|
gradientOpacity: Animated.Value;
|
|
@@ -32,7 +32,7 @@ const SearchInput = forwardRef((props, ref) => {
|
|
|
32
32
|
style,
|
|
33
33
|
inaccessible
|
|
34
34
|
} = props;
|
|
35
|
-
const currentAnimatedValue = useRef();
|
|
35
|
+
const currentAnimatedValue = useRef(undefined);
|
|
36
36
|
const searchInputRef = useRef(null);
|
|
37
37
|
const [hasValue, setHasValue] = useState(Boolean(controlledValue));
|
|
38
38
|
const [value, setValue] = useState(controlledValue);
|
|
@@ -26,7 +26,7 @@ export type SearchInputProps = TextInputProps & {
|
|
|
26
26
|
/**
|
|
27
27
|
* Custom right element
|
|
28
28
|
*/
|
|
29
|
-
customRightElement?: React.ReactElement
|
|
29
|
+
customRightElement?: React.ReactElement<any>;
|
|
30
30
|
/**
|
|
31
31
|
* Whether to show a loader instead of the left search icon
|
|
32
32
|
*/
|
|
@@ -38,7 +38,7 @@ export type SearchInputProps = TextInputProps & {
|
|
|
38
38
|
/**
|
|
39
39
|
* custom loader element
|
|
40
40
|
*/
|
|
41
|
-
customLoader?: React.ReactElement
|
|
41
|
+
customLoader?: React.ReactElement<any>;
|
|
42
42
|
/**
|
|
43
43
|
* converts the colors of the search's input elements, icons and button to white
|
|
44
44
|
*/
|
|
@@ -7,11 +7,11 @@ export declare const SectionsWheelPickerDriver: (props: ComponentProps) => {
|
|
|
7
7
|
moveToItem: (index: number, itemHeight?: number, numberOfRows?: number) => void;
|
|
8
8
|
getLabel: () => string | (string | ReactTestInstance)[];
|
|
9
9
|
scroll: (contentOffset: Partial<import("react-native/types").NativeScrollPoint>, options?: {
|
|
10
|
-
contentInset: import("react-native/types").NativeScrollRectangle;
|
|
11
|
-
zoomScale: number;
|
|
12
10
|
layoutMeasurement: import("react-native/types").NativeScrollSize;
|
|
13
11
|
contentSize: import("react-native/types").NativeScrollSize;
|
|
14
12
|
velocity?: import("react-native/types").NativeScrollVelocity | undefined;
|
|
13
|
+
contentInset: import("react-native/types").NativeScrollRectangle;
|
|
14
|
+
zoomScale: number;
|
|
15
15
|
targetContentOffset?: import("react-native/types").NativeScrollPoint | undefined;
|
|
16
16
|
} | undefined) => void;
|
|
17
17
|
triggerEvent: (eventName?: string | undefined, event?: Partial<import("react-native/types").NativeScrollEvent> | undefined) => void;
|
|
@@ -35,7 +35,7 @@ export interface SkeletonListProps {
|
|
|
35
35
|
/**
|
|
36
36
|
* Extra content to be rendered on the end of the list item
|
|
37
37
|
*/
|
|
38
|
-
renderEndContent?: () => React.ReactElement | undefined;
|
|
38
|
+
renderEndContent?: () => React.ReactElement<any> | undefined;
|
|
39
39
|
}
|
|
40
40
|
export interface SkeletonViewProps extends AccessibilityProps, AlignmentModifiers, PaddingModifiers, MarginModifiers {
|
|
41
41
|
/**
|
|
@@ -155,9 +155,9 @@ declare class SkeletonView extends Component<SkeletonViewProps, SkeletonState> {
|
|
|
155
155
|
renderTextContentTemplate: () => React.JSX.Element;
|
|
156
156
|
renderTemplate: () => React.JSX.Element;
|
|
157
157
|
renderAdvanced: () => React.JSX.Element;
|
|
158
|
-
renderWithFading: (skeleton: any) => string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
159
|
-
renderSkeleton(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
158
|
+
renderWithFading: (skeleton: any) => string | number | bigint | boolean | 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 | undefined;
|
|
159
|
+
renderSkeleton(): string | number | bigint | boolean | 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 | undefined;
|
|
160
160
|
renderNothing: () => null;
|
|
161
|
-
render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
161
|
+
render(): string | number | bigint | boolean | 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 | undefined;
|
|
162
162
|
}
|
|
163
163
|
export default SkeletonView;
|
|
@@ -26,7 +26,7 @@ export interface ThumbProps extends ViewProps {
|
|
|
26
26
|
*/
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
/** ref to thumb component */
|
|
29
|
-
ref?: React.RefObject<RNView>;
|
|
29
|
+
ref?: React.RefObject<RNView | null>;
|
|
30
30
|
}
|
|
31
31
|
declare const Thumb: React.ForwardRefExoticComponent<Omit<ThumbProps, "ref"> & React.RefAttributes<unknown>>;
|
|
32
32
|
export default Thumb;
|
|
@@ -44,7 +44,7 @@ export type SliderProps = Omit<ThumbProps, 'ref'> & {
|
|
|
44
44
|
/**
|
|
45
45
|
* Custom render instead of rendering the track
|
|
46
46
|
*/
|
|
47
|
-
renderTrack?: () => ReactElement | ReactElement[];
|
|
47
|
+
renderTrack?: () => ReactElement<any> | ReactElement<any>[];
|
|
48
48
|
/**
|
|
49
49
|
* Callback for onValueChange
|
|
50
50
|
*/
|
|
@@ -47,11 +47,11 @@ export interface TabControllerItemProps extends Pick<TabControllerBarProps, 'spr
|
|
|
47
47
|
/**
|
|
48
48
|
* Pass to render a leading element
|
|
49
49
|
*/
|
|
50
|
-
leadingAccessory?: ReactElement
|
|
50
|
+
leadingAccessory?: ReactElement<any>;
|
|
51
51
|
/**
|
|
52
52
|
* Pass to render a trailing element
|
|
53
53
|
*/
|
|
54
|
-
trailingAccessory?: ReactElement
|
|
54
|
+
trailingAccessory?: ReactElement<any>;
|
|
55
55
|
/**
|
|
56
56
|
* A fixed width for the item
|
|
57
57
|
*/
|
|
@@ -46,7 +46,7 @@ export default function TabBarItem({
|
|
|
46
46
|
currentPage,
|
|
47
47
|
setCurrentIndex
|
|
48
48
|
} = useContext(TabBarContext);
|
|
49
|
-
const itemRef = useRef();
|
|
49
|
+
const itemRef = useRef(undefined);
|
|
50
50
|
const itemWidth = useRef(props.width);
|
|
51
51
|
const isPressed = useSharedValue(false);
|
|
52
52
|
// JSON.parse(JSON.stringify is due to an issue with reanimated
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren, type JSX } from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
export interface TabControllerPageProps {
|
|
4
4
|
/**
|
|
@@ -30,4 +30,4 @@ export interface TabControllerPageProps {
|
|
|
30
30
|
* @description: TabController's TabPage
|
|
31
31
|
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TabControllerScreen/index.tsx
|
|
32
32
|
*/
|
|
33
|
-
export default function TabPage({ testID, index, lazy, renderLoading, style, lazyLoadTime, ...props }: PropsWithChildren<TabControllerPageProps>):
|
|
33
|
+
export default function TabPage({ testID, index, lazy, renderLoading, style, lazyLoadTime, ...props }: PropsWithChildren<TabControllerPageProps>): JSX.Element;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { TextProps } from './index';
|
|
3
3
|
import { ComponentDriver } from '../../testkit/Component.driver';
|
|
4
4
|
export declare class TextDriver extends ComponentDriver<TextProps> {
|
|
5
|
-
getTextContent: () => Promise<import("react").ReactNode>;
|
|
5
|
+
getTextContent: () => Promise<string | number | bigint | boolean | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
|
|
6
6
|
isPressable: () => Promise<boolean | null>;
|
|
7
7
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {View, TextInput as RNTextInput, StyleSheet} from 'react-native';
|
|
3
|
-
import {TextInputPropTypes} from 'deprecated-react-native-prop-types';
|
|
4
3
|
import BaseInput from '../baseInput';
|
|
5
4
|
import {Colors} from '../../style';
|
|
6
5
|
|
|
@@ -15,11 +14,6 @@ import {Colors} from '../../style';
|
|
|
15
14
|
export default class TextArea extends BaseInput {
|
|
16
15
|
static displayName = 'TextArea';
|
|
17
16
|
|
|
18
|
-
static propTypes = {
|
|
19
|
-
...TextInputPropTypes,
|
|
20
|
-
...BaseInput.propTypes
|
|
21
|
-
};
|
|
22
|
-
|
|
23
17
|
generateStyles() {
|
|
24
18
|
this.styles = createStyles(this.props);
|
|
25
19
|
}
|
|
@@ -171,19 +171,19 @@ export type TextFieldProps = MarginModifiers & PaddingModifiers & TypographyModi
|
|
|
171
171
|
/**
|
|
172
172
|
* Pass to render a leading element
|
|
173
173
|
*/
|
|
174
|
-
leadingAccessory?: ReactElement
|
|
174
|
+
leadingAccessory?: ReactElement<any>;
|
|
175
175
|
/**
|
|
176
176
|
* Pass to render a trailing element
|
|
177
177
|
*/
|
|
178
|
-
trailingAccessory?: ReactElement
|
|
178
|
+
trailingAccessory?: ReactElement<any>;
|
|
179
179
|
/**
|
|
180
180
|
* Pass to render a top trailing element
|
|
181
181
|
*/
|
|
182
|
-
topTrailingAccessory?: ReactElement
|
|
182
|
+
topTrailingAccessory?: ReactElement<any>;
|
|
183
183
|
/**
|
|
184
184
|
* Pass to render a bottom element below the input
|
|
185
185
|
*/
|
|
186
|
-
bottomAccessory?: ReactElement
|
|
186
|
+
bottomAccessory?: ReactElement<any>;
|
|
187
187
|
/**
|
|
188
188
|
* Should show a clear button when there is a value
|
|
189
189
|
*/
|