@swan-io/lake 2.7.14 → 2.7.15
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/package.json
CHANGED
|
@@ -21,6 +21,7 @@ const styles = StyleSheet.create({
|
|
|
21
21
|
// to trigger the change
|
|
22
22
|
maxWidth: 202,
|
|
23
23
|
minWidth: 38,
|
|
24
|
+
justifyContent: "flex-end",
|
|
24
25
|
},
|
|
25
26
|
focus: {
|
|
26
27
|
outlineStyle: "none",
|
|
@@ -38,6 +39,11 @@ const styles = StyleSheet.create({
|
|
|
38
39
|
justifyContent: "flex-end",
|
|
39
40
|
flexGrow: 1,
|
|
40
41
|
},
|
|
42
|
+
largeInputContainer: {
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
justifyContent: "flex-end",
|
|
45
|
+
flexGrow: 1,
|
|
46
|
+
},
|
|
41
47
|
openSearchFieldContainer: {
|
|
42
48
|
position: "absolute",
|
|
43
49
|
right: 0,
|
|
@@ -74,7 +80,7 @@ const ExpandedSearchField = ({ inputRef, placeholder, initialValue, onChange, se
|
|
|
74
80
|
timeoutRef.current = window.setTimeout(() => {
|
|
75
81
|
setFocused.off();
|
|
76
82
|
}, 300);
|
|
77
|
-
}, style: [styles.input, hasFocus ? styles.focus : null] }));
|
|
83
|
+
}, containerStyle: styles.largeInputContainer, style: [styles.input, hasFocus ? styles.focus : null] }));
|
|
78
84
|
};
|
|
79
85
|
export const LakeSearchField = ({ initialValue, placeholder, onChangeText, debounceDuration = 500, maxWidth, renderEnd, }) => {
|
|
80
86
|
const [hasFocus, setFocused] = useBoolean(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEventHandler, ReactNode, Ref } from "react";
|
|
2
|
-
import { NativeSyntheticEvent, TextInput, TextInputFocusEventData, TextInputProps, View } from "react-native";
|
|
2
|
+
import { NativeSyntheticEvent, TextInput, TextInputFocusEventData, 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";
|
|
@@ -20,6 +20,7 @@ export type LakeTextInputProps = Except<TextInputProps, "editable" | "keyboardTy
|
|
|
20
20
|
children?: ReactNode;
|
|
21
21
|
hideErrors?: boolean;
|
|
22
22
|
style?: TextInputProps["style"];
|
|
23
|
+
containerStyle?: ViewProps["style"];
|
|
23
24
|
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
24
25
|
maxCharCount?: number;
|
|
25
26
|
help?: string;
|
|
@@ -233,6 +234,7 @@ export declare const LakeTextInput: import("react").ForwardRefExoticComponent<{
|
|
|
233
234
|
children?: ReactNode;
|
|
234
235
|
hideErrors?: boolean | undefined;
|
|
235
236
|
style?: TextInputProps["style"];
|
|
237
|
+
containerStyle?: ViewProps["style"];
|
|
236
238
|
onChange?: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
237
239
|
maxCharCount?: number | undefined;
|
|
238
240
|
help?: string | undefined;
|
|
@@ -121,7 +121,7 @@ const styles = StyleSheet.create({
|
|
|
121
121
|
paddingTop: spacings[4],
|
|
122
122
|
},
|
|
123
123
|
});
|
|
124
|
-
export const LakeTextInput = forwardRef(({ ariaExpanded, ariaControls, error, disabled = false, validating = false, valid = false, readOnly = false, icon, children, unit, color = "gray", inputMode = "text", hideErrors = false, onChange, pattern, style: stylesFromProps, onFocus: originalOnFocus, onBlur: originalOnBlur, value, defaultValue, multiline = false, containerRef,
|
|
124
|
+
export const LakeTextInput = forwardRef(({ ariaExpanded, ariaControls, error, disabled = false, validating = false, valid = false, readOnly = false, icon, children, unit, color = "gray", inputMode = "text", hideErrors = false, onChange, pattern, style: stylesFromProps, containerStyle: containerStylesFromProps, onFocus: originalOnFocus, onBlur: originalOnBlur, value, defaultValue, multiline = false, containerRef,
|
|
125
125
|
//maxCharCount is different from maxLength(props inherited of TextInput)
|
|
126
126
|
//maxLength truncates the text in the limitation asked,
|
|
127
127
|
//maxCharCount doesn't have limitation but displays a counter of characters
|
|
@@ -146,7 +146,7 @@ maxCharCount, help, renderEnd, ...props }, forwardRef) => {
|
|
|
146
146
|
const isInteractive = !disabled && !readOnly;
|
|
147
147
|
const hasError = isNotNullishOrEmpty(error);
|
|
148
148
|
const charCount = isNullish(value) ? 0 : value.length;
|
|
149
|
-
return (_jsxs(View, { style: commonStyles.fill, children: [_jsxs(View, { style: styles.root, "aria-errormessage": error, children: [_jsxs(View, { style: styles.container, children: [_jsxs(View, { style: [
|
|
149
|
+
return (_jsxs(View, { style: commonStyles.fill, children: [_jsxs(View, { style: styles.root, "aria-errormessage": error, children: [_jsxs(View, { style: [styles.container, containerStylesFromProps], children: [_jsxs(View, { style: [
|
|
150
150
|
styles.contents,
|
|
151
151
|
isHovered && isInteractive && styles.hovered,
|
|
152
152
|
isFocused && { borderColor: colors[color][500] },
|