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/dist/Avatar.d.ts +14 -0
- package/dist/Avatar.js +73 -8
- package/dist/Avatar.js.map +1 -1
- package/dist/Box.d.ts +1 -15
- package/dist/Box.js +185 -182
- package/dist/Box.js.map +1 -1
- package/dist/Common.d.ts +8 -5
- package/dist/IconButton.d.ts +6 -1
- package/dist/IconButton.js +12 -3
- package/dist/IconButton.js.map +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Switch.js.map +1 -1
- package/dist/TableRow.js.map +1 -1
- package/dist/TextField.js +3 -3
- package/dist/TextField.js.map +1 -1
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +5 -0
- package/dist/Tooltip.js.map +1 -1
- package/dist/Unifier.js +2 -1
- package/dist/Unifier.js.map +1 -1
- package/dist/WithLabel.d.ts +3 -2
- package/dist/WithLabel.js +2 -2
- package/dist/WithLabel.js.map +1 -1
- package/package.json +3 -2
- package/src/Avatar.tsx +177 -50
- package/src/Box.tsx +109 -100
- package/src/Common.ts +9 -9
- package/src/IconButton.tsx +27 -1
- package/src/Switch.tsx +1 -1
- package/src/TableRow.tsx +1 -1
- package/src/TextField.tsx +3 -3
- package/src/Tooltip.tsx +8 -1
- package/src/Unifier.ts +2 -1
- package/src/WithLabel.tsx +4 -1
package/src/Tooltip.tsx
CHANGED
|
@@ -118,7 +118,8 @@ const getTooltipPosition = ({
|
|
|
118
118
|
|
|
119
119
|
interface TooltipProps {
|
|
120
120
|
children: React.ReactElement;
|
|
121
|
-
text
|
|
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 {
|
|
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%"
|