@swan-io/lake 12.2.11 → 12.2.13

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": "12.2.11",
3
+ "version": "12.2.13",
4
4
  "engines": {
5
5
  "node": "^22.12.0"
6
6
  },
@@ -127,8 +127,8 @@ export const BreadcrumbsRoot = ({ rootLevelCrumbs = emptyCrumbArray, children })
127
127
  setRootCrumbs(rootLevelCrumbs.map(crumb => ({ id: uuid(), crumb, isRootCrumb: true })));
128
128
  }, [rootLevelCrumbs]);
129
129
  const orderedCrumbs = useMemo(() => [...crumbs].sort((a, b) => { var _a, _b; return (((_a = b.index) !== null && _a !== void 0 ? _a : -1) > ((_b = a.index) !== null && _b !== void 0 ? _b : -1) ? -1 : 1); }), [crumbs]);
130
- // biome-ignore lint/correctness/useExhaustiveDependencies(setCrumbs): _
131
- // biome-ignore lint/correctness/useExhaustiveDependencies(currentIndexRef): _
130
+ // biome-ignore lint/correctness/useExhaustiveDependencies(setCrumbs):
131
+ // biome-ignore lint/correctness/useExhaustiveDependencies(currentIndexRef):
132
132
  const value = useMemo(() => [rootCrumbs, orderedCrumbs, setCrumbs, currentIndexRef], [rootCrumbs, orderedCrumbs, setCrumbs, currentIndexRef]);
133
133
  return _jsx(BreadcrumbsContext.Provider, { value: value, children: children });
134
134
  };
@@ -15,8 +15,8 @@ export const FlatList = ({ ref, ItemSeparatorComponent, ListEmptyComponent, List
15
15
  const scrollTrackerStyle = horizontal
16
16
  ? { top: 0, width: onEndReachedThresholdPx }
17
17
  : { left: 0, height: onEndReachedThresholdPx };
18
- // biome-ignore lint/correctness/useExhaustiveDependencies(onEndReached): _
19
- // biome-ignore lint/correctness/useExhaustiveDependencies(data.length): _
18
+ // biome-ignore lint/correctness/useExhaustiveDependencies(onEndReached):
19
+ // biome-ignore lint/correctness/useExhaustiveDependencies(data.length):
20
20
  useEffect(() => {
21
21
  const element = scrollTrackerRef.current;
22
22
  if (element != null) {
@@ -39,7 +39,7 @@ const styles = StyleSheet.create({
39
39
  export const LakeCheckbox = ({ value, color = "current", disabled = false, isError = false, }) => {
40
40
  const isFirstRender = useRef(true);
41
41
  const [shouldAnimate, setShouldAnimate] = useState(false);
42
- // biome-ignore lint/correctness/useExhaustiveDependencies(value): _
42
+ // biome-ignore lint/correctness/useExhaustiveDependencies(value):
43
43
  useEffect(() => {
44
44
  if (!isFirstRender.current) {
45
45
  setShouldAnimate(true);
@@ -151,7 +151,7 @@ export const MultiSelect = ({ color = "gray", disabled = false, emptyResultText,
151
151
  setFilter("");
152
152
  }
153
153
  }, [visible]);
154
- // biome-ignore lint/correctness/useExhaustiveDependencies(values): _
154
+ // biome-ignore lint/correctness/useExhaustiveDependencies(values):
155
155
  useEffect(() => {
156
156
  var _a, _b;
157
157
  if (shouldScrollToBottomRef.current) {
@@ -17,7 +17,7 @@ const styles = StyleSheet.create({
17
17
  },
18
18
  });
19
19
  const getPressable = (
20
- // biome-ignore lint/suspicious/noExplicitAny: _
20
+ // biome-ignore lint/suspicious/noExplicitAny:
21
21
  Component, config = {}) => {
22
22
  const { applyPressStyle = true } = config;
23
23
  return (props) => {
@@ -62,14 +62,14 @@ Component, config = {}) => {
62
62
  onHoverEnd: onHoverOut,
63
63
  });
64
64
  const interactionState = { hovered, focused, pressed };
65
- // biome-ignore lint/correctness/useExhaustiveDependencies(hostRef): _
65
+ // biome-ignore lint/correctness/useExhaustiveDependencies(hostRef):
66
66
  const blurHandler = useCallback((e) => {
67
67
  if (e.nativeEvent.target === hostRef.current) {
68
68
  setFocused(false);
69
69
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
70
70
  }
71
71
  }, [hostRef, setFocused, onBlur]);
72
- // biome-ignore lint/correctness/useExhaustiveDependencies(hostRef): _
72
+ // biome-ignore lint/correctness/useExhaustiveDependencies(hostRef):
73
73
  const focusHandler = useCallback((e) => {
74
74
  if (e.nativeEvent.target === hostRef.current) {
75
75
  setFocused(true);
@@ -16,8 +16,8 @@ export const SectionList = ({ ref, ItemSeparatorComponent, ListEmptyComponent, L
16
16
  const scrollTrackerStyle = horizontal
17
17
  ? { top: 0, width: onEndReachedThresholdPx }
18
18
  : { left: 0, height: onEndReachedThresholdPx };
19
- // biome-ignore lint/correctness/useExhaustiveDependencies(onEndReached): _
20
- // biome-ignore lint/correctness/useExhaustiveDependencies(sections.length): _
19
+ // biome-ignore lint/correctness/useExhaustiveDependencies(onEndReached):
20
+ // biome-ignore lint/correctness/useExhaustiveDependencies(sections.length):
21
21
  useEffect(() => {
22
22
  const element = scrollTrackerRef.current;
23
23
  if (element != null) {
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { P, match } from "ts-pattern";
@@ -110,9 +110,9 @@ export const SegmentedControl = ({ selected, items, onValueChange, minItemWidth
110
110
  },
111
111
  ] }), items.map(item => (_jsxs(Pressable, { style: styles.itemDesktop, onPress: () => {
112
112
  onValueChange(item.id);
113
- }, children: [isNotNullish(item.icon) &&
114
- match(item)
115
- .with({ icon: P.nonNullable, activeIcon: P.nonNullable }, () => (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id) === item.id ? selectedItem.activeIcon : item.icon)
116
- .with({ icon: P.nonNullable }, () => item.icon)
117
- .otherwise(() => null), _jsx(Space, { height: 8, width: 12 }), _jsx(LakeText, { color: colors.gray[900], numberOfLines: 1, variant: "regular", style: styles.itemText, children: item.name })] }, item.id)))] })) }));
113
+ }, children: [_jsxs(_Fragment, { children: [isNotNullish(item.icon) &&
114
+ match(item)
115
+ .with({ icon: P.nonNullable, activeIcon: P.nonNullable }, () => (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id) === item.id ? selectedItem.activeIcon : item.icon)
116
+ .with({ icon: P.nonNullable }, () => item.icon)
117
+ .otherwise(() => null), _jsx(Space, { height: 8, width: 12 })] }), _jsx(LakeText, { color: colors.gray[900], numberOfLines: 1, variant: "regular", style: styles.itemText, children: item.name })] }, item.id)))] })) }));
118
118
  };
@@ -290,8 +290,8 @@ export const TabView = ({ tabs, otherLabel, hideIfSingleItem = true, sticky = fa
290
290
  const location = useLocation();
291
291
  const { path } = location;
292
292
  const currentLocationURL = location.toString();
293
- // biome-ignore lint/correctness/useExhaustiveDependencies(kept): _
294
- // biome-ignore lint/correctness/useExhaustiveDependencies(collapsed): _
293
+ // biome-ignore lint/correctness/useExhaustiveDependencies(kept):
294
+ // biome-ignore lint/correctness/useExhaustiveDependencies(collapsed):
295
295
  useEffect(() => {
296
296
  if (isNotNullish(linksRefs.current)) {
297
297
  const values = Object.entries(linksRefs.current);
@@ -59,11 +59,11 @@ export const Toggle = ({ onToggle, value, disabled = false, mode = "desktop", on
59
59
  }));
60
60
  }, () => { });
61
61
  }, [value]);
62
- // biome-ignore lint/correctness/useExhaustiveDependencies(reajustLayout): _
63
- // biome-ignore lint/correctness/useExhaustiveDependencies(value): _
64
- // biome-ignore lint/correctness/useExhaustiveDependencies(isMobileMode): _
65
- // biome-ignore lint/correctness/useExhaustiveDependencies(onLabel): _
66
- // biome-ignore lint/correctness/useExhaustiveDependencies(offLabel): _
62
+ // biome-ignore lint/correctness/useExhaustiveDependencies(reajustLayout):
63
+ // biome-ignore lint/correctness/useExhaustiveDependencies(value):
64
+ // biome-ignore lint/correctness/useExhaustiveDependencies(isMobileMode):
65
+ // biome-ignore lint/correctness/useExhaustiveDependencies(onLabel):
66
+ // biome-ignore lint/correctness/useExhaustiveDependencies(offLabel):
67
67
  useEffect(reajustLayout, [reajustLayout, value, isMobileMode, onLabel, offLabel]);
68
68
  return (_jsxs(Pressable, { style: [styles.switch, disabled && commonStyles.disabled], onPress: () => onToggle(!value), "aria-disabled": disabled, "aria-checked": value, disabled: disabled, ref: containerRef, role: "switch", onLayout: reajustLayout, children: [_jsx(View, { style: [
69
69
  styles.handle,
@@ -273,7 +273,7 @@ export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns,
273
273
  .toUndefined();
274
274
  }, [onLayoutUpdate]);
275
275
  // tracks if the threshold to initiate the next data load is reached
276
- // biome-ignore lint/correctness/useExhaustiveDependencies(data.length): _
276
+ // biome-ignore lint/correctness/useExhaustiveDependencies(data.length):
277
277
  useEffect(() => {
278
278
  const scrollTracker = scrollTrackerRef.current;
279
279
  if (scrollTracker != null) {
@@ -2,9 +2,11 @@ import { useEffect } from "react";
2
2
  import { useFirstMountState } from "./useFirstMountState";
3
3
  export const useUpdateEffect = (effect, deps) => {
4
4
  const isFirstMount = useFirstMountState();
5
+ // biome-ignore lint/correctness/useExhaustiveDependencies(effect):
6
+ // biome-ignore lint/correctness/useExhaustiveDependencies(isFirstMount):
5
7
  useEffect(() => {
6
8
  if (!isFirstMount) {
7
9
  return effect();
8
- } // biome-ignore lint/correctness/useExhaustiveDependencies: _
10
+ }
9
11
  }, deps);
10
12
  };