rn-feav-ui 1.0.5 → 1.0.7
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/components/Badge/index.d.ts +9 -2
- package/dist/components/Badge/index.js +24 -9
- package/dist/components/Button/index.d.ts +10 -3
- package/dist/components/Button/index.js +63 -42
- package/dist/components/Card/index.d.ts +7 -3
- package/dist/components/Card/index.js +16 -9
- package/dist/components/Checkbox/index.d.ts +9 -1
- package/dist/components/Checkbox/index.js +13 -9
- package/dist/components/Input/index.d.ts +5 -6
- package/dist/components/Input/index.js +26 -3
- package/dist/components/Label/index.d.ts +8 -1
- package/dist/components/Label/index.js +8 -2
- package/dist/components/Switch/index.d.ts +9 -2
- package/dist/components/Switch/index.js +10 -4
- package/dist/components/Textarea/index.d.ts +5 -5
- package/dist/components/Textarea/index.js +26 -3
- package/dist/components/Typography/index.d.ts +8 -1
- package/dist/components/Typography/index.js +2 -2
- package/dist/examples/Showcase.d.ts +9 -1
- package/dist/examples/Showcase.js +218 -200
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/readme.md +625 -0
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
type BadgeProps = {
|
|
4
4
|
label: string;
|
|
5
|
+
/** Optional leading icon or dot. */
|
|
6
|
+
leftIcon?: React.ReactNode;
|
|
5
7
|
style?: StyleProp<ViewStyle>;
|
|
8
|
+
textStyle?: StyleProp<TextStyle>;
|
|
9
|
+
testID?: string;
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
/** If set, badge is tappable. */
|
|
12
|
+
onPress?: () => void;
|
|
6
13
|
};
|
|
7
|
-
export declare const BadgeFEA: ({ label, style }: BadgeProps) => React.JSX.Element;
|
|
14
|
+
export declare const BadgeFEA: ({ label, leftIcon, style, textStyle, testID, accessibilityLabel, onPress, }: BadgeProps) => React.JSX.Element;
|
|
8
15
|
export {};
|
|
@@ -38,23 +38,38 @@ var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
|
38
38
|
var React = __importStar(require("react"));
|
|
39
39
|
var react_native_1 = require("react-native");
|
|
40
40
|
var BadgeFEA = function (_a) {
|
|
41
|
-
var label = _a.label, _b = _a.style, style = _b === void 0 ? {} : _b;
|
|
41
|
+
var label = _a.label, leftIcon = _a.leftIcon, _b = _a.style, style = _b === void 0 ? {} : _b, textStyle = _a.textStyle, testID = _a.testID, accessibilityLabel = _a.accessibilityLabel, onPress = _a.onPress;
|
|
42
42
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
backgroundColor: theme.colors.secondary,
|
|
47
|
-
borderColor: theme.colors.border,
|
|
48
|
-
},
|
|
49
|
-
style,
|
|
50
|
-
] },
|
|
43
|
+
var body = (React.createElement(React.Fragment, null,
|
|
44
|
+
leftIcon,
|
|
51
45
|
React.createElement(react_native_1.Text, { style: [
|
|
52
46
|
styles.label,
|
|
53
47
|
{ color: theme.colors.secondaryForeground },
|
|
48
|
+
textStyle,
|
|
54
49
|
] }, label)));
|
|
50
|
+
var shellStyle = [
|
|
51
|
+
styles.badge,
|
|
52
|
+
{
|
|
53
|
+
backgroundColor: theme.colors.secondary,
|
|
54
|
+
borderColor: theme.colors.border,
|
|
55
|
+
},
|
|
56
|
+
style,
|
|
57
|
+
];
|
|
58
|
+
if (onPress) {
|
|
59
|
+
return (React.createElement(react_native_1.Pressable, { testID: testID, accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : label, accessibilityRole: "button", onPress: onPress, style: function (_a) {
|
|
60
|
+
var pressed = _a.pressed;
|
|
61
|
+
return [shellStyle, styles.row, pressed && { opacity: 0.85 }];
|
|
62
|
+
} }, body));
|
|
63
|
+
}
|
|
64
|
+
return (React.createElement(react_native_1.View, { testID: testID, accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : label, style: [shellStyle, styles.row] }, body));
|
|
55
65
|
};
|
|
56
66
|
exports.BadgeFEA = BadgeFEA;
|
|
57
67
|
var styles = react_native_1.StyleSheet.create({
|
|
68
|
+
row: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
gap: 6,
|
|
72
|
+
},
|
|
58
73
|
badge: {
|
|
59
74
|
paddingHorizontal: 10,
|
|
60
75
|
paddingVertical: 4,
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { StyleProp, TextStyle, TouchableOpacityProps, ViewStyle } from "react-native";
|
|
3
3
|
type ButtonVariant = "primary" | "glass" | "soft" | "outline" | "ghost";
|
|
4
4
|
type ButtonSize = "default" | "sm" | "lg";
|
|
5
|
+
type TouchablePassthrough = Pick<TouchableOpacityProps, "testID" | "accessibilityLabel" | "accessibilityHint" | "accessibilityRole" | "accessibilityState" | "hitSlop" | "delayLongPress" | "activeOpacity">;
|
|
5
6
|
type ButtonProps = {
|
|
6
7
|
title: string;
|
|
7
8
|
variant?: ButtonVariant;
|
|
8
9
|
size?: ButtonSize;
|
|
9
10
|
onPress: () => void;
|
|
10
11
|
disabled?: boolean;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
leftIcon?: React.ReactNode;
|
|
14
|
+
rightIcon?: React.ReactNode;
|
|
15
|
+
/** Stretch to parent width (common for forms). */
|
|
16
|
+
fullWidth?: boolean;
|
|
11
17
|
style?: StyleProp<ViewStyle>;
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
textStyle?: StyleProp<TextStyle>;
|
|
19
|
+
} & TouchablePassthrough;
|
|
20
|
+
export declare const ButtonFEA: ({ title, variant, size, onPress, disabled, loading, leftIcon, rightIcon, fullWidth, style, textStyle, testID, accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityState, hitSlop, delayLongPress, activeOpacity, }: ButtonProps) => React.JSX.Element;
|
|
14
21
|
export {};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -39,85 +50,95 @@ var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
|
39
50
|
var react_native_1 = require("react-native");
|
|
40
51
|
var GlassCard_1 = require("../GlassCard");
|
|
41
52
|
var ButtonFEA = function (_a) {
|
|
42
|
-
var title = _a.title, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "default" : _c, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, style = _a.style;
|
|
53
|
+
var title = _a.title, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "default" : _c, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.loading, loading = _e === void 0 ? false : _e, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _f = _a.fullWidth, fullWidth = _f === void 0 ? false : _f, style = _a.style, textStyle = _a.textStyle, testID = _a.testID, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, _g = _a.accessibilityRole, accessibilityRole = _g === void 0 ? "button" : _g, accessibilityState = _a.accessibilityState, hitSlop = _a.hitSlop, delayLongPress = _a.delayLongPress, activeOpacity = _a.activeOpacity;
|
|
43
54
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
44
55
|
var sizeStyle = size === "sm"
|
|
45
56
|
? styles.sizeSm
|
|
46
57
|
: size === "lg"
|
|
47
58
|
? styles.sizeLg
|
|
48
59
|
: styles.sizeDefault;
|
|
60
|
+
var inactive = disabled || loading;
|
|
61
|
+
var touchableProps = {
|
|
62
|
+
testID: testID,
|
|
63
|
+
accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : title,
|
|
64
|
+
accessibilityHint: accessibilityHint,
|
|
65
|
+
accessibilityRole: accessibilityRole,
|
|
66
|
+
accessibilityState: __assign({ disabled: inactive }, accessibilityState),
|
|
67
|
+
hitSlop: hitSlop,
|
|
68
|
+
delayLongPress: delayLongPress,
|
|
69
|
+
activeOpacity: activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : (variant === "glass" ? 0.85 : 0.9),
|
|
70
|
+
onPress: onPress,
|
|
71
|
+
disabled: inactive,
|
|
72
|
+
};
|
|
73
|
+
var widthStyle = fullWidth ? { alignSelf: "stretch", width: "100%" } : undefined;
|
|
74
|
+
var renderLabel = function (color, opacity) { return (React.createElement(react_native_1.View, { style: styles.contentRow },
|
|
75
|
+
loading ? (React.createElement(react_native_1.ActivityIndicator, { size: "small", color: color })) : (leftIcon),
|
|
76
|
+
React.createElement(react_native_1.Text, { style: [styles.text, { color: color, opacity: opacity }, textStyle] }, title),
|
|
77
|
+
!loading ? rightIcon : null)); };
|
|
49
78
|
if (variant === "glass") {
|
|
50
|
-
return (React.createElement(GlassCard_1.GlassCardFEA, { style: [styles.glassCard, style] },
|
|
51
|
-
React.createElement(react_native_1.TouchableOpacity, {
|
|
52
|
-
React.createElement(react_native_1.Text, { style: [
|
|
53
|
-
styles.text,
|
|
54
|
-
{ color: theme.colors.foreground, opacity: disabled ? 0.5 : 1 },
|
|
55
|
-
] }, title))));
|
|
79
|
+
return (React.createElement(GlassCard_1.GlassCardFEA, { style: [styles.glassCard, widthStyle, style] },
|
|
80
|
+
React.createElement(react_native_1.TouchableOpacity, __assign({}, touchableProps, { style: [styles.baseButton, sizeStyle] }), renderLabel(theme.colors.foreground, inactive ? 0.5 : 1))));
|
|
56
81
|
}
|
|
57
82
|
if (variant === "soft") {
|
|
58
|
-
return (React.createElement(react_native_1.TouchableOpacity, {
|
|
83
|
+
return (React.createElement(react_native_1.TouchableOpacity, __assign({}, touchableProps, { style: [
|
|
59
84
|
styles.baseButton,
|
|
60
85
|
sizeStyle,
|
|
61
86
|
styles.softButton,
|
|
62
87
|
{ backgroundColor: theme.colors.secondary, borderColor: theme.colors.border },
|
|
63
|
-
|
|
88
|
+
inactive && styles.disabled,
|
|
89
|
+
widthStyle,
|
|
64
90
|
style,
|
|
65
|
-
] },
|
|
66
|
-
React.createElement(react_native_1.Text, { style: [
|
|
67
|
-
styles.text,
|
|
68
|
-
{ color: theme.colors.secondaryForeground, opacity: disabled ? 0.6 : 1 },
|
|
69
|
-
] }, title)));
|
|
91
|
+
] }), renderLabel(theme.colors.secondaryForeground, inactive ? 0.6 : 1)));
|
|
70
92
|
}
|
|
71
93
|
if (variant === "outline") {
|
|
72
|
-
return (React.createElement(react_native_1.TouchableOpacity, {
|
|
94
|
+
return (React.createElement(react_native_1.TouchableOpacity, __assign({}, touchableProps, { style: [
|
|
73
95
|
styles.baseButton,
|
|
74
96
|
sizeStyle,
|
|
75
97
|
styles.outlineButton,
|
|
76
98
|
{
|
|
77
99
|
borderColor: theme.colors.border,
|
|
78
100
|
},
|
|
79
|
-
|
|
101
|
+
inactive && styles.disabled,
|
|
102
|
+
widthStyle,
|
|
80
103
|
style,
|
|
81
|
-
] },
|
|
82
|
-
React.createElement(react_native_1.Text, { style: [
|
|
83
|
-
styles.text,
|
|
84
|
-
{
|
|
85
|
-
color: theme.colors.foreground,
|
|
86
|
-
opacity: disabled ? 0.6 : 1,
|
|
87
|
-
},
|
|
88
|
-
] }, title)));
|
|
104
|
+
] }), renderLabel(theme.colors.foreground, inactive ? 0.6 : 1)));
|
|
89
105
|
}
|
|
90
106
|
if (variant === "ghost") {
|
|
91
|
-
return (React.createElement(react_native_1.TouchableOpacity, {
|
|
107
|
+
return (React.createElement(react_native_1.TouchableOpacity, __assign({}, touchableProps, { style: [
|
|
92
108
|
styles.baseButton,
|
|
93
109
|
sizeStyle,
|
|
94
110
|
styles.ghostButton,
|
|
95
|
-
|
|
111
|
+
inactive && styles.disabledGhost,
|
|
112
|
+
widthStyle,
|
|
96
113
|
style,
|
|
97
|
-
] },
|
|
98
|
-
React.createElement(react_native_1.Text, { style: [
|
|
99
|
-
styles.text,
|
|
100
|
-
{
|
|
101
|
-
color: theme.colors.foreground,
|
|
102
|
-
opacity: disabled ? 0.5 : 1,
|
|
103
|
-
},
|
|
104
|
-
] }, title)));
|
|
114
|
+
] }), renderLabel(theme.colors.foreground, inactive ? 0.5 : 1)));
|
|
105
115
|
}
|
|
106
|
-
return (React.createElement(react_native_1.TouchableOpacity, {
|
|
116
|
+
return (React.createElement(react_native_1.TouchableOpacity, __assign({}, touchableProps, { style: [
|
|
107
117
|
styles.baseButton,
|
|
108
118
|
sizeStyle,
|
|
109
119
|
{ backgroundColor: theme.colors.primary },
|
|
110
|
-
|
|
120
|
+
inactive && { opacity: 0.7 },
|
|
121
|
+
widthStyle,
|
|
111
122
|
style,
|
|
112
|
-
] },
|
|
113
|
-
React.createElement(react_native_1.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
] }),
|
|
124
|
+
React.createElement(react_native_1.View, { style: styles.contentRow },
|
|
125
|
+
loading ? (React.createElement(react_native_1.ActivityIndicator, { size: "small", color: theme.colors.primaryForeground })) : (leftIcon),
|
|
126
|
+
React.createElement(react_native_1.Text, { style: [
|
|
127
|
+
styles.text,
|
|
128
|
+
{ color: theme.colors.primaryForeground },
|
|
129
|
+
inactive && { opacity: 0.8 },
|
|
130
|
+
textStyle,
|
|
131
|
+
] }, title),
|
|
132
|
+
!loading ? rightIcon : null)));
|
|
118
133
|
};
|
|
119
134
|
exports.ButtonFEA = ButtonFEA;
|
|
120
135
|
var styles = react_native_1.StyleSheet.create({
|
|
136
|
+
contentRow: {
|
|
137
|
+
flexDirection: "row",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
justifyContent: "center",
|
|
140
|
+
gap: 8,
|
|
141
|
+
},
|
|
121
142
|
baseButton: {
|
|
122
143
|
borderRadius: 999,
|
|
123
144
|
justifyContent: "center",
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { StyleProp, ViewProps, ViewStyle } from "react-native";
|
|
3
3
|
type CardProps = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/** When set, the card is pressable (e.g. list row). */
|
|
7
|
+
onPress?: () => void;
|
|
8
|
+
/** Passed to the root `View` or `Pressable`. */
|
|
9
|
+
testID?: string;
|
|
10
|
+
} & Pick<ViewProps, "accessibilityLabel" | "accessibilityRole" | "accessibilityHint">;
|
|
11
|
+
export declare const CardFEA: ({ children, style, onPress, testID, accessibilityLabel, accessibilityRole, accessibilityHint, }: CardProps) => React.JSX.Element;
|
|
8
12
|
export {};
|
|
@@ -38,16 +38,23 @@ var React = __importStar(require("react"));
|
|
|
38
38
|
var react_native_1 = require("react-native");
|
|
39
39
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
40
40
|
var CardFEA = function (_a) {
|
|
41
|
-
var children = _a.children, style = _a.style;
|
|
41
|
+
var children = _a.children, style = _a.style, onPress = _a.onPress, testID = _a.testID, accessibilityLabel = _a.accessibilityLabel, accessibilityRole = _a.accessibilityRole, accessibilityHint = _a.accessibilityHint;
|
|
42
42
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
var cardStyle = [
|
|
44
|
+
styles.card,
|
|
45
|
+
{
|
|
46
|
+
backgroundColor: theme.colors.card,
|
|
47
|
+
borderColor: theme.colors.border,
|
|
48
|
+
},
|
|
49
|
+
style,
|
|
50
|
+
];
|
|
51
|
+
if (onPress) {
|
|
52
|
+
return (React.createElement(react_native_1.Pressable, { onPress: onPress, testID: testID, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole !== null && accessibilityRole !== void 0 ? accessibilityRole : "button", accessibilityHint: accessibilityHint, style: function (_a) {
|
|
53
|
+
var pressed = _a.pressed;
|
|
54
|
+
return [cardStyle, pressed && { opacity: 0.92 }];
|
|
55
|
+
} }, children));
|
|
56
|
+
}
|
|
57
|
+
return (React.createElement(react_native_1.View, { testID: testID, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole, accessibilityHint: accessibilityHint, style: cardStyle }, children));
|
|
51
58
|
};
|
|
52
59
|
exports.CardFEA = CardFEA;
|
|
53
60
|
var styles = react_native_1.StyleSheet.create({
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
export declare const CheckboxFEA: ({ checked, onChange, label, disabled, size, style, testID, accessibilityLabel, accessibilityHint, labelStyle, }: {
|
|
3
4
|
checked: boolean;
|
|
4
5
|
onChange: (next: boolean) => void;
|
|
5
6
|
label?: string;
|
|
6
7
|
disabled?: boolean;
|
|
8
|
+
/** Box width/height in dp. */
|
|
9
|
+
size?: number;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
testID?: string;
|
|
12
|
+
accessibilityLabel?: string;
|
|
13
|
+
accessibilityHint?: string;
|
|
14
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
7
15
|
}) => React.JSX.Element;
|
|
@@ -38,18 +38,27 @@ var React = __importStar(require("react"));
|
|
|
38
38
|
var react_native_1 = require("react-native");
|
|
39
39
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
40
40
|
var CheckboxFEA = function (_a) {
|
|
41
|
-
var checked = _a.checked, onChange = _a.onChange, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
41
|
+
var checked = _a.checked, onChange = _a.onChange, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 18 : _c, style = _a.style, testID = _a.testID, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, labelStyle = _a.labelStyle;
|
|
42
42
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
return (React.createElement(react_native_1.Pressable, { onPress: function () { return !disabled && onChange(!checked); }, style: styles.row, disabled: disabled },
|
|
43
|
+
return (React.createElement(react_native_1.Pressable, { testID: testID, accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : label, accessibilityHint: accessibilityHint, accessibilityRole: "checkbox", accessibilityState: { checked: checked, disabled: disabled }, onPress: function () { return !disabled && onChange(!checked); }, style: [styles.row, style], disabled: disabled },
|
|
44
44
|
React.createElement(react_native_1.View, { style: [
|
|
45
45
|
styles.box,
|
|
46
46
|
{
|
|
47
|
+
width: size,
|
|
48
|
+
height: size,
|
|
49
|
+
borderRadius: Math.max(4, size / 5),
|
|
47
50
|
borderColor: checked ? theme.colors.primary : theme.colors.input,
|
|
48
51
|
backgroundColor: checked ? theme.colors.primary : "transparent",
|
|
49
52
|
opacity: disabled ? 0.5 : 1,
|
|
50
53
|
},
|
|
51
|
-
] }, checked ? React.createElement(react_native_1.Text, { style:
|
|
52
|
-
|
|
54
|
+
] }, checked ? (React.createElement(react_native_1.Text, { style: [
|
|
55
|
+
styles.tick,
|
|
56
|
+
{ fontSize: Math.max(10, size * 0.65), lineHeight: Math.max(12, size * 0.72) },
|
|
57
|
+
] }, "\u2713")) : null),
|
|
58
|
+
label ? (React.createElement(react_native_1.Text, { style: [
|
|
59
|
+
{ color: theme.colors.foreground, opacity: disabled ? 0.6 : 1, flexShrink: 1 },
|
|
60
|
+
labelStyle,
|
|
61
|
+
] }, label)) : null));
|
|
53
62
|
};
|
|
54
63
|
exports.CheckboxFEA = CheckboxFEA;
|
|
55
64
|
var styles = react_native_1.StyleSheet.create({
|
|
@@ -59,17 +68,12 @@ var styles = react_native_1.StyleSheet.create({
|
|
|
59
68
|
gap: 8,
|
|
60
69
|
},
|
|
61
70
|
box: {
|
|
62
|
-
width: 18,
|
|
63
|
-
height: 18,
|
|
64
|
-
borderRadius: 4,
|
|
65
71
|
borderWidth: 1.5,
|
|
66
72
|
alignItems: "center",
|
|
67
73
|
justifyContent: "center",
|
|
68
74
|
},
|
|
69
75
|
tick: {
|
|
70
76
|
color: "#ffffff",
|
|
71
|
-
fontSize: 12,
|
|
72
|
-
lineHeight: 13,
|
|
73
77
|
fontWeight: "700",
|
|
74
78
|
},
|
|
75
79
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp,
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
style?: StyleProp<
|
|
2
|
+
import { StyleProp, TextInputProps, TextStyle } from "react-native";
|
|
3
|
+
export type InputFEAProps = Omit<TextInputProps, "placeholderTextColor" | "style"> & {
|
|
4
|
+
/** Merged after themed base styles. */
|
|
5
|
+
style?: StyleProp<TextStyle>;
|
|
6
6
|
};
|
|
7
|
-
export declare const InputFEA: ({
|
|
8
|
-
export {};
|
|
7
|
+
export declare const InputFEA: ({ style, editable, ...rest }: InputFEAProps) => React.JSX.Element;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -32,23 +43,35 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
43
|
return result;
|
|
33
44
|
};
|
|
34
45
|
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
35
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
58
|
exports.InputFEA = void 0;
|
|
37
59
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
38
60
|
var React = __importStar(require("react"));
|
|
39
61
|
var react_native_1 = require("react-native");
|
|
40
62
|
var InputFEA = function (_a) {
|
|
41
|
-
var
|
|
63
|
+
var style = _a.style, _b = _a.editable, editable = _b === void 0 ? true : _b, rest = __rest(_a, ["style", "editable"]);
|
|
42
64
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
return (React.createElement(react_native_1.TextInput, {
|
|
65
|
+
return (React.createElement(react_native_1.TextInput, __assign({ editable: editable, placeholderTextColor: theme.colors.mutedForeground }, rest, { style: [
|
|
44
66
|
styles.base,
|
|
45
67
|
{
|
|
46
68
|
backgroundColor: theme.colors.background,
|
|
47
69
|
color: theme.colors.foreground,
|
|
48
70
|
borderColor: theme.colors.input,
|
|
71
|
+
opacity: editable ? 1 : 0.55,
|
|
49
72
|
},
|
|
50
73
|
style,
|
|
51
|
-
] }));
|
|
74
|
+
] })));
|
|
52
75
|
};
|
|
53
76
|
exports.InputFEA = InputFEA;
|
|
54
77
|
var styles = react_native_1.StyleSheet.create({
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, TextStyle } from "react-native";
|
|
3
|
-
export declare const LabelFEA: ({ children, style, }: {
|
|
3
|
+
export declare const LabelFEA: ({ children, style, required, disabled, testID, nativeID, numberOfLines, }: {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
style?: StyleProp<TextStyle>;
|
|
6
|
+
/** Shows a trailing asterisk when true. */
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
testID?: string;
|
|
10
|
+
/** Wire to an input via `nativeID` / `accessibilityLabelledBy` patterns. */
|
|
11
|
+
nativeID?: string;
|
|
12
|
+
numberOfLines?: number;
|
|
6
13
|
}) => React.JSX.Element;
|
|
@@ -38,9 +38,15 @@ var React = __importStar(require("react"));
|
|
|
38
38
|
var react_native_1 = require("react-native");
|
|
39
39
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
40
40
|
var LabelFEA = function (_a) {
|
|
41
|
-
var children = _a.children, style = _a.style;
|
|
41
|
+
var children = _a.children, style = _a.style, required = _a.required, disabled = _a.disabled, testID = _a.testID, nativeID = _a.nativeID, numberOfLines = _a.numberOfLines;
|
|
42
42
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
return React.createElement(react_native_1.Text, {
|
|
43
|
+
return (React.createElement(react_native_1.Text, { nativeID: nativeID, testID: testID, numberOfLines: numberOfLines, style: [
|
|
44
|
+
styles.base,
|
|
45
|
+
{ color: theme.colors.foreground, opacity: disabled ? 0.6 : 1 },
|
|
46
|
+
style,
|
|
47
|
+
] },
|
|
48
|
+
children,
|
|
49
|
+
required ? React.createElement(react_native_1.Text, { style: { color: theme.colors.destructive } }, " *") : null));
|
|
44
50
|
};
|
|
45
51
|
exports.LabelFEA = LabelFEA;
|
|
46
52
|
var styles = react_native_1.StyleSheet.create({
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
export declare const SwitchFEA: ({ value, onValueChange, label, style, disabled, }: {
|
|
2
|
+
import { StyleProp, ViewStyle, ColorValue } from "react-native";
|
|
3
|
+
export declare const SwitchFEA: ({ value, onValueChange, label, labelPosition, style, disabled, testID, accessibilityLabel, thumbColor, ios_backgroundColor, }: {
|
|
4
4
|
value: boolean;
|
|
5
5
|
onValueChange: (next: boolean) => void;
|
|
6
6
|
label?: string;
|
|
7
|
+
/** Label row placement relative to the switch. */
|
|
8
|
+
labelPosition?: "left" | "right";
|
|
7
9
|
style?: StyleProp<ViewStyle>;
|
|
8
10
|
disabled?: boolean;
|
|
11
|
+
testID?: string;
|
|
12
|
+
accessibilityLabel?: string;
|
|
13
|
+
/** Overrides default white thumb. */
|
|
14
|
+
thumbColor?: ColorValue;
|
|
15
|
+
ios_backgroundColor?: ColorValue;
|
|
9
16
|
}) => React.JSX.Element;
|
|
@@ -38,10 +38,16 @@ var React = __importStar(require("react"));
|
|
|
38
38
|
var react_native_1 = require("react-native");
|
|
39
39
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
40
40
|
var SwitchFEA = function (_a) {
|
|
41
|
-
var value = _a.value, onValueChange = _a.onValueChange, label = _a.label, style = _a.style,
|
|
41
|
+
var value = _a.value, onValueChange = _a.onValueChange, label = _a.label, _b = _a.labelPosition, labelPosition = _b === void 0 ? "left" : _b, style = _a.style, _c = _a.disabled, disabled = _c === void 0 ? false : _c, testID = _a.testID, accessibilityLabel = _a.accessibilityLabel, thumbColor = _a.thumbColor, ios_backgroundColor = _a.ios_backgroundColor;
|
|
42
42
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
var labelEl = label ? (React.createElement(react_native_1.Text, { style: { color: theme.colors.foreground, opacity: disabled ? 0.6 : 1, flexShrink: 1 } }, label)) : null;
|
|
44
|
+
var track = { false: theme.colors.input, true: theme.colors.primary };
|
|
45
|
+
var sw = (React.createElement(react_native_1.Switch, { testID: testID, accessibilityLabel: accessibilityLabel !== null && accessibilityLabel !== void 0 ? accessibilityLabel : label, value: value, onValueChange: onValueChange, disabled: disabled, trackColor: track, thumbColor: thumbColor !== null && thumbColor !== void 0 ? thumbColor : "#ffffff", ios_backgroundColor: ios_backgroundColor }));
|
|
46
|
+
return (React.createElement(react_native_1.View, { style: [
|
|
47
|
+
{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 12 },
|
|
48
|
+
style,
|
|
49
|
+
] }, labelPosition === "left" ? (React.createElement(React.Fragment, null, labelEl !== null && labelEl !== void 0 ? labelEl : React.createElement(react_native_1.View, null),
|
|
50
|
+
sw)) : (React.createElement(React.Fragment, null,
|
|
51
|
+
sw, labelEl !== null && labelEl !== void 0 ? labelEl : React.createElement(react_native_1.View, null)))));
|
|
46
52
|
};
|
|
47
53
|
exports.SwitchFEA = SwitchFEA;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp,
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}) => React.JSX.Element;
|
|
2
|
+
import { StyleProp, TextInputProps, TextStyle } from "react-native";
|
|
3
|
+
export type TextareaFEAProps = Omit<TextInputProps, "placeholderTextColor" | "style" | "multiline"> & {
|
|
4
|
+
style?: StyleProp<TextStyle>;
|
|
5
|
+
};
|
|
6
|
+
export declare const TextareaFEA: ({ style, editable, ...rest }: TextareaFEAProps) => React.JSX.Element;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -32,23 +43,35 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
43
|
return result;
|
|
33
44
|
};
|
|
34
45
|
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
35
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
58
|
exports.TextareaFEA = void 0;
|
|
37
59
|
var React = __importStar(require("react"));
|
|
38
60
|
var react_native_1 = require("react-native");
|
|
39
61
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
40
62
|
var TextareaFEA = function (_a) {
|
|
41
|
-
var
|
|
63
|
+
var style = _a.style, _b = _a.editable, editable = _b === void 0 ? true : _b, rest = __rest(_a, ["style", "editable"]);
|
|
42
64
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
|
-
return (React.createElement(react_native_1.TextInput, { multiline: true, textAlignVertical: "top",
|
|
65
|
+
return (React.createElement(react_native_1.TextInput, __assign({ multiline: true, textAlignVertical: "top", editable: editable, placeholderTextColor: theme.colors.mutedForeground }, rest, { style: [
|
|
44
66
|
styles.base,
|
|
45
67
|
{
|
|
46
68
|
backgroundColor: theme.colors.background,
|
|
47
69
|
color: theme.colors.foreground,
|
|
48
70
|
borderColor: theme.colors.input,
|
|
71
|
+
opacity: editable ? 1 : 0.55,
|
|
49
72
|
},
|
|
50
73
|
style,
|
|
51
|
-
] }));
|
|
74
|
+
] })));
|
|
52
75
|
};
|
|
53
76
|
exports.TextareaFEA = TextareaFEA;
|
|
54
77
|
var styles = react_native_1.StyleSheet.create({
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, TextStyle } from "react-native";
|
|
3
3
|
type TypographyVariant = "h1" | "h2" | "h3" | "p" | "small" | "muted";
|
|
4
|
-
export declare const TypographyFEA: ({ children, variant, style, }: {
|
|
4
|
+
export declare const TypographyFEA: ({ children, variant, style, numberOfLines, ellipsizeMode, selectable, testID, maxFontSizeMultiplier, onPress, accessibilityRole, }: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
variant?: TypographyVariant;
|
|
7
7
|
style?: StyleProp<TextStyle>;
|
|
8
|
+
numberOfLines?: number;
|
|
9
|
+
ellipsizeMode?: "head" | "middle" | "tail" | "clip";
|
|
10
|
+
selectable?: boolean;
|
|
11
|
+
testID?: string;
|
|
12
|
+
maxFontSizeMultiplier?: number;
|
|
13
|
+
onPress?: () => void;
|
|
14
|
+
accessibilityRole?: "text" | "header" | "link" | "none";
|
|
8
15
|
}) => React.JSX.Element;
|
|
9
16
|
export {};
|
|
@@ -38,7 +38,7 @@ var React = __importStar(require("react"));
|
|
|
38
38
|
var react_native_1 = require("react-native");
|
|
39
39
|
var ThemeFEAVUiProvider_1 = require("../../theme/ThemeFEAVUiProvider");
|
|
40
40
|
var TypographyFEA = function (_a) {
|
|
41
|
-
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "p" : _b, style = _a.style;
|
|
41
|
+
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "p" : _b, style = _a.style, numberOfLines = _a.numberOfLines, ellipsizeMode = _a.ellipsizeMode, selectable = _a.selectable, testID = _a.testID, maxFontSizeMultiplier = _a.maxFontSizeMultiplier, onPress = _a.onPress, accessibilityRole = _a.accessibilityRole;
|
|
42
42
|
var theme = (0, ThemeFEAVUiProvider_1.useTheme)().theme;
|
|
43
43
|
var variantStyle = variant === "h1"
|
|
44
44
|
? styles.h1
|
|
@@ -51,7 +51,7 @@ var TypographyFEA = function (_a) {
|
|
|
51
51
|
: variant === "muted"
|
|
52
52
|
? styles.muted
|
|
53
53
|
: styles.p;
|
|
54
|
-
return (React.createElement(react_native_1.Text, { style: [
|
|
54
|
+
return (React.createElement(react_native_1.Text, { testID: testID, accessibilityRole: accessibilityRole, numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode, selectable: selectable, maxFontSizeMultiplier: maxFontSizeMultiplier, onPress: onPress, style: [
|
|
55
55
|
variantStyle,
|
|
56
56
|
{
|
|
57
57
|
color: variant === "muted" ? theme.colors.mutedForeground : theme.colors.foreground,
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { ViewStyle } from "react-native";
|
|
3
|
+
type ShowcaseScreenPropsFEA = {
|
|
4
|
+
contentContainerStyle?: ViewStyle;
|
|
5
|
+
};
|
|
6
|
+
export declare const ShowcaseScreenFEA: ({ contentContainerStyle }: ShowcaseScreenPropsFEA) => React.JSX.Element;
|
|
7
|
+
export declare const ShowcaseWithProviderFEA: (props: ShowcaseScreenPropsFEA) => React.JSX.Element;
|
|
8
|
+
export declare const ShowcaseFEA: (props: ShowcaseScreenPropsFEA) => React.JSX.Element;
|
|
9
|
+
export declare const Showcase: (props: ShowcaseScreenPropsFEA) => React.JSX.Element;
|
|
10
|
+
export {};
|