ferns-ui 1.0.0-beta.0 → 1.0.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/Accordion.js +15 -8
- package/dist/Accordion.js.map +1 -1
- package/dist/Badge.d.ts +1 -1
- package/dist/Badge.js +10 -5
- package/dist/Badge.js.map +1 -1
- package/dist/Button.js +3 -3
- package/dist/Common.d.ts +60 -9
- package/dist/Common.js.map +1 -1
- package/dist/IconButton.js +3 -3
- package/dist/Modal.js +5 -5
- package/dist/SegmentedControl.js +3 -2
- package/dist/SegmentedControl.js.map +1 -1
- package/dist/TapToEdit.d.ts +1 -1
- package/dist/TapToEdit.js +43 -39
- package/dist/TapToEdit.js.map +1 -1
- package/dist/Tooltip.js +26 -29
- package/dist/Tooltip.js.map +1 -1
- package/package.json +1 -1
- package/src/Accordion.tsx +28 -20
- package/src/Badge.tsx +18 -8
- package/src/Button.tsx +4 -4
- package/src/Common.ts +73 -15
- package/src/IconButton.tsx +4 -4
- package/src/Modal.tsx +8 -8
- package/src/SegmentedControl.tsx +3 -2
- package/src/TapToEdit.tsx +71 -79
- package/src/Tooltip.tsx +52 -58
package/dist/Tooltip.js
CHANGED
|
@@ -244,36 +244,33 @@ export const Tooltip = ({ text, children, idealPosition, includeArrow }) => {
|
|
|
244
244
|
return children;
|
|
245
245
|
}
|
|
246
246
|
return (React.createElement(View, null,
|
|
247
|
-
React.createElement(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
React.createElement(View, { style:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
247
|
+
visible && (React.createElement(Portal, null,
|
|
248
|
+
React.createElement(View, { style: Object.assign({ position: "absolute", zIndex: 999 }, getTooltipPosition(Object.assign(Object.assign({}, measurement), { idealPosition }))), onLayout: handleOnLayout },
|
|
249
|
+
includeArrow && isWeb && (React.createElement(View, { style: arrowContainerStyles },
|
|
250
|
+
React.createElement(Arrow, { color: theme.surface.secondaryExtraDark, position: finalPosition }))),
|
|
251
|
+
React.createElement(View, { style: {
|
|
252
|
+
backgroundColor: theme.surface.secondaryExtraDark,
|
|
253
|
+
borderRadius: theme.radius.default,
|
|
254
|
+
paddingVertical: 2,
|
|
255
|
+
paddingHorizontal: 8,
|
|
256
|
+
maxWidth: 320,
|
|
257
|
+
display: "flex",
|
|
258
|
+
flexShrink: 1,
|
|
259
|
+
opacity: measurement.measured ? 1 : 0,
|
|
260
|
+
} },
|
|
261
|
+
React.createElement(Pressable, { accessibilityHint: "Tooltip information", accessibilityLabel: text, accessibilityRole: "button", style: {
|
|
255
262
|
backgroundColor: theme.surface.secondaryExtraDark,
|
|
256
263
|
borderRadius: theme.radius.default,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
React.createElement(Text, { color: "inverted", size: "sm" }, text)))))),
|
|
269
|
-
React.createElement(View, Object.assign({ ref: childrenWrapperRef, hitSlop: { top: 10, bottom: 10, left: 15, right: 15 }, onPointerEnter: () => {
|
|
270
|
-
var _a, _b;
|
|
271
|
-
handleHoverIn();
|
|
272
|
-
(_b = (_a = children.props).onHoverIn) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
273
|
-
}, onPointerLeave: () => {
|
|
274
|
-
var _a, _b;
|
|
275
|
-
handleHoverOut();
|
|
276
|
-
(_b = (_a = children.props).onHoverOut) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
277
|
-
}, onTouchStart: handleTouchStart }, (!isWeb && mobilePressProps)), children))));
|
|
264
|
+
}, testID: "tooltip-container", onPress: () => setVisible(false) },
|
|
265
|
+
React.createElement(Text, { color: "inverted", size: "sm" }, text)))))),
|
|
266
|
+
React.createElement(View, Object.assign({ ref: childrenWrapperRef, hitSlop: { top: 10, bottom: 10, left: 15, right: 15 }, onPointerEnter: () => {
|
|
267
|
+
var _a, _b;
|
|
268
|
+
handleHoverIn();
|
|
269
|
+
(_b = (_a = children.props).onHoverIn) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
270
|
+
}, onPointerLeave: () => {
|
|
271
|
+
var _a, _b;
|
|
272
|
+
handleHoverOut();
|
|
273
|
+
(_b = (_a = children.props).onHoverOut) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
274
|
+
}, onTouchStart: handleTouchStart }, (!isWeb && mobilePressProps)), children)));
|
|
278
275
|
};
|
|
279
276
|
//# sourceMappingURL=Tooltip.js.map
|
package/dist/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAK,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,UAAU,EAGV,QAAQ,EACR,SAAS,EACT,IAAI,GAEL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAK,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,UAAU,EAGV,QAAQ,EACR,SAAS,EACT,IAAI,GAEL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,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,OAAO,CAAC,kBAAkB;4BACjD,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;yBACnC,EACD,MAAM,EAAC,mBAAmB,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;wBAEhC,oBAAC,IAAI,IAAC,KAAK,EAAC,UAAU,EAAC,IAAI,EAAC,IAAI,IAC7B,IAAI,CACA,CACG,CACP,CACF,CACA,CACV;QACD,oBAAC,IAAI,kBACH,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAC,EACnD,cAAc,EAAE,GAAG,EAAE;;gBACnB,aAAa,EAAE,CAAC;gBAChB,MAAA,MAAA,QAAQ,CAAC,KAAK,EAAC,SAAS,kDAAI,CAAC;YAC/B,CAAC,EACD,cAAc,EAAE,GAAG,EAAE;;gBACnB,cAAc,EAAE,CAAC;gBACjB,MAAA,MAAA,QAAQ,CAAC,KAAK,EAAC,UAAU,kDAAI,CAAC;YAChC,CAAC,EACD,YAAY,EAAE,gBAAgB,IAC1B,CAAC,CAAC,KAAK,IAAI,gBAAgB,CAAC,GAE/B,QAAQ,CACJ,CACF,CACR,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/Accordion.tsx
CHANGED
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
|
|
2
|
-
import React, {FC, useState} from "react";
|
|
2
|
+
import React, {FC, useEffect, useState} from "react";
|
|
3
3
|
import {Pressable, View} from "react-native";
|
|
4
4
|
|
|
5
5
|
import {AccordionProps} from "./Common";
|
|
6
6
|
import {Heading} from "./Heading";
|
|
7
7
|
import {Modal} from "./Modal";
|
|
8
|
+
import {Text} from "./Text";
|
|
8
9
|
import {useTheme} from "./Theme";
|
|
9
10
|
|
|
10
11
|
export const Accordion: FC<AccordionProps> = ({
|
|
11
12
|
children,
|
|
12
13
|
isCollapsed = false,
|
|
13
14
|
title,
|
|
15
|
+
subtitle,
|
|
14
16
|
includeInfoModal = false,
|
|
15
17
|
infoModalChildren,
|
|
16
|
-
|
|
18
|
+
infoModalSubtitle,
|
|
17
19
|
infoModalText,
|
|
18
20
|
infoModalTitle,
|
|
19
21
|
}) => {
|
|
20
22
|
const {theme} = useTheme();
|
|
21
|
-
const [collapsed, setCollapsed] = useState(
|
|
23
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
22
24
|
const [infoModalVisibleState, setInfoModalVisibleState] = useState(false);
|
|
23
25
|
|
|
26
|
+
// The external collapse state should override the internal collapse state.
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setCollapsed(isCollapsed);
|
|
29
|
+
}, [isCollapsed]);
|
|
30
|
+
|
|
24
31
|
return (
|
|
25
32
|
<>
|
|
26
33
|
<Modal
|
|
27
34
|
primaryButtonOnClick={() => setInfoModalVisibleState(false)}
|
|
28
35
|
primaryButtonText="Close"
|
|
29
36
|
size="md"
|
|
30
|
-
|
|
37
|
+
subtitle={infoModalSubtitle}
|
|
31
38
|
text={infoModalText}
|
|
32
39
|
title={infoModalTitle}
|
|
33
40
|
visible={infoModalVisibleState}
|
|
@@ -46,22 +53,23 @@ export const Accordion: FC<AccordionProps> = ({
|
|
|
46
53
|
}}
|
|
47
54
|
>
|
|
48
55
|
<View style={{flexDirection: "row", justifyContent: "space-between", alignItems: "center"}}>
|
|
49
|
-
<View style={{flexDirection: "
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
<View style={{flexDirection: "column", gap: 4}}>
|
|
57
|
+
<View style={{flexDirection: "row", alignItems: "center"}}>
|
|
58
|
+
<Heading>{title}</Heading>
|
|
59
|
+
{includeInfoModal && infoModalTitle && (
|
|
60
|
+
<Pressable
|
|
61
|
+
accessibilityRole="button"
|
|
62
|
+
hitSlop={{top: 10, bottom: 10, left: 10, right: 10}}
|
|
63
|
+
style={{marginLeft: 8}}
|
|
64
|
+
onPress={() => setInfoModalVisibleState(true)}
|
|
65
|
+
>
|
|
66
|
+
<Heading color="secondaryLight" size="sm">
|
|
67
|
+
ⓘ
|
|
68
|
+
</Heading>
|
|
69
|
+
</Pressable>
|
|
70
|
+
)}
|
|
71
|
+
</View>
|
|
72
|
+
{subtitle && <Text>{subtitle}</Text>}
|
|
65
73
|
</View>
|
|
66
74
|
<View>
|
|
67
75
|
<Pressable
|
package/src/Badge.tsx
CHANGED
|
@@ -12,6 +12,11 @@ export const Badge = ({
|
|
|
12
12
|
secondary = false,
|
|
13
13
|
variant,
|
|
14
14
|
maxValue = 100,
|
|
15
|
+
customBackgroundColor,
|
|
16
|
+
customTextColor,
|
|
17
|
+
customBorderColor,
|
|
18
|
+
customIconColor,
|
|
19
|
+
customIconName,
|
|
15
20
|
}: BadgeProps): React.ReactElement => {
|
|
16
21
|
const {theme} = useTheme();
|
|
17
22
|
const isIconOnly = variant === "iconOnly";
|
|
@@ -25,6 +30,7 @@ export const Badge = ({
|
|
|
25
30
|
info: "#8FC1D2",
|
|
26
31
|
success: "#7FD898",
|
|
27
32
|
neutral: "#AAAAAA",
|
|
33
|
+
custom: "#AAAAAA",
|
|
28
34
|
};
|
|
29
35
|
|
|
30
36
|
if (secondary) {
|
|
@@ -55,6 +61,11 @@ export const Badge = ({
|
|
|
55
61
|
badgeBgColor = secondary ? "neutralLight" : "neutralDark";
|
|
56
62
|
}
|
|
57
63
|
|
|
64
|
+
const backgroundColor = status === "custom" ? customBackgroundColor : theme.surface[badgeBgColor];
|
|
65
|
+
const borderColor = status === "custom" ? customBorderColor : secondaryBorderColors[status];
|
|
66
|
+
const textColor = status === "custom" ? customTextColor : theme.text[badgeColor];
|
|
67
|
+
const iconColor = status === "custom" ? customIconColor : badgeColor;
|
|
68
|
+
|
|
58
69
|
let badgeBorderRadius = theme.radius.default;
|
|
59
70
|
if (isIconOnly) {
|
|
60
71
|
badgeBorderRadius = theme.radius.full;
|
|
@@ -89,27 +100,26 @@ export const Badge = ({
|
|
|
89
100
|
justifyContent: "center",
|
|
90
101
|
alignItems: "center",
|
|
91
102
|
paddingVertical: variant === "iconOnly" ? 1 : theme.spacing.xs,
|
|
92
|
-
paddingHorizontal:
|
|
93
|
-
variant === "iconOnly" ? (theme.spacing.xs as any) : theme.spacing.sm,
|
|
103
|
+
paddingHorizontal: variant === "iconOnly" ? theme.spacing.xs : theme.spacing.sm,
|
|
94
104
|
flexDirection: "row",
|
|
95
|
-
borderRadius: badgeBorderRadius
|
|
96
|
-
backgroundColor
|
|
105
|
+
borderRadius: badgeBorderRadius,
|
|
106
|
+
backgroundColor,
|
|
97
107
|
height: variant === "iconOnly" ? 16 : "auto",
|
|
98
108
|
width: variant === "iconOnly" ? 16 : "auto",
|
|
99
109
|
},
|
|
100
110
|
isIconOnly && {height: 16, width: 16},
|
|
101
|
-
secondary && {borderWidth: 1, borderColor
|
|
111
|
+
secondary && {borderWidth: 1, borderColor},
|
|
102
112
|
]}
|
|
103
113
|
>
|
|
104
114
|
{Boolean(variant !== "numberOnly" && iconName) && (
|
|
105
|
-
<View style={{marginRight: variant === "iconOnly" ? 0 :
|
|
106
|
-
<Icon color={
|
|
115
|
+
<View style={{marginRight: variant === "iconOnly" ? 0 : theme.spacing.sm}}>
|
|
116
|
+
<Icon color={iconColor} iconName={customIconName ?? iconName!} size="xs" />
|
|
107
117
|
</View>
|
|
108
118
|
)}
|
|
109
119
|
{Boolean(variant !== "iconOnly") && (
|
|
110
120
|
<Text
|
|
111
121
|
style={{
|
|
112
|
-
color:
|
|
122
|
+
color: textColor,
|
|
113
123
|
fontSize: 10,
|
|
114
124
|
fontWeight: "700",
|
|
115
125
|
fontFamily: "text",
|
package/src/Button.tsx
CHANGED
|
@@ -15,18 +15,18 @@ import {isNative} from "./Utilities";
|
|
|
15
15
|
const ConfirmationModal: FC<{
|
|
16
16
|
visible: boolean;
|
|
17
17
|
title: string;
|
|
18
|
-
|
|
18
|
+
subtitle?: string;
|
|
19
19
|
text: string;
|
|
20
20
|
onConfirm: () => void;
|
|
21
21
|
onCancel: () => void;
|
|
22
|
-
}> = ({visible, title,
|
|
22
|
+
}> = ({visible, title, subtitle, text, onConfirm, onCancel}) => {
|
|
23
23
|
return (
|
|
24
24
|
<Modal
|
|
25
25
|
primaryButtonOnClick={onConfirm}
|
|
26
26
|
primaryButtonText="Confirm"
|
|
27
27
|
secondaryButtonOnClick={onCancel}
|
|
28
28
|
secondaryButtonText="Cancel"
|
|
29
|
-
|
|
29
|
+
subtitle={subtitle}
|
|
30
30
|
title={title}
|
|
31
31
|
visible={visible}
|
|
32
32
|
onDismiss={onCancel}
|
|
@@ -145,7 +145,7 @@ const ButtonComponent: FC<ButtonProps> = ({
|
|
|
145
145
|
</View>
|
|
146
146
|
{withConfirmation && (
|
|
147
147
|
<ConfirmationModal
|
|
148
|
-
|
|
148
|
+
subtitle={modalSubTitle}
|
|
149
149
|
text={confirmationText}
|
|
150
150
|
title={modalTitle}
|
|
151
151
|
visible={showConfirmation}
|
package/src/Common.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface AccordionProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* The subtitle of the information modal.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
infoModalSubtitle?: ModalProps["subtitle"];
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The text content of the information modal.
|
|
@@ -49,6 +49,11 @@ export interface AccordionProps {
|
|
|
49
49
|
*/
|
|
50
50
|
isCollapsed?: boolean;
|
|
51
51
|
|
|
52
|
+
/*
|
|
53
|
+
* The subtitle showed below the title of the accordion.
|
|
54
|
+
*/
|
|
55
|
+
subtitle?: string;
|
|
56
|
+
|
|
52
57
|
/**
|
|
53
58
|
* The title of the accordion.
|
|
54
59
|
*/
|
|
@@ -1296,6 +1301,26 @@ export interface AvatarProps {
|
|
|
1296
1301
|
}
|
|
1297
1302
|
|
|
1298
1303
|
export interface BadgeProps {
|
|
1304
|
+
/**
|
|
1305
|
+
* When status is "custom", determines the badge's background color.
|
|
1306
|
+
*/
|
|
1307
|
+
customBackgroundColor?: string;
|
|
1308
|
+
/**
|
|
1309
|
+
* When status is "custom", determines the badge's border color.
|
|
1310
|
+
*/
|
|
1311
|
+
customBorderColor?: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* When status is "custom", determines the badge's icon color
|
|
1314
|
+
*/
|
|
1315
|
+
customIconColor?: IconColor;
|
|
1316
|
+
/**
|
|
1317
|
+
* When status is "custom", determines the badge's icon
|
|
1318
|
+
*/
|
|
1319
|
+
customIconName?: IconName;
|
|
1320
|
+
/**
|
|
1321
|
+
* When status is "custom", determines the badge's text color.
|
|
1322
|
+
*/
|
|
1323
|
+
customTextColor?: string;
|
|
1299
1324
|
/**
|
|
1300
1325
|
* The name of the icon to display in the badge.
|
|
1301
1326
|
*/
|
|
@@ -1320,7 +1345,7 @@ export interface BadgeProps {
|
|
|
1320
1345
|
* The status of the badge. Determines its color and appearance.
|
|
1321
1346
|
* @default "info"
|
|
1322
1347
|
*/
|
|
1323
|
-
status?: "info" | "error" | "warning" | "success" | "neutral";
|
|
1348
|
+
status?: "info" | "error" | "warning" | "success" | "neutral" | "custom";
|
|
1324
1349
|
|
|
1325
1350
|
/**
|
|
1326
1351
|
* The text or number to display inside the badge.
|
|
@@ -1711,7 +1736,7 @@ export interface ModalProps {
|
|
|
1711
1736
|
/**
|
|
1712
1737
|
* The subtitle of the modal.
|
|
1713
1738
|
*/
|
|
1714
|
-
|
|
1739
|
+
subtitle?: string;
|
|
1715
1740
|
/**
|
|
1716
1741
|
* The text content of the modal.
|
|
1717
1742
|
*/
|
|
@@ -2103,28 +2128,61 @@ export type TapToEditProps =
|
|
|
2103
2128
|
export interface BaseTapToEditProps extends Omit<FieldProps, "onChange" | "value"> {
|
|
2104
2129
|
title: string;
|
|
2105
2130
|
value: any;
|
|
2106
|
-
|
|
2131
|
+
|
|
2132
|
+
/**
|
|
2133
|
+
* Not required if not editable.
|
|
2134
|
+
*/
|
|
2107
2135
|
setValue?: (value: any) => void;
|
|
2108
|
-
|
|
2136
|
+
|
|
2137
|
+
/**
|
|
2138
|
+
* Not required if not editable.
|
|
2139
|
+
*/
|
|
2109
2140
|
onSave?: (value: any) => void | Promise<void>;
|
|
2110
|
-
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* If false, the field will not be editable and will be disabled
|
|
2144
|
+
* @default true
|
|
2145
|
+
*/
|
|
2111
2146
|
editable?: boolean;
|
|
2112
|
-
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* Enable edit mode from outside the component.
|
|
2150
|
+
*/
|
|
2113
2151
|
isEditing?: boolean;
|
|
2114
|
-
// For changing how the non-editing row renders
|
|
2115
|
-
rowBoxProps?: Partial<BoxProps>;
|
|
2116
2152
|
transform?: (value: any) => string;
|
|
2117
|
-
|
|
2153
|
+
/**
|
|
2154
|
+
* Show a confirmation modal before saving the value.
|
|
2155
|
+
* @default false
|
|
2156
|
+
*/
|
|
2118
2157
|
withConfirmation?: boolean;
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
* The text content of the confirmation modal.
|
|
2161
|
+
* @default "Are you sure you want save your changes?"
|
|
2162
|
+
*/
|
|
2119
2163
|
confirmationText?: string;
|
|
2120
|
-
|
|
2121
|
-
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* The title of the confirmation modal.
|
|
2167
|
+
* @default "Confirm"
|
|
2168
|
+
*/
|
|
2169
|
+
confirmationTitle?: string;
|
|
2170
|
+
|
|
2171
|
+
/**
|
|
2172
|
+
* Field helperText, a description of the field surfaced in the UI
|
|
2173
|
+
* @default "Confirm"
|
|
2174
|
+
*/
|
|
2175
|
+
helperText?: string;
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* Only display the helperText in the UI while editing. if false, the helperText is always shown below the value.
|
|
2179
|
+
* @default true
|
|
2180
|
+
*/
|
|
2181
|
+
onlyShowHelperTextWhileEditing?: boolean;
|
|
2182
|
+
|
|
2122
2183
|
// openApi to supported in future
|
|
2123
2184
|
// openApiModel?: string;
|
|
2124
2185
|
// openApiField?: string;
|
|
2125
|
-
showDescriptionAsTooltip?: boolean;
|
|
2126
|
-
// Default true. If false, description is shown below the value always.
|
|
2127
|
-
onlyShowDescriptionWhileEditing?: boolean;
|
|
2128
2186
|
}
|
|
2129
2187
|
|
|
2130
2188
|
export interface APIError {
|
package/src/IconButton.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import {isNative} from "./Utilities";
|
|
|
15
15
|
type ConfirmationModalProps = {
|
|
16
16
|
visible: boolean;
|
|
17
17
|
title: string;
|
|
18
|
-
|
|
18
|
+
subtitle?: string;
|
|
19
19
|
text: string;
|
|
20
20
|
onConfirm: () => void;
|
|
21
21
|
onCancel: () => void;
|
|
@@ -24,7 +24,7 @@ type ConfirmationModalProps = {
|
|
|
24
24
|
const ConfirmationModal: FC<ConfirmationModalProps> = ({
|
|
25
25
|
visible,
|
|
26
26
|
title,
|
|
27
|
-
|
|
27
|
+
subtitle,
|
|
28
28
|
text,
|
|
29
29
|
onConfirm,
|
|
30
30
|
onCancel,
|
|
@@ -35,7 +35,7 @@ const ConfirmationModal: FC<ConfirmationModalProps> = ({
|
|
|
35
35
|
primaryButtonText="Confirm"
|
|
36
36
|
secondaryButtonOnClick={onCancel}
|
|
37
37
|
secondaryButtonText="Cancel"
|
|
38
|
-
|
|
38
|
+
subtitle={subtitle}
|
|
39
39
|
title={title}
|
|
40
40
|
visible={visible}
|
|
41
41
|
onDismiss={onCancel}
|
|
@@ -173,7 +173,7 @@ const IconButtonComponent: FC<IconButtonProps> = ({
|
|
|
173
173
|
)}
|
|
174
174
|
{withConfirmation && (
|
|
175
175
|
<ConfirmationModal
|
|
176
|
-
|
|
176
|
+
subtitle={undefined}
|
|
177
177
|
text={confirmationText}
|
|
178
178
|
title={confirmationHeading}
|
|
179
179
|
visible={showConfirmation}
|
package/src/Modal.tsx
CHANGED
|
@@ -32,7 +32,7 @@ const getModalSize = (size: "sm" | "md" | "lg"): DimensionValue => {
|
|
|
32
32
|
const ModalContent: FC<{
|
|
33
33
|
children?: ModalProps["children"];
|
|
34
34
|
title?: ModalProps["title"];
|
|
35
|
-
|
|
35
|
+
subtitle?: ModalProps["subtitle"];
|
|
36
36
|
text?: ModalProps["text"];
|
|
37
37
|
primaryButtonText?: ModalProps["primaryButtonText"];
|
|
38
38
|
primaryButtonDisabled?: ModalProps["primaryButtonDisabled"];
|
|
@@ -46,7 +46,7 @@ const ModalContent: FC<{
|
|
|
46
46
|
}> = ({
|
|
47
47
|
children,
|
|
48
48
|
title,
|
|
49
|
-
|
|
49
|
+
subtitle,
|
|
50
50
|
text,
|
|
51
51
|
primaryButtonText,
|
|
52
52
|
primaryButtonDisabled,
|
|
@@ -113,14 +113,14 @@ const ModalContent: FC<{
|
|
|
113
113
|
<Heading size="lg">{title}</Heading>
|
|
114
114
|
</View>
|
|
115
115
|
)}
|
|
116
|
-
{
|
|
116
|
+
{subtitle && (
|
|
117
117
|
<View
|
|
118
118
|
accessibilityHint="Modal Sub Heading Text"
|
|
119
|
-
accessibilityLabel={
|
|
119
|
+
accessibilityLabel={subtitle}
|
|
120
120
|
accessibilityRole="text"
|
|
121
|
-
style={{alignSelf: "flex-start", marginTop:
|
|
121
|
+
style={{alignSelf: "flex-start", marginTop: subtitle ? 8 : 0}}
|
|
122
122
|
>
|
|
123
|
-
<Text size="lg">{
|
|
123
|
+
<Text size="lg">{subtitle}</Text>
|
|
124
124
|
</View>
|
|
125
125
|
)}
|
|
126
126
|
{text && (
|
|
@@ -172,7 +172,7 @@ export const Modal: FC<ModalProps> = ({
|
|
|
172
172
|
primaryButtonText,
|
|
173
173
|
secondaryButtonText,
|
|
174
174
|
size = "sm",
|
|
175
|
-
|
|
175
|
+
subtitle,
|
|
176
176
|
text,
|
|
177
177
|
title,
|
|
178
178
|
visible,
|
|
@@ -201,7 +201,7 @@ export const Modal: FC<ModalProps> = ({
|
|
|
201
201
|
|
|
202
202
|
const modalContentProps = {
|
|
203
203
|
title,
|
|
204
|
-
|
|
204
|
+
subtitle,
|
|
205
205
|
text,
|
|
206
206
|
primaryButtonText,
|
|
207
207
|
primaryButtonDisabled,
|
package/src/SegmentedControl.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import {Pressable, View} from "react-native";
|
|
3
3
|
|
|
4
4
|
import {SegmentedControlProps} from "./Common";
|
|
5
|
-
import {
|
|
5
|
+
import {Heading} from "./Heading";
|
|
6
6
|
import {useTheme} from "./Theme";
|
|
7
7
|
|
|
8
8
|
export const SegmentedControl = ({
|
|
@@ -23,6 +23,7 @@ export const SegmentedControl = ({
|
|
|
23
23
|
alignItems: "center",
|
|
24
24
|
gap: 4,
|
|
25
25
|
height,
|
|
26
|
+
maxHeight: height,
|
|
26
27
|
borderRadius: theme.primitives.radius3xl,
|
|
27
28
|
borderColor: theme.primitives.neutral300,
|
|
28
29
|
borderWidth: 3,
|
|
@@ -52,7 +53,7 @@ export const SegmentedControl = ({
|
|
|
52
53
|
}}
|
|
53
54
|
onPress={() => onChange(index)}
|
|
54
55
|
>
|
|
55
|
-
<
|
|
56
|
+
<Heading size="sm">{item}</Heading>
|
|
56
57
|
</Pressable>
|
|
57
58
|
))}
|
|
58
59
|
</View>
|