@oxyhq/services 10.4.0 → 10.5.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/ui/components/AnotherDeviceQR.js +121 -0
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +1 -0
- package/lib/commonjs/ui/components/SignInModal.js +145 -356
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +458 -0
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +1 -0
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +62 -460
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +116 -0
- package/lib/module/ui/components/AnotherDeviceQR.js.map +1 -0
- package/lib/module/ui/components/SignInModal.js +149 -358
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +452 -0
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +1 -0
- package/lib/module/ui/screens/OxyAuthScreen.js +62 -460
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +24 -0
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +10 -5
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +83 -0
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +12 -8
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +24 -0
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SignInModal.d.ts +10 -5
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +83 -0
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +12 -8
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/components/AnotherDeviceQR.tsx +111 -0
- package/src/ui/components/SignInModal.tsx +142 -381
- package/src/ui/hooks/useOxyAuthSession.ts +556 -0
- package/src/ui/screens/OxyAuthScreen.tsx +61 -506
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeQrcodeSvg = _interopRequireDefault(require("react-native-qrcode-svg"));
|
|
10
|
+
var _theme = require("@oxyhq/bloom/theme");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
/**
|
|
14
|
+
* AnotherDeviceQR — the collapsed "Sign in on another device" disclosure shared
|
|
15
|
+
* by both sign-in containers (`SignInModal` on web, `OxyAuthScreen` on native).
|
|
16
|
+
*
|
|
17
|
+
* The QR code is always DEMOTED below the platform-primary "Continue with Oxy"
|
|
18
|
+
* action: you cannot scan your own screen, so the QR is only useful for handing
|
|
19
|
+
* sign-in to a SECOND device (scan with the Oxy Accounts app there). It lives
|
|
20
|
+
* inside a tap-to-expand disclosure so it never competes with the primary CTA.
|
|
21
|
+
*
|
|
22
|
+
* The QR plate stays white intentionally — high contrast is required for
|
|
23
|
+
* reliable scanning regardless of the app theme.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** Size, in px, of the rendered QR symbol. */
|
|
27
|
+
const QR_SIZE = 200;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Collapsed disclosure that reveals a high-contrast QR for signing in on a
|
|
31
|
+
* second device with the Oxy Accounts app.
|
|
32
|
+
*/
|
|
33
|
+
const AnotherDeviceQR = ({
|
|
34
|
+
qrData
|
|
35
|
+
}) => {
|
|
36
|
+
const {
|
|
37
|
+
colors
|
|
38
|
+
} = (0, _theme.useTheme)();
|
|
39
|
+
const [expanded, setExpanded] = (0, _react.useState)(false);
|
|
40
|
+
const toggle = (0, _react.useCallback)(() => {
|
|
41
|
+
setExpanded(prev => !prev);
|
|
42
|
+
}, []);
|
|
43
|
+
if (!qrData) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
47
|
+
style: styles.container,
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
49
|
+
style: styles.toggle,
|
|
50
|
+
onPress: toggle,
|
|
51
|
+
accessibilityRole: "button",
|
|
52
|
+
accessibilityState: {
|
|
53
|
+
expanded
|
|
54
|
+
},
|
|
55
|
+
accessibilityHint: "Reveals a QR code to sign in using the Oxy Accounts app on another device",
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
57
|
+
style: styles.toggleText,
|
|
58
|
+
className: "text-muted-foreground",
|
|
59
|
+
children: "Sign in on another device"
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
61
|
+
style: styles.chevron,
|
|
62
|
+
className: "text-muted-foreground",
|
|
63
|
+
children: expanded ? '✕' : '›'
|
|
64
|
+
})]
|
|
65
|
+
}), expanded && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
66
|
+
style: styles.body,
|
|
67
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
68
|
+
style: [styles.qrPlate, {
|
|
69
|
+
backgroundColor: '#FFFFFF'
|
|
70
|
+
}],
|
|
71
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeQrcodeSvg.default, {
|
|
72
|
+
value: qrData,
|
|
73
|
+
size: QR_SIZE,
|
|
74
|
+
backgroundColor: "#FFFFFF",
|
|
75
|
+
color: "#000000"
|
|
76
|
+
})
|
|
77
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
78
|
+
style: [styles.hint, {
|
|
79
|
+
color: colors.textSecondary
|
|
80
|
+
}],
|
|
81
|
+
children: "Scan with the Oxy Accounts app"
|
|
82
|
+
})]
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const styles = _reactNative.StyleSheet.create({
|
|
87
|
+
container: {
|
|
88
|
+
width: '100%',
|
|
89
|
+
alignItems: 'center'
|
|
90
|
+
},
|
|
91
|
+
toggle: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
justifyContent: 'center',
|
|
95
|
+
paddingVertical: 12,
|
|
96
|
+
paddingHorizontal: 8
|
|
97
|
+
},
|
|
98
|
+
toggleText: {
|
|
99
|
+
fontSize: 14,
|
|
100
|
+
fontWeight: '600'
|
|
101
|
+
},
|
|
102
|
+
chevron: {
|
|
103
|
+
fontSize: 16,
|
|
104
|
+
marginLeft: 8
|
|
105
|
+
},
|
|
106
|
+
body: {
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
marginTop: 8
|
|
109
|
+
},
|
|
110
|
+
qrPlate: {
|
|
111
|
+
padding: 16,
|
|
112
|
+
borderRadius: 16
|
|
113
|
+
},
|
|
114
|
+
hint: {
|
|
115
|
+
marginTop: 12,
|
|
116
|
+
fontSize: 12,
|
|
117
|
+
textAlign: 'center'
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
var _default = exports.default = AnotherDeviceQR;
|
|
121
|
+
//# sourceMappingURL=AnotherDeviceQR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_reactNativeQrcodeSvg","_interopRequireDefault","_theme","_jsxRuntime","e","__esModule","default","QR_SIZE","AnotherDeviceQR","qrData","colors","useTheme","expanded","setExpanded","useState","toggle","useCallback","prev","jsxs","View","style","styles","container","children","TouchableOpacity","onPress","accessibilityRole","accessibilityState","accessibilityHint","jsx","Text","toggleText","className","chevron","body","qrPlate","backgroundColor","value","size","color","hint","textSecondary","StyleSheet","create","width","alignItems","flexDirection","justifyContent","paddingVertical","paddingHorizontal","fontSize","fontWeight","marginLeft","marginTop","padding","borderRadius","textAlign","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/components/AnotherDeviceQR.tsx"],"mappings":";;;;;;AAcA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjB9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA,MAAMG,OAAO,GAAG,GAAG;;AAEnB;AACA;AACA;AACA;AACA,MAAMC,eAA+C,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EACtE,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC;EAC7B,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE/C,MAAMC,MAAM,GAAG,IAAAC,kBAAW,EAAC,MA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