react-native-ui-lib 7.36.0-snapshot.6096 → 7.36.0-snapshot.6098

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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/components/hint/index.d.ts +186 -17
  3. package/src/components/hint/index.js +403 -150
  4. package/src/components/tabController/TabBar.js +2 -1
  5. package/src/components/tabController/TabBarContext.d.ts +1 -0
  6. package/src/components/tabController/TabBarItem.js +5 -2
  7. package/src/components/tabController/index.js +4 -1
  8. package/src/components/view/View.driver.new.js +1 -2
  9. package/src/components/hint/Hint.driver.new.d.ts +0 -19
  10. package/src/components/hint/Hint.driver.new.js +0 -19
  11. package/src/components/hint/HintAnchor.d.ts +0 -13
  12. package/src/components/hint/HintAnchor.js +0 -47
  13. package/src/components/hint/HintBubble.d.ts +0 -12
  14. package/src/components/hint/HintBubble.js +0 -64
  15. package/src/components/hint/HintMockChildren.d.ts +0 -8
  16. package/src/components/hint/HintMockChildren.js +0 -49
  17. package/src/components/hint/HintOld.d.ts +0 -196
  18. package/src/components/hint/HintOld.js +0 -549
  19. package/src/components/hint/hooks/useHintAccessibility.d.ts +0 -10
  20. package/src/components/hint/hooks/useHintAccessibility.js +0 -26
  21. package/src/components/hint/hooks/useHintLayout.d.ts +0 -13
  22. package/src/components/hint/hooks/useHintLayout.js +0 -66
  23. package/src/components/hint/hooks/useHintPosition.d.ts +0 -29
  24. package/src/components/hint/hooks/useHintPosition.js +0 -119
  25. package/src/components/hint/hooks/useHintVisibility.d.ts +0 -6
  26. package/src/components/hint/hooks/useHintVisibility.js +0 -26
  27. package/src/components/hint/types.d.ts +0 -106
  28. package/src/components/hint/types.js +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.36.0-snapshot.6096",
3
+ "version": "7.36.0-snapshot.6098",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -1,22 +1,191 @@
1
- import React from 'react';
2
- import { HintPositions, HintProps } from './types';
3
- declare const Hint: {
4
- (props: HintProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
- displayName: string;
6
- defaultProps: {
1
+ import React, { Component, ReactElement, ElementRef } from 'react';
2
+ import { Animated, GestureResponderEvent, ImageSourcePropType, ImageStyle, StyleProp, TextStyle, ViewStyle, LayoutChangeEvent, View as RNView } from 'react-native';
3
+ declare enum TARGET_POSITIONS {
4
+ LEFT = "left",
5
+ RIGHT = "right",
6
+ CENTER = "center"
7
+ }
8
+ declare enum HintPositions {
9
+ TOP = "top",
10
+ BOTTOM = "bottom"
11
+ }
12
+ interface HintTargetFrame {
13
+ x?: number;
14
+ y?: number;
15
+ width?: number;
16
+ height?: number;
17
+ }
18
+ type Position = Pick<ViewStyle, 'top' | 'bottom' | 'left' | 'right'>;
19
+ type HintPositionStyle = Position & Pick<ViewStyle, 'alignItems'>;
20
+ type Paddings = Pick<ViewStyle, 'paddingLeft' | 'paddingRight' | 'paddingVertical' | 'paddingHorizontal'>;
21
+ type ContentType = string | ReactElement;
22
+ export interface HintProps {
23
+ /**
24
+ * Control the visibility of the hint
25
+ */
26
+ visible?: boolean;
27
+ /**
28
+ * The hint background color
29
+ */
30
+ color?: string;
31
+ /**
32
+ * The hint message
33
+ */
34
+ message?: ContentType | ContentType[];
35
+ /**
36
+ * The hint message custom style
37
+ */
38
+ messageStyle?: StyleProp<TextStyle>;
39
+ /**
40
+ * Icon to show next to the hint's message
41
+ */
42
+ icon?: ImageSourcePropType;
43
+ /**
44
+ * The icon's style
45
+ */
46
+ iconStyle?: StyleProp<ImageStyle>;
47
+ /**
48
+ * The hint's position
49
+ */
50
+ position?: HintPositions;
51
+ /**
52
+ * Provide custom target position instead of wrapping a child
53
+ */
54
+ targetFrame?: HintTargetFrame;
55
+ /**
56
+ * Open the hint using a Modal component
57
+ */
58
+ useModal?: boolean;
59
+ /**
60
+ * Show side tips instead of the middle tip
61
+ */
62
+ useSideTip?: boolean;
63
+ /**
64
+ * The hint's border radius
65
+ */
66
+ borderRadius?: number;
67
+ /**
68
+ * Hint margins from screen edges
69
+ */
70
+ edgeMargins?: number;
71
+ /**
72
+ * Hint offset from target
73
+ */
74
+ offset?: number;
75
+ /**
76
+ * Callback for Hint press
77
+ */
78
+ onPress?: () => void;
79
+ /**
80
+ * Callback for the background press
81
+ */
82
+ onBackgroundPress?: (event: GestureResponderEvent) => void;
83
+ /**
84
+ * Color for background overlay (require onBackgroundPress)
85
+ */
86
+ backdropColor?: string;
87
+ /**
88
+ * The hint container width
89
+ */
90
+ containerWidth?: number;
91
+ /**
92
+ * Custom content element to render inside the hint container
93
+ */
94
+ customContent?: JSX.Element;
95
+ /**
96
+ * Remove all hint's paddings
97
+ */
98
+ removePaddings?: boolean;
99
+ /**
100
+ * Enable shadow (for hint with white background only)
101
+ */
102
+ enableShadow?: boolean;
103
+ /**
104
+ * The hint's test identifier
105
+ */
106
+ testID?: string;
107
+ /**
108
+ * Additional styling
109
+ */
110
+ style?: StyleProp<ViewStyle>;
111
+ children?: React.ReactNode;
112
+ }
113
+ interface HintState {
114
+ targetLayout?: HintTargetFrame;
115
+ targetLayoutInWindow?: HintTargetFrame;
116
+ hintUnmounted: boolean;
117
+ }
118
+ /**
119
+ * @description: Hint component for displaying a tooltip over wrapped component
120
+ * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/HintsScreen.tsx
121
+ * @notes: You can either wrap a component or pass a specific targetFrame
122
+ * @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Hint/Hint.gif?raw=true
123
+ */
124
+ declare class Hint extends Component<HintProps, HintState> {
125
+ static displayName: string;
126
+ static defaultProps: {
7
127
  position: HintPositions;
8
128
  useModal: boolean;
9
129
  };
10
- positions: typeof HintPositions;
11
- };
12
- export { HintProps, Hint };
13
- declare const _default: React.ForwardRefExoticComponent<HintProps & React.RefAttributes<any>> & {
14
- (props: HintProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
15
- displayName: string;
16
- defaultProps: {
17
- position: HintPositions;
18
- useModal: boolean;
130
+ static positions: typeof HintPositions;
131
+ targetRef: ElementRef<typeof RNView> | null;
132
+ hintRef: React.RefObject<RNView>;
133
+ animationDuration: number;
134
+ state: {
135
+ targetLayoutInWindow: {
136
+ x: number;
137
+ y: number;
138
+ width: number;
139
+ height: number;
140
+ } | undefined;
141
+ targetLayout: HintTargetFrame | undefined;
142
+ hintUnmounted: boolean;
143
+ };
144
+ visibleAnimated: Animated.Value;
145
+ componentDidMount(): void;
146
+ componentDidUpdate(prevProps: HintProps): void;
147
+ animateHint: () => void;
148
+ toggleAnimationEndedToRemoveHint: () => void;
149
+ focusAccessibilityOnHint: () => void;
150
+ setTargetRef: (ref: ElementRef<typeof RNView>) => void;
151
+ onTargetLayout: ({ nativeEvent: { layout } }: LayoutChangeEvent) => void;
152
+ getAccessibilityInfo(): {
153
+ accessible: boolean;
154
+ accessibilityLabel: string;
155
+ } | undefined;
156
+ get containerWidth(): number;
157
+ get targetLayout(): HintTargetFrame | undefined;
158
+ get showHint(): boolean;
159
+ get tipSize(): {
160
+ width: number;
161
+ height: number;
162
+ };
163
+ get hintOffset(): number;
164
+ get edgeMargins(): number;
165
+ get useSideTip(): boolean;
166
+ getTargetPositionOnScreen(): TARGET_POSITIONS;
167
+ getContainerPosition(): {
168
+ top: number | undefined;
169
+ left: number | undefined;
170
+ } | undefined;
171
+ getHintPosition(): HintPositionStyle;
172
+ getHintPadding(): Paddings;
173
+ getHintAnimatedStyle: () => {
174
+ opacity: Animated.Value;
175
+ transform: {
176
+ translateY: Animated.AnimatedInterpolation<string | number>;
177
+ }[];
19
178
  };
20
- positions: typeof HintPositions;
21
- };
179
+ getTipPosition(): Position;
180
+ isUsingModal: () => boolean | undefined;
181
+ renderOverlay(): React.JSX.Element | undefined;
182
+ renderHintTip(): React.JSX.Element;
183
+ renderContent(): React.JSX.Element;
184
+ renderHint(): React.JSX.Element | undefined;
185
+ renderHintContainer(): React.JSX.Element;
186
+ renderMockChildren(): React.JSX.Element | undefined;
187
+ renderChildren(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
188
+ render(): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
189
+ }
190
+ declare const _default: React.ForwardRefExoticComponent<HintProps & React.RefAttributes<any>> & typeof Hint;
22
191
  export default _default;