@swan-io/lake 13.11.1 → 13.11.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/lake",
3
- "version": "13.11.1",
3
+ "version": "13.11.2",
4
4
  "engines": {
5
5
  "node": ">22.12.0"
6
6
  },
@@ -34,9 +34,10 @@ export type SelectProps<V, T extends Item<V> = Item<V>> = {
34
34
  hideErrors?: boolean;
35
35
  id?: string;
36
36
  error?: string;
37
+ help?: string;
37
38
  readOnly?: boolean;
38
39
  style?: StyleProp<ViewStyle>;
39
40
  hasSearch?: boolean;
40
41
  searchPlaceholder?: string;
41
42
  };
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;
43
+ 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, help, icon, onValueChange, disabledItems, renderItem, PopoverFooter, style, hasSearch, searchPlaceholder, }: SelectProps<V, T>) => import("react/jsx-runtime").JSX.Element;
@@ -102,7 +102,7 @@ const styles = StyleSheet.create({
102
102
  whiteSpace: "nowrap",
103
103
  textOverflow: "ellipsis",
104
104
  },
105
- errorText: {
105
+ additionalText: {
106
106
  paddingTop: spacings[4],
107
107
  },
108
108
  focusedInput: {
@@ -153,7 +153,7 @@ const styles = StyleSheet.create({
153
153
  color: colors.gray.primary,
154
154
  },
155
155
  });
156
- 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, }) => {
156
+ 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, help, icon, onValueChange, disabledItems = [], renderItem, PopoverFooter, style, hasSearch = false, searchPlaceholder, }) => {
157
157
  var _a;
158
158
  const [filter, setFilter] = useState("");
159
159
  const [filterFocused, setFilterFocused] = useBoolean(false);
@@ -242,7 +242,7 @@ export const LakeSelect = ({ ref, title, items, valueStyle, size, color = "curre
242
242
  styles.itemText,
243
243
  styles.selectPlaceholder,
244
244
  isSmall && styles.selectSmallPlaceholder,
245
- ], 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: [hasSearch ? ListHeaderComponent : undefined, _jsxs(View, { style: styles.list, 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, ListEmptyComponent: ListEmptyComponent, onKeyDown: (event) => {
245
+ ], 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(Box, { direction: "row", style: styles.additionalText, 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 : " " })) })), _jsxs(Popover, { role: "listbox", matchReferenceWidth: matchReferenceWidth, matchReferenceMinWidth: matchReferenceMinWidth, onDismiss: close, referenceRef: inputRef, returnFocus: true, visible: visible, children: [hasSearch ? ListHeaderComponent : undefined, _jsxs(View, { style: styles.list, 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, ListEmptyComponent: ListEmptyComponent, onKeyDown: (event) => {
246
246
  var _a;
247
247
  const { key } = event.nativeEvent;
248
248
  if (key === "ArrowDown" || key === "ArrowUp") {
@@ -43,7 +43,7 @@ const styles = StyleSheet.create({
43
43
  justifyContent: "center",
44
44
  alignItems: "center",
45
45
  paddingVertical: 12,
46
- paddingHorizontal: 12,
46
+ paddingHorizontal: 16,
47
47
  borderRadius: 30,
48
48
  },
49
49
  itemSelected: {