ferns-ui 0.34.0 → 0.35.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.
package/src/Tooltip.tsx CHANGED
@@ -118,7 +118,8 @@ const getTooltipPosition = ({
118
118
 
119
119
  interface TooltipProps {
120
120
  children: React.ReactElement;
121
- text: string;
121
+ // If text is undefined, the children will be rendered without a tooltip.
122
+ text?: string;
122
123
  idealDirection?: "top" | "bottom" | "left" | "right";
123
124
  bgColor?: "white" | "lightGray" | "gray" | "darkGray";
124
125
  }
@@ -214,6 +215,12 @@ export const Tooltip = (props: TooltipProps) => {
214
215
  }, [children.props]),
215
216
  };
216
217
 
218
+ // Allow disabling tooltips when there is no string, otherwise you need to wrap the children in a function to
219
+ // determine if there should be a tooltip or not, which gets messy.
220
+ if (!text) {
221
+ return children;
222
+ }
223
+
217
224
  return (
218
225
  <>
219
226
  {visible && (
package/src/Unifier.ts CHANGED
@@ -2,10 +2,11 @@
2
2
  /* eslint-disable @typescript-eslint/no-empty-function */
3
3
 
4
4
  import AsyncStorage from "@react-native-async-storage/async-storage";
5
+ import * as Clipboard from "expo-clipboard";
5
6
  import * as Font from "expo-font";
6
7
  import {FontSource} from "expo-font";
7
8
  import * as Haptics from "expo-haptics";
8
- import {Clipboard, Dimensions, Keyboard, Linking, Platform, Vibration} from "react-native";
9
+ import {Dimensions, Keyboard, Linking, Platform, Vibration} from "react-native";
9
10
 
10
11
  import {PermissionKind, UnifiedTheme} from "./Common";
11
12
  import {requestPermissions} from "./Permissions";
package/src/WithLabel.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
 
3
3
  import {Box} from "./Box";
4
- import {AllColors, JustifyContent, ReactChildren, TextSize} from "./Common";
4
+ import {AlignItems, AllColors, JustifyContent, ReactChildren, TextSize} from "./Common";
5
5
  import {Text} from "./Text";
6
6
 
7
7
  export interface WithLabelProps {
@@ -11,6 +11,7 @@ export interface WithLabelProps {
11
11
  labelInline?: boolean;
12
12
  labelColor?: AllColors;
13
13
  labelJustifyContent?: JustifyContent;
14
+ labelAlignItems?: AlignItems;
14
15
  labelPlacement?: "before" | "after";
15
16
  labelSize?: TextSize;
16
17
  }
@@ -19,6 +20,7 @@ export function WithLabel({
19
20
  label,
20
21
  labelInline,
21
22
  labelJustifyContent,
23
+ labelAlignItems,
22
24
  labelPlacement,
23
25
  labelSize,
24
26
  labelColor,
@@ -30,6 +32,7 @@ export function WithLabel({
30
32
  }
31
33
  return (
32
34
  <Box
35
+ alignItems={labelAlignItems}
33
36
  direction={labelInline ? "row" : "column"}
34
37
  justifyContent={labelJustifyContent}
35
38
  width="100%"