react-native-ui-lib 8.3.3 → 8.3.4-snapshot.7783

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 (147) hide show
  1. package/lib/android/build.gradle +3 -3
  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 +5 -1
  6. package/lib/components/Keyboard/KeyboardAccessoryView/index.d.ts +2 -2
  7. package/lib/components/Keyboard/KeyboardAccessoryView/index.js +3 -1
  8. package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.js +3 -1
  9. package/lib/components/Keyboard/KeyboardTrackingView/index.d.ts +6 -2
  10. package/lib/components/Keyboard/KeyboardTrackingView/index.js +5 -4
  11. package/lib/components/Keyboard/index.d.ts +2 -1
  12. package/lib/package.json +20 -21
  13. package/lib/react-native.config.js +1 -1
  14. package/package.json +161 -164
  15. package/screenFooter.d.ts +2 -0
  16. package/screenFooter.js +1 -0
  17. package/scripts/release/prReleaseNotesCommon.js +2 -1
  18. package/src/assets/internal/images/bottomGradient.png +0 -0
  19. package/src/assets/internal/images/bottomGradient@1.5x.png +0 -0
  20. package/src/assets/internal/images/bottomGradient@2x.png +0 -0
  21. package/src/assets/internal/images/bottomGradient@3x.png +0 -0
  22. package/src/assets/internal/images/bottomGradient@4x.png +0 -0
  23. package/src/assets/internal/images/index.js +3 -0
  24. package/src/commons/asBaseComponent.js +2 -1
  25. package/src/commons/baseComponent.js +0 -8
  26. package/src/commons/forwardRef.js +1 -4
  27. package/src/commons/modifiers.d.ts +0 -6
  28. package/src/commons/modifiers.js +0 -18
  29. package/src/commons/withScrollEnabler.js +0 -4
  30. package/src/commons/withScrollReached.js +0 -4
  31. package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +0 -7
  32. package/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +0 -6
  33. package/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +0 -6
  34. package/src/components/WheelPicker/WheelPicker.driver.d.ts +2 -2
  35. package/src/components/WheelPicker/index.d.ts +2 -2
  36. package/src/components/WheelPicker/index.js +1 -1
  37. package/src/components/WheelPicker/usePresenter.d.ts +1 -1
  38. package/src/components/actionSheet/index.d.ts +1 -1
  39. package/src/components/animatedImage/index.d.ts +1 -1
  40. package/src/components/animatedScanner/index.js +0 -37
  41. package/src/components/avatar/index.d.ts +1 -1
  42. package/src/components/badge/index.d.ts +4 -4
  43. package/src/components/baseInput/index.d.ts +0 -1
  44. package/src/components/baseInput/index.js +1 -49
  45. package/src/components/button/index.d.ts +4 -4
  46. package/src/components/button/types.d.ts +2 -2
  47. package/src/components/carousel/index.d.ts +8 -8
  48. package/src/components/carousel/types.d.ts +4 -1
  49. package/src/components/carousel/types.js +0 -2
  50. package/src/components/checkbox/index.d.ts +1 -1
  51. package/src/components/chip/index.d.ts +1 -1
  52. package/src/components/colorPalette/index.d.ts +1 -1
  53. package/src/components/dateTimePicker/index.d.ts +2 -2
  54. package/src/components/dateTimePicker/index.js +2 -2
  55. package/src/components/dialog/types.d.ts +4 -4
  56. package/src/components/dialog/useDialogContent.d.ts +1 -1
  57. package/src/components/drawer/index.d.ts +1 -1
  58. package/src/components/expandableSection/index.d.ts +2 -2
  59. package/src/components/fadedScrollView/index.js +1 -1
  60. package/src/components/featureHighlight/index.js +5 -7
  61. package/src/components/gridListItem/index.d.ts +7 -7
  62. package/src/components/gridView/index.d.ts +1 -1
  63. package/src/components/hint/HintBubble.d.ts +1 -1
  64. package/src/components/hint/HintOld.d.ts +10 -10
  65. package/src/components/hint/hooks/useHintLayout.d.ts +1 -1
  66. package/src/components/hint/index.d.ts +2 -2
  67. package/src/components/hint/types.d.ts +2 -2
  68. package/src/components/icon/index.js +0 -3
  69. package/src/components/image/index.d.ts +1 -1
  70. package/src/components/image/index.js +20 -17
  71. package/src/components/loaderScreen/index.d.ts +1 -1
  72. package/src/components/loaderScreen/types.d.ts +1 -1
  73. package/src/components/maskedInput/index.d.ts +21 -4
  74. package/src/components/maskedInput/index.js +78 -16
  75. package/src/components/maskedInput/maskedInput.api.json +0 -1
  76. package/src/components/modal/index.d.ts +3 -3
  77. package/src/components/numberInput/index.js +2 -2
  78. package/src/components/overlay/index.d.ts +1 -1
  79. package/src/components/picker/PickerDialog.android.js +0 -15
  80. package/src/components/picker/PickerDialog.js +0 -7
  81. package/src/components/picker/helpers/useImperativePickerHandle.d.ts +1 -1
  82. package/src/components/picker/helpers/useImperativePickerHandle.js +1 -1
  83. package/src/components/picker/types.d.ts +9 -9
  84. package/src/components/progressBar/index.d.ts +2 -2
  85. package/src/components/screenFooter/index.d.ts +8 -0
  86. package/src/components/screenFooter/index.js +211 -0
  87. package/src/components/screenFooter/screenFooter.api.json +262 -0
  88. package/src/components/screenFooter/types.d.ts +100 -0
  89. package/src/components/screenFooter/types.js +39 -0
  90. package/src/components/scrollBar/index.d.ts +11 -4
  91. package/src/components/searchInput/index.js +1 -1
  92. package/src/components/searchInput/types.d.ts +2 -2
  93. package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +2 -2
  94. package/src/components/skeletonView/index.d.ts +4 -4
  95. package/src/components/slider/Thumb.d.ts +1 -1
  96. package/src/components/slider/types.d.ts +1 -1
  97. package/src/components/stackAggregator/index.d.ts +1 -1
  98. package/src/components/tabController/TabBarItem.d.ts +2 -2
  99. package/src/components/tabController/TabBarItem.js +1 -1
  100. package/src/components/tabController/TabPage.d.ts +2 -2
  101. package/src/components/tabController/useScrollToItem.d.ts +1 -1
  102. package/src/components/text/Text.driver.d.ts +1 -1
  103. package/src/components/textArea/index.js +0 -6
  104. package/src/components/textField/types.d.ts +4 -4
  105. package/src/components/textField/useImperativeInputHandle.d.ts +1 -1
  106. package/src/components/textField/useImperativeInputHandle.js +1 -1
  107. package/src/components/textField/usePreset.d.ts +36 -36
  108. package/src/components/timeline/index.js +1 -1
  109. package/src/components/toast/index.js +0 -69
  110. package/src/components/view/index.js +9 -6
  111. package/src/components/wizard/index.d.ts +1 -1
  112. package/src/components/wizard/types.d.ts +1 -1
  113. package/src/components/wizard/wizard.api.json +1 -1
  114. package/src/hooks/index.d.ts +1 -0
  115. package/src/hooks/index.js +1 -0
  116. package/src/hooks/useCombinedRefs/index.js +1 -2
  117. package/src/hooks/useDebounce/index.js +1 -1
  118. package/src/hooks/useHiddenLocation/index.js +2 -2
  119. package/src/hooks/useHiddenLocation/index.web.js +2 -2
  120. package/src/hooks/useMeasure/index.d.ts +1 -1
  121. package/src/hooks/useMeasure/index.js +1 -1
  122. package/src/hooks/useScrollTo/index.d.ts +2 -2
  123. package/src/hooks/useScrollToHide/index.d.ts +24 -0
  124. package/src/hooks/useScrollToHide/index.js +48 -0
  125. package/src/incubator/calendar/index.js +1 -1
  126. package/src/incubator/calendar/types.d.ts +2 -2
  127. package/src/incubator/expandableOverlay/index.d.ts +2 -2
  128. package/src/incubator/expandableOverlay/index.js +7 -3
  129. package/src/incubator/slider/Track.d.ts +1 -1
  130. package/src/incubator/slider/index.d.ts +1 -1
  131. package/src/incubator/toast/helpers/useToastTimer.js +1 -1
  132. package/src/incubator/toast/index.js +1 -1
  133. package/src/incubator/toast/types.d.ts +2 -2
  134. package/src/index.d.ts +1 -0
  135. package/src/index.js +70 -0
  136. package/src/testkit/Component.driver.d.ts +1 -1
  137. package/src/testkit/drivers/TestingLibraryDriver.d.ts +1 -1
  138. package/src/typings/module.d.ts +12 -3
  139. package/ReactNativeUiLib.podspec +0 -22
  140. package/src/components/maskedInput/new.d.ts +0 -22
  141. package/src/components/maskedInput/new.js +0 -85
  142. package/src/components/maskedInput/old.js +0 -95
  143. package/src/components/textFieldOld/index.d.ts +0 -71
  144. package/src/components/textFieldOld/index.js +0 -807
  145. package/src/helpers/DocsGenerator.js +0 -61
  146. package/textFieldOld.d.ts +0 -2
  147. package/textFieldOld.js +0 -1
@@ -1,85 +0,0 @@
1
- import _isFunction from "lodash/isFunction";
2
- import _identity from "lodash/identity";
3
- import React, { useCallback, useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
4
- import { StyleSheet, Keyboard, TextInput } from 'react-native';
5
- import View from "../view";
6
- import Text from "../text";
7
- import TouchableOpacity from "../touchableOpacity";
8
- /**
9
- * @description: Mask Input to create custom looking inputs with custom formats
10
- * @gif: https://camo.githubusercontent.com/61eedb65e968845d5eac713dcd21a69691571fb1/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f4b5a5a7446666f486f454b334b2f67697068792e676966
11
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/MaskedInputScreen.tsx
12
- */
13
- function MaskedInput(props, ref) {
14
- const {
15
- initialValue,
16
- formatter = _identity,
17
- containerStyle,
18
- renderMaskedText,
19
- onChangeText,
20
- ...others
21
- } = props;
22
- const [value, setValue] = useState(initialValue);
23
- const inputRef = useRef();
24
- const keyboardDidHideListener = useRef();
25
- useImperativeHandle(ref, () => {
26
- return {
27
- isFocused: () => inputRef.current?.isFocused(),
28
- focus,
29
- blur: () => inputRef.current?.blur(),
30
- clear: () => {
31
- inputRef.current?.clear();
32
- setValue('');
33
- // NOTE: This fixes an RN issue - when triggering imperative clear method, it doesn't call onChangeText
34
- onChangeText?.('');
35
- }
36
- };
37
- });
38
- useEffect(() => {
39
- if (initialValue !== value) {
40
- setValue(initialValue);
41
- }
42
- }, [initialValue]);
43
- useEffect(() => {
44
- keyboardDidHideListener.current = Keyboard.addListener('keyboardDidHide', () => {
45
- if (inputRef.current?.isFocused()) {
46
- inputRef.current?.blur();
47
- }
48
- });
49
- return () => keyboardDidHideListener.current.remove();
50
- }, []);
51
- const _onChangeText = useCallback(value => {
52
- const formattedValue = formatter(value) ?? '';
53
- setValue(formattedValue);
54
- onChangeText?.(formattedValue);
55
- }, [onChangeText, formatter]);
56
- const focus = useCallback(() => {
57
- inputRef.current?.focus();
58
- }, []);
59
- const _renderMaskedText = () => {
60
- if (_isFunction(renderMaskedText)) {
61
- return renderMaskedText(value);
62
- }
63
- return <Text>{value}</Text>;
64
- };
65
- return <TouchableOpacity style={containerStyle} activeOpacity={1} onPress={focus}>
66
- <TextInput {...others} value={value}
67
- // @ts-expect-error
68
- ref={inputRef} style={styles.hiddenInput} enableErrors={false} hideUnderline placeholder="" caretHidden multiline={false} onChangeText={_onChangeText} />
69
- <View style={styles.maskedInputWrapper}>{_renderMaskedText()}</View>
70
- </TouchableOpacity>;
71
- }
72
- const styles = StyleSheet.create({
73
- hiddenInput: {
74
- ...StyleSheet.absoluteFillObject,
75
- zIndex: 1,
76
- color: 'transparent',
77
- backgroundColor: 'transparent',
78
- height: undefined
79
- },
80
- maskedInputWrapper: {
81
- zIndex: 0
82
- }
83
- });
84
- MaskedInput.displayName = 'MaskedInput';
85
- export default forwardRef(MaskedInput);
@@ -1,95 +0,0 @@
1
- import _ from 'lodash';
2
- import PropTypes from 'prop-types';
3
- import React from 'react';
4
- import {StyleSheet, Keyboard} from 'react-native';
5
- import {ViewPropTypes} from 'deprecated-react-native-prop-types';
6
- import BaseInput from '../baseInput';
7
- import TextField from '../textFieldOld';
8
- import View from '../view';
9
- import Text from '../text';
10
- import TouchableOpacity from '../touchableOpacity';
11
-
12
- /**
13
- * @description: Mask Input to create custom looking inputs with custom formats
14
- * @gif: https://camo.githubusercontent.com/61eedb65e968845d5eac713dcd21a69691571fb1/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f4b5a5a7446666f486f454b334b2f67697068792e676966
15
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/MaskedInputScreen.tsx
16
- */
17
- export default class MaskedInput extends BaseInput {
18
- static displayName = 'MaskedInput';
19
- static propTypes = {
20
- ...TextField.propTypes,
21
- /**
22
- * callback for rendering the custom input out of the value returns from the actual input
23
- */
24
- renderMaskedText: PropTypes.elementType.isRequired,
25
- /**
26
- * container style for the masked input container
27
- */
28
- containerStyle: ViewPropTypes.style
29
- };
30
-
31
- componentDidMount() {
32
- this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
33
- if (_.invoke(this, 'isFocused')) {
34
- _.invoke(this, 'blur');
35
- }
36
- });
37
- }
38
-
39
- componentWillUnmount() {
40
- this.keyboardDidHideListener.remove();
41
- }
42
-
43
- clear() {
44
- this.setState({value: ''});
45
- this.input.clear();
46
- }
47
-
48
- renderMaskedText() {
49
- const {renderMaskedText} = this.props;
50
- const {value} = this.state;
51
-
52
- if (_.isFunction(renderMaskedText)) {
53
- return renderMaskedText(value);
54
- }
55
- return <Text>{value}</Text>;
56
- }
57
-
58
- render() {
59
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
60
- const {containerStyle, style} = this.props;
61
-
62
- return (
63
- <TouchableOpacity style={containerStyle} activeOpacity={1} onPress={() => this.input.focus()}>
64
- <TextField
65
- ref={r => (this.input = r)}
66
- containerStyle={styles.hiddenInputContainer}
67
- style={styles.hiddenInput}
68
- enableErrors={false}
69
- hideUnderline
70
- placeholder=""
71
- {...this.props}
72
- caretHidden
73
- multiline={false}
74
- onChangeText={this.onChangeText}
75
- />
76
- <View style={styles.maskedInputWrapper}>{this.renderMaskedText()}</View>
77
- </TouchableOpacity>
78
- );
79
- }
80
- }
81
-
82
- const styles = StyleSheet.create({
83
- hiddenInputContainer: {
84
- ...StyleSheet.absoluteFillObject,
85
- zIndex: 1
86
- },
87
- hiddenInput: {
88
- color: 'transparent',
89
- backgroundColor: 'transparent',
90
- height: undefined
91
- },
92
- maskedInputWrapper: {
93
- zIndex: 0
94
- }
95
- });
@@ -1,71 +0,0 @@
1
- import React from 'react';
2
- import BaseInput from '../baseInput';
3
- /**
4
- * @description: A wrapper for TextInput component with extra functionality like floating placeholder and validations (This is an uncontrolled component)
5
- * @modifiers: Typography
6
- * @extends: TextInput
7
- * @extendsLink: https://reactnative.dev/docs/textinput
8
- * @gif: https://media.giphy.com/media/xULW8su8Cs5Z9Fq4PS/giphy.gif, https://media.giphy.com/media/3ohc1dhDcLS9FvWLJu/giphy.gif, https://media.giphy.com/media/oNUSOxnHdMP5ZnKYsh/giphy.gif
9
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/TextFieldScreen/BasicTextFieldScreen.js
10
- */
11
- export default class TextField extends BaseInput {
12
- static displayName: string;
13
- static propTypes: any;
14
- static defaultProps: {
15
- enableErrors: boolean;
16
- validateOnBlur: boolean;
17
- };
18
- constructor(props: any);
19
- UNSAFE_componentWillReceiveProps(nextProps: any): void;
20
- componentDidUpdate(_prevProps: any, prevState: any): void;
21
- onPlaceholderLayout: (event: any) => void;
22
- /** Actions */
23
- generatePropsWarnings(props: any): void;
24
- generateStyles(): void;
25
- getAccessibilityInfo(): {
26
- accessibilityLabel: any;
27
- accessibilityState: {
28
- disabled: boolean;
29
- } | undefined;
30
- };
31
- toggleExpandableModal: (value: any) => void;
32
- updateFloatingPlaceholderState: (withoutAnimation: any) => void;
33
- getPlaceholderText: (this: any, placeholder: any, helperText: any) => any;
34
- getStateColor(colorProp?: {}): any;
35
- getCharCount(): any;
36
- setCharCountColor(key: any): void;
37
- getCharCountColor(): any;
38
- getTopPaddings(): 25 | undefined;
39
- getTopErrorsPosition(): {
40
- top: number;
41
- } | undefined;
42
- isDisabled(): boolean;
43
- isCounterLimit(): boolean;
44
- hasText(value: any): boolean;
45
- shouldShowHelperText(): any;
46
- shouldFloatOnFocus(): any;
47
- shouldFloatPlaceholder(text: any): any;
48
- shouldFakePlaceholder(): boolean;
49
- shouldShowError(): any;
50
- getErrorMessage(): any;
51
- shouldShowTopError(): any;
52
- shouldDisplayRightButton(): any;
53
- shouldRenderTitle(): any;
54
- onPressRightButton: () => void;
55
- /** Renders */
56
- renderPlaceholder(): React.JSX.Element | undefined;
57
- renderPrefix(): React.JSX.Element | undefined;
58
- renderTitle(): React.JSX.Element | undefined;
59
- renderCharCounter(): React.JSX.Element | undefined;
60
- renderError(visible: any): React.JSX.Element | undefined;
61
- renderExpandableModal(): any;
62
- renderExpandableInput(): any;
63
- renderTextInput(): React.JSX.Element;
64
- renderRightButton(): React.JSX.Element | undefined;
65
- renderRightIcon(): React.JSX.Element | undefined;
66
- render(): React.JSX.Element;
67
- /** Events */
68
- onDoneEditingExpandableInput: () => void;
69
- onKeyPress: (event: any) => void;
70
- onChangeText: (text: any) => void;
71
- }