@entropy-softworks/ui 2026.910.1 → 2026.910.2
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/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/social-connections.d.ts +52 -1
- package/lib/components/social-connections.d.ts.map +1 -1
- package/lib/components/social-connections.jsx +31 -2
- package/lib/components/social-connections.jsx.map +1 -1
- package/package.json +1 -1
- package/src/components/__tests__/social-connections.test.ts +97 -0
- package/src/components/index.ts +8 -1
- package/src/components/social-connections.tsx +68 -3
|
@@ -31,7 +31,7 @@ export { BottomNav, type BottomNavItem, type BottomNavProps } from "./bottom-nav
|
|
|
31
31
|
export { ItemIcon, type ItemIconProps } from "./item-icon";
|
|
32
32
|
export { TotpDisplay, type TotpDisplayProps } from "./totp-display";
|
|
33
33
|
export { UserAvatar, type UserAvatarProps } from "./user-avatar";
|
|
34
|
-
export { SocialConnections, type SocialConnectionsProps } from "./social-connections";
|
|
34
|
+
export { SocialConnections, visibleProviders, type SocialConnectionsProps, type Provider, type ProviderKey, type ProviderVisibility, } from "./social-connections";
|
|
35
35
|
export { ProfileDialog, ProfileTab, SecurityTab, type ProfileDialogProps, type ProfileTabProps, type SecurityTabProps, } from "./profile";
|
|
36
36
|
export { ServerSettings, type ServerSettingsProps } from "./server-settings";
|
|
37
37
|
export { ConnectionSettings, type ConnectionSettingsProps, type RunMode, } from "./connection-settings";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,KAAK,SAAS,EACd,KA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c,EAAE,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,OAAO,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE9F,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -33,7 +33,7 @@ export { BottomNav } from "./bottom-nav";
|
|
|
33
33
|
export { ItemIcon } from "./item-icon";
|
|
34
34
|
export { TotpDisplay } from "./totp-display";
|
|
35
35
|
export { UserAvatar } from "./user-avatar";
|
|
36
|
-
export { SocialConnections } from "./social-connections";
|
|
36
|
+
export { SocialConnections, visibleProviders, } from "./social-connections";
|
|
37
37
|
export { ProfileDialog, ProfileTab, SecurityTab, } from "./profile";
|
|
38
38
|
export { ServerSettings } from "./server-settings";
|
|
39
39
|
export { ConnectionSettings, } from "./connection-settings";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,uDAAuD;AAEvD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAoB,MAAM,UAAU,CAAC;AAEhE,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,GAIhB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,oB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53 @@ export interface SocialConnectionsProps {
|
|
|
27
27
|
* button away from consumers that want the placeholder.
|
|
28
28
|
*/
|
|
29
29
|
showEntropy?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to offer "Continue with Apple". Defaults to `true`.
|
|
32
|
+
*
|
|
33
|
+
* ## Why these three needed flags of their own
|
|
34
|
+
*
|
|
35
|
+
* Apple, Google and Microsoft used to render unconditionally, so a consumer
|
|
36
|
+
* could suppress the whole row or none of it. That is the wrong granularity
|
|
37
|
+
* for an identity provider whose upstream connectors are configured per
|
|
38
|
+
* tenant: a tenant with only a Google connector still drew Apple and
|
|
39
|
+
* Microsoft, as two squares that respond to a press by doing nothing.
|
|
40
|
+
*
|
|
41
|
+
* `undefined` handlers do not hide a button, and that is deliberate and
|
|
42
|
+
* unchanged — a handler-less provider is the "coming soon" placeholder the
|
|
43
|
+
* consumer apps use during a staged rollout, and simple-finance renders the
|
|
44
|
+
* whole row with no handlers at all. So intent cannot be inferred from a
|
|
45
|
+
* missing handler; it has to be said. Same shape and same default as
|
|
46
|
+
* {@link SocialConnectionsProps.showEntropy}, so existing callers are
|
|
47
|
+
* unaffected.
|
|
48
|
+
*/
|
|
49
|
+
showApple?: boolean;
|
|
50
|
+
/** Whether to offer "Continue with Google". Defaults to `true`. See {@link SocialConnectionsProps.showApple}. */
|
|
51
|
+
showGoogle?: boolean;
|
|
52
|
+
/** Whether to offer "Continue with Microsoft". Defaults to `true`. See {@link SocialConnectionsProps.showApple}. */
|
|
53
|
+
showMicrosoft?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** The federated providers this row can draw. */
|
|
56
|
+
export type ProviderKey = "entropy" | "apple" | "google" | "microsoft";
|
|
57
|
+
export interface Provider {
|
|
58
|
+
key: ProviderKey;
|
|
59
|
+
label: string;
|
|
60
|
+
/** Ionicons glyph, or `null` for Entropy, which draws its own brand mark. */
|
|
61
|
+
icon: "logo-apple" | "logo-google" | "logo-microsoft" | null;
|
|
30
62
|
}
|
|
63
|
+
/** Which providers each `show*` flag governs. Every key is required, so a new
|
|
64
|
+
* provider in {@link PROVIDERS} cannot be added without deciding its flag. */
|
|
65
|
+
export type ProviderVisibility = Record<ProviderKey, boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* The providers to render, in {@link PROVIDERS} order.
|
|
68
|
+
*
|
|
69
|
+
* Exported and pure so the visibility rules are testable without a render
|
|
70
|
+
* runtime — the component itself pulls in `@expo/vector-icons` and reanimated,
|
|
71
|
+
* which the unit-suite transform does not process.
|
|
72
|
+
*
|
|
73
|
+
* Order comes from `PROVIDERS`, not from the caller's flags, so the row cannot
|
|
74
|
+
* reshuffle between renders or between consumers.
|
|
75
|
+
*/
|
|
76
|
+
export declare function visibleProviders(shown: ProviderVisibility): readonly Provider[];
|
|
31
77
|
/**
|
|
32
78
|
* Button row for federated sign-in: Entropy / Apple / Google / Microsoft.
|
|
33
79
|
*
|
|
@@ -37,12 +83,17 @@ export interface SocialConnectionsProps {
|
|
|
37
83
|
* (`/api/auth/oidc/start?connector=…`); the difference between them is a hint
|
|
38
84
|
* passed to Access, not a separate flow.
|
|
39
85
|
*
|
|
86
|
+
* To render only some providers, use the `show*` flags — one per provider, all
|
|
87
|
+
* defaulting to `true`. A consumer that knows which upstream connectors are
|
|
88
|
+
* configured (Entropy Access does, per tenant) should pass them, or it will
|
|
89
|
+
* draw brand marks for providers that cannot complete a sign-in.
|
|
90
|
+
*
|
|
40
91
|
* The buttons are icon-only, so each carries a tooltip AND an
|
|
41
92
|
* `accessibilityLabel`. The two are not redundant: the tooltip is for a sighted
|
|
42
93
|
* user hovering on web or long-pressing on native, the label is what a screen
|
|
43
94
|
* reader announces. Without the tooltip these are four unlabelled squares, and
|
|
44
95
|
* a user has to guess which mark is which.
|
|
45
96
|
*/
|
|
46
|
-
export declare function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, showEntropy, }: SocialConnectionsProps): React.JSX.Element;
|
|
97
|
+
export declare function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, showEntropy, showApple, showGoogle, showMicrosoft, }: SocialConnectionsProps): React.JSX.Element;
|
|
47
98
|
export default SocialConnections;
|
|
48
99
|
//# sourceMappingURL=social-connections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-connections.d.ts","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"social-connections.d.ts","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;;;;;;;;OAkBG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iHAAiH;IACjH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oHAAoH;IACpH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,WAAW,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,gBAAgB,GAAG,IAAI,CAAC;CAC9D;AAYD;8EAC8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAE9D;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,kBAAkB,GACxB,SAAS,QAAQ,EAAE,CAErB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,WAAkB,EAClB,SAAgB,EAChB,UAAiB,EACjB,aAAoB,GACrB,EAAE,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAoD5C;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -13,6 +13,19 @@ const PROVIDERS = [
|
|
|
13
13
|
{ key: "google", label: "Google", icon: "logo-google" },
|
|
14
14
|
{ key: "microsoft", label: "Microsoft", icon: "logo-microsoft" },
|
|
15
15
|
];
|
|
16
|
+
/**
|
|
17
|
+
* The providers to render, in {@link PROVIDERS} order.
|
|
18
|
+
*
|
|
19
|
+
* Exported and pure so the visibility rules are testable without a render
|
|
20
|
+
* runtime — the component itself pulls in `@expo/vector-icons` and reanimated,
|
|
21
|
+
* which the unit-suite transform does not process.
|
|
22
|
+
*
|
|
23
|
+
* Order comes from `PROVIDERS`, not from the caller's flags, so the row cannot
|
|
24
|
+
* reshuffle between renders or between consumers.
|
|
25
|
+
*/
|
|
26
|
+
export function visibleProviders(shown) {
|
|
27
|
+
return PROVIDERS.filter(({ key }) => shown[key]);
|
|
28
|
+
}
|
|
16
29
|
/**
|
|
17
30
|
* Button row for federated sign-in: Entropy / Apple / Google / Microsoft.
|
|
18
31
|
*
|
|
@@ -22,13 +35,18 @@ const PROVIDERS = [
|
|
|
22
35
|
* (`/api/auth/oidc/start?connector=…`); the difference between them is a hint
|
|
23
36
|
* passed to Access, not a separate flow.
|
|
24
37
|
*
|
|
38
|
+
* To render only some providers, use the `show*` flags — one per provider, all
|
|
39
|
+
* defaulting to `true`. A consumer that knows which upstream connectors are
|
|
40
|
+
* configured (Entropy Access does, per tenant) should pass them, or it will
|
|
41
|
+
* draw brand marks for providers that cannot complete a sign-in.
|
|
42
|
+
*
|
|
25
43
|
* The buttons are icon-only, so each carries a tooltip AND an
|
|
26
44
|
* `accessibilityLabel`. The two are not redundant: the tooltip is for a sighted
|
|
27
45
|
* user hovering on web or long-pressing on native, the label is what a screen
|
|
28
46
|
* reader announces. Without the tooltip these are four unlabelled squares, and
|
|
29
47
|
* a user has to guess which mark is which.
|
|
30
48
|
*/
|
|
31
|
-
export function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, showEntropy = true, }) {
|
|
49
|
+
export function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, showEntropy = true, showApple = true, showGoogle = true, showMicrosoft = true, }) {
|
|
32
50
|
const { colorScheme } = useColorScheme();
|
|
33
51
|
const isDark = colorScheme === "dark";
|
|
34
52
|
const handlers = {
|
|
@@ -37,8 +55,19 @@ export function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, s
|
|
|
37
55
|
google: onGoogle,
|
|
38
56
|
microsoft: onMicrosoft,
|
|
39
57
|
};
|
|
58
|
+
// One map rather than four `key !== "x" || showX` clauses: the filter used
|
|
59
|
+
// to name `entropy` explicitly, which read fine for one exception and would
|
|
60
|
+
// be four boolean conditions for four. `ProviderVisibility` requires every
|
|
61
|
+
// key, so adding a provider to PROVIDERS without deciding its flag is a type
|
|
62
|
+
// error rather than a button nobody can turn off.
|
|
63
|
+
const shown = {
|
|
64
|
+
entropy: showEntropy,
|
|
65
|
+
apple: showApple,
|
|
66
|
+
google: showGoogle,
|
|
67
|
+
microsoft: showMicrosoft,
|
|
68
|
+
};
|
|
40
69
|
return (<View className="w-full flex-row items-center justify-center gap-3">
|
|
41
|
-
{
|
|
70
|
+
{visibleProviders(shown).map(({ key, icon, label }) => (<Tooltip key={key} delayDuration={200}>
|
|
42
71
|
<TooltipTrigger asChild>
|
|
43
72
|
<Pressable onPress={handlers[key]} className="h-12 w-12 items-center justify-center rounded-lg border border-border dark:border-neutral-600 active:opacity-70" accessibilityRole="button" accessibilityLabel={`Continue with ${label}`}>
|
|
44
73
|
{icon ? (<Ionicons name={icon} size={22} color={isDark ? "#FFFFFF" : "#000000"}/>) : (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-connections.jsx","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"social-connections.jsx","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAkEpE,MAAM,SAAS,GAAwB;IACrC,0EAA0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|
|
3
|
+
type ProviderKey,
|
|
4
|
+
type ProviderVisibility,
|
|
5
|
+
} from "../social-connections";
|
|
6
|
+
|
|
7
|
+
// The component module imports view-layer deps (`@expo/vector-icons`,
|
|
8
|
+
// `react-native-reanimated` via Tooltip/EntropyMark) that the unit-suite babel
|
|
9
|
+
// transform does not process. The shared setup stubs `react-native` /
|
|
10
|
+
// `nativewind`; stub the rest here so the pure helper under test loads without
|
|
11
|
+
// a render runtime. Same pattern as the pagination test.
|
|
12
|
+
jest.mock("@expo/vector-icons", () => ({ Ionicons: "Ionicons" }));
|
|
13
|
+
// `react-native-svg` is not in the transform whitelist, so its TypeScript
|
|
14
|
+
// source reaches jest untranspiled; EntropyMark pulls it in for the brand mark.
|
|
15
|
+
jest.mock("react-native-svg", () => ({
|
|
16
|
+
__esModule: true,
|
|
17
|
+
default: "Svg",
|
|
18
|
+
Path: "Path",
|
|
19
|
+
}));
|
|
20
|
+
jest.mock("react-native-reanimated", () => ({
|
|
21
|
+
__esModule: true,
|
|
22
|
+
default: { View: "Animated.View" },
|
|
23
|
+
useSharedValue: () => ({ value: 0 }),
|
|
24
|
+
useAnimatedStyle: () => ({}),
|
|
25
|
+
withTiming: (v: number) => v,
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const ALL: ProviderVisibility = {
|
|
29
|
+
entropy: true,
|
|
30
|
+
apple: true,
|
|
31
|
+
google: true,
|
|
32
|
+
microsoft: true,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const keysOf = (shown: ProviderVisibility): ProviderKey[] =>
|
|
36
|
+
visibleProviders(shown).map(({ key }) => key);
|
|
37
|
+
|
|
38
|
+
describe("visibleProviders", () => {
|
|
39
|
+
it("renders every provider when all flags are set", () => {
|
|
40
|
+
// The component's defaults are all `true`, so this is what an existing
|
|
41
|
+
// caller that passes no `show*` prop still gets.
|
|
42
|
+
expect(keysOf(ALL)).toEqual(["entropy", "apple", "google", "microsoft"]);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it.each<ProviderKey>(["entropy", "apple", "google", "microsoft"])(
|
|
46
|
+
"suppresses only %s when its flag is false",
|
|
47
|
+
(key) => {
|
|
48
|
+
const got = keysOf({ ...ALL, [key]: false });
|
|
49
|
+
expect(got).not.toContain(key);
|
|
50
|
+
expect(got).toHaveLength(3);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
it("renders one provider when only its flag is set", () => {
|
|
55
|
+
// The case that motivated per-provider flags: a tenant with a Google
|
|
56
|
+
// connector and nothing else drew Apple and Microsoft as dead buttons.
|
|
57
|
+
expect(
|
|
58
|
+
keysOf({ entropy: false, apple: false, google: true, microsoft: false })
|
|
59
|
+
).toEqual(["google"]);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("returns nothing when every flag is false", () => {
|
|
63
|
+
// A caller that hides all four gets an empty row, not a stray gap-spaced
|
|
64
|
+
// container with one invisible child — the consumer is expected to skip
|
|
65
|
+
// rendering the component at all, and this is what it can check against.
|
|
66
|
+
expect(
|
|
67
|
+
keysOf({
|
|
68
|
+
entropy: false,
|
|
69
|
+
apple: false,
|
|
70
|
+
google: false,
|
|
71
|
+
microsoft: false,
|
|
72
|
+
})
|
|
73
|
+
).toEqual([]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it("keeps PROVIDERS order regardless of the flag object's key order", () => {
|
|
77
|
+
// Order comes from the module's provider list, not from the caller, so the
|
|
78
|
+
// row cannot reshuffle between consumers that build the map differently.
|
|
79
|
+
const reversed: ProviderVisibility = {
|
|
80
|
+
microsoft: true,
|
|
81
|
+
google: true,
|
|
82
|
+
apple: true,
|
|
83
|
+
entropy: true,
|
|
84
|
+
};
|
|
85
|
+
expect(keysOf(reversed)).toEqual(keysOf(ALL));
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("carries the brand mark opt-out only for entropy", () => {
|
|
89
|
+
// `icon: null` is what tells the component to draw EntropyMark instead of
|
|
90
|
+
// an Ionicons glyph; the other three must keep a glyph name.
|
|
91
|
+
const byKey = new Map(visibleProviders(ALL).map((p) => [p.key, p]));
|
|
92
|
+
expect(byKey.get("entropy")?.icon).toBeNull();
|
|
93
|
+
expect(byKey.get("apple")?.icon).toBe("logo-apple");
|
|
94
|
+
expect(byKey.get("google")?.icon).toBe("logo-google");
|
|
95
|
+
expect(byKey.get("microsoft")?.icon).toBe("logo-microsoft");
|
|
96
|
+
});
|
|
97
|
+
});
|
package/src/components/index.ts
CHANGED
|
@@ -129,7 +129,14 @@ export { TotpDisplay, type TotpDisplayProps } from "./totp-display";
|
|
|
129
129
|
|
|
130
130
|
export { UserAvatar, type UserAvatarProps } from "./user-avatar";
|
|
131
131
|
|
|
132
|
-
export {
|
|
132
|
+
export {
|
|
133
|
+
SocialConnections,
|
|
134
|
+
visibleProviders,
|
|
135
|
+
type SocialConnectionsProps,
|
|
136
|
+
type Provider,
|
|
137
|
+
type ProviderKey,
|
|
138
|
+
type ProviderVisibility,
|
|
139
|
+
} from "./social-connections";
|
|
133
140
|
|
|
134
141
|
export {
|
|
135
142
|
ProfileDialog,
|
|
@@ -33,11 +33,36 @@ export interface SocialConnectionsProps {
|
|
|
33
33
|
* button away from consumers that want the placeholder.
|
|
34
34
|
*/
|
|
35
35
|
showEntropy?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to offer "Continue with Apple". Defaults to `true`.
|
|
38
|
+
*
|
|
39
|
+
* ## Why these three needed flags of their own
|
|
40
|
+
*
|
|
41
|
+
* Apple, Google and Microsoft used to render unconditionally, so a consumer
|
|
42
|
+
* could suppress the whole row or none of it. That is the wrong granularity
|
|
43
|
+
* for an identity provider whose upstream connectors are configured per
|
|
44
|
+
* tenant: a tenant with only a Google connector still drew Apple and
|
|
45
|
+
* Microsoft, as two squares that respond to a press by doing nothing.
|
|
46
|
+
*
|
|
47
|
+
* `undefined` handlers do not hide a button, and that is deliberate and
|
|
48
|
+
* unchanged — a handler-less provider is the "coming soon" placeholder the
|
|
49
|
+
* consumer apps use during a staged rollout, and simple-finance renders the
|
|
50
|
+
* whole row with no handlers at all. So intent cannot be inferred from a
|
|
51
|
+
* missing handler; it has to be said. Same shape and same default as
|
|
52
|
+
* {@link SocialConnectionsProps.showEntropy}, so existing callers are
|
|
53
|
+
* unaffected.
|
|
54
|
+
*/
|
|
55
|
+
showApple?: boolean;
|
|
56
|
+
/** Whether to offer "Continue with Google". Defaults to `true`. See {@link SocialConnectionsProps.showApple}. */
|
|
57
|
+
showGoogle?: boolean;
|
|
58
|
+
/** Whether to offer "Continue with Microsoft". Defaults to `true`. See {@link SocialConnectionsProps.showApple}. */
|
|
59
|
+
showMicrosoft?: boolean;
|
|
36
60
|
}
|
|
37
61
|
|
|
38
|
-
|
|
62
|
+
/** The federated providers this row can draw. */
|
|
63
|
+
export type ProviderKey = "entropy" | "apple" | "google" | "microsoft";
|
|
39
64
|
|
|
40
|
-
interface Provider {
|
|
65
|
+
export interface Provider {
|
|
41
66
|
key: ProviderKey;
|
|
42
67
|
label: string;
|
|
43
68
|
/** Ionicons glyph, or `null` for Entropy, which draws its own brand mark. */
|
|
@@ -54,6 +79,26 @@ const PROVIDERS: readonly Provider[] = [
|
|
|
54
79
|
{ key: "microsoft", label: "Microsoft", icon: "logo-microsoft" },
|
|
55
80
|
];
|
|
56
81
|
|
|
82
|
+
/** Which providers each `show*` flag governs. Every key is required, so a new
|
|
83
|
+
* provider in {@link PROVIDERS} cannot be added without deciding its flag. */
|
|
84
|
+
export type ProviderVisibility = Record<ProviderKey, boolean>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The providers to render, in {@link PROVIDERS} order.
|
|
88
|
+
*
|
|
89
|
+
* Exported and pure so the visibility rules are testable without a render
|
|
90
|
+
* runtime — the component itself pulls in `@expo/vector-icons` and reanimated,
|
|
91
|
+
* which the unit-suite transform does not process.
|
|
92
|
+
*
|
|
93
|
+
* Order comes from `PROVIDERS`, not from the caller's flags, so the row cannot
|
|
94
|
+
* reshuffle between renders or between consumers.
|
|
95
|
+
*/
|
|
96
|
+
export function visibleProviders(
|
|
97
|
+
shown: ProviderVisibility
|
|
98
|
+
): readonly Provider[] {
|
|
99
|
+
return PROVIDERS.filter(({ key }) => shown[key]);
|
|
100
|
+
}
|
|
101
|
+
|
|
57
102
|
/**
|
|
58
103
|
* Button row for federated sign-in: Entropy / Apple / Google / Microsoft.
|
|
59
104
|
*
|
|
@@ -63,6 +108,11 @@ const PROVIDERS: readonly Provider[] = [
|
|
|
63
108
|
* (`/api/auth/oidc/start?connector=…`); the difference between them is a hint
|
|
64
109
|
* passed to Access, not a separate flow.
|
|
65
110
|
*
|
|
111
|
+
* To render only some providers, use the `show*` flags — one per provider, all
|
|
112
|
+
* defaulting to `true`. A consumer that knows which upstream connectors are
|
|
113
|
+
* configured (Entropy Access does, per tenant) should pass them, or it will
|
|
114
|
+
* draw brand marks for providers that cannot complete a sign-in.
|
|
115
|
+
*
|
|
66
116
|
* The buttons are icon-only, so each carries a tooltip AND an
|
|
67
117
|
* `accessibilityLabel`. The two are not redundant: the tooltip is for a sighted
|
|
68
118
|
* user hovering on web or long-pressing on native, the label is what a screen
|
|
@@ -75,6 +125,9 @@ export function SocialConnections({
|
|
|
75
125
|
onMicrosoft,
|
|
76
126
|
onEntropy,
|
|
77
127
|
showEntropy = true,
|
|
128
|
+
showApple = true,
|
|
129
|
+
showGoogle = true,
|
|
130
|
+
showMicrosoft = true,
|
|
78
131
|
}: SocialConnectionsProps): React.JSX.Element {
|
|
79
132
|
const { colorScheme } = useColorScheme();
|
|
80
133
|
const isDark = colorScheme === "dark";
|
|
@@ -86,9 +139,21 @@ export function SocialConnections({
|
|
|
86
139
|
microsoft: onMicrosoft,
|
|
87
140
|
};
|
|
88
141
|
|
|
142
|
+
// One map rather than four `key !== "x" || showX` clauses: the filter used
|
|
143
|
+
// to name `entropy` explicitly, which read fine for one exception and would
|
|
144
|
+
// be four boolean conditions for four. `ProviderVisibility` requires every
|
|
145
|
+
// key, so adding a provider to PROVIDERS without deciding its flag is a type
|
|
146
|
+
// error rather than a button nobody can turn off.
|
|
147
|
+
const shown: ProviderVisibility = {
|
|
148
|
+
entropy: showEntropy,
|
|
149
|
+
apple: showApple,
|
|
150
|
+
google: showGoogle,
|
|
151
|
+
microsoft: showMicrosoft,
|
|
152
|
+
};
|
|
153
|
+
|
|
89
154
|
return (
|
|
90
155
|
<View className="w-full flex-row items-center justify-center gap-3">
|
|
91
|
-
{
|
|
156
|
+
{visibleProviders(shown).map(
|
|
92
157
|
({ key, icon, label }) => (
|
|
93
158
|
<Tooltip key={key} delayDuration={200}>
|
|
94
159
|
<TooltipTrigger asChild>
|