@swan-io/lake 11.4.3 → 12.0.0

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 (72) hide show
  1. package/package.json +15 -16
  2. package/src/components/AutoWidthImage.d.ts +8 -105
  3. package/src/components/AutoWidthImage.js +4 -4
  4. package/src/components/AutocompleteSearchInput.d.ts +2 -2
  5. package/src/components/AutocompleteSearchInput.js +1 -1
  6. package/src/components/Avatar.d.ts +0 -7
  7. package/src/components/Avatar.js +3 -6
  8. package/src/components/Box.d.ts +3 -11
  9. package/src/components/Box.js +3 -5
  10. package/src/components/Card3dPreview.d.ts +3 -1
  11. package/src/components/Card3dPreview.js +4 -4
  12. package/src/components/Cells.d.ts +1 -66
  13. package/src/components/Cells.js +1 -50
  14. package/src/components/FlatList.d.ts +3 -5
  15. package/src/components/FlatList.js +3 -4
  16. package/src/components/FocusTrap.d.ts +6 -5
  17. package/src/components/FocusTrap.js +3 -3
  18. package/src/components/Form.d.ts +35 -9
  19. package/src/components/Form.js +4 -4
  20. package/src/components/LakeButton.d.ts +3 -2
  21. package/src/components/LakeButton.js +4 -4
  22. package/src/components/LakeCombobox.d.ts +8 -11
  23. package/src/components/LakeCombobox.js +7 -8
  24. package/src/components/LakeHeading.d.ts +7 -102
  25. package/src/components/LakeHeading.js +2 -3
  26. package/src/components/LakeSelect.d.ts +3 -6
  27. package/src/components/LakeSelect.js +3 -4
  28. package/src/components/LakeTagInput.d.ts +7 -207
  29. package/src/components/LakeTagInput.js +7 -9
  30. package/src/components/LakeText.d.ts +5 -3
  31. package/src/components/LakeText.js +2 -3
  32. package/src/components/LakeTextInput.d.ts +3 -218
  33. package/src/components/LakeTextInput.js +5 -5
  34. package/src/components/LakeTooltip.d.ts +10 -8
  35. package/src/components/LakeTooltip.js +8 -8
  36. package/src/components/Link.d.ts +3 -122
  37. package/src/components/Link.js +4 -4
  38. package/src/components/ListRightPanel.d.ts +3 -4
  39. package/src/components/ListRightPanel.js +2 -5
  40. package/src/components/LoadingView.d.ts +3 -1
  41. package/src/components/LoadingView.js +1 -2
  42. package/src/components/PlainListView.d.ts +5 -3
  43. package/src/components/Popover.d.ts +1 -1
  44. package/src/components/Pressable.d.ts +1 -0
  45. package/src/components/Pressable.js +6 -6
  46. package/src/components/RightPanel.d.ts +3 -2
  47. package/src/components/RightPanel.js +3 -3
  48. package/src/components/ScrollView.d.ts +3 -8
  49. package/src/components/ScrollView.js +4 -4
  50. package/src/components/SectionList.d.ts +3 -5
  51. package/src/components/SectionList.js +3 -4
  52. package/src/components/Stack.d.ts +7 -11
  53. package/src/components/Stack.js +5 -6
  54. package/src/components/Switch.d.ts +3 -1
  55. package/src/components/Switch.js +2 -4
  56. package/src/components/TabView.js +5 -5
  57. package/src/components/Tag.d.ts +2 -2
  58. package/src/components/Tile.js +3 -1
  59. package/src/components/WithCurrentColor.d.ts +3 -3
  60. package/src/hooks/useBreakpoint.js +1 -1
  61. package/src/hooks/useContextualLayer.d.ts +3 -3
  62. package/src/hooks/useForceableState.js +1 -1
  63. package/src/hooks/useHover.d.ts +2 -2
  64. package/src/hooks/useHover.js +1 -1
  65. package/src/hooks/useMergeRefs.d.ts +2 -2
  66. package/src/hooks/useMergeRefs.js +1 -2
  67. package/src/hooks/useNativeProp.d.ts +2 -2
  68. package/src/hooks/usePressEvents.d.ts +2 -2
  69. package/src/hooks/usePressEvents.js +1 -1
  70. package/src/utils/clipboard.js +1 -1
  71. package/src/utils/refs.d.ts +2 -2
  72. package/src/utils/windowSize.js +1 -1
@@ -1,6 +1,11 @@
1
- import { NativeSyntheticEvent, TextInput, TextInputFocusEventData, TextInputKeyPressEventData, TextInputProps } from "react-native";
1
+ import { Ref } from "react";
2
+ import { TextInput, TextInputProps } from "react-native";
2
3
  import { Merge } from "type-fest";
4
+ export type TagInputRef = TextInput & {
5
+ pushPendingValue: () => void;
6
+ };
3
7
  export type LakeTagInputProps = Merge<TextInputProps, {
8
+ ref?: Ref<TagInputRef>;
4
9
  readOnly?: boolean;
5
10
  error?: string;
6
11
  disabled?: boolean;
@@ -13,209 +18,4 @@ export type LakeTagInputProps = Merge<TextInputProps, {
13
18
  onValuesChanged: (values: string[]) => void;
14
19
  placeholder?: string;
15
20
  }>;
16
- export type TagInputRef = TextInput & {
17
- pushPendingValue: () => void;
18
- };
19
- export declare const LakeTagInput: import("react").ForwardRefExoticComponent<{
20
- allowFontScaling?: boolean | undefined | undefined;
21
- autoCapitalize?: "none" | "sentences" | "words" | "characters" | undefined | undefined;
22
- autoCorrect?: boolean | undefined | undefined;
23
- autoFocus?: boolean | undefined | undefined;
24
- blurOnSubmit?: boolean | undefined | undefined;
25
- caretHidden?: boolean | undefined | undefined;
26
- contextMenuHidden?: boolean | undefined | undefined;
27
- defaultValue?: string | undefined | undefined;
28
- editable?: boolean | undefined | undefined;
29
- keyboardType?: import("react-native").KeyboardTypeOptions | undefined;
30
- inputMode?: import("react-native").InputModeOptions | undefined;
31
- maxLength?: number | undefined | undefined;
32
- multiline?: boolean | undefined | undefined;
33
- onBlur?: ((e: NativeSyntheticEvent<TextInputFocusEventData>) => void) | undefined | undefined;
34
- onChange?: ((e: NativeSyntheticEvent<import("react-native").TextInputChangeEventData>) => void) | undefined | undefined;
35
- onChangeText?: ((text: string) => void) | undefined | undefined;
36
- onContentSizeChange?: ((e: NativeSyntheticEvent<import("react-native").TextInputContentSizeChangeEventData>) => void) | undefined | undefined;
37
- onEndEditing?: ((e: NativeSyntheticEvent<import("react-native").TextInputEndEditingEventData>) => void) | undefined | undefined;
38
- onPressIn?: ((e: NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined | undefined;
39
- onPressOut?: ((e: NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined | undefined;
40
- onFocus?: ((e: NativeSyntheticEvent<TextInputFocusEventData>) => void) | undefined | undefined;
41
- onSelectionChange?: ((e: NativeSyntheticEvent<import("react-native").TextInputSelectionChangeEventData>) => void) | undefined | undefined;
42
- onSubmitEditing?: ((e: NativeSyntheticEvent<import("react-native").TextInputSubmitEditingEventData>) => void) | undefined | undefined;
43
- onTextInput?: ((e: NativeSyntheticEvent<import("react-native").TextInputTextInputEventData>) => void) | undefined | undefined;
44
- onScroll?: ((e: NativeSyntheticEvent<import("react-native").TextInputScrollEventData>) => void) | undefined | undefined;
45
- onKeyPress?: ((e: NativeSyntheticEvent<TextInputKeyPressEventData>) => void) | undefined | undefined;
46
- placeholderTextColor?: import("react-native").ColorValue | undefined;
47
- returnKeyType?: import("react-native").ReturnKeyTypeOptions | undefined;
48
- secureTextEntry?: boolean | undefined | undefined;
49
- selectTextOnFocus?: boolean | undefined | undefined;
50
- selection?: {
51
- start: number;
52
- end?: number | undefined;
53
- } | undefined | undefined;
54
- selectionColor?: import("react-native").ColorValue | undefined;
55
- style?: import("react-native").StyleProp<import("react-native").TextStyle>;
56
- textAlign?: "left" | "center" | "right" | undefined | undefined;
57
- testID?: string | undefined | undefined;
58
- inputAccessoryViewID?: string | undefined | undefined;
59
- value?: string | undefined | undefined;
60
- maxFontSizeMultiplier?: number | null | undefined | undefined;
61
- role?: import("react-native").WebRole | undefined;
62
- lang?: string | undefined;
63
- initialValue?: string | undefined;
64
- autoComplete?: "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday" | "bday-day" | "bday-month" | "bday-year" | "cc-additional-name" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "email" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "impp" | "language" | "name" | "new-password" | "nickname" | "off" | "on" | "one-time-code" | "organization" | "organization-title" | "postal-code" | "sex" | "street-address" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "transaction-amount" | "transaction-currency" | "url" | "username" | undefined;
65
- enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
66
- rows?: number | undefined;
67
- children?: import("react").ReactNode;
68
- hitSlop?: import("react-native").Insets | undefined;
69
- id?: string | undefined | undefined;
70
- onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined | undefined;
71
- pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined | undefined;
72
- removeClippedSubviews?: boolean | undefined | undefined;
73
- nativeID?: string | undefined | undefined;
74
- onKeyDown?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
75
- onKeyDownCapture?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
76
- onKeyUp?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
77
- onKeyUpCapture?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
78
- collapsable?: boolean | undefined | undefined;
79
- needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
80
- renderToHardwareTextureAndroid?: boolean | undefined | undefined;
81
- focusable?: boolean | undefined | undefined;
82
- shouldRasterizeIOS?: boolean | undefined | undefined;
83
- isTVSelectable?: boolean | undefined | undefined;
84
- hasTVPreferredFocus?: boolean | undefined | undefined;
85
- tvParallaxProperties?: import("react-native").TVParallaxProperties | undefined;
86
- tvParallaxShiftDistanceX?: number | undefined | undefined;
87
- tvParallaxShiftDistanceY?: number | undefined | undefined;
88
- tvParallaxTiltAngle?: number | undefined | undefined;
89
- tvParallaxMagnification?: number | undefined | undefined;
90
- onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
91
- onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
92
- onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
93
- onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
94
- onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
95
- onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
96
- onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
97
- onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
98
- onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
99
- onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
100
- onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
101
- onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
102
- onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
103
- onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
104
- onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
105
- onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
106
- onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
107
- onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
108
- onPointerEnterCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
109
- onPointerLeave?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
110
- onPointerLeaveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
111
- onPointerMove?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
112
- onPointerMoveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
113
- onPointerCancel?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
114
- onPointerCancelCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
115
- onPointerDown?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
116
- onPointerDownCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
117
- onPointerUp?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
118
- onPointerUpCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
119
- accessible?: boolean | undefined | undefined;
120
- accessibilityActions?: readonly Readonly<{
121
- name: import("react-native").AccessibilityActionName | string;
122
- label?: string | undefined;
123
- }>[] | undefined;
124
- accessibilityLabel?: string | undefined | undefined;
125
- "aria-label"?: string | undefined | undefined;
126
- accessibilityRole?: import("react-native").AccessibilityRole | undefined;
127
- accessibilityState?: import("react-native").AccessibilityState | undefined;
128
- "aria-busy"?: boolean | undefined | undefined;
129
- "aria-checked"?: boolean | "mixed" | undefined | undefined;
130
- "aria-disabled"?: boolean | undefined | undefined;
131
- "aria-expanded"?: boolean | undefined | undefined;
132
- "aria-selected"?: boolean | undefined | undefined;
133
- "aria-labelledby"?: string | undefined | undefined;
134
- accessibilityHint?: string | undefined | undefined;
135
- accessibilityValue?: import("react-native").AccessibilityValue | undefined;
136
- "aria-valuemax"?: number | undefined;
137
- "aria-valuemin"?: number | undefined;
138
- "aria-valuenow"?: number | undefined;
139
- "aria-valuetext"?: string | undefined;
140
- onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined | undefined;
141
- importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined | undefined;
142
- "aria-hidden"?: boolean | undefined | undefined;
143
- "aria-live"?: ("polite" | "assertive" | "off") | undefined | undefined;
144
- "aria-modal"?: boolean | undefined | undefined;
145
- accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined | undefined;
146
- accessibilityLabelledBy?: string | string[] | undefined | undefined;
147
- accessibilityElementsHidden?: boolean | undefined | undefined;
148
- accessibilityViewIsModal?: boolean | undefined | undefined;
149
- onAccessibilityEscape?: (() => void) | undefined | undefined;
150
- onAccessibilityTap?: (() => void) | undefined | undefined;
151
- onMagicTap?: (() => void) | undefined | undefined;
152
- accessibilityIgnoresInvertColors?: boolean | undefined | undefined;
153
- accessibilityLanguage?: string | undefined | undefined;
154
- tabIndex?: 0 | -1 | undefined;
155
- "aria-activedescendant"?: string | undefined;
156
- "aria-atomic"?: boolean | undefined;
157
- "aria-autocomplete"?: string | undefined;
158
- "aria-colcount"?: number | undefined;
159
- "aria-colindex"?: number | undefined;
160
- "aria-colspan"?: number | undefined;
161
- "aria-controls"?: string | undefined;
162
- "aria-current"?: boolean | "page" | "step" | "location" | "date" | "time" | undefined;
163
- "aria-describedby"?: string | undefined;
164
- "aria-details"?: string | undefined;
165
- "aria-errormessage"?: string | undefined;
166
- "aria-flowto"?: string | undefined;
167
- "aria-haspopup"?: string | undefined;
168
- "aria-invalid"?: boolean | undefined;
169
- "aria-keyshortcuts"?: string | undefined;
170
- "aria-level"?: number | undefined;
171
- "aria-multiline"?: boolean | undefined;
172
- "aria-multiselectable"?: boolean | undefined;
173
- "aria-orientation"?: "horizontal" | "vertical" | undefined;
174
- "aria-owns"?: string | undefined;
175
- "aria-placeholder"?: string | undefined;
176
- "aria-posinset"?: number | undefined;
177
- "aria-pressed"?: boolean | undefined;
178
- "aria-readonly"?: boolean | undefined;
179
- "aria-required"?: boolean | undefined;
180
- "aria-roledescription"?: string | undefined;
181
- "aria-rowcount"?: number | undefined;
182
- "aria-rowindex"?: number | undefined;
183
- "aria-rowspan"?: number | undefined;
184
- "aria-setsize"?: number | undefined;
185
- "aria-sort"?: "ascending" | "descending" | "none" | "other" | undefined;
186
- clearButtonMode?: "never" | "while-editing" | "unless-editing" | "always" | undefined | undefined;
187
- clearTextOnFocus?: boolean | undefined | undefined;
188
- dataDetectorTypes?: import("react-native").DataDetectorTypes | import("react-native").DataDetectorTypes[] | undefined;
189
- enablesReturnKeyAutomatically?: boolean | undefined | undefined;
190
- keyboardAppearance?: "default" | "light" | "dark" | undefined | undefined;
191
- passwordRules?: string | null | undefined | undefined;
192
- rejectResponderTermination?: boolean | null | undefined | undefined;
193
- selectionState?: import("react-native").DocumentSelectionState | undefined;
194
- spellCheck?: boolean | undefined | undefined;
195
- textContentType?: "none" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "name" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "username" | "password" | "newPassword" | "oneTimeCode" | undefined | undefined;
196
- scrollEnabled?: boolean | undefined | undefined;
197
- lineBreakStrategyIOS?: "none" | "standard" | "hangul-word" | "push-out" | undefined | undefined;
198
- cursorColor?: import("react-native").ColorValue | null | undefined;
199
- importantForAutofill?: "auto" | "no" | "noExcludeDescendants" | "yes" | "yesExcludeDescendants" | undefined | undefined;
200
- disableFullscreenUI?: boolean | undefined | undefined;
201
- inlineImageLeft?: string | undefined | undefined;
202
- inlineImagePadding?: number | undefined | undefined;
203
- numberOfLines?: number | undefined | undefined;
204
- returnKeyLabel?: string | undefined | undefined;
205
- textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined | undefined;
206
- underlineColorAndroid?: import("react-native").ColorValue | undefined;
207
- textAlignVertical?: "auto" | "top" | "bottom" | "center" | undefined | undefined;
208
- showSoftInputOnFocus?: boolean | undefined | undefined;
209
- verticalAlign?: "auto" | "top" | "bottom" | "middle" | undefined | undefined;
210
- readOnly?: boolean | undefined;
211
- error?: string | undefined;
212
- disabled?: boolean | undefined;
213
- valid?: boolean | undefined;
214
- hideErrors?: boolean | undefined;
215
- validateOnBlur?: boolean | undefined;
216
- help?: string | undefined;
217
- validator?: ((value: string) => boolean) | undefined;
218
- values: string[];
219
- onValuesChanged: (values: string[]) => void;
220
- placeholder?: string | undefined;
221
- } & import("react").RefAttributes<TagInputRef>>;
21
+ export declare const LakeTagInput: ({ ref, validator, onFocus: originalOnFocus, onBlur: originalOnBlur, validateOnBlur, values, onValuesChanged, readOnly, disabled, valid, hideErrors, placeholder, help, error, }: LakeTagInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useImperativeHandle, useRef, useState } from "react";
2
+ import { useCallback, useImperativeHandle, useRef, useState } from "react";
3
3
  import { StyleSheet, TextInput, View, } from "react-native";
4
- import { P, match } from "ts-pattern";
4
+ import { match, P } from "ts-pattern";
5
5
  import { backgroundColor, colors, radii, shadows, spacings } from "../constants/design";
6
6
  import { useHover } from "../hooks/useHover";
7
7
  import { useMergeRefs } from "../hooks/useMergeRefs";
@@ -77,12 +77,12 @@ const styles = StyleSheet.create({
77
77
  },
78
78
  });
79
79
  const SEPARATORS_REGEX = /,| /;
80
- export const LakeTagInput = forwardRef(({ validator = () => true, onFocus: originalOnFocus, onBlur: originalOnBlur, validateOnBlur = true, values, onValuesChanged, readOnly = false, disabled = false, valid = false, hideErrors = false, placeholder, help, error, }, forwardedRef) => {
80
+ export const LakeTagInput = ({ ref, validator = () => true, onFocus: originalOnFocus, onBlur: originalOnBlur, validateOnBlur = true, values, onValuesChanged, readOnly = false, disabled = false, valid = false, hideErrors = false, placeholder, help, error, }) => {
81
81
  const inputRef = useRef(null);
82
82
  const containerRef = useRef(null);
83
83
  const [isFocused, setIsFocused] = useState(false);
84
84
  const [isHovered, setIsHovered] = useState(false);
85
- const mergedRef = useMergeRefs(inputRef, forwardedRef);
85
+ const mergedRef = useMergeRefs(inputRef, ref);
86
86
  useHover(containerRef, {
87
87
  onHoverStart: () => setIsHovered(true),
88
88
  onHoverEnd: () => setIsHovered(false),
@@ -124,15 +124,13 @@ export const LakeTagInput = forwardRef(({ validator = () => true, onFocus: origi
124
124
  }, [originalOnFocus]);
125
125
  const onBlur = useCallback((event) => {
126
126
  const input = inputRef.current;
127
- if (input instanceof HTMLInputElement &&
128
- isNotNullishOrEmpty(input.value) &&
129
- validateOnBlur) {
127
+ if (input instanceof HTMLInputElement && isNotNullishOrEmpty(input.value) && validateOnBlur) {
130
128
  pushNewValues([input.value]);
131
129
  }
132
130
  setIsFocused(false);
133
131
  originalOnBlur === null || originalOnBlur === void 0 ? void 0 : originalOnBlur(event);
134
132
  }, [pushNewValues, originalOnBlur, validateOnBlur]);
135
- useImperativeHandle(forwardedRef, () => ({
133
+ useImperativeHandle(ref, () => ({
136
134
  pushPendingValue: () => {
137
135
  const input = inputRef.current;
138
136
  if (input instanceof HTMLInputElement &&
@@ -155,4 +153,4 @@ export const LakeTagInput = forwardRef(({ validator = () => true, onFocus: origi
155
153
  ], "aria-errormessage": error, onPress: autoFocus, ref: containerRef, children: [values.map((value, i) => (_jsx(Tag, { onPressRemove: !readOnly && !disabled
156
154
  ? () => onValuesChanged(values.filter(current => current !== value))
157
155
  : undefined, style: styles.tag, color: validator(value) ? "gray" : "negative", children: value }, i))), _jsx(TextInput, { ref: mergedRef, style: [styles.input, disabled && styles.disabled], onFocus: onFocus, onBlur: onBlur, "aria-disabled": disabled, onChangeText: onTextInputChange, onKeyPress: onTextInputKeyPress, readOnly: readOnly, placeholder: placeholder })] }), !hideErrors && (_jsx(Box, { direction: "row", style: styles.errorContainer, children: isNotNullish(error) ? (_jsx(LakeText, { variant: "smallRegular", color: colors.negative[500], children: error })) : (_jsx(LakeText, { variant: "smallRegular", color: colors.gray[500], children: help !== null && help !== void 0 ? help : " " })) }))] }));
158
- });
156
+ };
@@ -1,4 +1,4 @@
1
- import { ComponentProps, ReactNode } from "react";
1
+ import { ComponentProps, ReactNode, Ref } from "react";
2
2
  import { Text, TextProps, TextStyle } from "react-native";
3
3
  import { LakeTooltip } from "./LakeTooltip";
4
4
  declare const alignments: {
@@ -23,12 +23,14 @@ declare const variants: {
23
23
  };
24
24
  type TextAlign = keyof typeof alignments;
25
25
  export type TextVariant = keyof typeof variants;
26
- export declare const LakeText: import("react").ForwardRefExoticComponent<TextProps & {
26
+ type Props = TextProps & {
27
+ ref?: Ref<Text>;
27
28
  align?: TextAlign;
28
29
  children: ReactNode;
29
30
  color?: string;
30
31
  userSelect?: TextStyle["userSelect"];
31
32
  variant?: TextVariant;
32
33
  tooltip?: Omit<ComponentProps<typeof LakeTooltip>, "children">;
33
- } & import("react").RefAttributes<Text>>;
34
+ };
35
+ export declare const LakeText: ({ ref, align, children, color, style, userSelect, variant, tooltip, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
34
36
  export {};
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { StyleSheet, Text } from "react-native";
4
3
  import { texts } from "../constants/design";
5
4
  import { isNotNullish } from "../utils/nullish";
@@ -27,10 +26,10 @@ const styles = StyleSheet.create({
27
26
  textOverflow: "ellipsis",
28
27
  },
29
28
  });
30
- export const LakeText = forwardRef(({ align = "left", children, color, style, userSelect, variant = "regular", tooltip, ...props }, forwardedRef) => (_jsx(Text, { ref: forwardedRef, style: [
29
+ export const LakeText = ({ ref, align = "left", children, color, style, userSelect, variant = "regular", tooltip, ...props }) => (_jsx(Text, { ref: ref, style: [
31
30
  variants[variant],
32
31
  alignments[align],
33
32
  isNotNullish(color) && { color },
34
33
  isNotNullish(userSelect) && { userSelect },
35
34
  style,
36
- ], ...props, children: tooltip ? (_jsx(LakeTooltip, { containerStyle: styles.tooltip, ...tooltip, children: _jsx(Text, { style: styles.ellipsis, children: children }) })) : (children) })));
35
+ ], ...props, children: tooltip ? (_jsx(LakeTooltip, { containerStyle: styles.tooltip, ...tooltip, children: _jsx(Text, { style: styles.ellipsis, children: children }) })) : (children) }));
@@ -1,9 +1,10 @@
1
1
  import { ChangeEventHandler, ReactNode, Ref } from "react";
2
- import { NativeSyntheticEvent, TextInput, TextInputFocusEventData, TextInputProps, View, ViewProps } from "react-native";
2
+ import { TextInput, TextInputProps, View, ViewProps } from "react-native";
3
3
  import { Except } from "type-fest";
4
4
  import { ColorVariants } from "../constants/design";
5
5
  import { IconName } from "./Icon";
6
6
  export type LakeTextInputProps = Except<TextInputProps, "editable" | "keyboardType" | "onChange"> & {
7
+ ref?: Ref<TextInput>;
7
8
  ariaExpanded?: boolean;
8
9
  ariaControls?: string;
9
10
  error?: string;
@@ -30,220 +31,4 @@ export type LakeTextInputProps = Except<TextInputProps, "editable" | "keyboardTy
30
31
  renderEnd?: () => ReactNode;
31
32
  containerRef?: Ref<View>;
32
33
  };
33
- export declare const LakeTextInput: import("react").ForwardRefExoticComponent<{
34
- allowFontScaling?: boolean | undefined | undefined;
35
- autoCapitalize?: "none" | "sentences" | "words" | "characters" | undefined | undefined;
36
- autoCorrect?: boolean | undefined | undefined;
37
- autoFocus?: boolean | undefined | undefined;
38
- blurOnSubmit?: boolean | undefined | undefined;
39
- caretHidden?: boolean | undefined | undefined;
40
- contextMenuHidden?: boolean | undefined | undefined;
41
- defaultValue?: string | undefined | undefined;
42
- inputMode?: import("react-native").InputModeOptions | undefined;
43
- maxLength?: number | undefined | undefined;
44
- multiline?: boolean | undefined | undefined;
45
- onBlur?: ((e: NativeSyntheticEvent<TextInputFocusEventData>) => void) | undefined | undefined;
46
- onChangeText?: ((text: string) => void) | undefined | undefined;
47
- onContentSizeChange?: ((e: NativeSyntheticEvent<import("react-native").TextInputContentSizeChangeEventData>) => void) | undefined | undefined;
48
- onEndEditing?: ((e: NativeSyntheticEvent<import("react-native").TextInputEndEditingEventData>) => void) | undefined | undefined;
49
- onPressIn?: ((e: NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined | undefined;
50
- onPressOut?: ((e: NativeSyntheticEvent<import("react-native").NativeTouchEvent>) => void) | undefined | undefined;
51
- onFocus?: ((e: NativeSyntheticEvent<TextInputFocusEventData>) => void) | undefined | undefined;
52
- onSelectionChange?: ((e: NativeSyntheticEvent<import("react-native").TextInputSelectionChangeEventData>) => void) | undefined | undefined;
53
- onSubmitEditing?: ((e: NativeSyntheticEvent<import("react-native").TextInputSubmitEditingEventData>) => void) | undefined | undefined;
54
- onTextInput?: ((e: NativeSyntheticEvent<import("react-native").TextInputTextInputEventData>) => void) | undefined | undefined;
55
- onScroll?: ((e: NativeSyntheticEvent<import("react-native").TextInputScrollEventData>) => void) | undefined | undefined;
56
- onKeyPress?: ((e: NativeSyntheticEvent<import("react-native").TextInputKeyPressEventData>) => void) | undefined | undefined;
57
- placeholder?: string | undefined | undefined;
58
- placeholderTextColor?: import("react-native").ColorValue | undefined;
59
- returnKeyType?: import("react-native").ReturnKeyTypeOptions | undefined;
60
- secureTextEntry?: boolean | undefined | undefined;
61
- selectTextOnFocus?: boolean | undefined | undefined;
62
- selection?: {
63
- start: number;
64
- end?: number | undefined;
65
- } | undefined | undefined;
66
- selectionColor?: import("react-native").ColorValue | undefined;
67
- style?: import("react-native").StyleProp<import("react-native").TextStyle>;
68
- textAlign?: "left" | "center" | "right" | undefined | undefined;
69
- testID?: string | undefined | undefined;
70
- inputAccessoryViewID?: string | undefined | undefined;
71
- value?: string | undefined | undefined;
72
- maxFontSizeMultiplier?: number | null | undefined | undefined;
73
- role?: import("react-native").WebRole | undefined;
74
- lang?: string | undefined;
75
- initialValue?: string | undefined;
76
- autoComplete?: "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday" | "bday-day" | "bday-month" | "bday-year" | "cc-additional-name" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "email" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "impp" | "language" | "name" | "new-password" | "nickname" | "off" | "on" | "one-time-code" | "organization" | "organization-title" | "postal-code" | "sex" | "street-address" | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "transaction-amount" | "transaction-currency" | "url" | "username" | undefined;
77
- enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
78
- rows?: number | undefined;
79
- readOnly?: boolean | undefined;
80
- children?: ReactNode;
81
- hitSlop?: import("react-native").Insets | undefined;
82
- id?: string | undefined | undefined;
83
- onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined | undefined;
84
- pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined | undefined;
85
- removeClippedSubviews?: boolean | undefined | undefined;
86
- nativeID?: string | undefined | undefined;
87
- onKeyDown?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
88
- onKeyDownCapture?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
89
- onKeyUp?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
90
- onKeyUpCapture?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
91
- collapsable?: boolean | undefined | undefined;
92
- needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
93
- renderToHardwareTextureAndroid?: boolean | undefined | undefined;
94
- focusable?: boolean | undefined | undefined;
95
- shouldRasterizeIOS?: boolean | undefined | undefined;
96
- isTVSelectable?: boolean | undefined | undefined;
97
- hasTVPreferredFocus?: boolean | undefined | undefined;
98
- tvParallaxProperties?: import("react-native").TVParallaxProperties | undefined;
99
- tvParallaxShiftDistanceX?: number | undefined | undefined;
100
- tvParallaxShiftDistanceY?: number | undefined | undefined;
101
- tvParallaxTiltAngle?: number | undefined | undefined;
102
- tvParallaxMagnification?: number | undefined | undefined;
103
- onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
104
- onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
105
- onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
106
- onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
107
- onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
108
- onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
109
- onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
110
- onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
111
- onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
112
- onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
113
- onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
114
- onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined | undefined;
115
- onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
116
- onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
117
- onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
118
- onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
119
- onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined | undefined;
120
- onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
121
- onPointerEnterCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
122
- onPointerLeave?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
123
- onPointerLeaveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
124
- onPointerMove?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
125
- onPointerMoveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
126
- onPointerCancel?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
127
- onPointerCancelCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
128
- onPointerDown?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
129
- onPointerDownCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
130
- onPointerUp?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
131
- onPointerUpCapture?: ((event: import("react-native").PointerEvent) => void) | undefined | undefined;
132
- accessible?: boolean | undefined | undefined;
133
- accessibilityActions?: readonly Readonly<{
134
- name: import("react-native").AccessibilityActionName | string;
135
- label?: string | undefined;
136
- }>[] | undefined;
137
- accessibilityLabel?: string | undefined | undefined;
138
- "aria-label"?: string | undefined | undefined;
139
- accessibilityRole?: import("react-native").AccessibilityRole | undefined;
140
- accessibilityState?: import("react-native").AccessibilityState | undefined;
141
- "aria-busy"?: boolean | undefined | undefined;
142
- "aria-checked"?: boolean | "mixed" | undefined | undefined;
143
- "aria-disabled"?: boolean | undefined | undefined;
144
- "aria-expanded"?: boolean | undefined | undefined;
145
- "aria-selected"?: boolean | undefined | undefined;
146
- "aria-labelledby"?: string | undefined | undefined;
147
- accessibilityHint?: string | undefined | undefined;
148
- accessibilityValue?: import("react-native").AccessibilityValue | undefined;
149
- "aria-valuemax"?: number | undefined;
150
- "aria-valuemin"?: number | undefined;
151
- "aria-valuenow"?: number | undefined;
152
- "aria-valuetext"?: string | undefined;
153
- onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined | undefined;
154
- importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined | undefined;
155
- "aria-hidden"?: boolean | undefined | undefined;
156
- "aria-live"?: ("polite" | "assertive" | "off") | undefined | undefined;
157
- "aria-modal"?: boolean | undefined | undefined;
158
- accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined | undefined;
159
- accessibilityLabelledBy?: string | string[] | undefined | undefined;
160
- accessibilityElementsHidden?: boolean | undefined | undefined;
161
- accessibilityViewIsModal?: boolean | undefined | undefined;
162
- onAccessibilityEscape?: (() => void) | undefined | undefined;
163
- onAccessibilityTap?: (() => void) | undefined | undefined;
164
- onMagicTap?: (() => void) | undefined | undefined;
165
- accessibilityIgnoresInvertColors?: boolean | undefined | undefined;
166
- accessibilityLanguage?: string | undefined | undefined;
167
- tabIndex?: 0 | -1 | undefined;
168
- "aria-activedescendant"?: string | undefined;
169
- "aria-atomic"?: boolean | undefined;
170
- "aria-autocomplete"?: string | undefined;
171
- "aria-colcount"?: number | undefined;
172
- "aria-colindex"?: number | undefined;
173
- "aria-colspan"?: number | undefined;
174
- "aria-controls"?: string | undefined;
175
- "aria-current"?: boolean | "page" | "step" | "location" | "date" | "time" | undefined;
176
- "aria-describedby"?: string | undefined;
177
- "aria-details"?: string | undefined;
178
- "aria-errormessage"?: string | undefined;
179
- "aria-flowto"?: string | undefined;
180
- "aria-haspopup"?: string | undefined;
181
- "aria-invalid"?: boolean | undefined;
182
- "aria-keyshortcuts"?: string | undefined;
183
- "aria-level"?: number | undefined;
184
- "aria-multiline"?: boolean | undefined;
185
- "aria-multiselectable"?: boolean | undefined;
186
- "aria-orientation"?: "horizontal" | "vertical" | undefined;
187
- "aria-owns"?: string | undefined;
188
- "aria-placeholder"?: string | undefined;
189
- "aria-posinset"?: number | undefined;
190
- "aria-pressed"?: boolean | undefined;
191
- "aria-readonly"?: boolean | undefined;
192
- "aria-required"?: boolean | undefined;
193
- "aria-roledescription"?: string | undefined;
194
- "aria-rowcount"?: number | undefined;
195
- "aria-rowindex"?: number | undefined;
196
- "aria-rowspan"?: number | undefined;
197
- "aria-setsize"?: number | undefined;
198
- "aria-sort"?: "ascending" | "descending" | "none" | "other" | undefined;
199
- clearButtonMode?: "never" | "while-editing" | "unless-editing" | "always" | undefined | undefined;
200
- clearTextOnFocus?: boolean | undefined | undefined;
201
- dataDetectorTypes?: import("react-native").DataDetectorTypes | import("react-native").DataDetectorTypes[] | undefined;
202
- enablesReturnKeyAutomatically?: boolean | undefined | undefined;
203
- keyboardAppearance?: "default" | "light" | "dark" | undefined | undefined;
204
- passwordRules?: string | null | undefined | undefined;
205
- rejectResponderTermination?: boolean | null | undefined | undefined;
206
- selectionState?: import("react-native").DocumentSelectionState | undefined;
207
- spellCheck?: boolean | undefined | undefined;
208
- textContentType?: "none" | "URL" | "addressCity" | "addressCityAndState" | "addressState" | "countryName" | "creditCardNumber" | "emailAddress" | "familyName" | "fullStreetAddress" | "givenName" | "jobTitle" | "location" | "middleName" | "name" | "namePrefix" | "nameSuffix" | "nickname" | "organizationName" | "postalCode" | "streetAddressLine1" | "streetAddressLine2" | "sublocality" | "telephoneNumber" | "username" | "password" | "newPassword" | "oneTimeCode" | undefined | undefined;
209
- scrollEnabled?: boolean | undefined | undefined;
210
- lineBreakStrategyIOS?: "none" | "standard" | "hangul-word" | "push-out" | undefined | undefined;
211
- cursorColor?: import("react-native").ColorValue | null | undefined;
212
- importantForAutofill?: "auto" | "no" | "noExcludeDescendants" | "yes" | "yesExcludeDescendants" | undefined | undefined;
213
- disableFullscreenUI?: boolean | undefined | undefined;
214
- inlineImageLeft?: string | undefined | undefined;
215
- inlineImagePadding?: number | undefined | undefined;
216
- numberOfLines?: number | undefined | undefined;
217
- returnKeyLabel?: string | undefined | undefined;
218
- textBreakStrategy?: "simple" | "highQuality" | "balanced" | undefined | undefined;
219
- underlineColorAndroid?: import("react-native").ColorValue | undefined;
220
- textAlignVertical?: "auto" | "top" | "bottom" | "center" | undefined | undefined;
221
- showSoftInputOnFocus?: boolean | undefined | undefined;
222
- verticalAlign?: "auto" | "top" | "bottom" | "middle" | undefined | undefined;
223
- } & {
224
- ariaExpanded?: boolean;
225
- ariaControls?: string;
226
- error?: string;
227
- readOnly?: boolean;
228
- validating?: boolean;
229
- valid?: boolean;
230
- disabled?: boolean;
231
- color?: ColorVariants;
232
- multiline?: boolean;
233
- icon?: IconName;
234
- unit?: string;
235
- units?: string[];
236
- inputMode?: TextInputProps["inputMode"];
237
- pattern?: string;
238
- children?: ReactNode;
239
- hideErrors?: boolean;
240
- style?: TextInputProps["style"];
241
- containerStyle?: ViewProps["style"];
242
- onChange?: ChangeEventHandler<HTMLInputElement>;
243
- onUnitChange?: (value: string) => void;
244
- maxCharCount?: number;
245
- help?: string;
246
- warning?: boolean;
247
- renderEnd?: () => ReactNode;
248
- containerRef?: Ref<View>;
249
- } & import("react").RefAttributes<TextInput | null>>;
34
+ export declare const LakeTextInput: ({ ref, ariaExpanded, ariaControls, error, disabled, validating, valid, readOnly, icon, children, unit, units, color, inputMode, hideErrors, onChange, onUnitChange, pattern, style: stylesFromProps, containerStyle: containerStylesFromProps, onFocus: originalOnFocus, onBlur: originalOnBlur, value, defaultValue, multiline, containerRef, maxCharCount, help, warning, renderEnd, ...props }: LakeTextInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useRef, useState, } from "react";
2
+ import { useCallback, useRef, useState } from "react";
3
3
  import { ActivityIndicator, StyleSheet, TextInput, View, } from "react-native";
4
4
  import { commonStyles } from "../constants/commonStyles";
5
5
  import { backgroundColor, colors, radii, shadows, spacings, texts, } from "../constants/design";
@@ -124,11 +124,11 @@ const styles = StyleSheet.create({
124
124
  paddingTop: spacings[4],
125
125
  },
126
126
  });
127
- export const LakeTextInput = forwardRef(({ ariaExpanded, ariaControls, error, disabled = false, validating = false, valid = false, readOnly = false, icon, children, unit, units, color = "gray", inputMode = "text", hideErrors = false, onChange, onUnitChange, pattern, style: stylesFromProps, containerStyle: containerStylesFromProps, onFocus: originalOnFocus, onBlur: originalOnBlur, value, defaultValue, multiline = false, containerRef,
127
+ export const LakeTextInput = ({ ref, ariaExpanded, ariaControls, error, disabled = false, validating = false, valid = false, readOnly = false, icon, children, unit, units, color = "gray", inputMode = "text", hideErrors = false, onChange, onUnitChange, pattern, style: stylesFromProps, containerStyle: containerStylesFromProps, onFocus: originalOnFocus, onBlur: originalOnBlur, value, defaultValue, multiline = false, containerRef,
128
128
  //maxCharCount is different from maxLength(props inherited of TextInput)
129
129
  //maxLength truncates the text in the limitation asked,
130
130
  //maxCharCount doesn't have limitation but displays a counter of characters
131
- maxCharCount, help, warning = false, renderEnd, ...props }, forwardRef) => {
131
+ maxCharCount, help, warning = false, renderEnd, ...props }) => {
132
132
  const inputRef = useRef(null);
133
133
  const [isHovered, setIsHovered] = useState(false);
134
134
  const [isFocused, setIsFocused] = useState(false);
@@ -145,7 +145,7 @@ maxCharCount, help, warning = false, renderEnd, ...props }, forwardRef) => {
145
145
  setIsFocused(false);
146
146
  originalOnBlur === null || originalOnBlur === void 0 ? void 0 : originalOnBlur(event);
147
147
  }, [originalOnBlur]);
148
- const mergedRef = useMergeRefs(inputRef, forwardRef);
148
+ const mergedRef = useMergeRefs(inputRef, ref);
149
149
  const isInteractive = !disabled && !readOnly;
150
150
  const hasError = isNotNullishOrEmpty(error);
151
151
  const charCount = isNullish(value) ? 0 : value.length;
@@ -169,4 +169,4 @@ maxCharCount, help, warning = false, renderEnd, ...props }, forwardRef) => {
169
169
  disabled && styles.disabled,
170
170
  readOnly && styles.readOnly,
171
171
  ] }), isNotNullish(renderEnd) && _jsx(View, { style: styles.endComponents, children: renderEnd() }), validating && (_jsx(ActivityIndicator, { size: "small", style: styles.endIcon, color: colors.current[500] })), !validating && hasError && (_jsx(Icon, { name: "warning-regular", size: 20, color: colors.negative[400], style: [styles.endIcon, readOnly && styles.readOnlyEndIcon] })), !validating && warning && !hasError && (_jsx(Icon, { name: "warning-regular", size: 20, color: colors.warning[500], style: [styles.endIcon, readOnly && styles.readOnlyEndIcon] })), !validating && !hasError && valid && (_jsx(Icon, { name: "checkmark-filled", size: 20, color: colors.positive[400], style: [styles.endIcon, readOnly && styles.readOnlyEndIcon] }))] }), isNotNullish(units) && isNotNullish(onUnitChange) ? (_jsx(Box, { children: _jsx(LakeSelect, { value: unit, onValueChange: onUnitChange, items: units.map(value => ({ name: value, value })), disabled: disabled, style: [styles.unit, (disabled || readOnly) && styles.unitDisabled], mode: "borderless", hideErrors: true }) })) : isNotNullish(unit) ? (_jsx(LakeText, { color: colors.gray[900], style: [styles.unit, (disabled || readOnly) && styles.unitDisabled], children: unit })) : null] }), children] }), !hideErrors && (_jsxs(Box, { direction: "row", style: styles.errorContainer, children: [isNotNullish(error) ? (_jsx(LakeText, { variant: "smallRegular", color: colors.negative[500], children: error })) : (_jsx(LakeText, { variant: "smallRegular", color: colors.gray[500], children: help !== null && help !== void 0 ? help : " " })), isNotNullish(maxCharCount) && (_jsxs(_Fragment, { children: [_jsx(Fill, { minWidth: 4 }), _jsxs(LakeText, { variant: "smallRegular", color: charCount > maxCharCount ? colors.negative[500] : colors.gray[400], style: styles.descriptionLimitation, children: [charCount, " / ", maxCharCount] })] }))] }))] }));
172
- });
172
+ };
@@ -1,7 +1,12 @@
1
- import { ReactNode } from "react";
1
+ import { ReactNode, Ref } from "react";
2
2
  import { ViewProps } from "react-native";
3
3
  import { IconName } from "./Icon";
4
+ export type TooltipRef = {
5
+ show: () => void;
6
+ hide: () => void;
7
+ };
4
8
  type Props = {
9
+ ref?: Ref<TooltipRef>;
5
10
  children: ReactNode;
6
11
  content: ReactNode;
7
12
  describedBy?: string;
@@ -16,14 +21,11 @@ type Props = {
16
21
  containerStyle?: ViewProps["style"];
17
22
  disabled?: boolean;
18
23
  };
19
- export type TooltipRef = {
20
- show: () => void;
21
- hide: () => void;
22
- };
23
- export declare const LakeTooltip: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<TooltipRef>>;
24
- export declare const InformationTooltip: import("react").ForwardRefExoticComponent<{
24
+ export declare const LakeTooltip: ({ ref, content, children, ...rest }: Props) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
25
+ export declare const InformationTooltip: ({ ref, text, icon, iconSize, }: {
26
+ ref?: Ref<TooltipRef>;
25
27
  text: string;
26
28
  icon?: IconName;
27
29
  iconSize?: number;
28
- } & import("react").RefAttributes<TooltipRef>>;
30
+ }) => import("react/jsx-runtime").JSX.Element;
29
31
  export {};