@activecollab/components 2.0.359 → 2.0.361
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/cjs/components/EditableText/EditableText.js +8 -2
- package/dist/cjs/components/EditableText/EditableText.js.map +1 -1
- package/dist/cjs/components/Icons/collection/Key.js +60 -0
- package/dist/cjs/components/Icons/collection/Key.js.map +1 -0
- package/dist/cjs/components/Icons/collection/index.js +7 -0
- package/dist/cjs/components/Icons/collection/index.js.map +1 -1
- package/dist/cjs/presentation/shared/TwoFactorDialogs.js +432 -0
- package/dist/cjs/presentation/shared/TwoFactorDialogs.js.map +1 -0
- package/dist/cjs/presentation/shared/TwoFactorShield.js +31 -0
- package/dist/cjs/presentation/shared/TwoFactorShield.js.map +1 -0
- package/dist/cjs/presentation/shared/UserMenu.js +282 -0
- package/dist/cjs/presentation/shared/UserMenu.js.map +1 -0
- package/dist/cjs/presentation/shared/index.js +32 -1
- package/dist/cjs/presentation/shared/index.js.map +1 -1
- package/dist/esm/components/EditableText/EditableText.d.ts +2 -0
- package/dist/esm/components/EditableText/EditableText.d.ts.map +1 -1
- package/dist/esm/components/EditableText/EditableText.js +8 -2
- package/dist/esm/components/EditableText/EditableText.js.map +1 -1
- package/dist/esm/components/Icons/collection/Key.d.ts +32 -0
- package/dist/esm/components/Icons/collection/Key.d.ts.map +1 -0
- package/dist/esm/components/Icons/collection/Key.js +53 -0
- package/dist/esm/components/Icons/collection/Key.js.map +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts +1 -0
- package/dist/esm/components/Icons/collection/index.d.ts.map +1 -1
- package/dist/esm/components/Icons/collection/index.js +1 -0
- package/dist/esm/components/Icons/collection/index.js.map +1 -1
- package/dist/esm/presentation/shared/TwoFactorDialogs.d.ts +24 -0
- package/dist/esm/presentation/shared/TwoFactorDialogs.d.ts.map +1 -0
- package/dist/esm/presentation/shared/TwoFactorDialogs.js +383 -0
- package/dist/esm/presentation/shared/TwoFactorDialogs.js.map +1 -0
- package/dist/esm/presentation/shared/TwoFactorShield.d.ts +13 -0
- package/dist/esm/presentation/shared/TwoFactorShield.d.ts.map +1 -0
- package/dist/esm/presentation/shared/TwoFactorShield.js +25 -0
- package/dist/esm/presentation/shared/TwoFactorShield.js.map +1 -0
- package/dist/esm/presentation/shared/UserMenu.d.ts +27 -0
- package/dist/esm/presentation/shared/UserMenu.d.ts.map +1 -0
- package/dist/esm/presentation/shared/UserMenu.js +255 -0
- package/dist/esm/presentation/shared/UserMenu.js.map +1 -0
- package/dist/esm/presentation/shared/index.d.ts +6 -0
- package/dist/esm/presentation/shared/index.d.ts.map +1 -1
- package/dist/esm/presentation/shared/index.js +3 -0
- package/dist/esm/presentation/shared/index.js.map +1 -1
- package/dist/index.js +326 -270
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Button } from "../../components/Button";
|
|
4
|
+
import { Dialog } from "../../components/Dialog";
|
|
5
|
+
import { IconButton } from "../../components/IconButton";
|
|
6
|
+
import { CancelCrossIcon, CopyIcon } from "../../components/Icons";
|
|
7
|
+
import { InfoBox } from "../../components/InfoBox";
|
|
8
|
+
import { InputPassword } from "../../components/Input";
|
|
9
|
+
import { Label } from "../../components/Label";
|
|
10
|
+
import { SkeletonLoader } from "../../components/Loaders";
|
|
11
|
+
import { ToastMessage } from "../../components/ToastMessage";
|
|
12
|
+
import { Tooltip } from "../../components/Tooltip";
|
|
13
|
+
import { SlideFromTop } from "../../components/Transitions";
|
|
14
|
+
import { Body2, Caption1, Header3 } from "../../components/Typography";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Self-hosted 2FA dialogs shared by the People stories (Users list + User
|
|
18
|
+
* profile). Two flows, both reached from the user three-dot menu and both
|
|
19
|
+
* gated (in the menu) behind the self-hosted + 2FA-enabled guard:
|
|
20
|
+
*
|
|
21
|
+
* - **Backup Codes** (own account, `self` menu): a single dialog that both
|
|
22
|
+
* explains the destructive regenerate and takes the password (identity
|
|
23
|
+
* confirmation is "valid password + submit", no separate confirm step).
|
|
24
|
+
* Submitting opens the reveal dialog, which shows a skeleton while the new
|
|
25
|
+
* set "loads", then the 10 codes once.
|
|
26
|
+
* - **Create Login Code** (another user, `member`/`client` menu): an owner
|
|
27
|
+
* re-enters their own password, then a one-time code is revealed once with
|
|
28
|
+
* its expiry and a "user notified" note. (Task #18.)
|
|
29
|
+
*
|
|
30
|
+
* Everything is mocked locally: passwords aren't checked, the "load" is a
|
|
31
|
+
* timer, and the codes are static samples.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const SANS = '-apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif';
|
|
35
|
+
const MONO = '"SF Mono", "Roboto Mono", Menlo, Consolas, "Courier New", monospace';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* DS `InputPassword` calls `onChange` with the string value at runtime, but its
|
|
39
|
+
* type is still inherited from the native input (`ChangeEventHandler`). Adapt a
|
|
40
|
+
* string handler so TypeScript is satisfied without lying about the value.
|
|
41
|
+
*/
|
|
42
|
+
const asInputChange = fn => fn;
|
|
43
|
+
|
|
44
|
+
/* Sample codes (10+10 A-Z0-9), mirroring the real generator's format. */
|
|
45
|
+
const SAMPLE_BACKUP_CODES = ["4K7Q9ZM2XN-8V3TJRD6WP", "P2W8XK4M9Q-3RJ7VND5TZ", "9ZM2XN4K7Q-6WP8V3TJRD", "TJRD6WP8V3-2XN4K7Q9ZM", "V3TJRD6WP8-K7Q9ZM2XN4", "8V3TJRD6WP-Q9ZM2XN4K7", "RD5TZP2W8X-M9Q3RJ7VND", "3RJ7VND5TZ-8XK4M9QP2W", "N4K7Q9ZM2X-6WP8V3TJRD", "Q9ZM2XN4K7-8V3TJRD6WP"];
|
|
46
|
+
const SAMPLE_LOGIN_CODE = "4K7Q9ZM2XN-8V3TJRD6WP";
|
|
47
|
+
|
|
48
|
+
/* ------------------------------------------------------------------ */
|
|
49
|
+
/* Toast (reuses the fixed upper-right anchor pattern from headers) */
|
|
50
|
+
/* ------------------------------------------------------------------ */
|
|
51
|
+
|
|
52
|
+
const StyledToastAnchor = styled.div.withConfig({
|
|
53
|
+
displayName: "TwoFactorDialogs__StyledToastAnchor",
|
|
54
|
+
componentId: "sc-nn5qbh-0"
|
|
55
|
+
})(["position:fixed;top:16px;right:16px;z-index:10000;pointer-events:none;.c-toast-message{pointer-events:auto;}"]);
|
|
56
|
+
const CopyToast = _ref => {
|
|
57
|
+
let open = _ref.open,
|
|
58
|
+
toastKey = _ref.toastKey,
|
|
59
|
+
text = _ref.text,
|
|
60
|
+
onClose = _ref.onClose;
|
|
61
|
+
return /*#__PURE__*/React.createElement(StyledToastAnchor, null, /*#__PURE__*/React.createElement(SlideFromTop, {
|
|
62
|
+
in: open
|
|
63
|
+
}, /*#__PURE__*/React.createElement(ToastMessage, {
|
|
64
|
+
key: toastKey,
|
|
65
|
+
className: "c-toast-message",
|
|
66
|
+
type: "success",
|
|
67
|
+
text: text,
|
|
68
|
+
dismissible: true,
|
|
69
|
+
dropShadow: true,
|
|
70
|
+
timeout: 3000,
|
|
71
|
+
onClose: onClose
|
|
72
|
+
})));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/* ------------------------------------------------------------------ */
|
|
76
|
+
/* Shared password-gate body (describe + password in one dialog) */
|
|
77
|
+
/* ------------------------------------------------------------------ */
|
|
78
|
+
|
|
79
|
+
const StyledGateBody = styled.div.withConfig({
|
|
80
|
+
displayName: "TwoFactorDialogs__StyledGateBody",
|
|
81
|
+
componentId: "sc-nn5qbh-1"
|
|
82
|
+
})(["font-family:", ";display:flex;flex-direction:column;gap:16px;.pg-field{display:flex;flex-direction:column;gap:4px;}.pg-input.c-input-wrapper,.pg-input{width:100%;max-width:none;}"], SANS);
|
|
83
|
+
|
|
84
|
+
/* ------------------------------------------------------------------ */
|
|
85
|
+
/* Backup Codes — combined describe + password dialog */
|
|
86
|
+
/* ------------------------------------------------------------------ */
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The full Backup Codes flow: the combined regenerate/password dialog, then the
|
|
90
|
+
* one-time reveal dialog with its loading skeleton. Cancelling the first dialog
|
|
91
|
+
* is a pure no-op — no codes are issued, no toast.
|
|
92
|
+
*/
|
|
93
|
+
export const BackupCodesDialogs = _ref2 => {
|
|
94
|
+
let open = _ref2.open,
|
|
95
|
+
onClose = _ref2.onClose;
|
|
96
|
+
const _useState = useState(""),
|
|
97
|
+
password = _useState[0],
|
|
98
|
+
setPassword = _useState[1];
|
|
99
|
+
const _useState2 = useState(false),
|
|
100
|
+
attempted = _useState2[0],
|
|
101
|
+
setAttempted = _useState2[1];
|
|
102
|
+
const _useState3 = useState(false),
|
|
103
|
+
revealOpen = _useState3[0],
|
|
104
|
+
setRevealOpen = _useState3[1];
|
|
105
|
+
const _useState4 = useState(true),
|
|
106
|
+
loading = _useState4[0],
|
|
107
|
+
setLoading = _useState4[1];
|
|
108
|
+
const _useState5 = useState(false),
|
|
109
|
+
copyOpen = _useState5[0],
|
|
110
|
+
setCopyOpen = _useState5[1];
|
|
111
|
+
const _useState6 = useState(0),
|
|
112
|
+
copyKey = _useState6[0],
|
|
113
|
+
setCopyKey = _useState6[1];
|
|
114
|
+
|
|
115
|
+
// Reset the gate each time it (re)opens.
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (open) {
|
|
118
|
+
setPassword("");
|
|
119
|
+
setAttempted(false);
|
|
120
|
+
}
|
|
121
|
+
}, [open]);
|
|
122
|
+
|
|
123
|
+
// Simulate the API generating the new set: a ~1s skeleton on reveal.
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (!revealOpen) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
setLoading(true);
|
|
129
|
+
const timer = window.setTimeout(() => setLoading(false), 1100);
|
|
130
|
+
return () => window.clearTimeout(timer);
|
|
131
|
+
}, [revealOpen]);
|
|
132
|
+
const passwordInvalid = attempted && password.trim() === "";
|
|
133
|
+
const handleConfirm = () => {
|
|
134
|
+
if (password.trim() === "") {
|
|
135
|
+
setAttempted(true);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
// Valid password + submit is all the confirmation we need: close the gate
|
|
139
|
+
// and open the reveal (which regenerates the set).
|
|
140
|
+
onClose();
|
|
141
|
+
setRevealOpen(true);
|
|
142
|
+
};
|
|
143
|
+
const handleCopy = () => {
|
|
144
|
+
setCopyOpen(true);
|
|
145
|
+
setCopyKey(k => k + 1);
|
|
146
|
+
};
|
|
147
|
+
const closeReveal = () => {
|
|
148
|
+
setRevealOpen(false);
|
|
149
|
+
};
|
|
150
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog, {
|
|
151
|
+
open: open,
|
|
152
|
+
onClose: onClose,
|
|
153
|
+
disableCloseOnEsc: true
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Dialog.Title, null, "Regenerate Backup Codes"), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledGateBody, null, /*#__PURE__*/React.createElement(Body2, {
|
|
155
|
+
color: "secondary",
|
|
156
|
+
lineHeight: "loose"
|
|
157
|
+
}, "This drops all of your existing backup codes and creates a new set of 10. Any codes you saved before will stop working. The new codes are shown only once. Enter your password to confirm it's you."), /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: "pg-field"
|
|
159
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
160
|
+
htmlFor: "backup-codes-password"
|
|
161
|
+
}, "Your Password"), /*#__PURE__*/React.createElement(InputPassword, {
|
|
162
|
+
id: "backup-codes-password",
|
|
163
|
+
wrapperClassName: "pg-input",
|
|
164
|
+
value: password,
|
|
165
|
+
onChange: asInputChange(value => {
|
|
166
|
+
setPassword(value);
|
|
167
|
+
setAttempted(false);
|
|
168
|
+
}),
|
|
169
|
+
invalid: passwordInvalid,
|
|
170
|
+
errorMessage: passwordInvalid ? "Your password is required." : undefined,
|
|
171
|
+
autoFocus: true,
|
|
172
|
+
autoComplete: "current-password"
|
|
173
|
+
})))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Actions, null, /*#__PURE__*/React.createElement(Button, {
|
|
174
|
+
variant: "primary",
|
|
175
|
+
style: {
|
|
176
|
+
marginRight: 12
|
|
177
|
+
},
|
|
178
|
+
onClick: handleConfirm
|
|
179
|
+
}, "Regenerate Codes"), /*#__PURE__*/React.createElement(Button, {
|
|
180
|
+
variant: "secondary",
|
|
181
|
+
onClick: onClose
|
|
182
|
+
}, "Cancel"))), /*#__PURE__*/React.createElement(BackupCodesRevealDialog, {
|
|
183
|
+
open: revealOpen,
|
|
184
|
+
loading: loading,
|
|
185
|
+
onClose: closeReveal,
|
|
186
|
+
onCopy: handleCopy
|
|
187
|
+
}), /*#__PURE__*/React.createElement(CopyToast, {
|
|
188
|
+
open: copyOpen,
|
|
189
|
+
toastKey: copyKey,
|
|
190
|
+
text: "Backup codes copied to clipboard.",
|
|
191
|
+
onClose: () => setCopyOpen(false)
|
|
192
|
+
}));
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/* ------------------------------------------------------------------ */
|
|
196
|
+
/* Backup Codes — one-time reveal (skeleton while loading) */
|
|
197
|
+
/* ------------------------------------------------------------------ */
|
|
198
|
+
|
|
199
|
+
const StyledRevealBody = styled.div.withConfig({
|
|
200
|
+
displayName: "TwoFactorDialogs__StyledRevealBody",
|
|
201
|
+
componentId: "sc-nn5qbh-2"
|
|
202
|
+
})(["font-family:", ";display:flex;flex-direction:column;gap:16px;.bc-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;}.bc-code{font-family:", ";font-size:14px;letter-spacing:0.5px;color:var(--color-theme-900);padding:6px 10px;border-radius:6px;background-color:var(--color-theme-200);text-align:center;}.bc-skeleton{height:32px;border-radius:6px;width:100%;}"], SANS, MONO);
|
|
203
|
+
const BackupCodesRevealDialog = _ref3 => {
|
|
204
|
+
let open = _ref3.open,
|
|
205
|
+
loading = _ref3.loading,
|
|
206
|
+
onClose = _ref3.onClose,
|
|
207
|
+
onCopy = _ref3.onCopy;
|
|
208
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
|
209
|
+
open: open,
|
|
210
|
+
onClose: onClose,
|
|
211
|
+
disableCloseOnEsc: true
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Dialog.Title, null, "Your Backup Codes"), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledRevealBody, null, /*#__PURE__*/React.createElement(Body2, {
|
|
213
|
+
color: "secondary",
|
|
214
|
+
lineHeight: "loose"
|
|
215
|
+
}, "Use a backup code to log in when email isn't available. Each code works once."), /*#__PURE__*/React.createElement("div", {
|
|
216
|
+
className: "bc-grid"
|
|
217
|
+
}, loading ? [...Array(10)].map((_, index) => /*#__PURE__*/React.createElement(SkeletonLoader, {
|
|
218
|
+
key: index,
|
|
219
|
+
className: "bc-skeleton"
|
|
220
|
+
})) : SAMPLE_BACKUP_CODES.map(code => /*#__PURE__*/React.createElement("div", {
|
|
221
|
+
key: code,
|
|
222
|
+
className: "bc-code"
|
|
223
|
+
}, code))), /*#__PURE__*/React.createElement(InfoBox, {
|
|
224
|
+
type: "note",
|
|
225
|
+
showIcon: true,
|
|
226
|
+
title: "Codes are shown only once"
|
|
227
|
+
}, /*#__PURE__*/React.createElement(Body2, {
|
|
228
|
+
color: "secondary"
|
|
229
|
+
}, "Save them somewhere safe, they can't be displayed again. You can generate a new set from your profile at any time.")))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Actions, null, /*#__PURE__*/React.createElement(Button, {
|
|
230
|
+
variant: "primary",
|
|
231
|
+
style: {
|
|
232
|
+
marginRight: 12
|
|
233
|
+
},
|
|
234
|
+
onClick: onClose,
|
|
235
|
+
disabled: loading
|
|
236
|
+
}, "I've Saved My Codes"), /*#__PURE__*/React.createElement(Button, {
|
|
237
|
+
variant: "secondary",
|
|
238
|
+
onClick: onCopy,
|
|
239
|
+
disabled: loading
|
|
240
|
+
}, "Copy Codes")));
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
/* ------------------------------------------------------------------ */
|
|
244
|
+
/* Create Login Code — password gate + one-time reveal */
|
|
245
|
+
/* ------------------------------------------------------------------ */
|
|
246
|
+
|
|
247
|
+
const StyledCodeRow = styled.div.withConfig({
|
|
248
|
+
displayName: "TwoFactorDialogs__StyledCodeRow",
|
|
249
|
+
componentId: "sc-nn5qbh-3"
|
|
250
|
+
})(["font-family:", ";display:flex;flex-direction:column;gap:16px;.lc-label{display:block;margin-bottom:6px;}.lc-code-field{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:8px;background-color:var(--color-theme-200);}.lc-code{font-family:", ";font-size:15px;letter-spacing:0.5px;color:var(--color-theme-900);flex:1 1 auto;}.lc-copy svg{fill:var(--color-theme-600);}.lc-caption{display:block;margin-top:6px;}"], SANS, MONO);
|
|
251
|
+
|
|
252
|
+
/* Title row for the reveal dialog: heading on the left, X close on the right
|
|
253
|
+
(the app's Use Token dialog pattern). Applied via className since
|
|
254
|
+
Dialog.Title doesn't accept inline style. */
|
|
255
|
+
const StyledRevealTitle = styled.div.withConfig({
|
|
256
|
+
displayName: "TwoFactorDialogs__StyledRevealTitle",
|
|
257
|
+
componentId: "sc-nn5qbh-4"
|
|
258
|
+
})(["display:flex;justify-content:space-between;align-items:center;width:100%;.lc-close svg{fill:var(--color-theme-600);}"]);
|
|
259
|
+
/**
|
|
260
|
+
* Owner-minted login code flow (task #18): password gate first, then the
|
|
261
|
+
* one-time reveal. The reveal has no footer — an X in the title closes it —
|
|
262
|
+
* mirroring the app's Use Token dialog.
|
|
263
|
+
*/
|
|
264
|
+
export const CreateLoginCodeDialogs = _ref4 => {
|
|
265
|
+
let open = _ref4.open,
|
|
266
|
+
onClose = _ref4.onClose,
|
|
267
|
+
userName = _ref4.userName;
|
|
268
|
+
const firstName = useMemo(() => userName.split(" ")[0] || userName, [userName]);
|
|
269
|
+
const _useState7 = useState(""),
|
|
270
|
+
password = _useState7[0],
|
|
271
|
+
setPassword = _useState7[1];
|
|
272
|
+
const _useState8 = useState(false),
|
|
273
|
+
attempted = _useState8[0],
|
|
274
|
+
setAttempted = _useState8[1];
|
|
275
|
+
const _useState9 = useState(false),
|
|
276
|
+
revealOpen = _useState9[0],
|
|
277
|
+
setRevealOpen = _useState9[1];
|
|
278
|
+
// Expiry copy: computed as "now + 10 min" at the moment the code is minted.
|
|
279
|
+
const _useState0 = useState(""),
|
|
280
|
+
expiry = _useState0[0],
|
|
281
|
+
setExpiry = _useState0[1];
|
|
282
|
+
const _useState1 = useState(false),
|
|
283
|
+
copyOpen = _useState1[0],
|
|
284
|
+
setCopyOpen = _useState1[1];
|
|
285
|
+
const _useState10 = useState(0),
|
|
286
|
+
copyKey = _useState10[0],
|
|
287
|
+
setCopyKey = _useState10[1];
|
|
288
|
+
useEffect(() => {
|
|
289
|
+
if (open) {
|
|
290
|
+
setPassword("");
|
|
291
|
+
setAttempted(false);
|
|
292
|
+
}
|
|
293
|
+
}, [open]);
|
|
294
|
+
const passwordInvalid = attempted && password.trim() === "";
|
|
295
|
+
const handleConfirm = () => {
|
|
296
|
+
if (password.trim() === "") {
|
|
297
|
+
setAttempted(true);
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const when = new Date(Date.now() + 10 * 60000);
|
|
301
|
+
const hh = String(when.getHours()).padStart(2, "0");
|
|
302
|
+
const mm = String(when.getMinutes()).padStart(2, "0");
|
|
303
|
+
setExpiry(hh + ":" + mm);
|
|
304
|
+
onClose();
|
|
305
|
+
setRevealOpen(true);
|
|
306
|
+
};
|
|
307
|
+
const handleCopy = () => {
|
|
308
|
+
setCopyOpen(true);
|
|
309
|
+
setCopyKey(k => k + 1);
|
|
310
|
+
};
|
|
311
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog, {
|
|
312
|
+
open: open,
|
|
313
|
+
onClose: onClose,
|
|
314
|
+
disableCloseOnEsc: true
|
|
315
|
+
}, /*#__PURE__*/React.createElement(Dialog.Title, null, "Confirm Password"), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledGateBody, null, /*#__PURE__*/React.createElement(Body2, {
|
|
316
|
+
color: "secondary",
|
|
317
|
+
lineHeight: "loose"
|
|
318
|
+
}, "You're about to create a one-time login code for ", userName, ". Any code they already had pending will be replaced."), /*#__PURE__*/React.createElement("div", {
|
|
319
|
+
className: "pg-field"
|
|
320
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
321
|
+
htmlFor: "login-code-password"
|
|
322
|
+
}, "Your Password"), /*#__PURE__*/React.createElement(InputPassword, {
|
|
323
|
+
id: "login-code-password",
|
|
324
|
+
wrapperClassName: "pg-input",
|
|
325
|
+
value: password,
|
|
326
|
+
onChange: asInputChange(value => {
|
|
327
|
+
setPassword(value);
|
|
328
|
+
setAttempted(false);
|
|
329
|
+
}),
|
|
330
|
+
invalid: passwordInvalid,
|
|
331
|
+
errorMessage: passwordInvalid ? "Your password is required." : undefined,
|
|
332
|
+
autoFocus: true,
|
|
333
|
+
autoComplete: "current-password"
|
|
334
|
+
})))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Actions, null, /*#__PURE__*/React.createElement(Button, {
|
|
335
|
+
variant: "primary",
|
|
336
|
+
style: {
|
|
337
|
+
marginRight: 12
|
|
338
|
+
},
|
|
339
|
+
onClick: handleConfirm
|
|
340
|
+
}, "Confirm"), /*#__PURE__*/React.createElement(Button, {
|
|
341
|
+
variant: "secondary",
|
|
342
|
+
onClick: onClose
|
|
343
|
+
}, "Cancel"))), /*#__PURE__*/React.createElement(Dialog, {
|
|
344
|
+
open: revealOpen,
|
|
345
|
+
onClose: () => setRevealOpen(false)
|
|
346
|
+
}, /*#__PURE__*/React.createElement(Dialog.Title, {
|
|
347
|
+
disableDefaultHeading: true
|
|
348
|
+
}, /*#__PURE__*/React.createElement(StyledRevealTitle, null, /*#__PURE__*/React.createElement(Header3, null, "One-Time Login Code"), /*#__PURE__*/React.createElement(IconButton, {
|
|
349
|
+
variant: "text gray",
|
|
350
|
+
className: "lc-close",
|
|
351
|
+
onClick: () => setRevealOpen(false)
|
|
352
|
+
}, /*#__PURE__*/React.createElement(CancelCrossIcon, null)))), /*#__PURE__*/React.createElement(Dialog.ContentDivider, null), /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(StyledCodeRow, null, /*#__PURE__*/React.createElement(Body2, {
|
|
353
|
+
color: "secondary",
|
|
354
|
+
lineHeight: "loose"
|
|
355
|
+
}, "Share this code with ", firstName, " through a secure channel. They'll still need their password to log in, the code alone won't work."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Label, {
|
|
356
|
+
className: "lc-label"
|
|
357
|
+
}, "Login Code"), /*#__PURE__*/React.createElement("div", {
|
|
358
|
+
className: "lc-code-field"
|
|
359
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
360
|
+
className: "lc-code"
|
|
361
|
+
}, SAMPLE_LOGIN_CODE), /*#__PURE__*/React.createElement(Tooltip, {
|
|
362
|
+
title: "Copy code"
|
|
363
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
364
|
+
variant: "text gray",
|
|
365
|
+
className: "lc-copy",
|
|
366
|
+
onClick: handleCopy
|
|
367
|
+
}, /*#__PURE__*/React.createElement(CopyIcon, null)))), /*#__PURE__*/React.createElement(Caption1, {
|
|
368
|
+
color: "tertiary",
|
|
369
|
+
className: "lc-caption"
|
|
370
|
+
}, "Expires at ", expiry, " (in 10 minutes), it can't be shown again.")), /*#__PURE__*/React.createElement(InfoBox, {
|
|
371
|
+
type: "default",
|
|
372
|
+
showIcon: true,
|
|
373
|
+
title: firstName + " has been notified"
|
|
374
|
+
}, /*#__PURE__*/React.createElement(Body2, {
|
|
375
|
+
color: "secondary"
|
|
376
|
+
}, "They received an email saying you created this code for their account. The email doesn't include the code."))))), /*#__PURE__*/React.createElement(CopyToast, {
|
|
377
|
+
open: copyOpen,
|
|
378
|
+
toastKey: copyKey,
|
|
379
|
+
text: "Login code copied to clipboard.",
|
|
380
|
+
onClose: () => setCopyOpen(false)
|
|
381
|
+
}));
|
|
382
|
+
};
|
|
383
|
+
//# sourceMappingURL=TwoFactorDialogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorDialogs.js","names":["React","useEffect","useMemo","useState","styled","Button","Dialog","IconButton","CancelCrossIcon","CopyIcon","InfoBox","InputPassword","Label","SkeletonLoader","ToastMessage","Tooltip","SlideFromTop","Body2","Caption1","Header3","SANS","MONO","asInputChange","fn","SAMPLE_BACKUP_CODES","SAMPLE_LOGIN_CODE","StyledToastAnchor","div","withConfig","displayName","componentId","CopyToast","_ref","open","toastKey","text","onClose","createElement","in","key","className","type","dismissible","dropShadow","timeout","StyledGateBody","BackupCodesDialogs","_ref2","_useState","password","setPassword","_useState2","attempted","setAttempted","_useState3","revealOpen","setRevealOpen","_useState4","loading","setLoading","_useState5","copyOpen","setCopyOpen","_useState6","copyKey","setCopyKey","undefined","timer","window","setTimeout","clearTimeout","passwordInvalid","trim","handleConfirm","handleCopy","k","closeReveal","Fragment","disableCloseOnEsc","Title","ContentDivider","Content","color","lineHeight","htmlFor","id","wrapperClassName","value","onChange","invalid","errorMessage","autoFocus","autoComplete","Actions","variant","style","marginRight","onClick","BackupCodesRevealDialog","onCopy","StyledRevealBody","_ref3","Array","map","_","index","code","showIcon","title","disabled","StyledCodeRow","StyledRevealTitle","CreateLoginCodeDialogs","_ref4","userName","firstName","split","_useState7","_useState8","_useState9","_useState0","expiry","setExpiry","_useState1","_useState10","when","Date","now","hh","String","getHours","padStart","mm","getMinutes","disableDefaultHeading"],"sources":["../../../../src/presentation/shared/TwoFactorDialogs.tsx"],"sourcesContent":["import React, { ReactElement, useEffect, useMemo, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { Button } from \"../../components/Button\";\nimport { Dialog } from \"../../components/Dialog\";\nimport { IconButton } from \"../../components/IconButton\";\nimport { CancelCrossIcon, CopyIcon } from \"../../components/Icons\";\nimport { InfoBox } from \"../../components/InfoBox\";\nimport { InputPassword } from \"../../components/Input\";\nimport { Label } from \"../../components/Label\";\nimport { SkeletonLoader } from \"../../components/Loaders\";\nimport { ToastMessage } from \"../../components/ToastMessage\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { SlideFromTop } from \"../../components/Transitions\";\nimport { Body2, Caption1, Header3 } from \"../../components/Typography\";\n\n/**\n * Self-hosted 2FA dialogs shared by the People stories (Users list + User\n * profile). Two flows, both reached from the user three-dot menu and both\n * gated (in the menu) behind the self-hosted + 2FA-enabled guard:\n *\n * - **Backup Codes** (own account, `self` menu): a single dialog that both\n * explains the destructive regenerate and takes the password (identity\n * confirmation is \"valid password + submit\", no separate confirm step).\n * Submitting opens the reveal dialog, which shows a skeleton while the new\n * set \"loads\", then the 10 codes once.\n * - **Create Login Code** (another user, `member`/`client` menu): an owner\n * re-enters their own password, then a one-time code is revealed once with\n * its expiry and a \"user notified\" note. (Task #18.)\n *\n * Everything is mocked locally: passwords aren't checked, the \"load\" is a\n * timer, and the codes are static samples.\n */\n\nconst SANS =\n '-apple-system, BlinkMacSystemFont, \"Roboto\", \"Helvetica Neue\", Arial, sans-serif';\nconst MONO =\n '\"SF Mono\", \"Roboto Mono\", Menlo, Consolas, \"Courier New\", monospace';\n\n/**\n * DS `InputPassword` calls `onChange` with the string value at runtime, but its\n * type is still inherited from the native input (`ChangeEventHandler`). Adapt a\n * string handler so TypeScript is satisfied without lying about the value.\n */\nconst asInputChange = (\n fn: (value: string) => void\n): React.ChangeEventHandler<HTMLInputElement> =>\n fn as unknown as React.ChangeEventHandler<HTMLInputElement>;\n\n/* Sample codes (10+10 A-Z0-9), mirroring the real generator's format. */\nconst SAMPLE_BACKUP_CODES = [\n \"4K7Q9ZM2XN-8V3TJRD6WP\",\n \"P2W8XK4M9Q-3RJ7VND5TZ\",\n \"9ZM2XN4K7Q-6WP8V3TJRD\",\n \"TJRD6WP8V3-2XN4K7Q9ZM\",\n \"V3TJRD6WP8-K7Q9ZM2XN4\",\n \"8V3TJRD6WP-Q9ZM2XN4K7\",\n \"RD5TZP2W8X-M9Q3RJ7VND\",\n \"3RJ7VND5TZ-8XK4M9QP2W\",\n \"N4K7Q9ZM2X-6WP8V3TJRD\",\n \"Q9ZM2XN4K7-8V3TJRD6WP\",\n];\n\nconst SAMPLE_LOGIN_CODE = \"4K7Q9ZM2XN-8V3TJRD6WP\";\n\n/* ------------------------------------------------------------------ */\n/* Toast (reuses the fixed upper-right anchor pattern from headers) */\n/* ------------------------------------------------------------------ */\n\nconst StyledToastAnchor = styled.div`\n position: fixed;\n top: 16px;\n right: 16px;\n z-index: 10000;\n pointer-events: none;\n\n .c-toast-message {\n pointer-events: auto;\n }\n`;\n\ninterface CopyToastProps {\n open: boolean;\n toastKey: number;\n text: string;\n onClose: () => void;\n}\n\nconst CopyToast = ({\n open,\n toastKey,\n text,\n onClose,\n}: CopyToastProps): ReactElement => (\n <StyledToastAnchor>\n <SlideFromTop in={open}>\n <ToastMessage\n key={toastKey}\n className=\"c-toast-message\"\n type=\"success\"\n text={text}\n dismissible\n dropShadow\n timeout={3000}\n onClose={onClose}\n />\n </SlideFromTop>\n </StyledToastAnchor>\n);\n\n/* ------------------------------------------------------------------ */\n/* Shared password-gate body (describe + password in one dialog) */\n/* ------------------------------------------------------------------ */\n\nconst StyledGateBody = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n .pg-field {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n /* DS InputPassword wrapper is fixed-width — fill the dialog. */\n .pg-input.c-input-wrapper,\n .pg-input {\n width: 100%;\n max-width: none;\n }\n`;\n\n/* ------------------------------------------------------------------ */\n/* Backup Codes — combined describe + password dialog */\n/* ------------------------------------------------------------------ */\n\nexport interface BackupCodesDialogsProps {\n open: boolean;\n onClose: () => void;\n}\n\n/**\n * The full Backup Codes flow: the combined regenerate/password dialog, then the\n * one-time reveal dialog with its loading skeleton. Cancelling the first dialog\n * is a pure no-op — no codes are issued, no toast.\n */\nexport const BackupCodesDialogs = ({\n open,\n onClose,\n}: BackupCodesDialogsProps): ReactElement => {\n const [password, setPassword] = useState(\"\");\n const [attempted, setAttempted] = useState(false);\n const [revealOpen, setRevealOpen] = useState(false);\n const [loading, setLoading] = useState(true);\n\n const [copyOpen, setCopyOpen] = useState(false);\n const [copyKey, setCopyKey] = useState(0);\n\n // Reset the gate each time it (re)opens.\n useEffect(() => {\n if (open) {\n setPassword(\"\");\n setAttempted(false);\n }\n }, [open]);\n\n // Simulate the API generating the new set: a ~1s skeleton on reveal.\n useEffect(() => {\n if (!revealOpen) {\n return undefined;\n }\n setLoading(true);\n const timer = window.setTimeout(() => setLoading(false), 1100);\n return () => window.clearTimeout(timer);\n }, [revealOpen]);\n\n const passwordInvalid = attempted && password.trim() === \"\";\n\n const handleConfirm = (): void => {\n if (password.trim() === \"\") {\n setAttempted(true);\n return;\n }\n // Valid password + submit is all the confirmation we need: close the gate\n // and open the reveal (which regenerates the set).\n onClose();\n setRevealOpen(true);\n };\n\n const handleCopy = (): void => {\n setCopyOpen(true);\n setCopyKey((k) => k + 1);\n };\n\n const closeReveal = (): void => {\n setRevealOpen(false);\n };\n\n return (\n <>\n <Dialog open={open} onClose={onClose} disableCloseOnEsc>\n <Dialog.Title>Regenerate Backup Codes</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledGateBody>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n This drops all of your existing backup codes and creates a new set\n of 10. Any codes you saved before will stop working. The new codes\n are shown only once. Enter your password to confirm it's you.\n </Body2>\n <div className=\"pg-field\">\n <Label htmlFor=\"backup-codes-password\">Your Password</Label>\n <InputPassword\n id=\"backup-codes-password\"\n wrapperClassName=\"pg-input\"\n value={password}\n onChange={asInputChange((value) => {\n setPassword(value);\n setAttempted(false);\n })}\n invalid={passwordInvalid}\n errorMessage={\n passwordInvalid ? \"Your password is required.\" : undefined\n }\n autoFocus\n autoComplete=\"current-password\"\n />\n </div>\n </StyledGateBody>\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n style={{ marginRight: 12 }}\n onClick={handleConfirm}\n >\n Regenerate Codes\n </Button>\n <Button variant=\"secondary\" onClick={onClose}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n\n <BackupCodesRevealDialog\n open={revealOpen}\n loading={loading}\n onClose={closeReveal}\n onCopy={handleCopy}\n />\n\n <CopyToast\n open={copyOpen}\n toastKey={copyKey}\n text=\"Backup codes copied to clipboard.\"\n onClose={() => setCopyOpen(false)}\n />\n </>\n );\n};\n\n/* ------------------------------------------------------------------ */\n/* Backup Codes — one-time reveal (skeleton while loading) */\n/* ------------------------------------------------------------------ */\n\nconst StyledRevealBody = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n .bc-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px 16px;\n }\n\n .bc-code {\n font-family: ${MONO};\n font-size: 14px;\n letter-spacing: 0.5px;\n color: var(--color-theme-900);\n padding: 6px 10px;\n border-radius: 6px;\n background-color: var(--color-theme-200);\n text-align: center;\n }\n\n .bc-skeleton {\n height: 32px;\n border-radius: 6px;\n width: 100%;\n }\n`;\n\ninterface BackupCodesRevealDialogProps {\n open: boolean;\n loading: boolean;\n onClose: () => void;\n onCopy: () => void;\n}\n\nconst BackupCodesRevealDialog = ({\n open,\n loading,\n onClose,\n onCopy,\n}: BackupCodesRevealDialogProps): ReactElement => (\n <Dialog open={open} onClose={onClose} disableCloseOnEsc>\n <Dialog.Title>Your Backup Codes</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledRevealBody>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n Use a backup code to log in when email isn't available. Each code\n works once.\n </Body2>\n <div className=\"bc-grid\">\n {loading\n ? [...Array(10)].map((_, index) => (\n <SkeletonLoader key={index} className=\"bc-skeleton\" />\n ))\n : SAMPLE_BACKUP_CODES.map((code) => (\n <div key={code} className=\"bc-code\">\n {code}\n </div>\n ))}\n </div>\n <InfoBox type=\"note\" showIcon title=\"Codes are shown only once\">\n <Body2 color=\"secondary\">\n Save them somewhere safe, they can't be displayed again. You\n can generate a new set from your profile at any time.\n </Body2>\n </InfoBox>\n </StyledRevealBody>\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n style={{ marginRight: 12 }}\n onClick={onClose}\n disabled={loading}\n >\n I've Saved My Codes\n </Button>\n <Button variant=\"secondary\" onClick={onCopy} disabled={loading}>\n Copy Codes\n </Button>\n </Dialog.Actions>\n </Dialog>\n);\n\n/* ------------------------------------------------------------------ */\n/* Create Login Code — password gate + one-time reveal */\n/* ------------------------------------------------------------------ */\n\nconst StyledCodeRow = styled.div`\n font-family: ${SANS};\n display: flex;\n flex-direction: column;\n gap: 16px;\n\n .lc-label {\n display: block;\n margin-bottom: 6px;\n }\n\n .lc-code-field {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: 8px;\n background-color: var(--color-theme-200);\n }\n\n .lc-code {\n font-family: ${MONO};\n font-size: 15px;\n letter-spacing: 0.5px;\n color: var(--color-theme-900);\n flex: 1 1 auto;\n }\n\n .lc-copy svg {\n fill: var(--color-theme-600);\n }\n\n .lc-caption {\n display: block;\n margin-top: 6px;\n }\n`;\n\n/* Title row for the reveal dialog: heading on the left, X close on the right\n (the app's Use Token dialog pattern). Applied via className since\n Dialog.Title doesn't accept inline style. */\nconst StyledRevealTitle = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n .lc-close svg {\n fill: var(--color-theme-600);\n }\n`;\n\nexport interface CreateLoginCodeDialogsProps {\n open: boolean;\n onClose: () => void;\n /** Target user's full name (drives the dialog copy). */\n userName: string;\n}\n\n/**\n * Owner-minted login code flow (task #18): password gate first, then the\n * one-time reveal. The reveal has no footer — an X in the title closes it —\n * mirroring the app's Use Token dialog.\n */\nexport const CreateLoginCodeDialogs = ({\n open,\n onClose,\n userName,\n}: CreateLoginCodeDialogsProps): ReactElement => {\n const firstName = useMemo(\n () => userName.split(\" \")[0] || userName,\n [userName]\n );\n\n const [password, setPassword] = useState(\"\");\n const [attempted, setAttempted] = useState(false);\n const [revealOpen, setRevealOpen] = useState(false);\n // Expiry copy: computed as \"now + 10 min\" at the moment the code is minted.\n const [expiry, setExpiry] = useState(\"\");\n\n const [copyOpen, setCopyOpen] = useState(false);\n const [copyKey, setCopyKey] = useState(0);\n\n useEffect(() => {\n if (open) {\n setPassword(\"\");\n setAttempted(false);\n }\n }, [open]);\n\n const passwordInvalid = attempted && password.trim() === \"\";\n\n const handleConfirm = (): void => {\n if (password.trim() === \"\") {\n setAttempted(true);\n return;\n }\n const when = new Date(Date.now() + 10 * 60000);\n const hh = String(when.getHours()).padStart(2, \"0\");\n const mm = String(when.getMinutes()).padStart(2, \"0\");\n setExpiry(`${hh}:${mm}`);\n onClose();\n setRevealOpen(true);\n };\n\n const handleCopy = (): void => {\n setCopyOpen(true);\n setCopyKey((k) => k + 1);\n };\n\n return (\n <>\n <Dialog open={open} onClose={onClose} disableCloseOnEsc>\n <Dialog.Title>Confirm Password</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledGateBody>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n You're about to create a one-time login code for {userName}.\n Any code they already had pending will be replaced.\n </Body2>\n <div className=\"pg-field\">\n <Label htmlFor=\"login-code-password\">Your Password</Label>\n <InputPassword\n id=\"login-code-password\"\n wrapperClassName=\"pg-input\"\n value={password}\n onChange={asInputChange((value) => {\n setPassword(value);\n setAttempted(false);\n })}\n invalid={passwordInvalid}\n errorMessage={\n passwordInvalid ? \"Your password is required.\" : undefined\n }\n autoFocus\n autoComplete=\"current-password\"\n />\n </div>\n </StyledGateBody>\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n style={{ marginRight: 12 }}\n onClick={handleConfirm}\n >\n Confirm\n </Button>\n <Button variant=\"secondary\" onClick={onClose}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n\n <Dialog open={revealOpen} onClose={() => setRevealOpen(false)}>\n <Dialog.Title disableDefaultHeading>\n <StyledRevealTitle>\n <Header3>One-Time Login Code</Header3>\n <IconButton\n variant=\"text gray\"\n className=\"lc-close\"\n onClick={() => setRevealOpen(false)}\n >\n <CancelCrossIcon />\n </IconButton>\n </StyledRevealTitle>\n </Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <StyledCodeRow>\n <Body2 color=\"secondary\" lineHeight=\"loose\">\n Share this code with {firstName} through a secure channel.\n They'll still need their password to log in, the code alone\n won't work.\n </Body2>\n <div>\n <Label className=\"lc-label\">Login Code</Label>\n <div className=\"lc-code-field\">\n <span className=\"lc-code\">{SAMPLE_LOGIN_CODE}</span>\n <Tooltip title=\"Copy code\">\n <IconButton\n variant=\"text gray\"\n className=\"lc-copy\"\n onClick={handleCopy}\n >\n <CopyIcon />\n </IconButton>\n </Tooltip>\n </div>\n <Caption1 color=\"tertiary\" className=\"lc-caption\">\n Expires at {expiry} (in 10 minutes), it can't be shown\n again.\n </Caption1>\n </div>\n <InfoBox\n type=\"default\"\n showIcon\n title={`${firstName} has been notified`}\n >\n <Body2 color=\"secondary\">\n They received an email saying you created this code for their\n account. The email doesn't include the code.\n </Body2>\n </InfoBox>\n </StyledCodeRow>\n </Dialog.Content>\n </Dialog>\n\n <CopyToast\n open={copyOpen}\n toastKey={copyKey}\n text=\"Login code copied to clipboard.\"\n onClose={() => setCopyOpen(false)}\n />\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAkBC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEzE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,eAAe,EAAEC,QAAQ,QAAQ,wBAAwB;AAClE,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,6BAA6B;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,IAAI,GACR,kFAAkF;AACpF,MAAMC,IAAI,GACR,qEAAqE;;AAEvE;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GACjBC,EAA2B,IAE3BA,EAA2D;;AAE7D;AACA,MAAMC,mBAAmB,GAAG,CAC1B,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,CACxB;AAED,MAAMC,iBAAiB,GAAG,uBAAuB;;AAEjD;AACA;AACA;;AAEA,MAAMC,iBAAiB,GAAGtB,M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@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export interface TwoFactorShieldProps {
|
|
3
|
+
/** When true, 2FA isn't set up yet for the logged-in user: the shield is
|
|
4
|
+
* dimmed and clickable, and the tooltip prompts to enable it. Otherwise it
|
|
5
|
+
* reads as "enabled" (the default). Mirrors `isLoggedUser2FADisabled`. */
|
|
6
|
+
needsSetup?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TwoFactorShield: {
|
|
10
|
+
({ needsSetup, className, }: TwoFactorShieldProps): ReactElement;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=TwoFactorShield.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorShield.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/TwoFactorShield.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAU5C,MAAM,WAAW,oBAAoB;IACnC;;+EAE2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe;iCAGzB,oBAAoB,GAAG,YAAY;;CAarC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ShieldIcon } from "../../components/Icons";
|
|
3
|
+
import { Tooltip } from "../../components/Tooltip";
|
|
4
|
+
|
|
5
|
+
/* Two-factor-authentication shield — the same indicator as the app's
|
|
6
|
+
`User2FA` (ShieldIcon + Tooltip). Shared by the Users list and the User
|
|
7
|
+
profile so the icon and its tooltip stay identical in one place. The shield
|
|
8
|
+
uses its default muted `--color-theme-600` fill. */
|
|
9
|
+
|
|
10
|
+
export const TwoFactorShield = _ref => {
|
|
11
|
+
let _ref$needsSetup = _ref.needsSetup,
|
|
12
|
+
needsSetup = _ref$needsSetup === void 0 ? false : _ref$needsSetup,
|
|
13
|
+
className = _ref.className;
|
|
14
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
15
|
+
title: needsSetup ? "Enable two-factor authentication" : "Two-factor authentication enabled"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(ShieldIcon, {
|
|
17
|
+
className: className,
|
|
18
|
+
style: needsSetup ? {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
cursor: "pointer"
|
|
21
|
+
} : undefined
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
TwoFactorShield.displayName = "TwoFactorShield";
|
|
25
|
+
//# sourceMappingURL=TwoFactorShield.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoFactorShield.js","names":["React","ShieldIcon","Tooltip","TwoFactorShield","_ref","_ref$needsSetup","needsSetup","className","createElement","title","style","opacity","cursor","undefined","displayName"],"sources":["../../../../src/presentation/shared/TwoFactorShield.tsx"],"sourcesContent":["import React, { ReactElement } from \"react\";\n\nimport { ShieldIcon } from \"../../components/Icons\";\nimport { Tooltip } from \"../../components/Tooltip\";\n\n/* Two-factor-authentication shield — the same indicator as the app's\n `User2FA` (ShieldIcon + Tooltip). Shared by the Users list and the User\n profile so the icon and its tooltip stay identical in one place. The shield\n uses its default muted `--color-theme-600` fill. */\n\nexport interface TwoFactorShieldProps {\n /** When true, 2FA isn't set up yet for the logged-in user: the shield is\n * dimmed and clickable, and the tooltip prompts to enable it. Otherwise it\n * reads as \"enabled\" (the default). Mirrors `isLoggedUser2FADisabled`. */\n needsSetup?: boolean;\n className?: string;\n}\n\nexport const TwoFactorShield = ({\n needsSetup = false,\n className,\n}: TwoFactorShieldProps): ReactElement => (\n <Tooltip\n title={\n needsSetup\n ? \"Enable two-factor authentication\"\n : \"Two-factor authentication enabled\"\n }\n >\n <ShieldIcon\n className={className}\n style={needsSetup ? { opacity: 0.5, cursor: \"pointer\" } : undefined}\n />\n </Tooltip>\n);\n\nTwoFactorShield.displayName = \"TwoFactorShield\";\n"],"mappings":"AAAA,OAAOA,KAAK,MAAwB,OAAO;AAE3C,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,OAAO,QAAQ,0BAA0B;;AAElD;AACA;AACA;AACA;;AAUA,OAAO,MAAMC,eAAe,GAAGC,IAAA;EAAA,IAAAC,eAAA,GAAAD,IAAA,CAC7BE,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,KAAK,GAAAA,eAAA;IAClBE,SAAS,GAAAH,IAAA,CAATG,SAAS;EAAA,oBAETP,KAAA,CAAAQ,aAAA,CAACN,OAAO;IACNO,KAAK,EACHH,UAAU,GACN,kCAAkC,GAClC;EACL,gBAEDN,KAAA,CAAAQ,aAAA,CAACP,UAAU;IACTM,SAAS,EAAEA,SAAU;IACrBG,KAAK,EAAEJ,UAAU,GAAG;MAAEK,OAAO,EAAE,GAAG;MAAEC,MAAM,EAAE;IAAU,CAAC,GAAGC;EAAU,CACrE,CACM,CAAC;AAAA,CACX;AAEDV,eAAe,CAACW,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
/** Which set of actions to show, from the owner/power-user's point of view.
|
|
3
|
+
* `self` = acting on their own row; `member` = another (active) member;
|
|
4
|
+
* `client` = a client/client+ (no rates & capacity — clients are excluded). */
|
|
5
|
+
export type UserMenuVariant = "self" | "member" | "client";
|
|
6
|
+
export interface UserMenuProps {
|
|
7
|
+
/** Which action set to render. Defaults to `member`. */
|
|
8
|
+
variant?: UserMenuVariant;
|
|
9
|
+
/** Class on the TreeDots trigger (parent controls its hover visibility). */
|
|
10
|
+
targetClassName?: string;
|
|
11
|
+
/** IconButton size of the trigger (omit for the default/regular size). */
|
|
12
|
+
size?: "small" | "medium" | "big";
|
|
13
|
+
/**
|
|
14
|
+
* The combined self-hosted + 2FA-enabled guard (`!isOnDemand &&
|
|
15
|
+
* multiFactorEnabled`). When true, the variant's 2FA item (Backup Codes for
|
|
16
|
+
* `self`, Create Login Code otherwise) is shown. Defaults to true here so the
|
|
17
|
+
* prototype demonstrates the enabled state.
|
|
18
|
+
*/
|
|
19
|
+
selfHosted2FA?: boolean;
|
|
20
|
+
/** Target user's name — drives the Create Login Code dialog copy. */
|
|
21
|
+
userName?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const UserMenu: {
|
|
24
|
+
({ variant, targetClassName, size, selfHosted2FA, userName, }: UserMenuProps): ReactElement;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/UserMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAyBnE;;gFAEgF;AAChF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAqH3D,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,QAAQ;mEAMlB,aAAa,GAAG,YAAY;;CAmF9B,CAAC"}
|