@swan-io/lake 2.7.22 → 2.7.24

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": "2.7.22",
3
+ "version": "2.7.24",
4
4
  "engines": {
5
5
  "node": ">=18.0.0",
6
6
  "yarn": "^1.22.0"
@@ -31,10 +31,7 @@ export declare const SimpleTitleCell: ({ isHighlighted, text, tooltip, }: {
31
31
  togglableOnFocus?: boolean | undefined;
32
32
  containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
33
33
  disabled?: boolean | undefined;
34
- } & import("react").RefAttributes<{
35
- show: () => void;
36
- hide: () => void;
37
- }>, "children"> | undefined;
34
+ }, "children"> | undefined;
38
35
  }) => import("react/jsx-runtime").JSX.Element;
39
36
  export declare const SimpleRegularTextCell: ({ variant, text, textAlign, color, }: {
40
37
  variant?: "light" | "medium" | "semibold" | "regular" | "smallSemibold" | "smallMedium" | "smallRegular" | undefined;
@@ -61,10 +58,7 @@ export declare const CopyableRegularTextCell: ({ variant, text, textToCopy, copy
61
58
  togglableOnFocus?: boolean | undefined;
62
59
  containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
63
60
  disabled?: boolean | undefined;
64
- } & import("react").RefAttributes<{
65
- show: () => void;
66
- hide: () => void;
67
- }>, "children"> | undefined;
61
+ }, "children"> | undefined;
68
62
  }) => import("react/jsx-runtime").JSX.Element;
69
63
  export declare const BalanceCell: ({ value, currency, originalValue, formatCurrency, textAlign, variant, }: {
70
64
  value: number;
@@ -95,10 +89,7 @@ export declare const LinkCell: ({ children, external, onPress, variant, tooltip,
95
89
  togglableOnFocus?: boolean | undefined;
96
90
  containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
97
91
  disabled?: boolean | undefined;
98
- } & import("react").RefAttributes<{
99
- show: () => void;
100
- hide: () => void;
101
- }>, "children"> | undefined;
92
+ }, "children"> | undefined;
102
93
  }) => import("react/jsx-runtime").JSX.Element;
103
94
  export declare const StartAlignedCell: ({ children }: {
104
95
  children: ReactNode;
@@ -29,9 +29,6 @@ export declare const LakeText: import("react").ForwardRefExoticComponent<TextPro
29
29
  togglableOnFocus?: boolean | undefined;
30
30
  containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
31
31
  disabled?: boolean | undefined;
32
- } & import("react").RefAttributes<{
33
- show: () => void;
34
- hide: () => void;
35
- }>, "children"> | undefined;
32
+ }, "children"> | undefined;
36
33
  } & import("react").RefAttributes<Text>>;
37
34
  export {};
@@ -14,11 +14,7 @@ type Props = {
14
14
  containerStyle?: ViewProps["style"];
15
15
  disabled?: boolean;
16
16
  };
17
- type TooltipRef = {
18
- show: () => void;
19
- hide: () => void;
20
- };
21
- export declare const LakeTooltip: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<TooltipRef>>>;
17
+ export declare const LakeTooltip: ({ content, children, ...rest }: Props) => string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
22
18
  export declare const InformationTooltip: ({ text }: {
23
19
  text: string;
24
20
  }) => import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import { usePopper } from "react-popper";
5
5
  import { match } from "ts-pattern";
6
6
  import { colors, shadows } from "../constants/design";
7
7
  import { useHover } from "../hooks/useHover";
8
- import { isNotNullish } from "../utils/nullish";
8
+ import { isNotNullish, isNullishOrEmpty } from "../utils/nullish";
9
9
  import { getRootElement, matchReferenceWidthModifier } from "../utils/popper";
10
10
  import { Icon } from "./Icon";
11
11
  import { LakeText } from "./LakeText";
@@ -83,7 +83,13 @@ const styles = StyleSheet.create({
83
83
  });
84
84
  const isReactText = (node) => ["string", "number"].includes(typeof node);
85
85
  const MAX_WIDTH = "calc(100vw - 20px)";
86
- export const LakeTooltip = memo(forwardRef(({ children, content, describedBy, matchReferenceWidth = false, hideArrow = false, onHide, onShow, placement, width, togglableOnFocus = false, containerStyle, disabled = false, }, forwardedRef) => {
86
+ export const LakeTooltip = ({ content, children, ...rest }) => {
87
+ if (isNullishOrEmpty(content)) {
88
+ return children;
89
+ }
90
+ return (_jsx(Tooltip, { content: content, ...rest, children: children }));
91
+ };
92
+ const Tooltip = memo(forwardRef(({ children, content, describedBy, matchReferenceWidth = false, hideArrow = false, onHide, onShow, placement, width, togglableOnFocus = false, containerStyle, disabled = false, }, forwardedRef) => {
87
93
  const referenceRef = useRef(null);
88
94
  const rootElement = getRootElement(referenceRef.current);
89
95
  const [popperElement, setPopperElement] = useState(null);