@swan-io/lake 13.7.1 → 13.7.3
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
|
@@ -12,6 +12,7 @@ export type SelectProps<V, T extends Item<V> = Item<V>> = {
|
|
|
12
12
|
ref?: Ref<View>;
|
|
13
13
|
placeholder?: string;
|
|
14
14
|
items: T[];
|
|
15
|
+
matchReferenceMinWidth?: boolean;
|
|
15
16
|
matchReferenceWidth?: boolean;
|
|
16
17
|
mode?: "normal" | "borderless";
|
|
17
18
|
title?: string;
|
|
@@ -38,4 +39,4 @@ export type SelectProps<V, T extends Item<V> = Item<V>> = {
|
|
|
38
39
|
hasSearch?: boolean;
|
|
39
40
|
searchPlaceholder?: string;
|
|
40
41
|
};
|
|
41
|
-
export declare const LakeSelect: <V, T extends Item<V> = Item<V>>({ ref, title, items, valueStyle, size, color, disabled, mode, placeholder, readOnly, id, matchReferenceWidth, value, error, hideErrors, icon, onValueChange, disabledItems, renderItem, PopoverFooter, style, hasSearch, searchPlaceholder, }: SelectProps<V, T>) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare const LakeSelect: <V, T extends Item<V> = Item<V>>({ ref, title, items, valueStyle, size, color, disabled, mode, placeholder, readOnly, id, matchReferenceMinWidth, matchReferenceWidth, value, error, hideErrors, icon, onValueChange, disabledItems, renderItem, PopoverFooter, style, hasSearch, searchPlaceholder, }: SelectProps<V, T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -116,7 +116,9 @@ const styles = StyleSheet.create({
|
|
|
116
116
|
filterContainer: {
|
|
117
117
|
flexGrow: 1,
|
|
118
118
|
flexShrink: 1,
|
|
119
|
-
|
|
119
|
+
marginHorizontal: 16,
|
|
120
|
+
marginBottom: 12,
|
|
121
|
+
marginTop: 4,
|
|
120
122
|
},
|
|
121
123
|
filterInput: {
|
|
122
124
|
...texts.regular,
|
|
@@ -140,7 +142,7 @@ const styles = StyleSheet.create({
|
|
|
140
142
|
left: 14,
|
|
141
143
|
},
|
|
142
144
|
});
|
|
143
|
-
export const LakeSelect = ({ ref, title, items, valueStyle, size, color = "current", disabled = false, mode = "normal", placeholder, readOnly = false, id,
|
|
145
|
+
export const LakeSelect = ({ ref, title, items, valueStyle, size, color = "current", disabled = false, mode = "normal", placeholder, readOnly = false, id, matchReferenceMinWidth = true, matchReferenceWidth = false, value, error, hideErrors = false, icon, onValueChange, disabledItems = [], renderItem, PopoverFooter, style, hasSearch = false, searchPlaceholder, }) => {
|
|
144
146
|
var _a;
|
|
145
147
|
const [filter, setFilter] = useState("");
|
|
146
148
|
const [filterFocused, setFilterFocused] = useBoolean(false);
|
|
@@ -228,7 +230,7 @@ export const LakeSelect = ({ ref, title, items, valueStyle, size, color = "curre
|
|
|
228
230
|
styles.itemText,
|
|
229
231
|
styles.selectPlaceholder,
|
|
230
232
|
isSmall && styles.selectSmallPlaceholder,
|
|
231
|
-
], children: placeholder !== null && placeholder !== void 0 ? placeholder : " " }))] }), _jsx(Fill, { minWidth: 8 }), !disabled && (_jsx(Icon, { color: colors.gray[900], name: visible ? "chevron-up-filled" : "chevron-down-filled", size: 16 }))] })] })) }), !hideErrors && (_jsx(LakeText, { variant: "smallRegular", color: colors.negative[500], style: styles.errorText, children: error !== null && error !== void 0 ? error : " " })), _jsxs(Popover, { role: "listbox",
|
|
233
|
+
], children: placeholder !== null && placeholder !== void 0 ? placeholder : " " }))] }), _jsx(Fill, { minWidth: 8 }), !disabled && (_jsx(Icon, { color: colors.gray[900], name: visible ? "chevron-up-filled" : "chevron-down-filled", size: 16 }))] })] })) }), !hideErrors && (_jsx(LakeText, { variant: "smallRegular", color: colors.negative[500], style: styles.errorText, children: error !== null && error !== void 0 ? error : " " })), _jsxs(Popover, { role: "listbox", matchReferenceWidth: matchReferenceWidth, matchReferenceMinWidth: matchReferenceMinWidth, onDismiss: close, referenceRef: inputRef, returnFocus: true, visible: visible, children: [isNotNullish(title) && (_jsxs(_Fragment, { children: [_jsx(LakeText, { variant: "semibold", color: colors.gray[900], style: styles.selectListTitle, children: title }), _jsx(Separator, {})] })), _jsx(FlatList, { role: "list", data: filteredItems, ref: listRef, contentContainerStyle: styles.listContent, onKeyDown: (event) => {
|
|
232
234
|
var _a;
|
|
233
235
|
const { key } = event.nativeEvent;
|
|
234
236
|
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
@@ -31,12 +31,12 @@ const styles = StyleSheet.create({
|
|
|
31
31
|
popoverContainer: {
|
|
32
32
|
position: "absolute",
|
|
33
33
|
display: "flex",
|
|
34
|
+
backgroundColor: backgroundColor.accented,
|
|
34
35
|
},
|
|
35
36
|
popover: {
|
|
36
37
|
pointerEvents: "auto",
|
|
37
38
|
display: "flex",
|
|
38
39
|
flexDirection: "column",
|
|
39
|
-
backgroundColor: backgroundColor.accented,
|
|
40
40
|
borderRadius: radii[8],
|
|
41
41
|
marginVertical: spacings[8],
|
|
42
42
|
overflow: "hidden",
|