@swan-io/lake 1.4.4 → 1.5.1
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 +4 -5
- package/src/components/AppOpeningAnimation.js +13 -13
- package/src/components/AutoWidthImage.d.ts +1 -0
- package/src/components/AutoWidthImage.js +3 -4
- package/src/components/Avatar.js +3 -2
- package/src/components/BorderedButton.d.ts +1 -1
- package/src/components/BorderedButton.js +6 -4
- package/src/components/BottomPanel.js +2 -2
- package/src/components/Box.js +1 -1
- package/src/components/Breadcrumbs.js +7 -7
- package/src/components/ChoicePicker.js +6 -6
- package/src/components/Fill.js +2 -1
- package/src/components/FilterChooser.js +2 -2
- package/src/components/Filters.js +9 -9
- package/src/components/FixedListView.js +15 -12
- package/src/components/FixedListViewCells.js +2 -2
- package/src/components/Form.d.ts +1 -1
- package/src/components/FullViewportLayer.js +10 -7
- package/src/components/Heading.d.ts +1 -1
- package/src/components/Heading.js +1 -1
- package/src/components/Icon.d.ts +2 -4
- package/src/components/Icon.js +7 -1
- package/src/components/Input.d.ts +6 -6
- package/src/components/Input.js +6 -11
- package/src/components/Label.d.ts +1 -1
- package/src/components/Label.js +1 -1
- package/src/components/LakeButton.d.ts +3 -3
- package/src/components/LakeButton.js +5 -5
- package/src/components/LakeCheckbox.js +2 -2
- package/src/components/LakeCombobox.d.ts +2 -2
- package/src/components/LakeCombobox.js +6 -10
- package/src/components/LakeDownloadButton.js +1 -1
- package/src/components/LakeHeading.d.ts +3 -2
- package/src/components/LakeHeading.js +7 -1
- package/src/components/LakeLabel.d.ts +0 -1
- package/src/components/LakeLabel.js +3 -3
- package/src/components/LakeModal.js +6 -3
- package/src/components/LakeRadio.js +3 -3
- package/src/components/LakeScrollView.js +2 -1
- package/src/components/LakeSearchField.js +3 -3
- package/src/components/LakeSelect.d.ts +2 -2
- package/src/components/LakeSelect.js +14 -23
- package/src/components/LakeSlider.js +1 -1
- package/src/components/LakeStepper.js +4 -4
- package/src/components/LakeText.d.ts +9 -8
- package/src/components/LakeText.js +7 -1
- package/src/components/LakeTextInput.d.ts +10 -5
- package/src/components/LakeTextInput.js +4 -4
- package/src/components/LakeTooltip.js +7 -12
- package/src/components/Link.d.ts +52 -49
- package/src/components/Link.js +2 -2
- package/src/components/ListRightPanel.js +2 -2
- package/src/components/Modal.js +15 -5
- package/src/components/MultiSelect.d.ts +1 -1
- package/src/components/MultiSelect.js +10 -7
- package/src/components/PlainListView.js +4 -3
- package/src/components/Popover.js +9 -5
- package/src/components/Portal.js +2 -2
- package/src/components/Pressable.d.ts +112 -101
- package/src/components/Pressable.js +16 -6
- package/src/components/RightPanel.js +10 -7
- package/src/components/Separator.js +1 -1
- package/src/components/SidebarNavigationTracker.js +5 -4
- package/src/components/Slider.js +28 -12
- package/src/components/SmsOpeningAnimation.js +15 -15
- package/src/components/Stack.d.ts +4 -4
- package/src/components/Stack.js +1 -1
- package/src/components/Stepper.js +1 -1
- package/src/components/Svg.d.ts +6 -7
- package/src/components/Switch.js +18 -6
- package/src/components/TabView.js +8 -7
- package/src/components/Tag.d.ts +2 -2
- package/src/components/Tag.js +6 -3
- package/src/components/Tile.js +2 -2
- package/src/components/ToastStack.js +16 -7
- package/src/components/Tooltip.js +3 -6
- package/src/components/TransitionGroupView.d.ts +2 -3
- package/src/components/TransitionGroupView.js +2 -2
- package/src/components/TransitionView.d.ts +2 -3
- package/src/components/TransitionView.js +2 -2
- package/src/components/WithCurrentColor.d.ts +1 -1
- package/src/constants/design.d.ts +4 -12
- package/src/constants/design.js +12 -12
- package/src/hooks/useAnimatedValue.js +9 -2
- package/src/hooks/useForceableState.js +1 -1
- package/src/hooks/useHover.js +1 -1
- package/src/hooks/useMergeRefs.js +1 -1
- package/src/hooks/usePressEvents.js +1 -1
- package/src/components/Alert.d.ts +0 -10
- package/src/components/Alert.js +0 -36
- package/src/components/Button.d.ts +0 -15
- package/src/components/Button.js +0 -83
- package/src/components/Checkbox.d.ts +0 -12
- package/src/components/Checkbox.js +0 -83
- package/src/components/Combobox.d.ts +0 -29
- package/src/components/Combobox.js +0 -182
- package/src/components/MultilineInput.d.ts +0 -15
- package/src/components/MultilineInput.js +0 -55
- package/src/components/Picker.d.ts +0 -26
- package/src/components/Picker.js +0 -116
- package/src/components/ProgressBar.d.ts +0 -11
- package/src/components/ProgressBar.js +0 -46
- package/src/components/SegmentedControl.d.ts +0 -19
- package/src/components/SegmentedControl.js +0 -74
- package/src/components/Table.d.ts +0 -34
- package/src/components/Table.js +0 -79
- package/src/hooks/useLazyRef.d.ts +0 -2
- package/src/hooks/useLazyRef.js +0 -9
|
@@ -12,6 +12,9 @@ const styles = StyleSheet.create({
|
|
|
12
12
|
...StyleSheet.absoluteFillObject,
|
|
13
13
|
overflow: "hidden",
|
|
14
14
|
},
|
|
15
|
+
inert: {
|
|
16
|
+
pointerEvents: "none",
|
|
17
|
+
},
|
|
15
18
|
fill: {
|
|
16
19
|
...StyleSheet.absoluteFillObject,
|
|
17
20
|
animationFillMode: "forwards",
|
|
@@ -33,14 +36,14 @@ const styles = StyleSheet.create({
|
|
|
33
36
|
},
|
|
34
37
|
containerEnter: {
|
|
35
38
|
animationKeyframes: {
|
|
36
|
-
"0%": { opacity: 0, transform:
|
|
39
|
+
"0%": { opacity: 0, transform: "translateZ(0px) translateX(200px)" },
|
|
37
40
|
},
|
|
38
41
|
animationDuration: "500ms",
|
|
39
42
|
animationTimingFunction: "ease-in-out",
|
|
40
43
|
},
|
|
41
44
|
containerLeave: {
|
|
42
45
|
animationKeyframes: {
|
|
43
|
-
"100%": { opacity: 0, transform:
|
|
46
|
+
"100%": { opacity: 0, transform: "translateZ(0px) translateX(200px)" },
|
|
44
47
|
},
|
|
45
48
|
animationDuration: "500ms",
|
|
46
49
|
animationTimingFunction: "ease-in-out",
|
|
@@ -51,21 +54,21 @@ const styles = StyleSheet.create({
|
|
|
51
54
|
},
|
|
52
55
|
container: {
|
|
53
56
|
...StyleSheet.absoluteFillObject,
|
|
54
|
-
transform:
|
|
57
|
+
transform: "translateZ(0px)",
|
|
55
58
|
flexDirection: "row",
|
|
56
59
|
alignItems: "stretch",
|
|
57
60
|
backgroundColor: backgroundColor.default,
|
|
58
61
|
},
|
|
59
62
|
contentsEnter: {
|
|
60
63
|
animationKeyframes: {
|
|
61
|
-
"0%": { transform:
|
|
64
|
+
"0%": { transform: "translateZ(0px) translateX(50px)" },
|
|
62
65
|
},
|
|
63
66
|
animationDuration: "500ms",
|
|
64
67
|
animationTimingFunction: "ease-in-out",
|
|
65
68
|
},
|
|
66
69
|
contentsLeave: {
|
|
67
70
|
animationKeyframes: {
|
|
68
|
-
"100%": { transform:
|
|
71
|
+
"100%": { transform: "translateZ(0px) translateX(50px)" },
|
|
69
72
|
},
|
|
70
73
|
animationDuration: "500ms",
|
|
71
74
|
animationTimingFunction: "ease-in-out",
|
|
@@ -73,7 +76,7 @@ const styles = StyleSheet.create({
|
|
|
73
76
|
contentsContainer: {
|
|
74
77
|
...StyleSheet.absoluteFillObject,
|
|
75
78
|
zIndex: 2,
|
|
76
|
-
transform:
|
|
79
|
+
transform: "translateZ(0px)",
|
|
77
80
|
maxWidth: "100%",
|
|
78
81
|
},
|
|
79
82
|
contents: {
|
|
@@ -87,5 +90,5 @@ export const FullViewportLayer = ({ visible, children }) => {
|
|
|
87
90
|
useEffect(() => {
|
|
88
91
|
setDelayedVisible(visible);
|
|
89
92
|
}, [visible]);
|
|
90
|
-
return (_jsx(Portal, { container: rootNode, children: _jsxs(View, { style: styles.root,
|
|
93
|
+
return (_jsx(Portal, { container: rootNode, children: _jsxs(View, { style: [styles.root, !visible && styles.inert], children: [_jsx(TransitionView, { style: styles.fill, enter: styles.overlayEnter, leave: styles.overlayLeave, children: visible ? _jsx(View, { style: styles.overlay }) : null }), _jsx(Suspense, { fallback: _jsx(LoadingView, { color: backgroundColor.accented, delay: 0 }), children: _jsx(TransitionView, { style: styles.fill, enter: styles.containerEnter, leave: styles.containerLeave, children: delayedVisible ? (_jsx(FocusTrap, { focusLock: true, autoFocus: true, returnFocus: true, style: styles.container, children: _jsx(TransitionView, { style: styles.contentsContainer, enter: styles.contentsEnter, leave: styles.contentsLeave, children: _jsx(View, { style: styles.contents, children: _jsx(View, { style: styles.contentsContainer, children: children }) }) }) })) : null }) })] }) }));
|
|
91
94
|
};
|
|
@@ -52,7 +52,7 @@ declare const sizes: {
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
type HeadingSize = keyof typeof sizes;
|
|
55
|
-
export declare const Heading: import("react").ForwardRefExoticComponent<Except<TextProps, "
|
|
55
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<Except<TextProps, "role"> & {
|
|
56
56
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
57
57
|
align?: "left" | "right" | "center" | undefined;
|
|
58
58
|
size: HeadingSize;
|
|
@@ -24,4 +24,4 @@ const sizes = StyleSheet.create({
|
|
|
24
24
|
16: { ...baseStyle, fontSize: 16 },
|
|
25
25
|
/* eslint-enable react-native/no-unused-styles */
|
|
26
26
|
});
|
|
27
|
-
export const Heading = forwardRef(({ children, align = "left", size, level, style, ...props }, forwardedRef) => (_jsx(Text, { ref: forwardedRef,
|
|
27
|
+
export const Heading = forwardRef(({ children, align = "left", size, level, style, ...props }, forwardedRef) => (_jsx(Text, { ref: forwardedRef, role: "heading", "aria-level": level, style: [sizes[size], alignments[align], style], ...props, children: children })));
|
package/src/components/Icon.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { StyleProp, ViewStyle, WebAccessibilityProps } from "react-native";
|
|
3
3
|
declare const paths: {
|
|
4
4
|
"lake-calendar-arrow-swap": string;
|
|
5
5
|
"lake-card": string;
|
|
@@ -183,11 +183,9 @@ declare const paths: {
|
|
|
183
183
|
"window-dev-tools-regular": string;
|
|
184
184
|
};
|
|
185
185
|
export type IconName = keyof typeof paths;
|
|
186
|
-
type Props =
|
|
186
|
+
type Props = WebAccessibilityProps & {
|
|
187
187
|
color?: string;
|
|
188
|
-
focusable?: boolean;
|
|
189
188
|
name: IconName;
|
|
190
|
-
pointerEvents?: ViewProps["pointerEvents"];
|
|
191
189
|
size: number;
|
|
192
190
|
style?: StyleProp<ViewStyle>;
|
|
193
191
|
};
|
package/src/components/Icon.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
3
4
|
import { Path, Svg } from "./Svg";
|
|
4
5
|
import customIcons from "../icons/custom-icons.json";
|
|
5
6
|
import fluentIcons from "../icons/fluent-icons.json";
|
|
@@ -7,5 +8,10 @@ const paths = {
|
|
|
7
8
|
...fluentIcons,
|
|
8
9
|
...customIcons,
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
const styles = StyleSheet.create({
|
|
12
|
+
inert: {
|
|
13
|
+
pointerEvents: "none",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const Icon = memo(({ name, color = "currentColor", size, style, ...props }) => (_jsx(Svg, { viewBox: "0 0 24 24", style: [styles.inert, { height: size, width: size }, style], ...props, children: _jsx(Path, { d: paths[name], fill: color }) })));
|
|
11
17
|
Icon.displayName = "Icon";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ChangeEventHandler, ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { NativeSyntheticEvent, StyleProp, TextInput, TextInputProps, TextStyle, ViewStyle, WebRole } from "react-native";
|
|
3
3
|
import { IconName } from "./Icon";
|
|
4
4
|
type Props = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
ariaControls?: string;
|
|
6
|
+
ariaExpanded?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
error?: string;
|
|
9
9
|
icon?: IconName;
|
|
10
10
|
inputContainerStyle?: StyleProp<ViewStyle>;
|
|
11
|
-
role?:
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
role?: WebRole;
|
|
12
|
+
inputMode?: TextInputProps["inputMode"];
|
|
13
|
+
enterKeyHint?: TextInputProps["enterKeyHint"];
|
|
14
14
|
maxLength?: number;
|
|
15
15
|
label?: string;
|
|
16
16
|
onFocus?: (event: NativeSyntheticEvent<React.FocusEvent>) => void;
|
package/src/components/Input.js
CHANGED
|
@@ -3,6 +3,7 @@ import { forwardRef, memo, useId, useRef } from "react";
|
|
|
3
3
|
import { StyleSheet, Text, View, } from "react-native";
|
|
4
4
|
import { colors } from "../constants/colors";
|
|
5
5
|
import { commonStyles } from "../constants/commonStyles";
|
|
6
|
+
import { shadows } from "../constants/design";
|
|
6
7
|
import { typography } from "../constants/typography";
|
|
7
8
|
import { useMergeRefs } from "../hooks/useMergeRefs";
|
|
8
9
|
import { isNotNullish } from "../utils/nullish";
|
|
@@ -29,7 +30,7 @@ const styles = StyleSheet.create({
|
|
|
29
30
|
placeholderTextColor: colors.gray[30],
|
|
30
31
|
textOverflow: "ellipsis",
|
|
31
32
|
transitionDuration: "150ms",
|
|
32
|
-
transitionProperty:
|
|
33
|
+
transitionProperty: "border-color, box-shadow",
|
|
33
34
|
whiteSpace: "nowrap",
|
|
34
35
|
wordBreak: "keep-all",
|
|
35
36
|
},
|
|
@@ -38,10 +39,7 @@ const styles = StyleSheet.create({
|
|
|
38
39
|
},
|
|
39
40
|
focused: {
|
|
40
41
|
borderColor: colors.gray[20],
|
|
41
|
-
|
|
42
|
-
shadowOpacity: 0.12,
|
|
43
|
-
shadowOffset: { height: 0, width: 0 },
|
|
44
|
-
shadowRadius: 2,
|
|
42
|
+
boxShadow: shadows.tile,
|
|
45
43
|
},
|
|
46
44
|
disabled: {
|
|
47
45
|
backgroundColor: colors.gray[3],
|
|
@@ -49,10 +47,7 @@ const styles = StyleSheet.create({
|
|
|
49
47
|
cursor: "not-allowed",
|
|
50
48
|
},
|
|
51
49
|
hovered: {
|
|
52
|
-
|
|
53
|
-
shadowOpacity: 0.06,
|
|
54
|
-
shadowOffset: { height: 4, width: 0 },
|
|
55
|
-
shadowRadius: 8,
|
|
50
|
+
boxShadow: shadows.tile,
|
|
56
51
|
},
|
|
57
52
|
leftIcon: {
|
|
58
53
|
position: "absolute",
|
|
@@ -95,13 +90,13 @@ const styles = StyleSheet.create({
|
|
|
95
90
|
...typography.bodyLarge,
|
|
96
91
|
},
|
|
97
92
|
});
|
|
98
|
-
export const Input = memo(forwardRef(({
|
|
93
|
+
export const Input = memo(forwardRef(({ ariaControls, ariaExpanded, disabled = false, error, icon, inputContainerStyle, role, inputMode, enterKeyHint, maxLength, label = "", onFocus, onBlur, onSubmitEditing, onChange, onValueChange, onKeyPress, placeholder, readOnly = false, size = "large", successful = false, suffix = "", value = "", style, inputStyle, RightComponent = null, hideErrorMessage = false, }, forwardedRef) => {
|
|
99
94
|
const ref = useRef(null);
|
|
100
95
|
const mergedRef = useMergeRefs(ref, forwardedRef);
|
|
101
96
|
const labelId = `label-${useId()}`;
|
|
102
97
|
const id = `input-${useId()}`;
|
|
103
98
|
const errored = isNotNullish(error);
|
|
104
|
-
return (_jsxs(View, { style: style, children: [label !== "" && (_jsxs(_Fragment, { children: [_jsx(Label, { id: labelId, htmlFor: id, children: label }), _jsx(Space, { height: 8 })] })), _jsxs(Box, { direction: "row", style: inputContainerStyle, children: [_jsxs(Box, { direction: "row", alignItems: "center", style: commonStyles.fill, children: [_jsx(PressableTextInput, { ref: mergedRef,
|
|
99
|
+
return (_jsxs(View, { style: style, children: [label !== "" && (_jsxs(_Fragment, { children: [_jsx(Label, { id: labelId, htmlFor: id, children: label }), _jsx(Space, { height: 8 })] })), _jsxs(Box, { direction: "row", style: inputContainerStyle, children: [_jsxs(Box, { direction: "row", alignItems: "center", style: commonStyles.fill, children: [_jsx(PressableTextInput, { ref: mergedRef, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-labelledby": labelId, id: id, allowFontScaling: false, autoComplete: "off", role: role, readOnly: readOnly || disabled, inputMode: inputMode, enterKeyHint: enterKeyHint, multiline: false, rows: 1, maxLength: maxLength, onFocus: onFocus, onBlur: onBlur, onChange: onChange, onChangeText: onValueChange, onSubmitEditing: onSubmitEditing, onKeyPress: onKeyPress, placeholder: placeholder, value: value, style: ({ hovered, focused }) => [
|
|
105
100
|
styles.base,
|
|
106
101
|
size === "small" && styles.small,
|
|
107
102
|
isNotNullish(icon) && styles.withLeftIcon,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { TextProps } from "react-native";
|
|
3
3
|
import { Except } from "type-fest";
|
|
4
|
-
type Props = Except<TextProps, "
|
|
4
|
+
type Props = Except<TextProps, "role"> & {
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
htmlFor?: string;
|
|
7
7
|
id?: string;
|
package/src/components/Label.js
CHANGED
|
@@ -15,5 +15,5 @@ const styles = StyleSheet.create({
|
|
|
15
15
|
export const Label = ({ htmlFor, id, style, ...props }) => {
|
|
16
16
|
const ref = useRef(null);
|
|
17
17
|
useNativeProp(ref, "for", htmlFor);
|
|
18
|
-
return
|
|
18
|
+
return _jsx(Text, { ref: ref, id: id, role: "label", style: [styles.base, style], ...props });
|
|
19
19
|
};
|
|
@@ -3,9 +3,9 @@ import { GestureResponderEvent, PressableStateCallbackType, StyleProp, View, Vie
|
|
|
3
3
|
import { ColorVariants, Spacings } from "../constants/design";
|
|
4
4
|
import { IconName } from "./Icon";
|
|
5
5
|
export type ButtonProps = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ariaControls?: string;
|
|
7
|
+
ariaExpanded?: boolean;
|
|
8
|
+
ariaLabel?: string;
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
color?: ColorVariants;
|
|
11
11
|
disabled?: boolean;
|
|
@@ -20,7 +20,7 @@ const styles = StyleSheet.create({
|
|
|
20
20
|
justifyContent: "center",
|
|
21
21
|
paddingHorizontal: 20,
|
|
22
22
|
transitionDuration: "150ms",
|
|
23
|
-
transitionProperty:
|
|
23
|
+
transitionProperty: "background-color, color",
|
|
24
24
|
},
|
|
25
25
|
grow: {
|
|
26
26
|
flexGrow: 1,
|
|
@@ -80,7 +80,7 @@ const styles = StyleSheet.create({
|
|
|
80
80
|
...StyleSheet.absoluteFillObject,
|
|
81
81
|
alignItems: "center",
|
|
82
82
|
justifyContent: "center",
|
|
83
|
-
transform:
|
|
83
|
+
transform: "translateZ(0px)",
|
|
84
84
|
borderRadius: radii[6],
|
|
85
85
|
},
|
|
86
86
|
group: {
|
|
@@ -101,13 +101,13 @@ const styles = StyleSheet.create({
|
|
|
101
101
|
},
|
|
102
102
|
});
|
|
103
103
|
const isReactText = (node) => ["string", "number"].includes(typeof node);
|
|
104
|
-
export const LakeButton = memo(forwardRef(({
|
|
104
|
+
export const LakeButton = memo(forwardRef(({ ariaControls, ariaExpanded, ariaLabel, children, color = "gray", disabled = false, icon, grow = false, iconPosition = "start", loading = false, mode = "primary", onPress, size = "large", style, forceBackground = false, href, hrefAttrs, pill, }, forwardedRef) => {
|
|
105
105
|
const isSmall = size === "small";
|
|
106
106
|
const iconSize = isSmall ? 18 : 20;
|
|
107
107
|
const hasIconStart = isNotNullish(icon) && iconPosition === "start";
|
|
108
108
|
const hasIconEnd = isNotNullish(icon) && iconPosition === "end";
|
|
109
109
|
const hasOnlyIcon = isNullish(children) && isNotNullish(icon);
|
|
110
|
-
return (_jsx(Pressable, { href: href, hrefAttrs: hrefAttrs,
|
|
110
|
+
return (_jsx(Pressable, { href: href, hrefAttrs: hrefAttrs, role: href != null ? "link" : "button", "aria-busy": loading, "aria-disabled": disabled, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, disabled: loading || disabled, ref: forwardedRef, onPress: onPress, style: ({ hovered, pressed, focused }) => [
|
|
111
111
|
styles.base,
|
|
112
112
|
isSmall && styles.small,
|
|
113
113
|
hasIconStart && isSmall ? styles.withIconStartSmall : styles.withIconStart,
|
|
@@ -151,7 +151,7 @@ export const LakeButton = memo(forwardRef(({ accessibilityControls, accessibilit
|
|
|
151
151
|
? colors[color][700]
|
|
152
152
|
: colors[color][600]
|
|
153
153
|
: colors[color].contrast;
|
|
154
|
-
return (_jsxs(_Fragment, { children: [hasIconStart && (_jsxs(_Fragment, { children: [_jsx(Icon, { color: textColor, name: icon, size: iconSize }), isNotNullish(children) && _jsx(Space, { width: isSmall ? 8 : 12 })] })), isReactText(children) ? (_jsx(LakeText, { numberOfLines: 1,
|
|
154
|
+
return (_jsxs(_Fragment, { children: [hasIconStart && (_jsxs(_Fragment, { children: [_jsx(Icon, { color: textColor, name: icon, size: iconSize }), isNotNullish(children) && _jsx(Space, { width: isSmall ? 8 : 12 })] })), isReactText(children) ? (_jsx(LakeText, { numberOfLines: 1, userSelect: "none", style: [isSmall ? styles.textSmall : styles.text, { color: textColor }], children: children })) : (children), hasIconEnd && (_jsxs(_Fragment, { children: [isNotNullish(children) && _jsx(Space, { width: isSmall ? 8 : 12 }), _jsx(Icon, { color: textColor, name: icon, size: iconSize })] })), loading && (_jsx(View, { role: "none", style: [
|
|
155
155
|
styles.loaderContainer,
|
|
156
156
|
{
|
|
157
157
|
backgroundColor: mode === "secondary" || mode === "tertiary"
|
|
@@ -39,7 +39,7 @@ export const LakeCheckbox = ({ value, color = "current", disabled = false, isErr
|
|
|
39
39
|
}
|
|
40
40
|
isFirstRender.current = false;
|
|
41
41
|
}, [value]);
|
|
42
|
-
return (_jsxs(View, {
|
|
42
|
+
return (_jsxs(View, { role: "none", style: [
|
|
43
43
|
styles.container,
|
|
44
44
|
disabled && styles.disabled,
|
|
45
45
|
value !== false && {
|
|
@@ -50,5 +50,5 @@ export const LakeCheckbox = ({ value, color = "current", disabled = false, isErr
|
|
|
50
50
|
], children: [value === true && (_jsx(Svg, { viewBox: "0 0 16 16", children: _jsx(Path, { d: "m3.5 7.5 2.8 3.4 5.6-6.7", stroke: colors[color].contrast, strokeWidth: 1.5, fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: "20", strokeDashoffset: shouldAnimate ? "20" : "0", children: shouldAnimate && (_jsx(Animate, { attributeName: "stroke-dashoffset", values: "20;0", dur: "150ms", begin: "150ms", fill: "freeze" })) }) })), value === "mixed" && (_jsx(View, { style: [styles.mixed, { backgroundColor: colors[color].contrast }] }))] }));
|
|
51
51
|
};
|
|
52
52
|
export const LakeLabelledCheckbox = ({ value, color, label, onValueChange, disabled = false, isError = false, }) => {
|
|
53
|
-
return (_jsxs(Pressable, {
|
|
53
|
+
return (_jsxs(Pressable, { "aria-checked": value, style: styles.labelled, onPress: () => onValueChange(value === true ? false : true), disabled: disabled, children: [_jsx(LakeCheckbox, { value: value, color: color, disabled: disabled, isError: isError }), _jsx(Space, { width: 8 }), _jsx(LakeText, { color: colors.gray[900], userSelect: "none", children: label })] }));
|
|
54
54
|
};
|
|
@@ -15,14 +15,14 @@ export type LakeComboboxProps<I> = {
|
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
emptyResultText: string;
|
|
17
17
|
error?: string;
|
|
18
|
-
|
|
18
|
+
id?: string;
|
|
19
19
|
readOnly?: boolean;
|
|
20
20
|
};
|
|
21
21
|
export type LakeComboboxRef = {
|
|
22
22
|
close: () => void;
|
|
23
23
|
open: () => void;
|
|
24
24
|
};
|
|
25
|
-
declare const LakeComboboxWithRef: <I>({ inputRef, value, items, ListFooterComponent, onValueChange, onSelectItem, renderItem, keyExtractor, icon, placeholder, disabled, emptyResultText, readOnly,
|
|
25
|
+
declare const LakeComboboxWithRef: <I>({ inputRef, value, items, ListFooterComponent, onValueChange, onSelectItem, renderItem, keyExtractor, icon, placeholder, disabled, emptyResultText, readOnly, id, error, }: LakeComboboxProps<I>, externalRef: ForwardedRef<LakeComboboxRef>) => JSX.Element;
|
|
26
26
|
export declare const LakeCombobox: <I>(props: LakeComboboxProps<I> & {
|
|
27
27
|
ref?: RefObject<LakeComboboxRef> | undefined;
|
|
28
28
|
}) => ReturnType<typeof LakeComboboxWithRef>;
|
|
@@ -46,6 +46,7 @@ const styles = StyleSheet.create({
|
|
|
46
46
|
},
|
|
47
47
|
itemText: {
|
|
48
48
|
...typography.bodyLarge,
|
|
49
|
+
userSelect: "none",
|
|
49
50
|
},
|
|
50
51
|
loader: {
|
|
51
52
|
padding: spacings[24],
|
|
@@ -81,9 +82,8 @@ const getItemLayout = (_data, index) => ({
|
|
|
81
82
|
offset: ELEMENT_HEIGHT * index,
|
|
82
83
|
index,
|
|
83
84
|
});
|
|
84
|
-
const LakeComboboxWithRef = ({ inputRef, value, items, ListFooterComponent, onValueChange, onSelectItem, renderItem, keyExtractor, icon, placeholder, disabled = false, emptyResultText, readOnly,
|
|
85
|
+
const LakeComboboxWithRef = ({ inputRef, value, items, ListFooterComponent, onValueChange, onSelectItem, renderItem, keyExtractor, icon, placeholder, disabled = false, emptyResultText, readOnly, id, error, }, externalRef) => {
|
|
85
86
|
const ref = useRef(null);
|
|
86
|
-
// @ts-expect-error
|
|
87
87
|
const inputTextRef = useMergeRefs(ref, inputRef);
|
|
88
88
|
const listRef = useRef(null);
|
|
89
89
|
const listContainerRef = useRef(null);
|
|
@@ -143,18 +143,14 @@ const LakeComboboxWithRef = ({ inputRef, value, items, ListFooterComponent, onVa
|
|
|
143
143
|
close();
|
|
144
144
|
}, 100);
|
|
145
145
|
}, [close]);
|
|
146
|
-
return (_jsxs(View, { children: [_jsx(LakeTextInput
|
|
147
|
-
// @ts-expect-error
|
|
148
|
-
, {
|
|
149
|
-
// @ts-expect-error
|
|
150
|
-
ref: inputTextRef, style: styles.input, accessibilityExpanded: isFocused, accessibilityControls: isFocused ? suggestionsId : "", returnKeyType: "search", icon: icon, accessibilityRole: "combobox", placeholder: placeholder, value: value, disabled: disabled, error: error, onChangeText: onValueChange, onFocus: handleFocus, onBlur: handleBlur, onKeyPress: handleKeyPress, nativeID: nativeID, readOnly: readOnly }), _jsx(Popover, { id: suggestionsId, role: "listbox", matchReferenceWidth: true, onDismiss: close, referenceRef: ref, autoFocus: true, returnFocus: false, visible: isFocused && !items.isNotAsked(), underlay: false, forcedMode: "Dropdown", children: _jsx(View, { style: styles.list, children: items.match({
|
|
146
|
+
return (_jsxs(View, { children: [_jsx(LakeTextInput, { ref: inputTextRef, style: styles.input, ariaExpanded: isFocused, ariaControls: isFocused ? suggestionsId : "", enterKeyHint: "search", icon: icon, role: "combobox", placeholder: placeholder, value: value, disabled: disabled, error: error, onChangeText: onValueChange, onFocus: handleFocus, onBlur: handleBlur, onKeyPress: handleKeyPress, id: id, readOnly: readOnly }), _jsx(Popover, { id: suggestionsId, role: "listbox", matchReferenceWidth: true, onDismiss: close, referenceRef: ref, autoFocus: true, returnFocus: false, visible: isFocused && !items.isNotAsked(), underlay: false, forcedMode: "Dropdown", children: _jsx(View, { style: styles.list, children: items.match({
|
|
151
147
|
NotAsked: () => null,
|
|
152
148
|
Loading: () => _jsx(LoadingView, { style: styles.loader }),
|
|
153
149
|
Done: items => items.match({
|
|
154
150
|
Error: _ => (_jsx(Icon, { name: "error-circle-regular", size: 22, color: colors.negative[500] })),
|
|
155
|
-
Ok: items => (_jsxs(View, { ref: listContainerRef, style: styles.listContainer, children: [items.length === 0 ? (_jsxs(Box, { justifyContent: "center", alignItems: "center", style: styles.emptyList, children: [_jsx(Icon, { name: "clipboard-search-regular", size: 24, color: colors.gray.primary }), _jsx(Space, { height: 8 }), _jsx(Text, { style: styles.emptyListText, children: emptyResultText })] })) : (_jsx(FlatList, { ref: listRef, keyExtractor: keyExtractor, getItemLayout: getItemLayout,
|
|
151
|
+
Ok: items => (_jsxs(View, { ref: listContainerRef, style: styles.listContainer, children: [items.length === 0 ? (_jsxs(Box, { justifyContent: "center", alignItems: "center", style: styles.emptyList, children: [_jsx(Icon, { name: "clipboard-search-regular", size: 24, color: colors.gray.primary }), _jsx(Space, { height: 8 }), _jsx(Text, { style: styles.emptyListText, children: emptyResultText })] })) : (_jsx(FlatList, { ref: listRef, keyExtractor: keyExtractor, getItemLayout: getItemLayout, role: "list", data: items, style: styles.flatList, renderItem: ({ item }) => {
|
|
156
152
|
const rendered = renderItem(item);
|
|
157
|
-
return (_jsx(Pressable, { onFocus: handleFocus, onBlur: handleBlur,
|
|
153
|
+
return (_jsx(Pressable, { onFocus: handleFocus, onBlur: handleBlur, role: "listitem", onKeyDown: handleListItemKeyPress, style: ({ hovered, pressed, focused }) => [
|
|
158
154
|
styles.item,
|
|
159
155
|
hovered && styles.hoveredItem,
|
|
160
156
|
focused && styles.focusedItem,
|
|
@@ -166,7 +162,7 @@ const LakeComboboxWithRef = ({ inputRef, value, items, ListFooterComponent, onVa
|
|
|
166
162
|
setIsFetchingAdditionalInfo(false);
|
|
167
163
|
close();
|
|
168
164
|
});
|
|
169
|
-
}, children: isReactText(rendered) ? (_jsx(Text, { numberOfLines: 1,
|
|
165
|
+
}, children: isReactText(rendered) ? (_jsx(Text, { numberOfLines: 1, style: styles.itemText, children: rendered })) : (rendered) }));
|
|
170
166
|
} })), ListFooterComponent, isFetchingAdditionalInfo ? (_jsxs(View, { style: styles.loaderAdditional, children: [_jsx(View, { style: styles.loaderAdditionalUnderlay }), _jsx(LoadingView, {})] })) : null] })),
|
|
171
167
|
}),
|
|
172
168
|
}) }) })] }));
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Text } from "react-native";
|
|
3
3
|
import { Icon } from "./Icon";
|
|
4
4
|
export const LakeDownloadButton = ({ url, filename }) => {
|
|
5
|
-
return (_jsx(Text, { href: url, hrefAttrs: { download: filename, target: "blank" },
|
|
5
|
+
return (_jsx(Text, { href: url, hrefAttrs: { download: filename, target: "blank" }, "aria-label": "download", children: _jsx(Icon, { size: 18, name: "arrow-download-filled" }) }));
|
|
6
6
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { Text, TextProps } from "react-native";
|
|
2
|
+
import { Text, TextProps, TextStyle } from "react-native";
|
|
3
3
|
import { Except } from "type-fest";
|
|
4
|
-
export declare const LakeHeading: import("react").ForwardRefExoticComponent<Except<TextProps, "
|
|
4
|
+
export declare const LakeHeading: import("react").ForwardRefExoticComponent<Except<TextProps, "role"> & {
|
|
5
5
|
align?: "left" | "right" | "center" | undefined;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
color?: string | undefined;
|
|
8
8
|
level: 1 | 2 | 3 | 4 | 5 | 6 | "none";
|
|
9
|
+
userSelect?: TextStyle["userSelect"];
|
|
9
10
|
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
10
11
|
} & import("react").RefAttributes<Text>>;
|
|
@@ -16,4 +16,10 @@ const variants = StyleSheet.create({
|
|
|
16
16
|
h5: texts.h5,
|
|
17
17
|
h6: texts.h6,
|
|
18
18
|
});
|
|
19
|
-
export const LakeHeading = forwardRef(({ align = "left", children, color, level, style, variant = "h1", ...props }, forwardedRef) => (_jsx(Text, { ref: forwardedRef,
|
|
19
|
+
export const LakeHeading = forwardRef(({ align = "left", children, color, level, style, userSelect, variant = "h1", ...props }, forwardedRef) => (_jsx(Text, { ref: forwardedRef, role: level === "none" ? undefined : "heading", "aria-level": level === "none" ? undefined : level, style: [
|
|
20
|
+
variants[variant],
|
|
21
|
+
alignments[align],
|
|
22
|
+
isNotNullish(color) && { color },
|
|
23
|
+
isNotNullish(userSelect) && { userSelect },
|
|
24
|
+
style,
|
|
25
|
+
], ...props, children: children })));
|
|
@@ -15,6 +15,5 @@ type Props = {
|
|
|
15
15
|
readOnly?: boolean;
|
|
16
16
|
style?: StyleProp<ViewStyle>;
|
|
17
17
|
};
|
|
18
|
-
export declare const defaultLabelType: LabelType;
|
|
19
18
|
export declare const LakeLabel: ({ label, optionalLabel, extra, readOnly, color, readOnlyColor, type, help, render, actions, style, }: Props) => JSX.Element;
|
|
20
19
|
export {};
|
|
@@ -28,7 +28,7 @@ const styles = StyleSheet.create({
|
|
|
28
28
|
const Label = (props) => {
|
|
29
29
|
return unstable_createElement("label", props);
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
const defaultLabelType = "formSmall";
|
|
32
32
|
export const LakeLabel = ({ label, optionalLabel, extra, readOnly = false, color = "current", readOnlyColor = colors[color].primary, type = defaultLabelType, help, render, actions, style, }) => {
|
|
33
33
|
const [id] = useState(() => uuid());
|
|
34
34
|
const containerRef = useRef(null);
|
|
@@ -40,9 +40,9 @@ export const LakeLabel = ({ label, optionalLabel, extra, readOnly = false, color
|
|
|
40
40
|
target?.focus();
|
|
41
41
|
}
|
|
42
42
|
}, [id]);
|
|
43
|
-
return (_jsxs(Box, { style: [styles.container, style], direction: "row", alignItems: "center", justifyContent: "spaceBetween", children: [_jsxs(View, { style: commonStyles.fill, ref: containerRef, children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", children: [_jsxs(Box, { direction: "row", style: styles.shrink, children: [type === "form" || type === "formSmall" || type === "radioGroup" ? (_jsxs(Label, { onClick: onClick, htmlFor: id, style: [styles.label, readOnly && { color: readOnlyColor }], children: [label, optionalLabel != null ? (_jsxs(_Fragment, { children: [" - ", _jsx(LakeText, { color: colors.gray[400], style: styles.optionalLabel, children: optionalLabel })] })) : null] })) : (_jsxs(LakeText, { variant: "medium", color: readOnlyColor,
|
|
43
|
+
return (_jsxs(Box, { style: [styles.container, style], direction: "row", alignItems: "center", justifyContent: "spaceBetween", children: [_jsxs(View, { style: commonStyles.fill, ref: containerRef, children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", children: [_jsxs(Box, { direction: "row", style: styles.shrink, children: [type === "form" || type === "formSmall" || type === "radioGroup" ? (_jsxs(Label, { onClick: onClick, htmlFor: id, style: [styles.label, readOnly && { color: readOnlyColor }], children: [label, optionalLabel != null ? (_jsxs(_Fragment, { children: [" - ", _jsx(LakeText, { color: colors.gray[400], style: styles.optionalLabel, children: optionalLabel })] })) : null] })) : (_jsxs(LakeText, { variant: "medium", color: readOnlyColor, id: id, children: [label, optionalLabel != null ? (_jsxs(_Fragment, { children: [" - ", _jsx(LakeText, { color: colors.gray[400], style: styles.optionalLabel, children: optionalLabel })] })) : null] })), isNotNullish(extra) && extra()] }), isNotNullish(help) && (_jsxs(_Fragment, { children: [_jsx(Space, { width: 16 }), help] }))] }), _jsx(Space, { height: match(type)
|
|
44
44
|
.with("formSmall", "viewSmall", () => 4)
|
|
45
45
|
.with("form", "view", () => 8)
|
|
46
46
|
.with("radioGroup", () => 12)
|
|
47
|
-
.exhaustive() }), _jsx(View, {
|
|
47
|
+
.exhaustive() }), _jsx(View, { "aria-labelledby": type === "view" || type === "viewSmall" ? id : undefined, children: render(id) })] }), isNotNullish(actions) && (_jsxs(_Fragment, { children: [_jsx(Space, { width: 16 }), actions] }))] }));
|
|
48
48
|
};
|
|
@@ -22,6 +22,9 @@ const styles = StyleSheet.create({
|
|
|
22
22
|
container: {
|
|
23
23
|
...StyleSheet.absoluteFillObject,
|
|
24
24
|
},
|
|
25
|
+
inert: {
|
|
26
|
+
pointerEvents: "none",
|
|
27
|
+
},
|
|
25
28
|
fill: {
|
|
26
29
|
...StyleSheet.absoluteFillObject,
|
|
27
30
|
animationFillMode: "forwards",
|
|
@@ -48,7 +51,7 @@ const styles = StyleSheet.create({
|
|
|
48
51
|
animationKeyframes: {
|
|
49
52
|
"0%": {
|
|
50
53
|
opacity: 0,
|
|
51
|
-
transform:
|
|
54
|
+
transform: "translateY(-20px)",
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
animationDuration: "300ms",
|
|
@@ -58,7 +61,7 @@ const styles = StyleSheet.create({
|
|
|
58
61
|
animationKeyframes: {
|
|
59
62
|
"100%": {
|
|
60
63
|
opacity: 0,
|
|
61
|
-
transform:
|
|
64
|
+
transform: "translateY(-20px)",
|
|
62
65
|
},
|
|
63
66
|
},
|
|
64
67
|
animationDuration: "300ms",
|
|
@@ -128,5 +131,5 @@ export const LakeModal = ({ visible, icon, title, color = "current", children, m
|
|
|
128
131
|
if (rootElement == null) {
|
|
129
132
|
return null;
|
|
130
133
|
}
|
|
131
|
-
return (_jsx(Portal, { container: rootElement, children: _jsxs(View, {
|
|
134
|
+
return (_jsx(Portal, { container: rootElement, children: _jsxs(View, { "aria-modal": true, style: [styles.container, !visible && styles.inert], children: [_jsx(TransitionView, { style: styles.fill, enter: styles.overlayEnter, leave: styles.overlayLeave, children: visible ? _jsx(View, { style: styles.overlay }) : null }), _jsx(Suspense, { fallback: _jsx(LoadingView, { color: backgroundColor.accented, delay: 0 }), children: _jsx(TransitionView, { style: styles.fill, enter: styles.modalEnter, leave: styles.modalLeave, children: visible ? (_jsx(ResponsiveContainer, { style: styles.root, breakpoint: breakpoints.tiny, children: ({ large, small }) => (_jsx(FocusTrap, { autoFocus: true, focusLock: true, returnFocus: true, onEscapeKey: onPressClose, style: styles.trap, children: _jsxs(ScrollView, { style: styles.modalContainer, contentContainerStyle: large ? styles.modalContentContainer : styles.modalContentContainerSmall, children: [onPressClose != null ? (_jsx(Pressable, { onPress: onPressClose, style: styles.pressableOverlay })) : null, _jsxs(View, { style: [large ? styles.modal : styles.modalSmall, { maxWidth }], children: [_jsxs(View, { style: styles.modalHeader, children: [_jsxs(View, { style: styles.modalIconTitle, children: [icon != null ? (_jsx(Icon, { name: icon, size: large ? 40 : 32, color: colors[color][500] })) : null, icon != null && title != null ? _jsx(Space, { height: 12 }) : null, title != null ? (_jsxs(_Fragment, { children: [_jsx(LakeHeading, { level: 2, variant: "h3", children: title }), _jsx(Space, { height: 12 })] })) : null] }), onPressClose != null ? (_jsx(LakeButton, { style: styles.closeButton, mode: "tertiary", onPress: onPressClose, icon: "lake-close" })) : null] }), typeof children == "function" ? children({ large, small }) : children] })] }) })) })) : null }) })] }) }));
|
|
132
135
|
};
|
|
@@ -20,12 +20,12 @@ const styles = StyleSheet.create({
|
|
|
20
20
|
height: INNER_CIRCLE_SIZE,
|
|
21
21
|
width: INNER_CIRCLE_SIZE,
|
|
22
22
|
borderRadius: INNER_CIRCLE_SIZE / 2,
|
|
23
|
-
transform:
|
|
23
|
+
transform: "scale(0)",
|
|
24
24
|
transitionProperty: "transform",
|
|
25
25
|
transitionDuration: "100ms",
|
|
26
26
|
},
|
|
27
27
|
innerCircleDisplay: {
|
|
28
|
-
transform:
|
|
28
|
+
transform: "scale(1)",
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
export const LakeRadio = ({ value, disabled = false, color = "current" }) => (_jsx(View, { style: [
|
|
@@ -34,7 +34,7 @@ export const LakeRadio = ({ value, disabled = false, color = "current" }) => (_j
|
|
|
34
34
|
disabled && {
|
|
35
35
|
borderColor: colors.gray[300],
|
|
36
36
|
},
|
|
37
|
-
],
|
|
37
|
+
], role: "none", children: _jsx(View, { "aria-hidden": !value, style: [
|
|
38
38
|
styles.innerCircle,
|
|
39
39
|
{ backgroundColor: colors[color].primary },
|
|
40
40
|
disabled && {
|
|
@@ -21,6 +21,7 @@ const styles = StyleSheet.create({
|
|
|
21
21
|
backgroundImage: `linear-gradient(to bottom, ${backgroundColor.default}, ${backgroundColor.defaultTransparent})`,
|
|
22
22
|
opacity: 0,
|
|
23
23
|
transition: "200ms ease-in-out opacity",
|
|
24
|
+
pointerEvents: "none",
|
|
24
25
|
},
|
|
25
26
|
visibleTopGradient: {
|
|
26
27
|
opacity: 1,
|
|
@@ -31,5 +32,5 @@ export const LakeScrollView = ({ children, horizontalSafeArea = HORIZONTAL_SAFE_
|
|
|
31
32
|
const onScroll = useCallback((event) => {
|
|
32
33
|
setIsScrolled(event.nativeEvent.contentOffset.y > 0);
|
|
33
34
|
}, []);
|
|
34
|
-
return (_jsxs(View, { style: styles.root, children: [_jsx(ScrollView, { onScroll: onScroll, scrollEventThrottle: 16, style: [styles.container, { marginHorizontal: -horizontalSafeArea }, style], contentContainerStyle: [{ paddingHorizontal: horizontalSafeArea }, contentContainerStyle], children: children }), _jsx(View, { style: [styles.topGradient, isScrolled && styles.visibleTopGradient]
|
|
35
|
+
return (_jsxs(View, { style: styles.root, children: [_jsx(ScrollView, { onScroll: onScroll, scrollEventThrottle: 16, style: [styles.container, { marginHorizontal: -horizontalSafeArea }, style], contentContainerStyle: [{ paddingHorizontal: horizontalSafeArea }, contentContainerStyle], children: children }), _jsx(View, { style: [styles.topGradient, isScrolled && styles.visibleTopGradient] })] }));
|
|
35
36
|
};
|
|
@@ -41,7 +41,7 @@ const styles = StyleSheet.create({
|
|
|
41
41
|
position: "absolute",
|
|
42
42
|
right: 0,
|
|
43
43
|
top: "50%",
|
|
44
|
-
transform:
|
|
44
|
+
transform: "translateY(-50%)",
|
|
45
45
|
padding: 16,
|
|
46
46
|
},
|
|
47
47
|
clear: {
|
|
@@ -69,13 +69,13 @@ const styles = StyleSheet.create({
|
|
|
69
69
|
},
|
|
70
70
|
});
|
|
71
71
|
const CollapsibleSeachField = ({ inputRef, placeholder, initialValue, onChange, setFocused, hasFocus, clear, currentValue, }) => {
|
|
72
|
-
return (_jsxs(View, { children: [_jsx(LakeButton, { mode: "secondary", size: "small",
|
|
72
|
+
return (_jsxs(View, { children: [_jsx(LakeButton, { mode: "secondary", size: "small", ariaLabel: placeholder, icon: "search-filled", onPress: () => {
|
|
73
73
|
setFocused.on();
|
|
74
74
|
}, pill: currentValue !== "" }), _jsx(TransitionView, { style: styles.openSearchFieldContainer, ...animations.fadeAndSlideInFromRight, children: hasFocus ? (_jsx(View, { style: styles.openSearchField, children: _jsx(ExpandedSearchField, { inputRef: inputRef, placeholder: placeholder, initialValue: initialValue, onChange: onChange, setFocused: setFocused, hasFocus: hasFocus, clear: clear, currentValue: currentValue }) })) : null })] }));
|
|
75
75
|
};
|
|
76
76
|
const ExpandedSearchField = ({ inputRef, placeholder, initialValue, onChange, setFocused, hasFocus, clear, }) => {
|
|
77
77
|
const timeoutRef = useRef(null);
|
|
78
|
-
return (_jsxs(View, { style: styles.container, children: [_jsx(LakeTextInput, { ref: inputRef, autoFocus: hasFocus, icon: "search-filled", placeholder: placeholder, defaultValue: initialValue,
|
|
78
|
+
return (_jsxs(View, { style: styles.container, children: [_jsx(LakeTextInput, { ref: inputRef, autoFocus: hasFocus, icon: "search-filled", placeholder: placeholder, defaultValue: initialValue, inputMode: "search", onChangeText: onChange, hideErrors: true, onFocus: () => {
|
|
79
79
|
if (timeoutRef.current != null) {
|
|
80
80
|
clearTimeout(timeoutRef.current);
|
|
81
81
|
}
|
|
@@ -22,9 +22,9 @@ export type SelectProps<V> = {
|
|
|
22
22
|
value?: V;
|
|
23
23
|
onValueChange: (value: V) => void;
|
|
24
24
|
hideErrors?: boolean;
|
|
25
|
-
|
|
25
|
+
id?: string;
|
|
26
26
|
error?: string;
|
|
27
27
|
readOnly?: boolean;
|
|
28
28
|
style?: StyleProp<ViewStyle>;
|
|
29
29
|
};
|
|
30
|
-
export declare function LakeSelect<V>({ title, items, valueStyle, size, color, disabled, mode, placeholder, readOnly,
|
|
30
|
+
export declare function LakeSelect<V>({ title, items, valueStyle, size, color, disabled, mode, placeholder, readOnly, id, matchReferenceWidth, value, error, hideErrors, icon, onValueChange, PopoverFooter, style, }: SelectProps<V>): JSX.Element;
|