@visns-studio/visns-components 6.6.4 → 6.15.1
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/README.md +1623 -18
- package/package.json +10 -4
- package/src/components/DataGrid.jsx +181 -38
- package/src/components/Fetch.jsx +80 -3
- package/src/components/Form.jsx +9 -0
- package/src/components/Navigation.jsx +109 -50
- package/src/components/Notification.jsx +279 -9
- package/src/components/TableFilter.jsx +14 -1
- package/src/components/auth/AuthBrandPanel.jsx +43 -0
- package/src/components/auth/AuthLoading.jsx +78 -0
- package/src/components/auth/AuthShell.jsx +59 -0
- package/src/components/auth/ClientAuth.jsx +161 -0
- package/src/components/auth/ClientAuthFrame.jsx +59 -0
- package/src/components/auth/ClientLogin.jsx +266 -55
- package/src/components/auth/ClientOTPVerify.jsx +587 -115
- package/src/components/auth/ImpersonateGate.jsx +254 -0
- package/src/components/auth/Login.jsx +134 -41
- package/src/components/auth/LogoutScreen.jsx +112 -0
- package/src/components/auth/Reset.jsx +134 -77
- package/src/components/auth/TwoFactorAuth.jsx +475 -297
- package/src/components/auth/Verify.jsx +237 -126
- package/src/components/auth/authEndpoints.js +105 -0
- package/src/components/auth/authFont.js +23 -0
- package/src/components/auth/authHelpers.js +465 -0
- package/src/components/auth/clientAuthProtocols.js +240 -0
- package/src/components/auth/useOptionalRouter.js +49 -0
- package/src/components/callQueue/CallQueuePop.jsx +1502 -0
- package/src/components/callQueue/CallQueueSettings.jsx +508 -0
- package/src/components/callQueue/callQueueHelpers.js +280 -0
- package/src/components/callQueue/callQueueSettingsHelpers.js +75 -0
- package/src/components/columns/ColumnRenderers.jsx +53 -7
- package/src/components/generic/GenericAuth.jsx +163 -96
- package/src/components/generic/GenericDetail.jsx +215 -90
- package/src/components/generic/GenericIndex.jsx +20 -47
- package/src/components/generic/GenericMain.jsx +5 -0
- package/src/components/generic/GroupedReportRenderer.jsx +1 -5
- package/src/components/generic/StandardModal.jsx +17 -5
- package/src/components/generic/reportSemanticSteps/SemanticEntityStep.jsx +1 -6
- package/src/components/generic/reportSemanticSteps/SemanticFieldsStep.jsx +4 -11
- package/src/components/generic/reportSemanticSteps/SemanticFiltersStep.jsx +9 -27
- package/src/components/generic/reportSemanticSteps/SemanticGroupingStep.jsx +5 -13
- package/src/components/generic/reportSemanticSteps/SemanticParameterPrompt.jsx +5 -13
- package/src/components/generic/reportSemanticSteps/SemanticPreviewStep.jsx +14 -31
- package/src/components/generic/reportSemanticSteps/SemanticRelationsStep.jsx +3 -9
- package/src/components/generic/reportSemanticSteps/SemanticValueInput.jsx +2 -15
- package/src/components/navActive.js +60 -0
- package/src/components/notify/desktopNotifications.js +256 -0
- package/src/components/sketch/SketchField.jsx +12 -2
- package/src/components/sms/SmsComposeModal.jsx +495 -0
- package/src/components/sms/SmsInbox.jsx +596 -0
- package/src/components/sms/SmsInboxBadge.jsx +468 -0
- package/src/components/sms/SmsLineSettings.jsx +854 -0
- package/src/components/sms/SmsThreadPanel.jsx +1184 -0
- package/src/components/sms/smsEndpoints.js +56 -0
- package/src/components/sms/smsHelpers.js +1075 -0
- package/src/components/sms/smsLiveState.js +132 -0
- package/src/components/sms/useSmsLive.js +307 -0
- package/src/components/styles/CallQueuePop.module.scss +646 -0
- package/src/components/styles/CallQueueSettings.module.scss +460 -0
- package/src/components/styles/ClientAuth.module.scss +229 -0
- package/src/components/styles/GenericDetail.module.scss +153 -26
- package/src/components/styles/GenericIndex.module.scss +13 -0
- package/src/components/styles/GenericMain.module.scss +19 -2
- package/src/components/styles/ImpersonateGate.module.scss +85 -0
- package/src/components/styles/Login.module.scss +13 -122
- package/src/components/styles/LogoutScreen.module.scss +89 -0
- package/src/components/styles/Navigation.module.scss +509 -223
- package/src/components/styles/Notification.module.scss +103 -0
- package/src/components/styles/Reset.module.scss +52 -186
- package/src/components/styles/Sms.module.scss +2382 -0
- package/src/components/styles/TableFilter.module.scss +118 -98
- package/src/components/styles/TwoFactorAuth.module.scss +115 -176
- package/src/components/styles/Vault.module.scss +1983 -0
- package/src/components/styles/Verify.module.scss +57 -180
- package/src/components/styles/_authBrandPanel.scss +163 -0
- package/src/components/styles/_authShell.scss +369 -0
- package/src/components/styles/global-datagrid.css +27 -2
- package/src/components/utils/buildEnv.js +67 -0
- package/src/components/utils/displayValue.js +94 -0
- package/src/components/utils/useDensity.js +345 -9
- package/src/components/vault/OtpChip.jsx +208 -0
- package/src/components/vault/PasswordGenerator.jsx +145 -0
- package/src/components/vault/QrScanner.jsx +326 -0
- package/src/components/vault/VaultAccessLog.jsx +225 -0
- package/src/components/vault/VaultConfirmPanel.jsx +113 -0
- package/src/components/vault/VaultEntryForm.jsx +740 -0
- package/src/components/vault/VaultManager.jsx +1000 -0
- package/src/components/vault/VaultQuickSearch.jsx +681 -0
- package/src/components/vault/qrDecode.js +257 -0
- package/src/components/vault/useDebouncedValue.js +22 -0
- package/src/components/vault/useVaultReveal.js +160 -0
- package/src/components/vault/vaultClipboard.js +33 -0
- package/src/components/vault/vaultEndpoints.js +40 -0
- package/src/components/vault/vaultFit.js +116 -0
- package/src/components/vault/vaultHelpers.js +547 -0
- package/src/components/vault/vaultNavigation.jsx +58 -0
- package/src/components/vault/vaultOtp.js +105 -0
- package/src/index.js +233 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Loader2, ShieldCheck } from 'lucide-react';
|
|
3
|
+
|
|
4
|
+
import styles from '../styles/Vault.module.scss';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* "Confirm your CRM password", drawn wherever a reveal was interrupted.
|
|
8
|
+
*
|
|
9
|
+
* Rendered by both the quick search popover and the manager, driven entirely
|
|
10
|
+
* by `useVaultReveal` — this file holds no flow logic, only the form. It is a
|
|
11
|
+
* plain `<div>` rather than a `<form>` so it can sit inside the manager's
|
|
12
|
+
* entry form without nesting one form in another; Enter is wired by hand.
|
|
13
|
+
*/
|
|
14
|
+
const VaultConfirmPanel = ({
|
|
15
|
+
message,
|
|
16
|
+
error,
|
|
17
|
+
pending,
|
|
18
|
+
onConfirm,
|
|
19
|
+
onCancel,
|
|
20
|
+
compact = false,
|
|
21
|
+
}) => {
|
|
22
|
+
const [password, setPassword] = useState('');
|
|
23
|
+
const inputRef = useRef(null);
|
|
24
|
+
|
|
25
|
+
// The panel appears in place of what the user was looking at, so the
|
|
26
|
+
// caret has to arrive with it — otherwise the next keystroke is lost.
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
inputRef.current?.focus();
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
// A rejected attempt clears the field: the value in it is known wrong,
|
|
32
|
+
// and leaving it there invites a second submit of the same thing.
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (error) setPassword('');
|
|
35
|
+
}, [error]);
|
|
36
|
+
|
|
37
|
+
const submit = () => {
|
|
38
|
+
if (pending || password === '') return;
|
|
39
|
+
onConfirm(password);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={`${styles.confirmPanel} ${compact ? styles.confirmCompact : ''}`}
|
|
45
|
+
role="group"
|
|
46
|
+
aria-label="Confirm your password"
|
|
47
|
+
>
|
|
48
|
+
<div className={styles.confirmHead}>
|
|
49
|
+
<ShieldCheck size={16} strokeWidth={2} aria-hidden="true" />
|
|
50
|
+
<strong>Confirm your CRM password</strong>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{message && <p className={styles.confirmMessage}>{message}</p>}
|
|
54
|
+
|
|
55
|
+
<div className={styles.confirmRow}>
|
|
56
|
+
<input
|
|
57
|
+
ref={inputRef}
|
|
58
|
+
type="password"
|
|
59
|
+
className={styles.confirmInput}
|
|
60
|
+
value={password}
|
|
61
|
+
autoComplete="current-password"
|
|
62
|
+
placeholder="Your password"
|
|
63
|
+
aria-label="Your CRM password"
|
|
64
|
+
aria-invalid={error ? 'true' : undefined}
|
|
65
|
+
disabled={pending}
|
|
66
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
67
|
+
onKeyDown={(e) => {
|
|
68
|
+
if (e.key === 'Enter') {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
submit();
|
|
71
|
+
}
|
|
72
|
+
if (e.key === 'Escape') {
|
|
73
|
+
// Escape backs out of the confirmation without
|
|
74
|
+
// closing the surface underneath it.
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
onCancel();
|
|
78
|
+
}
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
className={styles.confirmButton}
|
|
84
|
+
onClick={submit}
|
|
85
|
+
disabled={pending || password === ''}
|
|
86
|
+
>
|
|
87
|
+
{pending ? (
|
|
88
|
+
<Loader2 size={14} className={styles.spin} aria-hidden="true" />
|
|
89
|
+
) : null}
|
|
90
|
+
{pending ? 'Checking…' : 'Confirm'}
|
|
91
|
+
</button>
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
className={styles.confirmCancel}
|
|
95
|
+
onClick={onCancel}
|
|
96
|
+
disabled={pending}
|
|
97
|
+
>
|
|
98
|
+
Cancel
|
|
99
|
+
</button>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{/*
|
|
103
|
+
* The line is always in the DOM, holding its own height, so an
|
|
104
|
+
* error does not shove the buttons down the moment it appears.
|
|
105
|
+
*/}
|
|
106
|
+
<p className={styles.confirmError} role="alert">
|
|
107
|
+
{error || ' '}
|
|
108
|
+
</p>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export default VaultConfirmPanel;
|