@oxy.so/services 14.15.2 → 14.17.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/lib/commonjs/index.js +18 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/setupFlow/OxySetupFlow.js +273 -0
- package/lib/commonjs/ui/components/setupFlow/OxySetupFlow.js.map +1 -0
- package/lib/commonjs/ui/components/setupFlow/oxySignInStep.js +34 -0
- package/lib/commonjs/ui/components/setupFlow/oxySignInStep.js.map +1 -0
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js +21 -7
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/hooks/useI18n.js +4 -2
- package/lib/commonjs/ui/hooks/useI18n.js.map +1 -1
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/setupFlow/OxySetupFlow.js +270 -0
- package/lib/module/ui/components/setupFlow/OxySetupFlow.js.map +1 -0
- package/lib/module/ui/components/setupFlow/oxySignInStep.js +29 -0
- package/lib/module/ui/components/setupFlow/oxySignInStep.js.map +1 -0
- package/lib/module/ui/components/signIn/OxyAuthScreen.js +22 -8
- package/lib/module/ui/components/signIn/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/hooks/useI18n.js +4 -2
- package/lib/module/ui/hooks/useI18n.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/setupFlow/OxySetupFlow.d.ts +94 -0
- package/lib/typescript/commonjs/ui/components/setupFlow/OxySetupFlow.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/setupFlow/oxySignInStep.d.ts +23 -0
- package/lib/typescript/commonjs/ui/components/setupFlow/oxySignInStep.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts +12 -3
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useI18n.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useI18n.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/icons/Ionicons.d.ts +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +4 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/setupFlow/OxySetupFlow.d.ts +94 -0
- package/lib/typescript/module/ui/components/setupFlow/OxySetupFlow.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/setupFlow/oxySignInStep.d.ts +23 -0
- package/lib/typescript/module/ui/components/setupFlow/oxySignInStep.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts +12 -3
- package/lib/typescript/module/ui/components/signIn/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useI18n.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useI18n.d.ts.map +1 -1
- package/lib/typescript/module/ui/icons/Ionicons.d.ts +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/package.json +4 -4
- package/src/index.ts +12 -0
- package/src/ui/components/setupFlow/OxySetupFlow.tsx +346 -0
- package/src/ui/components/setupFlow/__tests__/OxySetupFlow.test.tsx +318 -0
- package/src/ui/components/setupFlow/oxySignInStep.tsx +32 -0
- package/src/ui/components/signIn/OxyAuthScreen.tsx +30 -7
- package/src/ui/hooks/useI18n.ts +4 -2
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* The shell every Oxy sign-in screen shares — the in-app account dialog and
|
|
3
3
|
* every page of the auth.oxy.so IdP render these, so the two cannot drift:
|
|
4
4
|
*
|
|
5
|
-
* header the Oxy mark (56)
|
|
6
|
-
* description, 8 apart
|
|
5
|
+
* header the Oxy mark (56) or the screen's own icon, then the title
|
|
6
|
+
* (48/800, tight) and a 18px description, 8 apart
|
|
7
7
|
* screen blocks 24 apart, at most 448 wide
|
|
8
8
|
* split from `md`, Bloom `AuthCard`'s split base — max 880, radius 24,
|
|
9
9
|
* 1px border, two equal columns, the right one on the secondary
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import type React from 'react';
|
|
20
|
-
import { Linking, Text as RNText } from 'react-native';
|
|
20
|
+
import { Linking, Platform, Text as RNText } from 'react-native';
|
|
21
21
|
import { View } from 'react-native-css/components';
|
|
22
22
|
import { Loading } from '@oxy.so/bloom/loading';
|
|
23
23
|
import { useTheme } from '@oxy.so/bloom/theme';
|
|
@@ -32,20 +32,43 @@ const PRIVACY_URL = 'https://oxy.so/company/transparency/policies/privacy';
|
|
|
32
32
|
const TITLE = { fontSize: 48, lineHeight: 48, fontWeight: '800', letterSpacing: -1.2 } as const;
|
|
33
33
|
const DESCRIPTION = { fontSize: 18, lineHeight: 28 } as const;
|
|
34
34
|
const TERMS = { fontSize: 14, lineHeight: 20, textAlign: 'center', paddingHorizontal: 24 } as const;
|
|
35
|
+
/** A title focused by code is a place, not a control: no focus ring. */
|
|
36
|
+
const PLACE = { outlineWidth: 0 } as const;
|
|
35
37
|
|
|
36
38
|
export interface OxyAuthScreenHeaderProps {
|
|
37
39
|
title: string;
|
|
38
40
|
description?: React.ReactNode;
|
|
41
|
+
/** Drawn in place of the Oxy mark (a platform's own step icon), at most 56 tall. */
|
|
42
|
+
icon?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* The title's host view, for a surface that moves focus to it (a setup
|
|
45
|
+
* assistant's step change). Given, the title also takes focus from code on
|
|
46
|
+
* the web (`tabIndex` -1), never from Tab.
|
|
47
|
+
*/
|
|
48
|
+
titleRef?: React.Ref<React.ComponentRef<typeof RNText>>;
|
|
39
49
|
}
|
|
40
50
|
|
|
41
|
-
/** The Oxy mark over the screen's title and description. */
|
|
42
|
-
export const OxyAuthScreenHeader: React.FC<OxyAuthScreenHeaderProps> = ({
|
|
51
|
+
/** The Oxy mark (or the screen's icon) over the screen's title and description. */
|
|
52
|
+
export const OxyAuthScreenHeader: React.FC<OxyAuthScreenHeaderProps> = ({
|
|
53
|
+
title,
|
|
54
|
+
description,
|
|
55
|
+
icon,
|
|
56
|
+
titleRef,
|
|
57
|
+
}) => {
|
|
43
58
|
const theme = useTheme();
|
|
59
|
+
const focusable = titleRef != null && Platform.OS === 'web';
|
|
44
60
|
return (
|
|
45
61
|
<View className="gap-6">
|
|
46
|
-
<LogoIcon height={LOGO_HEIGHT} />
|
|
62
|
+
{icon ?? <LogoIcon height={LOGO_HEIGHT} />}
|
|
47
63
|
<View className="max-w-[90%] gap-2">
|
|
48
|
-
<Text
|
|
64
|
+
<Text
|
|
65
|
+
accessibilityRole="header"
|
|
66
|
+
// Bloom's `Text` hands `ref` (a prop in React 19) and react-native-web's
|
|
67
|
+
// `tabIndex` to its host text; neither is in React Native's `TextProps`.
|
|
68
|
+
{...{ ref: titleRef }}
|
|
69
|
+
{...(focusable ? { tabIndex: -1 } : null)}
|
|
70
|
+
style={[TITLE, { color: theme.colors.text }, focusable ? PLACE : null]}
|
|
71
|
+
>
|
|
49
72
|
{title}
|
|
50
73
|
</Text>
|
|
51
74
|
{description != null && description !== '' ? (
|
package/src/ui/hooks/useI18n.ts
CHANGED
|
@@ -25,9 +25,11 @@ export type Translate = (key: string, vars?: Record<string, string | number>) =>
|
|
|
25
25
|
*
|
|
26
26
|
* Anything that reads or mutates session state uses `useOxy()`, which throws.
|
|
27
27
|
*/
|
|
28
|
-
export function useI18n() {
|
|
28
|
+
export function useI18n(locale?: string) {
|
|
29
29
|
const oxy = useOptionalOxy();
|
|
30
|
-
|
|
30
|
+
// A surface the host pins to a language of its own (a platform's setup, in the system's
|
|
31
|
+
// language before and after the sign-in) speaks it; anything else, the runtime's.
|
|
32
|
+
const currentLanguage = locale ?? oxy?.currentLanguage ?? FALLBACK_LOCALE;
|
|
31
33
|
// Core's non-English dictionaries load on demand; re-translate when one lands.
|
|
32
34
|
const localesVersion = useSyncExternalStore(
|
|
33
35
|
subscribeLocales,
|