ferns-ui 0.22.5 → 0.23.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/Button.d.ts +2 -1
- package/dist/Button.js +2 -2
- package/dist/Button.js.map +1 -1
- package/dist/Common.d.ts +1 -14
- package/dist/Common.js.map +1 -1
- package/dist/FernsProvider.d.ts +4 -0
- package/dist/FernsProvider.js +7 -0
- package/dist/FernsProvider.js.map +1 -0
- package/dist/IconButton.d.ts +21 -3
- package/dist/IconButton.js +44 -31
- package/dist/IconButton.js.map +1 -1
- package/dist/InfoTooltipButton.d.ts +8 -0
- package/dist/InfoTooltipButton.js +6 -0
- package/dist/InfoTooltipButton.js.map +1 -0
- package/dist/SelectList.js +26 -4
- package/dist/SelectList.js.map +1 -1
- package/dist/TapToEdit.js +17 -0
- package/dist/TapToEdit.js.map +1 -1
- package/dist/Toast.d.ts +10 -0
- package/dist/Toast.js +40 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Tooltip.d.ts +9 -0
- package/dist/Tooltip.js +170 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/src/Button.tsx +3 -1
- package/src/Common.ts +2 -15
- package/src/FernsProvider.tsx +20 -0
- package/src/IconButton.tsx +131 -79
- package/src/InfoTooltipButton.tsx +23 -0
- package/src/SelectList.tsx +25 -3
- package/src/TapToEdit.tsx +21 -0
- package/src/Toast.tsx +87 -0
- package/src/Tooltip.tsx +259 -0
- package/src/index.tsx +4 -0
- package/README.md +0 -22
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,UAAU,EAGV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|
export * from "./ErrorBoundary";
|
|
15
15
|
export * from "./ErrorPage";
|
|
16
|
+
export * from "./FernsProvider";
|
|
16
17
|
export * from "./FlatList";
|
|
17
18
|
export * from "./Field";
|
|
18
19
|
export * from "./Form";
|
|
@@ -22,6 +23,7 @@ export * from "./Icon";
|
|
|
22
23
|
export * from "./IconButton";
|
|
23
24
|
export * from "./Image";
|
|
24
25
|
export * from "./ImageBackground";
|
|
26
|
+
export * from "./InfoTooltipButton";
|
|
25
27
|
export * from "./Link";
|
|
26
28
|
export * from "./Mask";
|
|
27
29
|
export * from "./Meta";
|
|
@@ -38,6 +40,8 @@ export * from "./TapToEdit";
|
|
|
38
40
|
export * from "./Text";
|
|
39
41
|
export * from "./TextArea";
|
|
40
42
|
export * from "./TextField";
|
|
43
|
+
export * from "./Tooltip";
|
|
44
|
+
export * from "./Toast";
|
|
41
45
|
export * from "./UnifiedScreens";
|
|
42
46
|
export * from "./Unifier";
|
|
43
47
|
export * from "./WithLabel";
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./CheckBox";
|
|
|
13
13
|
export * from "./DateTimeActionSheet";
|
|
14
14
|
export * from "./ErrorBoundary";
|
|
15
15
|
export * from "./ErrorPage";
|
|
16
|
+
export * from "./FernsProvider";
|
|
16
17
|
export * from "./FlatList";
|
|
17
18
|
export * from "./Field";
|
|
18
19
|
export * from "./Form";
|
|
@@ -22,6 +23,7 @@ export * from "./Icon";
|
|
|
22
23
|
export * from "./IconButton";
|
|
23
24
|
export * from "./Image";
|
|
24
25
|
export * from "./ImageBackground";
|
|
26
|
+
export * from "./InfoTooltipButton";
|
|
25
27
|
// export * from "./Layout";
|
|
26
28
|
// export * from "./Drawer";
|
|
27
29
|
export * from "./Link";
|
|
@@ -40,6 +42,8 @@ export * from "./TapToEdit";
|
|
|
40
42
|
export * from "./Text";
|
|
41
43
|
export * from "./TextArea";
|
|
42
44
|
export * from "./TextField";
|
|
45
|
+
export * from "./Tooltip";
|
|
46
|
+
export * from "./Toast";
|
|
43
47
|
export * from "./UnifiedScreens";
|
|
44
48
|
export * from "./Unifier";
|
|
45
49
|
export * from "./WithLabel";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,4BAA4B;AAC5B,4BAA4B;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AAExB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa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cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,2BAA2B;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ferns-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"scripts": {
|
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
"react-native-picker-select": "^8.0.0",
|
|
168
168
|
"react-native-portalize": "^1.0.7",
|
|
169
169
|
"react-native-svg": "^13.0.0",
|
|
170
|
+
"react-native-toast-notifications": "^3.3.1",
|
|
170
171
|
"react-router": "^6.3.0",
|
|
171
172
|
"react-router-dom": "^6.3.0",
|
|
172
173
|
"react-time-picker": "^5.0.0",
|
|
@@ -198,6 +199,7 @@
|
|
|
198
199
|
"react-native-picker-select": "^8.0.0",
|
|
199
200
|
"react-native-portalize": "^1.0.7",
|
|
200
201
|
"react-native-svg": "^13.0.0",
|
|
202
|
+
"react-native-toast-notifications": "^3.3.1",
|
|
201
203
|
"react-router": "^6.3.0",
|
|
202
204
|
"react-router-dom": "^6.3.0",
|
|
203
205
|
"react-time-picker": "^5.0.0"
|
package/src/Button.tsx
CHANGED
|
@@ -29,6 +29,7 @@ export interface ButtonProps {
|
|
|
29
29
|
withConfirmation?: boolean;
|
|
30
30
|
confirmationText?: string;
|
|
31
31
|
confirmationHeading?: string;
|
|
32
|
+
shape?: "rounded" | "pill";
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const buttonTextColor: {[buttonColor: string]: "white" | "darkGray"} = {
|
|
@@ -67,6 +68,7 @@ export function Button({
|
|
|
67
68
|
withConfirmation = false,
|
|
68
69
|
confirmationText = "Are you sure you want to continue?",
|
|
69
70
|
confirmationHeading = "Confirm",
|
|
71
|
+
shape = "rounded",
|
|
70
72
|
}: ButtonProps) {
|
|
71
73
|
const [loading, setLoading] = useState(propsLoading);
|
|
72
74
|
const [showConfirmation, setShowConfirmation] = useState(false);
|
|
@@ -136,7 +138,7 @@ export function Button({
|
|
|
136
138
|
// flexGrow: inline ? 0 : 1,
|
|
137
139
|
alignItems: "center",
|
|
138
140
|
justifyContent: "center",
|
|
139
|
-
borderRadius: 5,
|
|
141
|
+
borderRadius: shape === "pill" ? 999 : 5,
|
|
140
142
|
borderColor: getBorderColor(color),
|
|
141
143
|
borderWidth: type === "outline" ? 2 : 0,
|
|
142
144
|
opacity: disabled ? 0.4 : 1,
|
package/src/Common.ts
CHANGED
|
@@ -2004,25 +2004,12 @@ export interface IconProps {
|
|
|
2004
2004
|
containerStyle?: any;
|
|
2005
2005
|
}
|
|
2006
2006
|
|
|
2007
|
-
export interface IconButtonProps {
|
|
2008
|
-
prefix?: IconPrefix;
|
|
2009
|
-
icon: IconName;
|
|
2010
|
-
accessibilityLabel: string;
|
|
2011
|
-
iconColor: "darkGray" | ButtonColor | ThemeColor | Color;
|
|
2012
|
-
onClick: () => void;
|
|
2013
|
-
size?: IconSize;
|
|
2014
|
-
bgColor?: "transparent" | "transparentDarkGray" | "gray" | "lightGray" | "white"; // default transparent
|
|
2015
|
-
disabled?: boolean;
|
|
2016
|
-
selected?: boolean;
|
|
2017
|
-
withConfirmation?: boolean;
|
|
2018
|
-
confirmationText?: string;
|
|
2019
|
-
confirmationHeading?: string;
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
2007
|
export interface NavigatorProps {
|
|
2023
2008
|
config?: any;
|
|
2024
2009
|
}
|
|
2025
2010
|
|
|
2011
|
+
export type TooltipDirection = "top" | "bottom" | "left" | "right";
|
|
2012
|
+
|
|
2026
2013
|
export interface PillProps {
|
|
2027
2014
|
text: string;
|
|
2028
2015
|
color: AllColors;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {ToastProvider} from "react-native-toast-notifications";
|
|
3
|
+
|
|
4
|
+
import {Toast} from "./Toast";
|
|
5
|
+
|
|
6
|
+
export function FernsProvider({children}: {children: React.ReactNode}): React.ReactElement {
|
|
7
|
+
return (
|
|
8
|
+
<ToastProvider
|
|
9
|
+
animationDuration={250}
|
|
10
|
+
animationType="slide-in"
|
|
11
|
+
duration={50000}
|
|
12
|
+
offset={50}
|
|
13
|
+
placement="bottom"
|
|
14
|
+
renderToast={(toastOptions) => <Toast {...(toastOptions as any)} />}
|
|
15
|
+
swipeEnabled
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</ToastProvider>
|
|
19
|
+
);
|
|
20
|
+
}
|
package/src/IconButton.tsx
CHANGED
|
@@ -1,89 +1,141 @@
|
|
|
1
|
-
import React, {useState} from "react";
|
|
2
|
-
import {TouchableOpacity} from "react-native";
|
|
1
|
+
import React, {forwardRef, useState} from "react";
|
|
2
|
+
import {Platform, TouchableOpacity, View} from "react-native";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ButtonColor,
|
|
6
|
+
Color,
|
|
7
|
+
IconName,
|
|
8
|
+
IconPrefix,
|
|
9
|
+
IconSize,
|
|
10
|
+
iconSizeToNumber,
|
|
11
|
+
ThemeColor,
|
|
12
|
+
TooltipDirection,
|
|
13
|
+
} from "./Common";
|
|
5
14
|
import {Icon} from "./Icon";
|
|
6
15
|
import {Modal} from "./Modal";
|
|
7
16
|
import {Text} from "./Text";
|
|
17
|
+
import {Tooltip} from "./Tooltip";
|
|
8
18
|
import {Unifier} from "./Unifier";
|
|
9
19
|
|
|
10
|
-
export
|
|
11
|
-
prefix
|
|
12
|
-
icon
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
export interface IconButtonProps {
|
|
21
|
+
prefix?: IconPrefix;
|
|
22
|
+
icon: IconName;
|
|
23
|
+
accessibilityLabel: string;
|
|
24
|
+
iconColor: "darkGray" | ButtonColor | ThemeColor | Color;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
size?: IconSize;
|
|
27
|
+
bgColor?: "transparent" | "transparentDarkGray" | "gray" | "lightGray" | "white"; // default transparent
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
withConfirmation?: boolean;
|
|
31
|
+
confirmationText?: string;
|
|
32
|
+
confirmationHeading?: string;
|
|
33
|
+
tooltip?: {
|
|
34
|
+
text: string;
|
|
35
|
+
idealDirection?: TooltipDirection;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
22
38
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
// eslint-disable-next-line react/display-name
|
|
40
|
+
export const IconButton = forwardRef(
|
|
41
|
+
(
|
|
42
|
+
{
|
|
43
|
+
prefix,
|
|
44
|
+
icon,
|
|
45
|
+
iconColor,
|
|
46
|
+
onClick,
|
|
47
|
+
size,
|
|
48
|
+
bgColor = "transparent",
|
|
49
|
+
withConfirmation = false,
|
|
50
|
+
confirmationText = "Are you sure you want to continue?",
|
|
51
|
+
confirmationHeading = "Confirm",
|
|
52
|
+
tooltip,
|
|
53
|
+
}: IconButtonProps,
|
|
54
|
+
ref
|
|
55
|
+
) => {
|
|
56
|
+
const [showConfirmation, setShowConfirmation] = useState(false);
|
|
34
57
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
size="sm"
|
|
47
|
-
visible={showConfirmation}
|
|
48
|
-
onDismiss={(): void => {
|
|
49
|
-
setShowConfirmation(false);
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
<Text>{confirmationText}</Text>
|
|
53
|
-
</Modal>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
58
|
+
let opacity = 1;
|
|
59
|
+
let color: string;
|
|
60
|
+
if (bgColor === "transparentDarkGray") {
|
|
61
|
+
opacity = 0.8;
|
|
62
|
+
color = Unifier.theme.darkGray;
|
|
63
|
+
} else if (bgColor === "transparent" || !bgColor) {
|
|
64
|
+
opacity = 1.0;
|
|
65
|
+
color = Unifier.theme.white;
|
|
66
|
+
} else {
|
|
67
|
+
color = Unifier.theme[bgColor];
|
|
68
|
+
}
|
|
56
69
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
opacity,
|
|
63
|
-
backgroundColor: color,
|
|
64
|
-
borderRadius: 100,
|
|
65
|
-
// paddingBottom: iconSizeToNumber(size) / 4,
|
|
66
|
-
// paddingTop: iconSizeToNumber(size) / 4,
|
|
67
|
-
// paddingLeft: iconSizeToNumber(size) / 2,
|
|
68
|
-
// paddingRight: iconSizeToNumber(size) / 2,
|
|
69
|
-
width: iconSizeToNumber(size) * 2.5,
|
|
70
|
-
height: iconSizeToNumber(size) * 2.5,
|
|
71
|
-
display: "flex",
|
|
72
|
-
justifyContent: "center",
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
}}
|
|
75
|
-
onPress={() => {
|
|
76
|
-
Unifier.utils.haptic();
|
|
77
|
-
if (withConfirmation && !showConfirmation) {
|
|
78
|
-
setShowConfirmation(true);
|
|
79
|
-
} else if (onClick) {
|
|
70
|
+
const renderConfirmation = () => {
|
|
71
|
+
return (
|
|
72
|
+
<Modal
|
|
73
|
+
heading={confirmationHeading}
|
|
74
|
+
primaryButtonOnClick={() => {
|
|
80
75
|
onClick();
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
setShowConfirmation(false);
|
|
77
|
+
}}
|
|
78
|
+
primaryButtonText="Confirm"
|
|
79
|
+
secondaryButtonOnClick={(): void => setShowConfirmation(false)}
|
|
80
|
+
secondaryButtonText="Cancel"
|
|
81
|
+
size="sm"
|
|
82
|
+
visible={showConfirmation}
|
|
83
|
+
onDismiss={(): void => {
|
|
84
|
+
setShowConfirmation(false);
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<Text>{confirmationText}</Text>
|
|
88
|
+
</Modal>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
function renderIconButton(): React.ReactElement {
|
|
93
|
+
return (
|
|
94
|
+
<View>
|
|
95
|
+
<TouchableOpacity
|
|
96
|
+
ref={ref as any}
|
|
97
|
+
hitSlop={{top: 10, left: 10, bottom: 10, right: 10}}
|
|
98
|
+
style={{
|
|
99
|
+
opacity,
|
|
100
|
+
backgroundColor: color,
|
|
101
|
+
borderRadius: 100,
|
|
102
|
+
// paddingBottom: iconSizeToNumber(size) / 4,
|
|
103
|
+
// paddingTop: iconSizeToNumber(size) / 4,
|
|
104
|
+
// paddingLeft: iconSizeToNumber(size) / 2,
|
|
105
|
+
// paddingRight: iconSizeToNumber(size) / 2,
|
|
106
|
+
width: iconSizeToNumber(size) * 2.5,
|
|
107
|
+
height: iconSizeToNumber(size) * 2.5,
|
|
108
|
+
display: "flex",
|
|
109
|
+
justifyContent: "center",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
}}
|
|
112
|
+
onPress={() => {
|
|
113
|
+
Unifier.utils.haptic();
|
|
114
|
+
if (withConfirmation && !showConfirmation) {
|
|
115
|
+
setShowConfirmation(true);
|
|
116
|
+
} else if (onClick) {
|
|
117
|
+
onClick();
|
|
118
|
+
}
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<Icon color={iconColor} name={icon} prefix={prefix || "fas"} size={size} />
|
|
122
|
+
</TouchableOpacity>
|
|
123
|
+
{Boolean(withConfirmation) && renderConfirmation()}
|
|
124
|
+
</View>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Only add for web. This doesn't make much sense for mobile, since the action would be performed for the button
|
|
129
|
+
// as well as the tooltip appearing.
|
|
130
|
+
// TODO: Add tooltip info button next to the icon button on mobile.
|
|
131
|
+
if (tooltip && Platform.OS === "web") {
|
|
132
|
+
return (
|
|
133
|
+
<Tooltip idealDirection={tooltip.idealDirection} text={tooltip.text}>
|
|
134
|
+
{renderIconButton()}
|
|
135
|
+
</Tooltip>
|
|
136
|
+
);
|
|
137
|
+
} else {
|
|
138
|
+
return renderIconButton();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {IconSize} from "./Common";
|
|
4
|
+
import {IconButton} from "./IconButton";
|
|
5
|
+
|
|
6
|
+
interface InfoTooltipButtonProps {
|
|
7
|
+
text: string;
|
|
8
|
+
size?: IconSize;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function InfoTooltipButton({text, size}: InfoTooltipButtonProps): React.ReactElement {
|
|
12
|
+
return (
|
|
13
|
+
<IconButton
|
|
14
|
+
accessibilityLabel="info"
|
|
15
|
+
bgColor="transparent"
|
|
16
|
+
icon="exclamation"
|
|
17
|
+
iconColor="blue"
|
|
18
|
+
size={size}
|
|
19
|
+
tooltip={{text}}
|
|
20
|
+
onClick={() => {}}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
package/src/SelectList.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import {Platform} from "react-native";
|
|
2
3
|
|
|
3
4
|
import {FieldWithLabelsProps, StyleProp} from "./Common";
|
|
5
|
+
import {Icon} from "./Icon";
|
|
4
6
|
import RNPickerSelect from "./PickerSelect";
|
|
5
7
|
import {Unifier} from "./Unifier";
|
|
6
8
|
import {WithLabel} from "./WithLabel";
|
|
@@ -34,6 +36,12 @@ export function SelectList({
|
|
|
34
36
|
return (
|
|
35
37
|
<WithLabel {...withLabelProps}>
|
|
36
38
|
<RNPickerSelect
|
|
39
|
+
// Icon only needed for iOs, web and android use default icons
|
|
40
|
+
Icon={() => {
|
|
41
|
+
return Platform.OS === "ios" ? (
|
|
42
|
+
<Icon color="darkGray" name="angle-down" size="md" />
|
|
43
|
+
) : null;
|
|
44
|
+
}}
|
|
37
45
|
items={options}
|
|
38
46
|
placeholder={placeholder ? {label: placeholder, value: ""} : {}}
|
|
39
47
|
style={{
|
|
@@ -43,14 +51,28 @@ export function SelectList({
|
|
|
43
51
|
alignItems: style?.alignItems || "center",
|
|
44
52
|
minHeight: style?.minHeight || 50,
|
|
45
53
|
width: style?.width || "100%",
|
|
46
|
-
// Add padding so the border doesn't mess up layouts
|
|
47
|
-
paddingHorizontal: style?.paddingHorizontal || 6,
|
|
48
|
-
paddingVertical: style?.paddingVertical || 4,
|
|
49
54
|
borderColor: style?.borderColor || Unifier.theme.gray,
|
|
50
55
|
borderWidth: style?.borderWidth || 1,
|
|
51
56
|
borderRadius: style?.borderRadius || 5,
|
|
52
57
|
backgroundColor: style?.backgroundColor || Unifier.theme.white,
|
|
53
58
|
},
|
|
59
|
+
inputIOS: {
|
|
60
|
+
paddingVertical: 12,
|
|
61
|
+
paddingHorizontal: 10,
|
|
62
|
+
paddingRight: 30,
|
|
63
|
+
},
|
|
64
|
+
iconContainer: {
|
|
65
|
+
top: 13,
|
|
66
|
+
right: 10,
|
|
67
|
+
bottom: 12,
|
|
68
|
+
paddingLeft: 40,
|
|
69
|
+
},
|
|
70
|
+
inputWeb: {
|
|
71
|
+
// Add padding so the border doesn't mess up layouts
|
|
72
|
+
paddingHorizontal: style?.paddingHorizontal || 6,
|
|
73
|
+
paddingVertical: style?.paddingVertical || 4,
|
|
74
|
+
borderRadius: style?.borderRadius || 5,
|
|
75
|
+
},
|
|
54
76
|
}}
|
|
55
77
|
value={value}
|
|
56
78
|
onValueChange={onChange}
|
package/src/TapToEdit.tsx
CHANGED
|
@@ -110,6 +110,27 @@ export const TapToEdit = ({
|
|
|
110
110
|
} else if (fieldProps?.type === "multiselect") {
|
|
111
111
|
// ???
|
|
112
112
|
displayValue = value.join(", ");
|
|
113
|
+
} else if (fieldProps?.type === "address") {
|
|
114
|
+
let city = "";
|
|
115
|
+
if (value?.city) {
|
|
116
|
+
city = value?.state || value.zipcode ? `${value.city}, ` : `${value.city}`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
let state = "";
|
|
120
|
+
if (value?.state) {
|
|
121
|
+
state = value?.zipcode ? `${value.state} ` : `${value.state}`;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const zip = value?.zipcode;
|
|
125
|
+
|
|
126
|
+
const addressLineOne = value?.address1 ?? "";
|
|
127
|
+
const addressLineTwo = value?.address2 ?? "";
|
|
128
|
+
const addressLineThree = `${city}${state}${zip}`;
|
|
129
|
+
|
|
130
|
+
// Only add new lines if lines before and after are not empty to avoid awkward whitespace
|
|
131
|
+
displayValue = `${addressLineOne}${
|
|
132
|
+
addressLineOne && (addressLineTwo || addressLineThree) ? `\n` : ""
|
|
133
|
+
}${addressLineTwo}${addressLineTwo && addressLineThree ? `\n` : ""}${addressLineThree}`;
|
|
113
134
|
}
|
|
114
135
|
}
|
|
115
136
|
return (
|
package/src/Toast.tsx
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Dimensions} from "react-native";
|
|
3
|
+
import {useToast as useRNToast} from "react-native-toast-notifications";
|
|
4
|
+
|
|
5
|
+
import {Box} from "./Box";
|
|
6
|
+
import {Button} from "./Button";
|
|
7
|
+
import {AllColors} from "./Common";
|
|
8
|
+
import {Icon} from "./Icon";
|
|
9
|
+
import {Text} from "./Text";
|
|
10
|
+
|
|
11
|
+
export function useToast(): any {
|
|
12
|
+
const toast = useRNToast();
|
|
13
|
+
return {
|
|
14
|
+
show: (
|
|
15
|
+
text: string,
|
|
16
|
+
options?: {
|
|
17
|
+
variant?: "default" | "warning" | "error";
|
|
18
|
+
buttonText?: string;
|
|
19
|
+
buttonOnClick: () => void | Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
): string => {
|
|
22
|
+
return toast.show(text, {
|
|
23
|
+
data: options,
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
hide: (id: string) => toast.hide(id),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function Toast({
|
|
31
|
+
message,
|
|
32
|
+
data,
|
|
33
|
+
}: {
|
|
34
|
+
message: string;
|
|
35
|
+
data: {
|
|
36
|
+
variant?: "default" | "warning" | "error";
|
|
37
|
+
buttonText?: string;
|
|
38
|
+
buttonOnClick?: () => void | Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
}): React.ReactElement {
|
|
41
|
+
// margin 8 on either side, times the standard 4px we multiply by.
|
|
42
|
+
const width = Math.min(Dimensions.get("window").width - 16 * 4, 712);
|
|
43
|
+
const {variant, buttonText, buttonOnClick} = data ?? {};
|
|
44
|
+
let color: AllColors = "darkGray";
|
|
45
|
+
if (variant === "warning") {
|
|
46
|
+
color = "orange";
|
|
47
|
+
} else if (variant === "error") {
|
|
48
|
+
color = "red";
|
|
49
|
+
}
|
|
50
|
+
return (
|
|
51
|
+
<Box
|
|
52
|
+
alignItems="center"
|
|
53
|
+
color={color}
|
|
54
|
+
direction="row"
|
|
55
|
+
flex="shrink"
|
|
56
|
+
marginBottom={4}
|
|
57
|
+
marginLeft={8}
|
|
58
|
+
marginRight={8}
|
|
59
|
+
maxWidth={width}
|
|
60
|
+
padding={2}
|
|
61
|
+
paddingX={4}
|
|
62
|
+
paddingY={3}
|
|
63
|
+
rounding={4}
|
|
64
|
+
>
|
|
65
|
+
{Boolean(variant === "error") && (
|
|
66
|
+
<Box marginRight={4}>
|
|
67
|
+
<Icon color="white" name="exclamation-circle" size="lg" />
|
|
68
|
+
</Box>
|
|
69
|
+
)}
|
|
70
|
+
{Boolean(variant === "warning") && (
|
|
71
|
+
<Box marginRight={4}>
|
|
72
|
+
<Icon color="white" name="exclamation-triangle" size="lg" />
|
|
73
|
+
</Box>
|
|
74
|
+
)}
|
|
75
|
+
<Box alignItems="center" direction="column" flex="shrink" justifyContent="center">
|
|
76
|
+
<Text color="white" size="lg" weight="bold">
|
|
77
|
+
{message}
|
|
78
|
+
</Text>
|
|
79
|
+
</Box>
|
|
80
|
+
{Boolean(buttonOnClick && buttonText) && (
|
|
81
|
+
<Box alignItems="center" justifyContent="center" marginLeft={4}>
|
|
82
|
+
<Button color="lightGray" shape="pill" text={buttonText!} onClick={buttonOnClick} />
|
|
83
|
+
</Box>
|
|
84
|
+
)}
|
|
85
|
+
</Box>
|
|
86
|
+
);
|
|
87
|
+
}
|