@swan-io/lake 15.3.1 → 15.4.0

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.
Files changed (119) hide show
  1. package/package.json +5 -5
  2. package/src/components/Accordion.d.ts +1 -1
  3. package/src/components/AppOpeningAnimation.d.ts +1 -1
  4. package/src/components/AutoWidthImage.d.ts +1 -1
  5. package/src/components/AutocompleteSearchInput.d.ts +1 -1
  6. package/src/components/AutocompleteSearchInput.js +2 -2
  7. package/src/components/Avatar.js +3 -6
  8. package/src/components/BorderedIcon.d.ts +1 -1
  9. package/src/components/BottomPanel.d.ts +1 -1
  10. package/src/components/Box.d.ts +1 -1
  11. package/src/components/Breadcrumbs.d.ts +2 -2
  12. package/src/components/Breadcrumbs.js +3 -5
  13. package/src/components/BulletList.d.ts +10 -0
  14. package/src/components/BulletList.js +12 -0
  15. package/src/components/Cells.d.ts +6 -6
  16. package/src/components/Cells.js +1 -1
  17. package/src/components/ContextMenu.d.ts +2 -2
  18. package/src/components/ContextMenu.js +1 -1
  19. package/src/components/EmptyView.d.ts +1 -1
  20. package/src/components/EmptyView.js +1 -1
  21. package/src/components/Fill.d.ts +1 -1
  22. package/src/components/FlatList.d.ts +1 -1
  23. package/src/components/FlatList.js +3 -3
  24. package/src/components/FlowPresentation.d.ts +1 -1
  25. package/src/components/FocusTrap.d.ts +1 -1
  26. package/src/components/Form.d.ts +120 -123
  27. package/src/components/FullViewportLayer.d.ts +1 -1
  28. package/src/components/Grid.d.ts +1 -1
  29. package/src/components/Icon.js +1 -1
  30. package/src/components/InputError.d.ts +1 -1
  31. package/src/components/LakeAlert.d.ts +1 -1
  32. package/src/components/LakeAlert.js +2 -2
  33. package/src/components/LakeButton.d.ts +2 -2
  34. package/src/components/LakeButton.js +1 -1
  35. package/src/components/LakeCheckbox.d.ts +2 -2
  36. package/src/components/LakeCheckbox.js +2 -2
  37. package/src/components/LakeCombobox.d.ts +1 -1
  38. package/src/components/LakeCopyButton.d.ts +1 -1
  39. package/src/components/LakeDownloadButton.d.ts +1 -1
  40. package/src/components/LakeHeading.d.ts +1 -1
  41. package/src/components/LakeLabel.d.ts +1 -1
  42. package/src/components/LakeLabel.js +2 -2
  43. package/src/components/LakeRadio.d.ts +1 -1
  44. package/src/components/LakeScrollView.d.ts +1 -1
  45. package/src/components/LakeSelect.d.ts +1 -1
  46. package/src/components/LakeSelect.js +8 -10
  47. package/src/components/LakeSlider.d.ts +1 -1
  48. package/src/components/LakeStepper.d.ts +3 -3
  49. package/src/components/LakeStepper.js +3 -3
  50. package/src/components/LakeTagInput.d.ts +1 -1
  51. package/src/components/LakeText.d.ts +1 -1
  52. package/src/components/LakeTextInput.d.ts +1 -1
  53. package/src/components/LakeTextInput.js +1 -1
  54. package/src/components/LakeTooltip.d.ts +2 -2
  55. package/src/components/LakeTooltip.js +2 -2
  56. package/src/components/Link.d.ts +1 -1
  57. package/src/components/ListRightPanel.d.ts +2 -2
  58. package/src/components/LoadingView.d.ts +1 -1
  59. package/src/components/MultiSelect.d.ts +1 -1
  60. package/src/components/MultiSelect.js +2 -2
  61. package/src/components/PlainListView.d.ts +3 -9
  62. package/src/components/PlainListView.js +1 -1
  63. package/src/components/PopoverContent.d.ts +1 -1
  64. package/src/components/Pressable.js +3 -3
  65. package/src/components/ProgressTracker.d.ts +22 -0
  66. package/src/components/ProgressTracker.js +71 -0
  67. package/src/components/ProjectEnvTag.d.ts +1 -1
  68. package/src/components/QuickActions.d.ts +1 -1
  69. package/src/components/QuickActions.js +6 -9
  70. package/src/components/RadioGroup.d.ts +1 -1
  71. package/src/components/RadioGroup.js +1 -1
  72. package/src/components/ReadOnlyFieldList.d.ts +1 -1
  73. package/src/components/ReadOnlyFieldList.js +1 -1
  74. package/src/components/ResponsiveContainer.d.ts +1 -1
  75. package/src/components/RightPanel.d.ts +1 -1
  76. package/src/components/RightPanel.js +1 -1
  77. package/src/components/ScrollView.d.ts +1 -1
  78. package/src/components/SectionList.d.ts +1 -1
  79. package/src/components/SectionList.js +3 -3
  80. package/src/components/SegmentedControl.d.ts +1 -1
  81. package/src/components/SegmentedControl.js +1 -1
  82. package/src/components/Separator.d.ts +1 -1
  83. package/src/components/SidebarNavigationTracker.d.ts +2 -2
  84. package/src/components/SidebarNavigationTracker.js +2 -1
  85. package/src/components/SmsOpeningAnimation.d.ts +1 -1
  86. package/src/components/SortBottomPanel.d.ts +1 -1
  87. package/src/components/Space.d.ts +1 -1
  88. package/src/components/Stack.d.ts +1 -1
  89. package/src/components/StepDots.d.ts +1 -1
  90. package/src/components/Suspendable.d.ts +1 -1
  91. package/src/components/Suspendable.js +1 -1
  92. package/src/components/Svg.d.ts +10 -10
  93. package/src/components/Svg.js +1 -1
  94. package/src/components/SwanLogo.d.ts +1 -1
  95. package/src/components/Switch.d.ts +1 -1
  96. package/src/components/Switch.js +1 -1
  97. package/src/components/TabView.d.ts +1 -1
  98. package/src/components/TabView.js +4 -4
  99. package/src/components/Tag.d.ts +1 -1
  100. package/src/components/Tag.js +1 -1
  101. package/src/components/Tick.d.ts +1 -1
  102. package/src/components/Tile.d.ts +13 -6
  103. package/src/components/Tile.js +32 -6
  104. package/src/components/TilePlaceholder.d.ts +4 -2
  105. package/src/components/TilePlaceholder.js +3 -3
  106. package/src/components/TimePicker.d.ts +2 -2
  107. package/src/components/Toggle.d.ts +1 -1
  108. package/src/components/Toggle.js +1 -1
  109. package/src/components/TransitionGroupView.d.ts +1 -1
  110. package/src/components/TransitionGroupView.js +1 -1
  111. package/src/components/TransitionView.d.ts +1 -1
  112. package/src/components/VirtualizedList.d.ts +2 -2
  113. package/src/components/VirtualizedList.js +2 -2
  114. package/src/components/WithCurrentColor.d.ts +2 -2
  115. package/src/components/WithPartnerAccentColor.d.ts +1 -1
  116. package/src/hooks/useUpdateEffect.js +1 -2
  117. package/src/utils/highlights.js +2 -1
  118. package/src/utils/string.js +1 -1
  119. package/src/utils/svg.js +5 -5
@@ -2,5 +2,5 @@ import { ReactNode } from "react";
2
2
  type Props = {
3
3
  children: ReactNode;
4
4
  };
5
- export declare const ReadOnlyFieldList: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ReadOnlyFieldList: ({ children }: Props) => import("react").JSX.Element;
6
6
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Children } from "react";
3
3
  import { View } from "react-native";
4
4
  import { isNotNullish } from "../utils/nullish";
@@ -9,5 +9,5 @@ type Props = Merge<ViewProps, {
9
9
  breakpoint?: number;
10
10
  children: (context: Context) => ReactNode;
11
11
  }>;
12
- export declare const ResponsiveContainer: ({ breakpoint, children, style, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const ResponsiveContainer: ({ breakpoint, children, style, ...props }: Props) => import("react").JSX.Element;
13
13
  export {};
@@ -7,5 +7,5 @@ type Props = {
7
7
  children: ReactNode | ((context: Context) => ReactNode);
8
8
  onPressClose?: () => void;
9
9
  };
10
- export declare const RightPanel: ({ ref, visible, children, onPressClose }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const RightPanel: ({ ref, visible, children, onPressClose }: Props) => import("react").JSX.Element;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { backgroundColor, breakpoints } from "../constants/design";
@@ -17,4 +17,4 @@ export type ScrollViewProps = ViewProps & {
17
17
  scrollEventThrottle?: number;
18
18
  showsScrollIndicators?: boolean;
19
19
  };
20
- export declare const ScrollView: ({ ref, children, contentContainerStyle, horizontal, both, onScroll, scrollEventThrottle, showsScrollIndicators, style, ...viewProps }: ScrollViewProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const ScrollView: ({ ref, children, contentContainerStyle, horizontal, both, onScroll, scrollEventThrottle, showsScrollIndicators, style, ...viewProps }: ScrollViewProps) => import("react").JSX.Element;
@@ -28,5 +28,5 @@ type Props<T> = {
28
28
  showsScrollIndicators?: boolean;
29
29
  style?: StyleProp<ViewStyle>;
30
30
  };
31
- export declare const SectionList: <T>({ ref, ItemSeparatorComponent, ListEmptyComponent, ListFooterComponent, ListHeaderComponent, contentContainerStyle, horizontal, keyExtractor, onEndReached, onEndReachedThresholdPx, onKeyDown, onScroll, renderItem, renderSectionHeader, role, scrollEventThrottle, sections, showsScrollIndicators, style, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const SectionList: <T>({ ref, ItemSeparatorComponent, ListEmptyComponent, ListFooterComponent, ListHeaderComponent, contentContainerStyle, horizontal, keyExtractor, onEndReached, onEndReachedThresholdPx, onKeyDown, onScroll, renderItem, renderSectionHeader, role, scrollEventThrottle, sections, showsScrollIndicators, style, }: Props<T>) => import("react").JSX.Element;
32
32
  export {};
@@ -1,4 +1,4 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment, useEffect, useId, useRef } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { ScrollView } from "./ScrollView";
@@ -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): re-create an observer only on list length change
20
+ // biome-ignore lint/correctness/useExhaustiveDependencies(sections.length): re-create an observer only on list length change
21
21
  useEffect(() => {
22
22
  const element = scrollTrackerRef.current;
23
23
  if (element != null) {
@@ -12,5 +12,5 @@ type Props<T extends string> = {
12
12
  mobileBreakpoint?: number;
13
13
  onValueChange: (value: T) => void;
14
14
  };
15
- export declare const SegmentedControl: <T extends string>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const SegmentedControl: <T extends string>(props: Props<T>) => import("react").JSX.Element;
16
16
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
3
  import { Pressable, StyleSheet, View } from "react-native";
4
4
  import { backgroundColor, breakpoints, colors, invariantColors, radii, spacings, } from "../constants/design";
@@ -9,5 +9,5 @@ type LineProps = {
9
9
  type Props = LineProps & {
10
10
  children?: ReactNode;
11
11
  };
12
- export declare const Separator: ({ horizontal, space, style, children }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Separator: ({ horizontal, space, style, children }: Props) => import("react").JSX.Element;
13
13
  export {};
@@ -4,9 +4,9 @@ type Props = {
4
4
  contentContainerStyle?: ScrollViewProps["style"];
5
5
  children: ScrollViewProps["children"];
6
6
  };
7
- export declare const SidebarNavigationTracker: ({ style, contentContainerStyle, children }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const SidebarNavigationTracker: ({ style, contentContainerStyle, children }: Props) => import("react").JSX.Element;
8
8
  type MarkerProps = {
9
9
  color: string;
10
10
  };
11
- export declare const SidebarNavigationTrackerActiveMarker: ({ color }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const SidebarNavigationTrackerActiveMarker: ({ color }: MarkerProps) => import("react").JSX.Element;
12
12
  export {};
@@ -32,7 +32,8 @@ const Context = createContext((_) => { });
32
32
  // using `offsetTop` and `offsetHeight` here to avoid calculations
33
33
  // being wrong when ancestor has as CSS transform applied
34
34
  const getCoordinates = (element, guide) => {
35
- var _a, _b;
35
+ var _a;
36
+ var _b;
36
37
  const parentTop = (_b = (_a = guide.parentElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top) !== null && _b !== void 0 ? _b : 0;
37
38
  const elementRect = element.getBoundingClientRect();
38
39
  return { top: elementRect.top - parentTop, height: elementRect.height };
@@ -3,5 +3,5 @@ type Props = {
3
3
  playing?: boolean;
4
4
  style?: StyleProp<ViewStyle>;
5
5
  };
6
- export declare const SmsOpeningAnimation: ({ playing, style }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const SmsOpeningAnimation: ({ playing, style }: Props) => import("react").JSX.Element;
7
7
  export {};
@@ -16,5 +16,5 @@ type Props<T extends string> = {
16
16
  onChange: (value: SortValue<T>) => void;
17
17
  onClose: () => void;
18
18
  };
19
- export declare const SortBottomPanel: <T extends string>({ visible, title, value, fields, onChange, onClose, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const SortBottomPanel: <T extends string>({ visible, title, value, fields, onChange, onClose, }: Props<T>) => import("react").JSX.Element;
20
20
  export {};
@@ -5,5 +5,5 @@ type Props = {
5
5
  width?: SpacingValue;
6
6
  flexGrow?: number;
7
7
  };
8
- export declare const Space: ({ height, width, flexGrow }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Space: ({ height, width, flexGrow }: Props) => import("react").JSX.Element;
9
9
  export {};
@@ -6,5 +6,5 @@ type Props = BoxProps & {
6
6
  ref?: Ref<View>;
7
7
  space?: SpacingValue;
8
8
  };
9
- export declare const Stack: ({ ref, children, space, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Stack: ({ ref, children, space, ...props }: Props) => import("react").JSX.Element;
10
10
  export {};
@@ -2,5 +2,5 @@ type Props<T extends string> = {
2
2
  steps: T[];
3
3
  currentStep: T;
4
4
  };
5
- export declare const StepDots: <T extends string>({ steps, currentStep }: Props<T>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const StepDots: <T extends string>({ steps, currentStep }: Props<T>) => import("react").JSX.Element;
6
6
  export {};
@@ -1,3 +1,3 @@
1
1
  import { SuspenseProps } from "react";
2
- export declare const Suspendable: (props: SuspenseProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Suspendable: (props: SuspenseProps) => import("react").JSX.Element;
3
3
  export declare const useIsSuspendable: () => boolean;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Suspense, createContext, useContext } from "react";
2
+ import { createContext, Suspense, useContext } from "react";
3
3
  const SuspendableContext = createContext(false);
4
4
  export const Suspendable = (props) => {
5
5
  return (_jsx(SuspendableContext.Provider, { value: true, children: _jsx(Suspense, { ...props }) }));
@@ -117,22 +117,22 @@ type PolygonProps = CommonProps & {
117
117
  fill?: string;
118
118
  };
119
119
  export declare const Svg: ({ style, ...props }: SvgProps) => import("react").ReactElement<{
120
- style: ({
121
- display: "flex";
122
- flexBasis: string;
123
- flexGrow: number;
124
- flexShrink: number;
125
- } | import("react-native").StyleProp<import("react-native").ViewStyle>)[];
126
- testID?: string | undefined | undefined;
127
- id?: string | undefined | undefined;
128
- role?: import("react-native").WebRole | undefined;
129
- tabIndex?: 0 | -1 | undefined;
120
+ id?: string | undefined;
121
+ testID?: string | undefined;
130
122
  children?: ReactNode;
131
123
  transformOrigin?: string;
132
124
  height?: number;
133
125
  title?: string;
134
126
  viewBox?: string;
135
127
  width?: number;
128
+ style: ({
129
+ display: "flex";
130
+ flexBasis: string;
131
+ flexGrow: number;
132
+ flexShrink: number;
133
+ } | import("react-native").StyleProp<import("react-native").ViewStyle>)[];
134
+ tabIndex?: 0 | -1;
135
+ role?: import("react-native").WebRole;
136
136
  }, string | import("react").JSXElementConstructor<any>>;
137
137
  export declare const Circle: (props: CircleProps) => import("react").ReactElement<CircleProps, string | import("react").JSXElementConstructor<any>>;
138
138
  export declare const Defs: (props: {
@@ -1,4 +1,4 @@
1
- import { StyleSheet, unstable_createElement as createElement } from "react-native";
1
+ import { unstable_createElement as createElement, StyleSheet } from "react-native";
2
2
  const styles = StyleSheet.create({
3
3
  svg: {
4
4
  display: "flex",
@@ -3,5 +3,5 @@ type Props = {
3
3
  color?: string;
4
4
  style?: StyleProp<ViewStyle>;
5
5
  };
6
- export declare const SwanLogo: ({ color, style }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const SwanLogo: ({ color, style }: Props) => import("react").JSX.Element;
7
7
  export {};
@@ -6,5 +6,5 @@ type Props = {
6
6
  onValueChange?: (value: boolean) => void;
7
7
  disabled?: boolean;
8
8
  };
9
- export declare const Switch: import("react").MemoExoticComponent<({ ref, value, disabled, onValueChange }: Props) => import("react/jsx-runtime").JSX.Element>;
9
+ export declare const Switch: import("react").MemoExoticComponent<({ ref, value, disabled, onValueChange }: Props) => import("react").JSX.Element>;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo } from "react";
3
3
  import { Pressable, StyleSheet, View } from "react-native";
4
4
  import { backgroundColor, colors, shadows } from "../constants/design";
@@ -22,5 +22,5 @@ type Props = {
22
22
  padding?: SpacingValue;
23
23
  sticky?: boolean;
24
24
  };
25
- export declare const TabView: ({ tabs, otherLabel, hideIfSingleItem, sticky, padding, activeTabId, onChange, }: Props) => import("react/jsx-runtime").JSX.Element | null;
25
+ export declare const TabView: ({ tabs, otherLabel, hideIfSingleItem, sticky, padding, activeTabId, onChange, }: Props) => import("react").JSX.Element | null;
26
26
  export {};
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useLocation } from "@swan-io/chicane";
3
3
  import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, } from "react";
4
4
  import { StyleSheet, Text, View, } from "react-native";
5
- import { P, match } from "ts-pattern";
5
+ import { match, P } from "ts-pattern";
6
6
  import { animations, backgroundColor, colors, negativeSpacings, radii, shadows, spacings, texts, } from "../constants/design";
7
7
  import { useHover } from "../hooks/useHover";
8
8
  import { useMergeRefs } from "../hooks/useMergeRefs";
@@ -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): we need to recalculate the underline position when the kept tabs change
294
+ // biome-ignore lint/correctness/useExhaustiveDependencies(collapsed): we need to recalculate the underline position when the collapsed tabs change
295
295
  useEffect(() => {
296
296
  if (isNotNullish(linksRefs.current)) {
297
297
  const values = Object.entries(linksRefs.current);
@@ -13,5 +13,5 @@ type Props = {
13
13
  style?: StyleProp<ViewStyle>;
14
14
  ariaLabel?: string;
15
15
  };
16
- export declare const Tag: ({ children, label, color, size, icon, ariaLabel, onPressRemove, style, }: Props) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const Tag: ({ children, label, color, size, icon, ariaLabel, onPressRemove, style, }: Props) => import("react").JSX.Element;
17
17
  export {};
@@ -74,7 +74,7 @@ export const Tag = ({ children, label, color = "gray", size = "small", icon, ari
74
74
  size === "large" && styles.larger,
75
75
  { backgroundColor: tint50 },
76
76
  style,
77
- ], children: [hasLabel && (_jsx(Box, { alignItems: "center", direction: "row", style: [styles.label, { backgroundColor: tint100, borderColor: tint200 }], children: _jsx(LakeText, { numberOfLines: 1, variant: "smallMedium", style: styles.unselectable, color: primary, children: label }) })), _jsxs(Box, { alignItems: "center", direction: "row", "aria-label": ariaLabel, style: styles.contents, children: [isNotNullish(icon) ? (_jsx(Box, { style: [styles.icon, { width: size === "large" ? spacings[40] : spacings[24] }], alignItems: "center", justifyContent: "center", children: _jsx(Icon, { name: icon, color: primary, size: 16 }) })) : null, children != null ? (_jsx(Box, { direction: "row", alignItems: "center", style: [styles.text, isNotNullish(icon) ? styles.textWithIcon : null], children: isValidElement(children) ? (children) : (_jsx(LakeText, { numberOfLines: 1, variant: "smallMedium", color: primary, style: styles.textContent, children: children })) })) : null] }), onPressRemove != null ? (_jsx(Pressable, { role: "button", onPress: onPressRemove, style: ({ hovered, pressed }) => [
77
+ ], children: [hasLabel && (_jsx(Box, { alignItems: "center", direction: "row", style: [styles.label, { backgroundColor: tint100, borderColor: tint200 }], children: _jsx(LakeText, { numberOfLines: 1, variant: "smallMedium", style: styles.unselectable, color: primary, children: label }) })), _jsxs(Box, { alignItems: "center", direction: "row", "aria-label": ariaLabel, style: styles.contents, children: [isNotNullish(icon) ? (_jsx(Box, { style: [styles.icon, { width: size === "large" ? spacings[40] : spacings[24] }], alignItems: "center", justifyContent: "center", children: _jsx(Icon, { name: icon, color: primary, size: 16 }) })) : null, children != null ? (_jsx(Box, { direction: "row", alignItems: "center", style: [styles.text, isNotNullish(icon) ? styles.textWithIcon : null], children: isValidElement(children) ? (children) : (_jsx(LakeText, { numberOfLines: 1, variant: "smallMedium", color: primary, style: styles.textContent, children: children })) })) : null] }), onPressRemove != null ? (_jsx(Pressable, { role: "button", "aria-label": "dismiss", onPress: onPressRemove, style: ({ hovered, pressed }) => [
78
78
  styles.dismiss,
79
79
  {
80
80
  color: primary,
@@ -4,5 +4,5 @@ type Props = {
4
4
  color: ColorValue;
5
5
  size?: "small" | "medium" | "large";
6
6
  };
7
- export declare const Tick: ({ color, style, size }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Tick: ({ color, style, size }: Props) => import("react").JSX.Element;
8
8
  export {};
@@ -5,7 +5,6 @@ type Props = {
5
5
  icon?: ReactNode;
6
6
  title?: ReactNode;
7
7
  description?: ReactNode;
8
- headerEnd?: ReactNode;
9
8
  paddingVertical?: Spacings;
10
9
  paddingHorizontal?: Spacings;
11
10
  children?: ReactNode;
@@ -18,17 +17,25 @@ type Props = {
18
17
  disabled?: boolean;
19
18
  selected?: boolean;
20
19
  style?: StyleProp<ViewStyle>;
21
- };
22
- export declare const Tile: ({ icon, title, description, headerEnd, footer, flexBasis, children, numberOfLines, paddingVertical, paddingHorizontal, hovered, flexGrow, flexShrink, disabled, selected, style, }: Props) => import("react/jsx-runtime").JSX.Element;
20
+ } & ({
21
+ collapsible: true;
22
+ defaultExpanded?: boolean;
23
+ headerEnd?: never;
24
+ } | {
25
+ collapsible?: false;
26
+ defaultExpanded?: never;
27
+ headerEnd?: ReactNode;
28
+ });
29
+ export declare const Tile: ({ icon, title, description, headerEnd, footer, flexBasis, children, numberOfLines, paddingVertical, paddingHorizontal, hovered, flexGrow, flexShrink, disabled, selected, collapsible, defaultExpanded, style, }: Props) => import("react").JSX.Element;
23
30
  export declare const TileFullWidthContent: ({ children, flexGrow, fitToBottom, }: {
24
31
  children: ReactNode;
25
32
  flexGrow?: number;
26
33
  fitToBottom?: boolean;
27
- }) => import("react/jsx-runtime").JSX.Element;
34
+ }) => import("react").JSX.Element;
28
35
  type TileGridProps = {
29
36
  breakpoint?: number;
30
37
  children: ReactNode;
31
38
  };
32
- export declare const TileGrid: ({ children, breakpoint }: TileGridProps) => import("react/jsx-runtime").JSX.Element;
33
- export declare const TileRows: ({ children, breakpoint }: TileGridProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const TileGrid: ({ children, breakpoint }: TileGridProps) => import("react").JSX.Element;
40
+ export declare const TileRows: ({ children, breakpoint }: TileGridProps) => import("react").JSX.Element;
34
41
  export {};
@@ -1,9 +1,11 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Children, cloneElement, Fragment, useCallback, useState, } from "react";
3
- import { StyleSheet, Text, View } from "react-native";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Children, cloneElement, Fragment, useCallback, useId, useState, } from "react";
3
+ import { Pressable, StyleSheet, Text, View, } from "react-native";
4
4
  import { backgroundColor, colors, negativeSpacings, radii, shadows, spacings, texts, } from "../constants/design";
5
+ import { useDisclosure } from "../hooks/useDisclosure";
5
6
  import { isNotNullish } from "../utils/nullish";
6
7
  import { Box } from "./Box";
8
+ import { Icon } from "./Icon";
7
9
  import { LakeText } from "./LakeText";
8
10
  import { ResponsiveContainer } from "./ResponsiveContainer";
9
11
  import { Space } from "./Space";
@@ -75,9 +77,33 @@ const styles = StyleSheet.create({
75
77
  marginHorizontal: negativeSpacings[32],
76
78
  alignSelf: "stretch",
77
79
  },
80
+ chevron: {
81
+ transitionProperty: "transform",
82
+ transitionDuration: "200ms",
83
+ },
84
+ chevronOpen: {
85
+ transform: "rotate(180deg)",
86
+ },
87
+ collapsibleContent: {
88
+ display: "grid",
89
+ gridTemplateRows: "0fr",
90
+ transitionProperty: "grid-template-rows",
91
+ transitionDuration: "300ms",
92
+ },
93
+ collapsibleContentOpen: {
94
+ gridTemplateRows: "1fr",
95
+ },
96
+ collapsibleInner: {
97
+ overflow: "hidden",
98
+ },
78
99
  });
79
- export const Tile = ({ icon, title, description, headerEnd, footer, flexBasis, children, numberOfLines, paddingVertical = 32, paddingHorizontal = 32, hovered = false, flexGrow = 0, flexShrink = 0, disabled = false, selected, style, }) => {
80
- return (_jsxs(View, { role: "region", style: [
100
+ export const Tile = ({ icon, title, description, headerEnd, footer, flexBasis, children, numberOfLines, paddingVertical = 32, paddingHorizontal = 32, hovered = false, flexGrow = 0, flexShrink = 0, disabled = false, selected, collapsible = false, defaultExpanded = true, style, }) => {
101
+ const contentId = useId();
102
+ const [expanded, { toggle }] = useDisclosure(defaultExpanded);
103
+ const hasHeader = isNotNullish(title) || isNotNullish(headerEnd) || isNotNullish(description) || collapsible;
104
+ const header = (_jsxs(_Fragment, { children: [_jsxs(View, { style: styles.header, children: [_jsxs(View, { style: styles.headerTitleIcon, children: [isNotNullish(icon) && (_jsxs(_Fragment, { children: [icon, _jsx(Space, { height: 12 })] })), isNotNullish(title) && (_jsx(Text, { style: styles.title, role: "heading", "aria-level": 3, children: title }))] }), collapsible ? (_jsx(Icon, { name: "chevron-down-filled", size: 16, color: colors.gray[500], style: [styles.chevron, expanded && styles.chevronOpen] })) : isNotNullish(headerEnd) ? (_jsx(View, { children: headerEnd })) : null] }), isNotNullish(description) && (_jsxs(_Fragment, { children: [isNotNullish(title) && _jsx(Space, { height: 12 }), _jsx(View, { style: styles.descriptionContainer, children: _jsx(LakeText, { numberOfLines: numberOfLines, style: styles.description, children: description }) })] }))] }));
105
+ const content = (_jsxs(_Fragment, { children: [children, isNotNullish(footer) && (_jsx(View, { style: [styles.footer, { marginTop: paddingVertical, marginBottom: -paddingVertical }], children: footer }))] }));
106
+ return (_jsx(View, { role: "region", style: [
81
107
  styles.container,
82
108
  selected === false && styles.unselectedContainer,
83
109
  {
@@ -91,7 +117,7 @@ export const Tile = ({ icon, title, description, headerEnd, footer, flexBasis, c
91
117
  selected === false && hovered && styles.unselectedHoveredContainer,
92
118
  disabled && styles.disabled,
93
119
  style,
94
- ], children: [(isNotNullish(title) || isNotNullish(headerEnd) || isNotNullish(description)) && (_jsxs(View, { style: styles.headerContainer, children: [_jsxs(View, { style: styles.header, children: [_jsxs(View, { style: styles.headerTitleIcon, children: [isNotNullish(icon) && (_jsxs(_Fragment, { children: [icon, _jsx(Space, { height: 12 })] })), isNotNullish(title) && (_jsx(Text, { style: styles.title, role: "heading", "aria-level": 3, children: title }))] }), isNotNullish(headerEnd) ? _jsx(View, { children: headerEnd }) : null] }), isNotNullish(description) && (_jsxs(_Fragment, { children: [isNotNullish(title) && _jsx(Space, { height: 12 }), _jsx(View, { style: styles.descriptionContainer, children: _jsx(LakeText, { numberOfLines: numberOfLines, style: styles.description, children: description }) })] })), isNotNullish(children) && _jsx(Space, { height: 24 })] })), children, isNotNullish(footer) && (_jsx(View, { style: [styles.footer, { marginTop: paddingVertical, marginBottom: -paddingVertical }], children: footer }))] }));
120
+ ], children: collapsible ? (_jsxs(_Fragment, { children: [hasHeader && (_jsx(Pressable, { role: "button", "aria-expanded": expanded, "aria-controls": contentId, onPress: toggle, style: styles.headerContainer, children: header })), _jsx(View, { id: contentId, "aria-hidden": !expanded, style: [styles.collapsibleContent, expanded && styles.collapsibleContentOpen], children: _jsxs(View, { style: styles.collapsibleInner, children: [isNotNullish(children) && hasHeader && _jsx(Space, { height: 24 }), content] }) })] })) : (_jsxs(_Fragment, { children: [hasHeader && (_jsxs(View, { style: styles.headerContainer, children: [header, isNotNullish(children) && _jsx(Space, { height: 24 })] })), content] })) }));
95
121
  };
96
122
  export const TileFullWidthContent = ({ children, flexGrow, fitToBottom = false, }) => {
97
123
  return (_jsx(View, { style: [styles.fullWidthContent, fitToBottom && styles.fitToBottom, { flexGrow }], children: children }));
@@ -1,5 +1,7 @@
1
- export declare const TilePlaceholder: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const TilePlaceholder: ({ collapsed }: {
2
+ collapsed?: boolean;
3
+ }) => import("react").JSX.Element;
2
4
  export declare const TileGridPlaceholder: ({ numberOfItems, withTabs, }: {
3
5
  numberOfItems?: number;
4
6
  withTabs?: boolean;
5
- }) => import("react/jsx-runtime").JSX.Element;
7
+ }) => import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { StyleSheet, View } from "react-native";
4
4
  import { colors, radii } from "../constants/design";
@@ -42,8 +42,8 @@ const styles = StyleSheet.create({
42
42
  paddingTop: 61,
43
43
  },
44
44
  });
45
- export const TilePlaceholder = () => {
46
- return (_jsxs(Tile, { children: [_jsx(View, { style: styles.placeholderTitle }), _jsx(Space, { height: 24 }), _jsxs(View, { style: styles.content, children: [_jsx(View, { style: styles.placeholderText }), _jsx(View, { style: styles.placeholderText }), _jsx(View, { style: styles.placeholderText }), _jsx(View, { style: styles.placeholderText })] })] }));
45
+ export const TilePlaceholder = ({ collapsed = false }) => {
46
+ return (_jsxs(Tile, { children: [_jsx(View, { style: styles.placeholderTitle }), !collapsed && (_jsxs(_Fragment, { children: [_jsx(Space, { height: 24 }), _jsxs(View, { style: styles.content, children: [_jsx(View, { style: styles.placeholderText }), _jsx(View, { style: styles.placeholderText }), _jsx(View, { style: styles.placeholderText }), _jsx(View, { style: styles.placeholderText })] })] }))] }));
47
47
  };
48
48
  export const TileGridPlaceholder = ({ numberOfItems = 2, withTabs = true, }) => {
49
49
  return (_jsx(View, { style: withTabs && styles.withTabs, children: _jsx(TileGrid, { children: useMemo(() => Array(numberOfItems)
@@ -30,7 +30,7 @@ export type TimePickerProps = {
30
30
  hideErrors?: boolean;
31
31
  noSuggestionLabel: string;
32
32
  };
33
- export declare const TimePicker: ({ value, onChangeText, suggestionStart, suggestionEnd, intervalInMinutes, nbMaxSuggestions, suggestionSuffix, readOnly, disabled, error, hideErrors, noSuggestionLabel, }: TimePickerProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const TimePicker: ({ value, onChangeText, suggestionStart, suggestionEnd, intervalInMinutes, nbMaxSuggestions, suggestionSuffix, readOnly, disabled, error, hideErrors, noSuggestionLabel, }: TimePickerProps) => import("react").JSX.Element;
34
34
  export type TimeRangePickerProps = {
35
35
  value: {
36
36
  start?: string;
@@ -51,5 +51,5 @@ export type TimeRangePickerProps = {
51
51
  hoursLabel: string;
52
52
  noSuggestionLabel: string;
53
53
  };
54
- export declare const TimeRangePicker: ({ value, onChange, intervalInMinutes, nbMaxSuggestions, readOnly, disabled, error, startLabel, endLabel, minutesLabel, hoursLabel, noSuggestionLabel, }: TimeRangePickerProps) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const TimeRangePicker: ({ value, onChange, intervalInMinutes, nbMaxSuggestions, readOnly, disabled, error, startLabel, endLabel, minutesLabel, hoursLabel, noSuggestionLabel, }: TimeRangePickerProps) => import("react").JSX.Element;
55
55
  export {};
@@ -5,5 +5,5 @@ type Props = {
5
5
  labelOn: string;
6
6
  onToggle: (value: boolean) => void;
7
7
  };
8
- export declare const Toggle: ({ compact, value, labelOff, labelOn, onToggle }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Toggle: ({ compact, value, labelOff, labelOn, onToggle }: Props) => import("react").JSX.Element;
9
9
  export {};
@@ -54,7 +54,7 @@ export const Toggle = ({ compact = false, value, labelOff, labelOn, onToggle })
54
54
  const [itemsWidth, setItemsWidth] = useState();
55
55
  const onViewRef = useRef(null);
56
56
  const offViewRef = useRef(null);
57
- // biome-ignore lint/correctness/useExhaustiveDependencies(compact):
57
+ // biome-ignore lint/correctness/useExhaustiveDependencies(compact): rerun effect only when compact changes
58
58
  useEffect(() => {
59
59
  // batch measurements
60
60
  setTimeout(() => {
@@ -7,5 +7,5 @@ type Props = {
7
7
  childStyle?: StyleProp<ViewStyle>;
8
8
  children: ReactNode;
9
9
  };
10
- export declare const TransitionGroupView: ({ children, enter, leave, style, childStyle }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const TransitionGroupView: ({ children, enter, leave, style, childStyle }: Props) => import("react").JSX.Element;
11
11
  export {};
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Array, Option } from "@swan-io/boxed";
3
3
  import { Children, useMemo, useReducer, useRef } from "react";
4
4
  import { View } from "react-native";
5
- import { P, match } from "ts-pattern";
5
+ import { match, P } from "ts-pattern";
6
6
  import { usePreviousValue } from "../hooks/usePreviousValue";
7
7
  import { TransitionView } from "./TransitionView";
8
8
  export const TransitionGroupView = ({ children, enter, leave, style, childStyle }) => {
@@ -7,5 +7,5 @@ type Props = {
7
7
  children: ReactNode | null;
8
8
  onLeave?: () => void;
9
9
  };
10
- export declare const TransitionView: ({ enter, leave, style, children, onLeave }: Props) => import("react/jsx-runtime").JSX.Element | null;
10
+ export declare const TransitionView: ({ enter, leave, style, children, onLeave }: Props) => import("react").JSX.Element | null;
11
11
  export {};
@@ -49,7 +49,7 @@ export type VirtualizedListProps<T, ExtraInfo> = {
49
49
  width: number;
50
50
  }) => void;
51
51
  };
52
- export declare const VirtualizedList: <T, ExtraInfo>({ variant, data, stickedToStartColumns, columns, stickedToEndColumns, headerHeight, rowHeight, renderThreshold, onEndReached, onEndReachedThreshold, loading, extraInfo, keyExtractor, marginHorizontal, renderEmptyList, onColumnResize, getRowLink, }: VirtualizedListProps<T, ExtraInfo>) => import("react/jsx-runtime").JSX.Element;
52
+ export declare const VirtualizedList: <T, ExtraInfo>({ variant, data, stickedToStartColumns, columns, stickedToEndColumns, headerHeight, rowHeight, renderThreshold, onEndReached, onEndReachedThreshold, loading, extraInfo, keyExtractor, marginHorizontal, renderEmptyList, onColumnResize, getRowLink, }: VirtualizedListProps<T, ExtraInfo>) => import("react").JSX.Element;
53
53
  type VirtualizedListPlaceholderProps = {
54
54
  count: number;
55
55
  rowHeight: number;
@@ -57,5 +57,5 @@ type VirtualizedListPlaceholderProps = {
57
57
  headerHeight?: number;
58
58
  marginHorizontal?: string;
59
59
  };
60
- export declare const VirtualizedListPlaceholder: ({ count, rowHeight, groupHeaderHeight, headerHeight, marginHorizontal, }: VirtualizedListPlaceholderProps) => import("react/jsx-runtime").JSX.Element;
60
+ export declare const VirtualizedListPlaceholder: ({ count, rowHeight, groupHeaderHeight, headerHeight, marginHorizontal, }: VirtualizedListPlaceholderProps) => import("react").JSX.Element;
61
61
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Option } from "@swan-io/boxed";
3
3
  import { cloneElement, memo, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, } from "react";
4
4
  import { StyleSheet, View } from "react-native";
@@ -374,7 +374,7 @@ export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns,
374
374
  .toUndefined();
375
375
  }, [onLayoutUpdate]);
376
376
  // tracks if the threshold to initiate the next data load is reached
377
- // biome-ignore lint/correctness/useExhaustiveDependencies(data.length):
377
+ // biome-ignore lint/correctness/useExhaustiveDependencies(data.length): re-create an observer on list length change
378
378
  useEffect(() => {
379
379
  const scrollTracker = scrollTrackerRef.current;
380
380
  if (scrollTracker != null) {
@@ -6,7 +6,7 @@ type Props = {
6
6
  style?: ViewProps["style"];
7
7
  children: ReactNode;
8
8
  };
9
- export declare const CurrentColorContext: import("react").Context<"gray" | "live" | "sandbox" | "positive" | "warning" | "negative" | "current" | "partner" | "swan" | "shakespear" | "darkPink" | "sunglow" | "mediumSladeBlue" | undefined>;
9
+ export declare const CurrentColorContext: import("react").Context<"current" | "darkPink" | "gray" | "live" | "mediumSladeBlue" | "negative" | "partner" | "positive" | "sandbox" | "shakespear" | "sunglow" | "swan" | "warning" | undefined>;
10
10
  export declare const useCurrentColor: (containerRef: RefObject<HTMLElement | null>, variant: ColorVariants | undefined) => void;
11
- export declare const WithCurrentColor: ({ variant, style, children }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const WithCurrentColor: ({ variant, style, children }: Props) => import("react").JSX.Element;
12
12
  export {};
@@ -4,5 +4,5 @@ type Props = {
4
4
  children: ReactNode;
5
5
  scoped?: boolean;
6
6
  };
7
- export declare const WithPartnerAccentColor: ({ color, scoped, children }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const WithPartnerAccentColor: ({ color, scoped, children }: Props) => import("react").JSX.Element;
8
8
  export {};
@@ -2,11 +2,10 @@ 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):
7
5
  useEffect(() => {
8
6
  if (!isFirstMount) {
9
7
  return effect();
10
8
  }
9
+ // biome-ignore lint/correctness/useExhaustiveDependencies: rerun effect only when deps change
11
10
  }, deps);
12
11
  };
@@ -1,7 +1,8 @@
1
1
  import { isNullishOrEmpty } from "./nullish";
2
2
  const highlightName = "lake-highlight";
3
3
  export const setHighlightApi = (text, element, minLength = 2) => {
4
- var _a, _b;
4
+ var _a;
5
+ var _b;
5
6
  if (!("highlights" in CSS)) {
6
7
  return;
7
8
  }
@@ -233,4 +233,4 @@ export const upperCase = (value) => value.toUpperCase();
233
233
  export const capitalize = (value) => `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
234
234
  export const uncapitalize = (value) => `${value.charAt(0).toLowerCase()}${value.slice(1)}`;
235
235
  export const optionFromString = (value) => value !== "" ? Option.Some(value) : Option.None();
236
- export const getFlagGlyphName = (flag) => { var _a, _b, _c, _d; return `${(_b = (_a = flag.codePointAt(0)) === null || _a === void 0 ? void 0 : _a.toString(16)) !== null && _b !== void 0 ? _b : ""}-${(_d = (_c = flag.codePointAt(2)) === null || _c === void 0 ? void 0 : _c.toString(16)) !== null && _d !== void 0 ? _d : ""}`; };
236
+ export const getFlagGlyphName = (flag) => { var _a, _b; var _c, _d; return `${(_c = (_a = flag.codePointAt(0)) === null || _a === void 0 ? void 0 : _a.toString(16)) !== null && _c !== void 0 ? _c : ""}-${(_d = (_b = flag.codePointAt(2)) === null || _b === void 0 ? void 0 : _b.toString(16)) !== null && _d !== void 0 ? _d : ""}`; };