@terreno/ui 0.1.0 → 0.3.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/AIRequestExplorer.d.ts +31 -0
- package/dist/AIRequestExplorer.js +44 -0
- package/dist/AIRequestExplorer.js.map +1 -0
- package/dist/AttachmentPreview.d.ts +8 -0
- package/dist/AttachmentPreview.js +16 -0
- package/dist/AttachmentPreview.js.map +1 -0
- package/dist/Common.d.ts +44 -0
- package/dist/FilePickerButton.d.ts +13 -0
- package/dist/FilePickerButton.js +50 -0
- package/dist/FilePickerButton.js.map +1 -0
- package/dist/GPTChat.d.ts +66 -0
- package/dist/GPTChat.js +112 -0
- package/dist/GPTChat.js.map +1 -0
- package/dist/GPTMemoryModal.d.ts +8 -0
- package/dist/GPTMemoryModal.js +14 -0
- package/dist/GPTMemoryModal.js.map +1 -0
- package/dist/SocialLoginButton.d.ts +19 -0
- package/dist/SocialLoginButton.js +119 -0
- package/dist/SocialLoginButton.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/login/LoginScreen.d.ts +25 -0
- package/dist/login/LoginScreen.js +55 -0
- package/dist/login/LoginScreen.js.map +1 -0
- package/dist/login/index.d.ts +2 -0
- package/dist/login/index.js +2 -0
- package/dist/login/index.js.map +1 -0
- package/dist/login/loginTypes.d.ts +48 -0
- package/dist/login/loginTypes.js +2 -0
- package/dist/login/loginTypes.js.map +1 -0
- package/dist/signUp/OAuthButtons.d.ts +18 -0
- package/dist/signUp/OAuthButtons.js +15 -0
- package/dist/signUp/OAuthButtons.js.map +1 -0
- package/dist/signUp/PasswordRequirements.d.ts +15 -0
- package/dist/signUp/PasswordRequirements.js +14 -0
- package/dist/signUp/PasswordRequirements.js.map +1 -0
- package/dist/signUp/SignUpScreen.d.ts +26 -0
- package/dist/signUp/SignUpScreen.js +64 -0
- package/dist/signUp/SignUpScreen.js.map +1 -0
- package/dist/signUp/Swiper.d.ts +13 -0
- package/dist/signUp/Swiper.js +16 -0
- package/dist/signUp/Swiper.js.map +1 -0
- package/dist/signUp/index.d.ts +6 -0
- package/dist/signUp/index.js +6 -0
- package/dist/signUp/index.js.map +1 -0
- package/dist/signUp/passwordPresets.d.ts +9 -0
- package/dist/signUp/passwordPresets.js +41 -0
- package/dist/signUp/passwordPresets.js.map +1 -0
- package/dist/signUp/signUpTypes.d.ts +90 -0
- package/dist/signUp/signUpTypes.js +2 -0
- package/dist/signUp/signUpTypes.js.map +1 -0
- package/package.json +4 -2
- package/src/AIRequestExplorer.tsx +147 -0
- package/src/AttachmentPreview.tsx +63 -0
- package/src/Common.ts +52 -0
- package/src/FilePickerButton.tsx +88 -0
- package/src/GPTChat.tsx +551 -0
- package/src/GPTMemoryModal.tsx +50 -0
- package/src/SocialLoginButton.test.tsx +158 -0
- package/src/SocialLoginButton.tsx +182 -0
- package/src/__snapshots__/SocialLoginButton.test.tsx.snap +277 -0
- package/src/index.tsx +9 -0
- package/src/login/LoginScreen.test.tsx +148 -0
- package/src/login/LoginScreen.tsx +159 -0
- package/src/login/__snapshots__/LoginScreen.test.tsx.snap +630 -0
- package/src/login/index.ts +2 -0
- package/src/login/loginTypes.ts +51 -0
- package/src/signUp/OAuthButtons.test.tsx +45 -0
- package/src/signUp/OAuthButtons.tsx +52 -0
- package/src/signUp/PasswordRequirements.test.tsx +41 -0
- package/src/signUp/PasswordRequirements.tsx +49 -0
- package/src/signUp/SignUpScreen.test.tsx +134 -0
- package/src/signUp/SignUpScreen.tsx +172 -0
- package/src/signUp/Swiper.test.tsx +46 -0
- package/src/signUp/Swiper.tsx +59 -0
- package/src/signUp/__snapshots__/OAuthButtons.test.tsx.snap +272 -0
- package/src/signUp/__snapshots__/PasswordRequirements.test.tsx.snap +427 -0
- package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +851 -0
- package/src/signUp/__snapshots__/Swiper.test.tsx.snap +249 -0
- package/src/signUp/index.ts +13 -0
- package/src/signUp/passwordPresets.test.ts +57 -0
- package/src/signUp/passwordPresets.ts +43 -0
- package/src/signUp/signUpTypes.ts +94 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import {describe, expect, it, mock} from "bun:test";
|
|
2
|
+
import {fireEvent} from "@testing-library/react-native";
|
|
3
|
+
|
|
4
|
+
import {SocialLoginButton} from "./SocialLoginButton";
|
|
5
|
+
import {renderWithTheme} from "./test-utils";
|
|
6
|
+
|
|
7
|
+
describe("SocialLoginButton", () => {
|
|
8
|
+
const createMockOnPress = () => mock(() => Promise.resolve());
|
|
9
|
+
|
|
10
|
+
it("renders correctly with Google provider", () => {
|
|
11
|
+
const onPress = createMockOnPress();
|
|
12
|
+
const {toJSON} = renderWithTheme(<SocialLoginButton onPress={onPress} provider="google" />);
|
|
13
|
+
expect(toJSON()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("renders correctly with GitHub provider", () => {
|
|
17
|
+
const onPress = createMockOnPress();
|
|
18
|
+
const {toJSON} = renderWithTheme(<SocialLoginButton onPress={onPress} provider="github" />);
|
|
19
|
+
expect(toJSON()).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("renders correctly with Apple provider", () => {
|
|
23
|
+
const onPress = createMockOnPress();
|
|
24
|
+
const {toJSON} = renderWithTheme(<SocialLoginButton onPress={onPress} provider="apple" />);
|
|
25
|
+
expect(toJSON()).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("displays default text for each provider", () => {
|
|
29
|
+
const onPress = createMockOnPress();
|
|
30
|
+
|
|
31
|
+
const {getByText: getGoogleText} = renderWithTheme(
|
|
32
|
+
<SocialLoginButton onPress={onPress} provider="google" />
|
|
33
|
+
);
|
|
34
|
+
expect(getGoogleText("Continue with Google")).toBeTruthy();
|
|
35
|
+
|
|
36
|
+
const {getByText: getGitHubText} = renderWithTheme(
|
|
37
|
+
<SocialLoginButton onPress={onPress} provider="github" />
|
|
38
|
+
);
|
|
39
|
+
expect(getGitHubText("Continue with GitHub")).toBeTruthy();
|
|
40
|
+
|
|
41
|
+
const {getByText: getAppleText} = renderWithTheme(
|
|
42
|
+
<SocialLoginButton onPress={onPress} provider="apple" />
|
|
43
|
+
);
|
|
44
|
+
expect(getAppleText("Continue with Apple")).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("displays custom text when provided", () => {
|
|
48
|
+
const onPress = createMockOnPress();
|
|
49
|
+
const customText = "Sign in with Google";
|
|
50
|
+
|
|
51
|
+
const {getByText} = renderWithTheme(
|
|
52
|
+
<SocialLoginButton onPress={onPress} provider="google" text={customText} />
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
expect(getByText(customText)).toBeTruthy();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("renders with outline variant", () => {
|
|
59
|
+
const onPress = createMockOnPress();
|
|
60
|
+
const {toJSON} = renderWithTheme(
|
|
61
|
+
<SocialLoginButton onPress={onPress} provider="google" variant="outline" />
|
|
62
|
+
);
|
|
63
|
+
expect(toJSON()).toMatchSnapshot();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("calls onPress when button is pressed", async () => {
|
|
67
|
+
const onPress = createMockOnPress();
|
|
68
|
+
const {getByTestId} = renderWithTheme(
|
|
69
|
+
<SocialLoginButton onPress={onPress} provider="google" testID="google-login" />
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const button = getByTestId("google-login");
|
|
73
|
+
fireEvent.press(button);
|
|
74
|
+
|
|
75
|
+
// Wait for debounce
|
|
76
|
+
await new Promise((resolve) => setTimeout(resolve, 600));
|
|
77
|
+
|
|
78
|
+
expect(onPress).toHaveBeenCalled();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("disables button when disabled prop is true", () => {
|
|
82
|
+
const onPress = createMockOnPress();
|
|
83
|
+
const {getByTestId} = renderWithTheme(
|
|
84
|
+
<SocialLoginButton disabled onPress={onPress} provider="google" />
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const button = getByTestId("social-login-google");
|
|
88
|
+
expect(button.props.disabled).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("disables button when loading is true", () => {
|
|
92
|
+
const onPress = createMockOnPress();
|
|
93
|
+
const {getByTestId} = renderWithTheme(
|
|
94
|
+
<SocialLoginButton loading onPress={onPress} provider="google" />
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const button = getByTestId("social-login-google");
|
|
98
|
+
expect(button.props.disabled).toBe(true);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("uses correct testID", () => {
|
|
102
|
+
const onPress = createMockOnPress();
|
|
103
|
+
const {getByTestId} = renderWithTheme(
|
|
104
|
+
<SocialLoginButton onPress={onPress} provider="google" testID="custom-test-id" />
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
expect(getByTestId("custom-test-id")).toBeTruthy();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("uses default testID based on provider", () => {
|
|
111
|
+
const onPress = createMockOnPress();
|
|
112
|
+
const {getByTestId} = renderWithTheme(
|
|
113
|
+
<SocialLoginButton onPress={onPress} provider="github" />
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
expect(getByTestId("social-login-github")).toBeTruthy();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("renders full width by default", () => {
|
|
120
|
+
const onPress = createMockOnPress();
|
|
121
|
+
const {getByTestId} = renderWithTheme(
|
|
122
|
+
<SocialLoginButton onPress={onPress} provider="google" />
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const button = getByTestId("social-login-google");
|
|
126
|
+
expect(button).toHaveStyle({width: "100%"});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("renders auto width when fullWidth is false", () => {
|
|
130
|
+
const onPress = createMockOnPress();
|
|
131
|
+
const {getByTestId} = renderWithTheme(
|
|
132
|
+
<SocialLoginButton fullWidth={false} onPress={onPress} provider="google" />
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const button = getByTestId("social-login-google");
|
|
136
|
+
expect(button).toHaveStyle({width: "auto"});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("has correct accessibility label", () => {
|
|
140
|
+
const onPress = createMockOnPress();
|
|
141
|
+
const {getByTestId} = renderWithTheme(
|
|
142
|
+
<SocialLoginButton onPress={onPress} provider="google" text="Sign in with Google" />
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
const button = getByTestId("social-login-google");
|
|
146
|
+
expect(button.props["aria-label"]).toBe("Sign in with Google");
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("has correct accessibility hint", () => {
|
|
150
|
+
const onPress = createMockOnPress();
|
|
151
|
+
const {getByTestId} = renderWithTheme(
|
|
152
|
+
<SocialLoginButton onPress={onPress} provider="google" />
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
const button = getByTestId("social-login-google");
|
|
156
|
+
expect(button.props.accessibilityHint).toBe("Sign in with Google");
|
|
157
|
+
});
|
|
158
|
+
});
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
|
|
2
|
+
import debounce from "lodash/debounce";
|
|
3
|
+
import {type FC, useMemo, useState} from "react";
|
|
4
|
+
import {ActivityIndicator, Pressable, Text, View} from "react-native";
|
|
5
|
+
|
|
6
|
+
import {Box} from "./Box";
|
|
7
|
+
import type {SocialLoginButtonProps} from "./Common";
|
|
8
|
+
import {useTheme} from "./Theme";
|
|
9
|
+
import {Unifier} from "./Unifier";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Brand colors for social login providers
|
|
13
|
+
*/
|
|
14
|
+
const PROVIDER_COLORS = {
|
|
15
|
+
apple: {
|
|
16
|
+
background: "#000000",
|
|
17
|
+
border: "#000000",
|
|
18
|
+
text: "#ffffff",
|
|
19
|
+
},
|
|
20
|
+
github: {
|
|
21
|
+
background: "#24292e",
|
|
22
|
+
border: "#24292e",
|
|
23
|
+
text: "#ffffff",
|
|
24
|
+
},
|
|
25
|
+
google: {
|
|
26
|
+
background: "#ffffff",
|
|
27
|
+
border: "#dadce0",
|
|
28
|
+
text: "#1f1f1f",
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Font Awesome icon names for social providers
|
|
34
|
+
*/
|
|
35
|
+
const PROVIDER_ICONS: Record<string, string> = {
|
|
36
|
+
apple: "apple",
|
|
37
|
+
github: "github",
|
|
38
|
+
google: "google",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Display names for social providers
|
|
43
|
+
*/
|
|
44
|
+
const PROVIDER_NAMES: Record<string, string> = {
|
|
45
|
+
apple: "Apple",
|
|
46
|
+
github: "GitHub",
|
|
47
|
+
google: "Google",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A branded social login button for OAuth authentication.
|
|
52
|
+
*
|
|
53
|
+
* Supports Google, GitHub, and Apple sign-in with appropriate brand colors
|
|
54
|
+
* and icons following each provider's brand guidelines.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <SocialLoginButton
|
|
59
|
+
* provider="google"
|
|
60
|
+
* onPress={async () => {
|
|
61
|
+
* await authClient.signIn.social({ provider: "google" });
|
|
62
|
+
* }}
|
|
63
|
+
* />
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export const SocialLoginButton: FC<SocialLoginButtonProps> = ({
|
|
67
|
+
provider,
|
|
68
|
+
onPress,
|
|
69
|
+
loading: propsLoading,
|
|
70
|
+
variant = "primary",
|
|
71
|
+
disabled = false,
|
|
72
|
+
fullWidth = true,
|
|
73
|
+
text,
|
|
74
|
+
testID,
|
|
75
|
+
}) => {
|
|
76
|
+
const [loading, setLoading] = useState(propsLoading);
|
|
77
|
+
const {theme} = useTheme();
|
|
78
|
+
|
|
79
|
+
const {backgroundColor, borderColor, textColor} = useMemo(() => {
|
|
80
|
+
const colors = PROVIDER_COLORS[provider];
|
|
81
|
+
|
|
82
|
+
if (variant === "outline") {
|
|
83
|
+
return {
|
|
84
|
+
backgroundColor: theme?.surface.base ?? "#ffffff",
|
|
85
|
+
borderColor: colors.border,
|
|
86
|
+
textColor: theme?.text.primary ?? "#1f1f1f",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
backgroundColor: colors.background,
|
|
92
|
+
borderColor: colors.border,
|
|
93
|
+
textColor: colors.text,
|
|
94
|
+
};
|
|
95
|
+
}, [provider, variant, theme]);
|
|
96
|
+
|
|
97
|
+
const iconName = PROVIDER_ICONS[provider];
|
|
98
|
+
const providerName = PROVIDER_NAMES[provider];
|
|
99
|
+
const buttonText = text ?? `Continue with ${providerName}`;
|
|
100
|
+
|
|
101
|
+
const handlePress = useMemo(
|
|
102
|
+
() =>
|
|
103
|
+
debounce(
|
|
104
|
+
async () => {
|
|
105
|
+
await Unifier.utils.haptic();
|
|
106
|
+
setLoading(true);
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
await onPress();
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(`Social login error (${provider}):`, error);
|
|
112
|
+
} finally {
|
|
113
|
+
setLoading(false);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
500,
|
|
117
|
+
{leading: true}
|
|
118
|
+
),
|
|
119
|
+
[onPress, provider]
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
if (!theme) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const isDisabled = disabled || loading;
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<Pressable
|
|
130
|
+
accessibilityHint={`Sign in with ${providerName}`}
|
|
131
|
+
aria-label={buttonText}
|
|
132
|
+
aria-role="button"
|
|
133
|
+
disabled={isDisabled}
|
|
134
|
+
onPress={handlePress}
|
|
135
|
+
style={{
|
|
136
|
+
alignItems: "center",
|
|
137
|
+
alignSelf: fullWidth ? "stretch" : undefined,
|
|
138
|
+
backgroundColor: isDisabled ? theme.surface.disabled : backgroundColor,
|
|
139
|
+
borderColor,
|
|
140
|
+
borderRadius: theme.radius.rounded,
|
|
141
|
+
borderWidth: 1,
|
|
142
|
+
flexDirection: "row",
|
|
143
|
+
justifyContent: "center",
|
|
144
|
+
opacity: isDisabled ? 0.6 : 1,
|
|
145
|
+
paddingHorizontal: 20,
|
|
146
|
+
paddingVertical: 12,
|
|
147
|
+
width: fullWidth ? "100%" : "auto",
|
|
148
|
+
}}
|
|
149
|
+
testID={testID ?? `social-login-${provider}`}
|
|
150
|
+
>
|
|
151
|
+
<View style={{alignItems: "center", flexDirection: "row"}}>
|
|
152
|
+
{Boolean(iconName) && (
|
|
153
|
+
<View style={{marginRight: 12}}>
|
|
154
|
+
<FontAwesome6
|
|
155
|
+
brand
|
|
156
|
+
color={isDisabled ? theme.text.secondaryLight : textColor}
|
|
157
|
+
name={iconName}
|
|
158
|
+
size={20}
|
|
159
|
+
/>
|
|
160
|
+
</View>
|
|
161
|
+
)}
|
|
162
|
+
<Text
|
|
163
|
+
style={{
|
|
164
|
+
color: isDisabled ? theme.text.secondaryLight : textColor,
|
|
165
|
+
fontSize: 16,
|
|
166
|
+
fontWeight: "600",
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
{buttonText}
|
|
170
|
+
</Text>
|
|
171
|
+
{Boolean(loading) && (
|
|
172
|
+
<Box marginLeft={2}>
|
|
173
|
+
<ActivityIndicator
|
|
174
|
+
color={isDisabled ? theme.text.secondaryLight : textColor}
|
|
175
|
+
size="small"
|
|
176
|
+
/>
|
|
177
|
+
</Box>
|
|
178
|
+
)}
|
|
179
|
+
</View>
|
|
180
|
+
</Pressable>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
|
|
2
|
+
|
|
3
|
+
exports[`SocialLoginButton renders correctly with Google provider 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"$$typeof": Symbol(react.test.json),
|
|
6
|
+
"children": [
|
|
7
|
+
{
|
|
8
|
+
"$$typeof": Symbol(react.test.json),
|
|
9
|
+
"children": [
|
|
10
|
+
{
|
|
11
|
+
"$$typeof": Symbol(react.test.json),
|
|
12
|
+
"children": null,
|
|
13
|
+
"props": {
|
|
14
|
+
"style": {
|
|
15
|
+
"marginRight": 12,
|
|
16
|
+
},
|
|
17
|
+
"testID": undefined,
|
|
18
|
+
},
|
|
19
|
+
"type": "View",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"$$typeof": Symbol(react.test.json),
|
|
23
|
+
"children": [
|
|
24
|
+
"Continue with Google",
|
|
25
|
+
],
|
|
26
|
+
"props": {
|
|
27
|
+
"style": {
|
|
28
|
+
"color": "#1f1f1f",
|
|
29
|
+
"fontSize": 16,
|
|
30
|
+
"fontWeight": "600",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
"type": "Text",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
"props": {
|
|
37
|
+
"style": {
|
|
38
|
+
"alignItems": "center",
|
|
39
|
+
"flexDirection": "row",
|
|
40
|
+
},
|
|
41
|
+
"testID": undefined,
|
|
42
|
+
},
|
|
43
|
+
"type": "View",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
"props": {
|
|
47
|
+
"accessibilityHint": "Sign in with Google",
|
|
48
|
+
"aria-label": "Continue with Google",
|
|
49
|
+
"aria-role": "button",
|
|
50
|
+
"disabled": undefined,
|
|
51
|
+
"onPress": [Function: debounced],
|
|
52
|
+
"style": {
|
|
53
|
+
"alignItems": "center",
|
|
54
|
+
"alignSelf": "stretch",
|
|
55
|
+
"backgroundColor": "#ffffff",
|
|
56
|
+
"borderColor": "#dadce0",
|
|
57
|
+
"borderRadius": 360,
|
|
58
|
+
"borderWidth": 1,
|
|
59
|
+
"flexDirection": "row",
|
|
60
|
+
"justifyContent": "center",
|
|
61
|
+
"opacity": 1,
|
|
62
|
+
"paddingHorizontal": 20,
|
|
63
|
+
"paddingVertical": 12,
|
|
64
|
+
"width": "100%",
|
|
65
|
+
},
|
|
66
|
+
"testID": "social-login-google",
|
|
67
|
+
},
|
|
68
|
+
"type": "Pressable",
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
exports[`SocialLoginButton renders correctly with GitHub provider 1`] = `
|
|
73
|
+
{
|
|
74
|
+
"$$typeof": Symbol(react.test.json),
|
|
75
|
+
"children": [
|
|
76
|
+
{
|
|
77
|
+
"$$typeof": Symbol(react.test.json),
|
|
78
|
+
"children": [
|
|
79
|
+
{
|
|
80
|
+
"$$typeof": Symbol(react.test.json),
|
|
81
|
+
"children": null,
|
|
82
|
+
"props": {
|
|
83
|
+
"style": {
|
|
84
|
+
"marginRight": 12,
|
|
85
|
+
},
|
|
86
|
+
"testID": undefined,
|
|
87
|
+
},
|
|
88
|
+
"type": "View",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"$$typeof": Symbol(react.test.json),
|
|
92
|
+
"children": [
|
|
93
|
+
"Continue with GitHub",
|
|
94
|
+
],
|
|
95
|
+
"props": {
|
|
96
|
+
"style": {
|
|
97
|
+
"color": "#ffffff",
|
|
98
|
+
"fontSize": 16,
|
|
99
|
+
"fontWeight": "600",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
"type": "Text",
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
"props": {
|
|
106
|
+
"style": {
|
|
107
|
+
"alignItems": "center",
|
|
108
|
+
"flexDirection": "row",
|
|
109
|
+
},
|
|
110
|
+
"testID": undefined,
|
|
111
|
+
},
|
|
112
|
+
"type": "View",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
"props": {
|
|
116
|
+
"accessibilityHint": "Sign in with GitHub",
|
|
117
|
+
"aria-label": "Continue with GitHub",
|
|
118
|
+
"aria-role": "button",
|
|
119
|
+
"disabled": undefined,
|
|
120
|
+
"onPress": [Function: debounced],
|
|
121
|
+
"style": {
|
|
122
|
+
"alignItems": "center",
|
|
123
|
+
"alignSelf": "stretch",
|
|
124
|
+
"backgroundColor": "#24292e",
|
|
125
|
+
"borderColor": "#24292e",
|
|
126
|
+
"borderRadius": 360,
|
|
127
|
+
"borderWidth": 1,
|
|
128
|
+
"flexDirection": "row",
|
|
129
|
+
"justifyContent": "center",
|
|
130
|
+
"opacity": 1,
|
|
131
|
+
"paddingHorizontal": 20,
|
|
132
|
+
"paddingVertical": 12,
|
|
133
|
+
"width": "100%",
|
|
134
|
+
},
|
|
135
|
+
"testID": "social-login-github",
|
|
136
|
+
},
|
|
137
|
+
"type": "Pressable",
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
|
|
141
|
+
exports[`SocialLoginButton renders correctly with Apple provider 1`] = `
|
|
142
|
+
{
|
|
143
|
+
"$$typeof": Symbol(react.test.json),
|
|
144
|
+
"children": [
|
|
145
|
+
{
|
|
146
|
+
"$$typeof": Symbol(react.test.json),
|
|
147
|
+
"children": [
|
|
148
|
+
{
|
|
149
|
+
"$$typeof": Symbol(react.test.json),
|
|
150
|
+
"children": null,
|
|
151
|
+
"props": {
|
|
152
|
+
"style": {
|
|
153
|
+
"marginRight": 12,
|
|
154
|
+
},
|
|
155
|
+
"testID": undefined,
|
|
156
|
+
},
|
|
157
|
+
"type": "View",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"$$typeof": Symbol(react.test.json),
|
|
161
|
+
"children": [
|
|
162
|
+
"Continue with Apple",
|
|
163
|
+
],
|
|
164
|
+
"props": {
|
|
165
|
+
"style": {
|
|
166
|
+
"color": "#ffffff",
|
|
167
|
+
"fontSize": 16,
|
|
168
|
+
"fontWeight": "600",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
"type": "Text",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
"props": {
|
|
175
|
+
"style": {
|
|
176
|
+
"alignItems": "center",
|
|
177
|
+
"flexDirection": "row",
|
|
178
|
+
},
|
|
179
|
+
"testID": undefined,
|
|
180
|
+
},
|
|
181
|
+
"type": "View",
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
"props": {
|
|
185
|
+
"accessibilityHint": "Sign in with Apple",
|
|
186
|
+
"aria-label": "Continue with Apple",
|
|
187
|
+
"aria-role": "button",
|
|
188
|
+
"disabled": undefined,
|
|
189
|
+
"onPress": [Function: debounced],
|
|
190
|
+
"style": {
|
|
191
|
+
"alignItems": "center",
|
|
192
|
+
"alignSelf": "stretch",
|
|
193
|
+
"backgroundColor": "#000000",
|
|
194
|
+
"borderColor": "#000000",
|
|
195
|
+
"borderRadius": 360,
|
|
196
|
+
"borderWidth": 1,
|
|
197
|
+
"flexDirection": "row",
|
|
198
|
+
"justifyContent": "center",
|
|
199
|
+
"opacity": 1,
|
|
200
|
+
"paddingHorizontal": 20,
|
|
201
|
+
"paddingVertical": 12,
|
|
202
|
+
"width": "100%",
|
|
203
|
+
},
|
|
204
|
+
"testID": "social-login-apple",
|
|
205
|
+
},
|
|
206
|
+
"type": "Pressable",
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
209
|
+
|
|
210
|
+
exports[`SocialLoginButton renders with outline variant 1`] = `
|
|
211
|
+
{
|
|
212
|
+
"$$typeof": Symbol(react.test.json),
|
|
213
|
+
"children": [
|
|
214
|
+
{
|
|
215
|
+
"$$typeof": Symbol(react.test.json),
|
|
216
|
+
"children": [
|
|
217
|
+
{
|
|
218
|
+
"$$typeof": Symbol(react.test.json),
|
|
219
|
+
"children": null,
|
|
220
|
+
"props": {
|
|
221
|
+
"style": {
|
|
222
|
+
"marginRight": 12,
|
|
223
|
+
},
|
|
224
|
+
"testID": undefined,
|
|
225
|
+
},
|
|
226
|
+
"type": "View",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"$$typeof": Symbol(react.test.json),
|
|
230
|
+
"children": [
|
|
231
|
+
"Continue with Google",
|
|
232
|
+
],
|
|
233
|
+
"props": {
|
|
234
|
+
"style": {
|
|
235
|
+
"color": "#1C1C1C",
|
|
236
|
+
"fontSize": 16,
|
|
237
|
+
"fontWeight": "600",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
"type": "Text",
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
"props": {
|
|
244
|
+
"style": {
|
|
245
|
+
"alignItems": "center",
|
|
246
|
+
"flexDirection": "row",
|
|
247
|
+
},
|
|
248
|
+
"testID": undefined,
|
|
249
|
+
},
|
|
250
|
+
"type": "View",
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
"props": {
|
|
254
|
+
"accessibilityHint": "Sign in with Google",
|
|
255
|
+
"aria-label": "Continue with Google",
|
|
256
|
+
"aria-role": "button",
|
|
257
|
+
"disabled": undefined,
|
|
258
|
+
"onPress": [Function: debounced],
|
|
259
|
+
"style": {
|
|
260
|
+
"alignItems": "center",
|
|
261
|
+
"alignSelf": "stretch",
|
|
262
|
+
"backgroundColor": "#FFFFFF",
|
|
263
|
+
"borderColor": "#dadce0",
|
|
264
|
+
"borderRadius": 360,
|
|
265
|
+
"borderWidth": 1,
|
|
266
|
+
"flexDirection": "row",
|
|
267
|
+
"justifyContent": "center",
|
|
268
|
+
"opacity": 1,
|
|
269
|
+
"paddingHorizontal": 20,
|
|
270
|
+
"paddingVertical": 12,
|
|
271
|
+
"width": "100%",
|
|
272
|
+
},
|
|
273
|
+
"testID": "social-login-google",
|
|
274
|
+
},
|
|
275
|
+
"type": "Pressable",
|
|
276
|
+
}
|
|
277
|
+
`;
|
package/src/index.tsx
CHANGED
|
@@ -3,6 +3,8 @@ export type {StyleProp, ViewStyle} from "react-native";
|
|
|
3
3
|
export * from "./Accordion";
|
|
4
4
|
export * from "./ActionSheet";
|
|
5
5
|
export * from "./AddressField";
|
|
6
|
+
export * from "./AIRequestExplorer";
|
|
7
|
+
export * from "./AttachmentPreview";
|
|
6
8
|
export * from "./Avatar";
|
|
7
9
|
export * from "./Badge";
|
|
8
10
|
export * from "./Banner";
|
|
@@ -26,7 +28,10 @@ export {default as EmojiSelector} from "./EmojiSelector";
|
|
|
26
28
|
export * from "./ErrorBoundary";
|
|
27
29
|
export * from "./ErrorPage";
|
|
28
30
|
export * from "./Field";
|
|
31
|
+
export * from "./FilePickerButton";
|
|
29
32
|
export * from "./FlatList";
|
|
33
|
+
export * from "./GPTChat";
|
|
34
|
+
export * from "./GPTMemoryModal";
|
|
30
35
|
export * from "./Heading";
|
|
31
36
|
export * from "./HeightActionSheet";
|
|
32
37
|
export * from "./Icon";
|
|
@@ -36,6 +41,8 @@ export * from "./ImageBackground";
|
|
|
36
41
|
export * from "./InfoModalIcon";
|
|
37
42
|
export * from "./InfoTooltipButton";
|
|
38
43
|
export * from "./Link";
|
|
44
|
+
export * from "./login";
|
|
45
|
+
|
|
39
46
|
export * from "./MarkdownView";
|
|
40
47
|
export * from "./MediaQuery";
|
|
41
48
|
export * from "./MobileAddressAutoComplete";
|
|
@@ -60,8 +67,10 @@ export * from "./SideDrawer";
|
|
|
60
67
|
export * from "./Signature";
|
|
61
68
|
export * from "./SignatureField";
|
|
62
69
|
export * from "./Slider";
|
|
70
|
+
export * from "./SocialLoginButton";
|
|
63
71
|
export * from "./Spinner";
|
|
64
72
|
export * from "./SplitPage";
|
|
73
|
+
export * from "./signUp";
|
|
65
74
|
export * from "./TapToEdit";
|
|
66
75
|
export * from "./TerrenoProvider";
|
|
67
76
|
export * from "./Text";
|