@vadimcomanescu/nadicode-design-system 2.0.5 → 2.0.7
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/.agents/skills/seed/contract.md +1 -0
- package/.agents/skills/seed/recipes/marketing-shell.md +10 -19
- package/.agents/skills/seed/recipes/navigation-shell.md +5 -5
- package/.agents/skills/seed/recipes/service-detail.md +1 -1
- package/.agents/skills/seed/references/blocks.md +25 -24
- package/.agents/skills/seed/references/brand-override.md +3 -1
- package/css/tokens.css +300 -122
- package/dist/catalog.json +1926 -125
- package/dist/chunk-2BADJLMV.js +117 -0
- package/dist/chunk-35EX5FP5.js +106 -0
- package/dist/chunk-5PORR6LE.js +60 -0
- package/dist/chunk-5PZ4VR2D.js +142 -0
- package/dist/chunk-5UESKK6S.js +76 -0
- package/dist/chunk-6N6CSJVE.js +269 -0
- package/dist/chunk-AURJQZC4.js +110 -0
- package/dist/{chunk-DF47R6LN.js → chunk-AWIG4QN6.js} +9 -9
- package/dist/chunk-AYWL4IYM.js +67 -0
- package/dist/{chunk-SV3KZ6CB.js → chunk-DSMGCFMJ.js} +7 -2
- package/dist/chunk-E4L6LR6P.js +33 -0
- package/dist/chunk-EJNF6JLL.js +105 -0
- package/dist/chunk-FX23F33E.js +57 -0
- package/dist/chunk-GJPTPLCQ.js +52 -0
- package/dist/chunk-GV4PKHG4.js +147 -0
- package/dist/chunk-HJ3A2YNO.js +163 -0
- package/dist/chunk-HJZRSPWB.js +38 -0
- package/dist/chunk-IDKZEPWK.js +133 -0
- package/dist/chunk-K7NQ6ZAW.js +84 -0
- package/dist/chunk-LCKLZ4XK.js +60 -0
- package/dist/chunk-MX5FUFQR.js +205 -0
- package/dist/chunk-NEHCPO53.js +44 -0
- package/dist/chunk-OHOOQUVJ.js +113 -0
- package/dist/chunk-QIHA7S3A.js +36 -0
- package/dist/chunk-RKQPU75I.js +126 -0
- package/dist/chunk-RMLS2QUC.js +77 -0
- package/dist/chunk-TS2JSPQR.js +120 -0
- package/dist/chunk-TUKZKU72.js +110 -0
- package/dist/chunk-TZXZFSD2.js +33 -0
- package/dist/chunk-UGV45DH3.js +18 -0
- package/dist/chunk-VBZQ4DBE.js +52 -0
- package/dist/{chunk-LQLFA2EL.js → chunk-VDONTZZX.js} +2 -2
- package/dist/{chunk-RWNJ54CI.js → chunk-VN475YZS.js} +1 -1
- package/dist/chunk-VZCB4APK.js +94 -0
- package/dist/chunk-W7FXDRQJ.js +94 -0
- package/dist/chunk-WAVU744B.js +183 -0
- package/dist/{chunk-5I3FWRC5.js → chunk-WOYBVPXK.js} +10 -10
- package/dist/chunk-WST5NLLC.js +73 -0
- package/dist/chunk-X6VXWEDO.js +125 -0
- package/dist/chunk-ZM2NODUK.js +39 -0
- package/dist/components/blocks/AccountLockedBlock.js +7 -57
- package/dist/components/blocks/ActivityFeedBlock.js +6 -39
- package/dist/components/blocks/AgentConversationBlock.js +5 -33
- package/dist/components/blocks/AudioVisualizerBlock.d.ts +1 -1
- package/dist/components/blocks/AudioVisualizerBlock.js +2 -2
- package/dist/components/blocks/AuthSuccessBlock.js +5 -60
- package/dist/components/blocks/BarChartBlock.d.ts +1 -1
- package/dist/components/blocks/BarChartBlock.js +2 -2
- package/dist/components/blocks/CallToActionBlock.d.ts +1 -1
- package/dist/components/blocks/CallToActionBlock.js +6 -52
- package/dist/components/blocks/ChangelogBlock.js +8 -105
- package/dist/components/blocks/ChartCollectionBlock.js +2 -2
- package/dist/components/blocks/CodeBlock.js +7 -60
- package/dist/components/blocks/ComparisonBlock.js +9 -94
- package/dist/components/blocks/ContactBlock.js +11 -120
- package/dist/components/blocks/FAQBlock.js +6 -44
- package/dist/components/blocks/FeatureBlock.d.ts +10 -14
- package/dist/components/blocks/FeatureBlock.js +17 -159
- package/dist/components/blocks/FeatureGridBlock.d.ts +1 -1
- package/dist/components/blocks/FeatureGridBlock.js +2 -2
- package/dist/components/blocks/FooterBlock.d.ts +2 -2
- package/dist/components/blocks/FooterBlock.js +11 -67
- package/dist/components/blocks/HeaderBlock.d.ts +2 -2
- package/dist/components/blocks/HeaderBlock.js +1 -1
- package/dist/components/blocks/HeatmapChartBlock.d.ts +1 -1
- package/dist/components/blocks/HeatmapChartBlock.js +1 -1
- package/dist/components/blocks/HeroBlock.d.ts +6 -3
- package/dist/components/blocks/HeroBlock.js +16 -199
- package/dist/components/blocks/HeroSectionBlock.d.ts +1 -1
- package/dist/components/blocks/HeroSectionBlock.js +4 -4
- package/dist/components/blocks/IntegrationsBlock.d.ts +1 -1
- package/dist/components/blocks/IntegrationsBlock.js +4 -4
- package/dist/components/blocks/InteractiveAreaChartBlock.d.ts +1 -1
- package/dist/components/blocks/InteractiveAreaChartBlock.js +2 -2
- package/dist/components/blocks/NewsletterBlock.js +11 -84
- package/dist/components/blocks/PasswordRecoveryBlock.js +14 -142
- package/dist/components/blocks/PricingBlock.d.ts +1 -1
- package/dist/components/blocks/PricingBlock.js +11 -110
- package/dist/components/blocks/ProcessFlowBlock.js +10 -77
- package/dist/components/blocks/ResetPasswordBlock.js +11 -125
- package/dist/components/blocks/SignUpBlock.d.ts +1 -1
- package/dist/components/blocks/SignUpBlock.js +2 -2
- package/dist/components/blocks/SocialProofBlock.d.ts +7 -11
- package/dist/components/blocks/SocialProofBlock.js +8 -107
- package/dist/components/blocks/StatsBlock.d.ts +1 -1
- package/dist/components/blocks/StatsBlock.js +2 -2
- package/dist/components/blocks/StatsMarketingBlock.d.ts +1 -1
- package/dist/components/blocks/StatsMarketingBlock.js +5 -36
- package/dist/components/blocks/TeamBlock.d.ts +1 -1
- package/dist/components/blocks/TeamBlock.js +4 -52
- package/dist/components/blocks/TestimonialsBlock.d.ts +1 -1
- package/dist/components/blocks/TestimonialsBlock.js +4 -133
- package/dist/components/blocks/TwoFactorChallengeBlock.js +9 -94
- package/dist/components/blocks/TwoFactorSetupBlock.js +16 -183
- package/dist/components/blocks/UsageDonutBlock.d.ts +1 -1
- package/dist/components/blocks/UsageDonutBlock.js +2 -2
- package/dist/components/logos/index.js +2 -2
- package/dist/components/page-kits/AccountLockedPageKit.d.ts +10 -0
- package/dist/components/page-kits/AccountLockedPageKit.js +48 -0
- package/dist/components/page-kits/AgentsChatPageKit.d.ts +46 -0
- package/dist/components/page-kits/AgentsChatPageKit.js +289 -0
- package/dist/components/page-kits/AnalyticsPageKit.d.ts +49 -0
- package/dist/components/page-kits/AnalyticsPageKit.js +277 -0
- package/dist/components/page-kits/BlogContentPageKit.d.ts +64 -0
- package/dist/components/page-kits/BlogContentPageKit.js +296 -0
- package/dist/components/page-kits/CheckoutPageKit.d.ts +36 -0
- package/dist/components/page-kits/CheckoutPageKit.js +209 -0
- package/dist/components/page-kits/CompanySuitePageKit.d.ts +25 -0
- package/dist/components/page-kits/CompanySuitePageKit.js +240 -0
- package/dist/components/page-kits/CrudFormPageKit.d.ts +54 -0
- package/dist/components/page-kits/CrudFormPageKit.js +138 -0
- package/dist/components/page-kits/CrudListDetailPageKit.d.ts +70 -0
- package/dist/components/page-kits/CrudListDetailPageKit.js +138 -0
- package/dist/components/page-kits/DashboardPageKit.d.ts +39 -0
- package/dist/components/page-kits/DashboardPageKit.js +284 -0
- package/dist/components/page-kits/ErrorPageKit.d.ts +22 -0
- package/dist/components/page-kits/ErrorPageKit.js +55 -0
- package/dist/components/page-kits/KanbanBoardPageKit.d.ts +31 -0
- package/dist/components/page-kits/KanbanBoardPageKit.js +305 -0
- package/dist/components/page-kits/LandingPageKit.d.ts +29 -0
- package/dist/components/page-kits/LandingPageKit.js +221 -0
- package/dist/components/page-kits/LoginPageKit.d.ts +16 -0
- package/dist/components/page-kits/LoginPageKit.js +43 -0
- package/dist/components/page-kits/MarketingShellPageKit.d.ts +21 -0
- package/dist/components/page-kits/MarketingShellPageKit.js +131 -0
- package/dist/components/page-kits/NavigationShellPageKit.d.ts +41 -0
- package/dist/components/page-kits/NavigationShellPageKit.js +132 -0
- package/dist/components/page-kits/OnboardingPageKit.d.ts +26 -0
- package/dist/components/page-kits/OnboardingPageKit.js +248 -0
- package/dist/components/page-kits/PricingPageKit.d.ts +41 -0
- package/dist/components/page-kits/PricingPageKit.js +279 -0
- package/dist/components/page-kits/ProfileSettingsPageKit.d.ts +50 -0
- package/dist/components/page-kits/ProfileSettingsPageKit.js +171 -0
- package/dist/components/page-kits/RecoveryPageKit.d.ts +17 -0
- package/dist/components/page-kits/RecoveryPageKit.js +58 -0
- package/dist/components/page-kits/ResetPageKit.d.ts +14 -0
- package/dist/components/page-kits/ResetPageKit.js +52 -0
- package/dist/components/page-kits/ServiceSuitePageKit.d.ts +25 -0
- package/dist/components/page-kits/ServiceSuitePageKit.js +320 -0
- package/dist/components/page-kits/SettingsPageKit.d.ts +27 -0
- package/dist/components/page-kits/SettingsPageKit.js +11 -0
- package/dist/components/page-kits/SignupPageKit.d.ts +15 -0
- package/dist/components/page-kits/SignupPageKit.js +41 -0
- package/dist/components/page-kits/SuccessPageKit.d.ts +15 -0
- package/dist/components/page-kits/SuccessPageKit.js +146 -0
- package/dist/components/page-kits/TeamSettingsPageKit.d.ts +50 -0
- package/dist/components/page-kits/TeamSettingsPageKit.js +297 -0
- package/dist/components/page-kits/TwoFactorPageKit.d.ts +16 -0
- package/dist/components/page-kits/TwoFactorPageKit.js +156 -0
- package/dist/components/page-kits/VerifyEmailPageKit.d.ts +15 -0
- package/dist/components/page-kits/VerifyEmailPageKit.js +146 -0
- package/dist/components/page-kits/VoiceAgentsPageKit.d.ts +35 -0
- package/dist/components/page-kits/VoiceAgentsPageKit.js +246 -0
- package/dist/components/ui/AudioWaveform.js +2 -76
- package/dist/components/ui/AvatarUpload.js +1 -1
- package/dist/components/ui/Breadcrumb.js +4 -106
- package/dist/components/ui/ChartCard.js +5 -38
- package/dist/components/ui/CheckoutFormDemo.js +5 -6
- package/dist/components/ui/DataFreshness.js +2 -73
- package/dist/components/ui/MouseEffect.js +1 -1
- package/dist/components/ui/NativeSelect.js +2 -18
- package/dist/components/ui/Pagination.js +6 -117
- package/dist/components/ui/ShaderBackground.js +2 -2
- package/dist/hooks/use-shader-preset.js +2 -2
- package/dist/lib/shader-presets.js +1 -1
- package/dist/lib/tokens.config.d.ts +19 -0
- package/package.json +793 -681
- package/scripts/ds-check.mjs +10 -2
- package/src/lib/tokens.config.js +63 -41
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { InputOTP, InputOTPGroup, InputOTPSlot } from './chunk-WN5ONOHC.js';
|
|
2
|
+
import { Separator } from './chunk-CUZJIDU7.js';
|
|
3
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './chunk-AH6YSYYT.js';
|
|
4
|
+
import { Alert, AlertDescription } from './chunk-GJUR6HT3.js';
|
|
5
|
+
import { m, scaleIn } from './chunk-PD2YEH3H.js';
|
|
6
|
+
import { bezier } from './chunk-CRY67BIF.js';
|
|
7
|
+
import { ShieldCheckIcon } from './chunk-BFLN54VR.js';
|
|
8
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var SHAKE_TRANSITION = { duration: 0.3, ease: bezier["out-cubic"] };
|
|
13
|
+
function TwoFactorChallengeBlock({
|
|
14
|
+
className,
|
|
15
|
+
onVerify,
|
|
16
|
+
onUseBackupCode,
|
|
17
|
+
onBackToLogin,
|
|
18
|
+
error,
|
|
19
|
+
title = "Two-factor authentication",
|
|
20
|
+
description = "Enter the 6-digit code from your authenticator app",
|
|
21
|
+
backupCodeLabel = "Use a backup code"
|
|
22
|
+
}) {
|
|
23
|
+
const [code, setCode] = React.useState("");
|
|
24
|
+
const [shake, setShake] = React.useState(false);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (error) {
|
|
27
|
+
setShake(true);
|
|
28
|
+
setCode("");
|
|
29
|
+
const timeout = setTimeout(() => setShake(false), 300);
|
|
30
|
+
return () => clearTimeout(timeout);
|
|
31
|
+
}
|
|
32
|
+
}, [error]);
|
|
33
|
+
const handleComplete = (value) => {
|
|
34
|
+
setCode(value);
|
|
35
|
+
if (value.length === 6) {
|
|
36
|
+
onVerify?.(value);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto mb-2", children: /* @__PURE__ */ jsx(ShieldCheckIcon, { size: 32, className: "text-text-secondary" }) }),
|
|
42
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: title }),
|
|
43
|
+
/* @__PURE__ */ jsx(CardDescription, { children: description })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "grid gap-4", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
m.div,
|
|
48
|
+
{
|
|
49
|
+
className: "flex justify-center",
|
|
50
|
+
animate: shake ? { x: [-4, 4, -4, 4, 0] } : {},
|
|
51
|
+
transition: SHAKE_TRANSITION,
|
|
52
|
+
children: /* @__PURE__ */ jsx(
|
|
53
|
+
InputOTP,
|
|
54
|
+
{
|
|
55
|
+
maxLength: 6,
|
|
56
|
+
value: code,
|
|
57
|
+
onChange: handleComplete,
|
|
58
|
+
children: /* @__PURE__ */ jsxs(InputOTPGroup, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 0 }),
|
|
60
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 1 }),
|
|
61
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 2 }),
|
|
62
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 3 }),
|
|
63
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 4 }),
|
|
64
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 5 })
|
|
65
|
+
] })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
!!error && /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx(AlertDescription, { children: error }) }),
|
|
71
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: onUseBackupCode,
|
|
77
|
+
className: "text-sm text-accent hover:text-accent/80 transition-colors",
|
|
78
|
+
children: backupCodeLabel
|
|
79
|
+
}
|
|
80
|
+
) })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsx(
|
|
83
|
+
"button",
|
|
84
|
+
{
|
|
85
|
+
type: "button",
|
|
86
|
+
onClick: onBackToLogin,
|
|
87
|
+
className: "text-sm text-text-tertiary hover:text-text-primary transition-colors",
|
|
88
|
+
children: "Back to login"
|
|
89
|
+
}
|
|
90
|
+
) })
|
|
91
|
+
] }) });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { TwoFactorChallengeBlock };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { useSafeTimeout } from './chunk-MDAYDDTC.js';
|
|
2
|
+
import { StaggerChildren } from './chunk-DQPK2XRL.js';
|
|
3
|
+
import { InputOTP, InputOTPGroup, InputOTPSlot } from './chunk-WN5ONOHC.js';
|
|
4
|
+
import { FormWizard } from './chunk-T5LXQNIP.js';
|
|
5
|
+
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './chunk-VJIL7W55.js';
|
|
6
|
+
import { Empty, EmptyDescription } from './chunk-55HD4L6G.js';
|
|
7
|
+
import { Checkbox } from './chunk-756Q7AC5.js';
|
|
8
|
+
import { Label } from './chunk-LIBXYD5Q.js';
|
|
9
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from './chunk-AH6YSYYT.js';
|
|
10
|
+
import { Button } from './chunk-7KIDDF3I.js';
|
|
11
|
+
import { m, scaleIn } from './chunk-PD2YEH3H.js';
|
|
12
|
+
import { CopyIcon } from './chunk-TV4RSQH4.js';
|
|
13
|
+
import { ShieldIcon } from './chunk-P6IRHPFM.js';
|
|
14
|
+
import { Badge } from './chunk-S4JAHKOP.js';
|
|
15
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import { useReducedMotion } from 'motion/react';
|
|
18
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
var DEFAULT_BACKUP_CODES = [
|
|
21
|
+
"a1b2-c3d4",
|
|
22
|
+
"e5f6-g7h8",
|
|
23
|
+
"i9j0-k1l2",
|
|
24
|
+
"m3n4-o5p6",
|
|
25
|
+
"q7r8-s9t0",
|
|
26
|
+
"u1v2-w3x4",
|
|
27
|
+
"y5z6-a7b8",
|
|
28
|
+
"c9d0-e1f2"
|
|
29
|
+
];
|
|
30
|
+
function TwoFactorSetupBlock({
|
|
31
|
+
className,
|
|
32
|
+
qrCodeUrl,
|
|
33
|
+
secret = "JBSWY3DPEHPK3PXP",
|
|
34
|
+
backupCodes = DEFAULT_BACKUP_CODES,
|
|
35
|
+
onVerify,
|
|
36
|
+
onComplete,
|
|
37
|
+
title = "Set up two-factor authentication",
|
|
38
|
+
description = "Add an extra layer of security to your account"
|
|
39
|
+
}) {
|
|
40
|
+
const prefersReduced = useReducedMotion();
|
|
41
|
+
const [otpCode, setOtpCode] = React.useState("");
|
|
42
|
+
const [verified, setVerified] = React.useState(false);
|
|
43
|
+
const [verifying, setVerifying] = React.useState(false);
|
|
44
|
+
const [verifyError, setVerifyError] = React.useState();
|
|
45
|
+
const [savedCodes, setSavedCodes] = React.useState(false);
|
|
46
|
+
const [copied, setCopied] = React.useState(false);
|
|
47
|
+
const setSafeTimeout = useSafeTimeout();
|
|
48
|
+
const copyToClipboard = (text) => {
|
|
49
|
+
navigator.clipboard.writeText(text);
|
|
50
|
+
setCopied(true);
|
|
51
|
+
setSafeTimeout(() => setCopied(false), 2e3);
|
|
52
|
+
};
|
|
53
|
+
const copyAllCodes = () => {
|
|
54
|
+
copyToClipboard(backupCodes.join("\n"));
|
|
55
|
+
};
|
|
56
|
+
const downloadCodes = () => {
|
|
57
|
+
const blob = new Blob([backupCodes.join("\n")], { type: "text/plain" });
|
|
58
|
+
const url = URL.createObjectURL(blob);
|
|
59
|
+
const a = document.createElement("a");
|
|
60
|
+
a.href = url;
|
|
61
|
+
a.download = "backup-codes.txt";
|
|
62
|
+
a.click();
|
|
63
|
+
URL.revokeObjectURL(url);
|
|
64
|
+
};
|
|
65
|
+
const handleVerify = (value) => {
|
|
66
|
+
setOtpCode(value);
|
|
67
|
+
setVerifyError(void 0);
|
|
68
|
+
setVerified(false);
|
|
69
|
+
if (value.length !== 6) {
|
|
70
|
+
setVerifying(false);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!onVerify) {
|
|
74
|
+
setVerified(true);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
setVerifying(true);
|
|
78
|
+
void Promise.resolve(onVerify(value)).then((ok) => {
|
|
79
|
+
if (ok) {
|
|
80
|
+
setVerified(true);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
setVerifyError("Verification failed. Please try again.");
|
|
84
|
+
}).catch(() => {
|
|
85
|
+
setVerifyError("Verification failed. Please try again.");
|
|
86
|
+
}).finally(() => {
|
|
87
|
+
setVerifying(false);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const steps = [
|
|
91
|
+
{
|
|
92
|
+
id: "scan",
|
|
93
|
+
title: "Scan QR code",
|
|
94
|
+
content: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center", children: qrCodeUrl ? /* @__PURE__ */ jsx("img", { src: qrCodeUrl, alt: "QR Code", className: "h-48 w-48 rounded-lg border border-border" }) : /* @__PURE__ */ jsx(Empty, { className: "h-48 w-48", children: /* @__PURE__ */ jsx(EmptyDescription, { children: "QR Code" }) }) }),
|
|
96
|
+
/* @__PURE__ */ jsxs(Collapsible, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "default", className: "w-full text-text-tertiary", children: [
|
|
98
|
+
"Can",
|
|
99
|
+
"'",
|
|
100
|
+
"t scan? Enter code manually"
|
|
101
|
+
] }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(CollapsibleContent, { className: "pt-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-md border border-border bg-surface p-4", children: [
|
|
103
|
+
/* @__PURE__ */ jsx("code", { className: "flex-1 text-sm font-mono text-text-primary break-all", children: secret }),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
Button,
|
|
106
|
+
{
|
|
107
|
+
variant: "ghost",
|
|
108
|
+
size: "icon",
|
|
109
|
+
onClick: () => copyToClipboard(secret),
|
|
110
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { size: 14 })
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] }) })
|
|
114
|
+
] })
|
|
115
|
+
] })
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "verify",
|
|
119
|
+
title: "Verify code",
|
|
120
|
+
content: /* @__PURE__ */ jsxs("div", { className: "space-y-4 text-center", children: [
|
|
121
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-text-secondary", children: "Enter the 6-digit code from your authenticator app" }),
|
|
122
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(InputOTP, { maxLength: 6, value: otpCode, onChange: handleVerify, children: /* @__PURE__ */ jsxs(InputOTPGroup, { children: [
|
|
123
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 0 }),
|
|
124
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 1 }),
|
|
125
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 2 }),
|
|
126
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 3 }),
|
|
127
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 4 }),
|
|
128
|
+
/* @__PURE__ */ jsx(InputOTPSlot, { index: 5 })
|
|
129
|
+
] }) }) }),
|
|
130
|
+
!!verifying && /* @__PURE__ */ jsx("p", { className: "text-sm text-text-secondary", children: "Verifying..." }),
|
|
131
|
+
!!verifyError && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-destructive", children: verifyError }),
|
|
132
|
+
!!verified && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-success", children: "Code verified successfully" })
|
|
133
|
+
] }),
|
|
134
|
+
validate: () => verified
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "backup",
|
|
138
|
+
title: "Save backup codes",
|
|
139
|
+
content: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
140
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-text-secondary", children: "Save these backup codes in a secure location. Each code can only be used once." }),
|
|
141
|
+
/* @__PURE__ */ jsx(StaggerChildren, { staggerMs: 40, className: "grid grid-cols-2 gap-2", children: backupCodes.map((code) => /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "justify-center font-mono text-xs py-1.5", children: code }, code)) }),
|
|
142
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
143
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "default", className: "flex-1", onClick: copyAllCodes, children: [
|
|
144
|
+
/* @__PURE__ */ jsx(CopyIcon, { size: 14, className: "mr-2" }),
|
|
145
|
+
copied ? "Copied!" : "Copy all"
|
|
146
|
+
] }),
|
|
147
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "default", className: "flex-1", onClick: downloadCodes, children: "Download" })
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
Checkbox,
|
|
152
|
+
{
|
|
153
|
+
id: "saved-codes",
|
|
154
|
+
checked: savedCodes,
|
|
155
|
+
onCheckedChange: (v) => setSavedCodes(v === true)
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "saved-codes", className: "text-sm", children: "I have saved my backup codes" })
|
|
159
|
+
] })
|
|
160
|
+
] }),
|
|
161
|
+
validate: () => savedCodes
|
|
162
|
+
}
|
|
163
|
+
];
|
|
164
|
+
return /* @__PURE__ */ jsx(m.div, { ...prefersReduced ? {} : scaleIn, className: cn("w-full max-w-lg mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
165
|
+
/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
166
|
+
/* @__PURE__ */ jsx(ShieldIcon, { size: 32, className: "text-text-secondary" }),
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
168
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-xl", children: title }),
|
|
169
|
+
/* @__PURE__ */ jsx(CardDescription, { children: description })
|
|
170
|
+
] })
|
|
171
|
+
] }) }),
|
|
172
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
|
|
173
|
+
FormWizard,
|
|
174
|
+
{
|
|
175
|
+
steps,
|
|
176
|
+
onComplete,
|
|
177
|
+
completeLabel: "Done"
|
|
178
|
+
}
|
|
179
|
+
) })
|
|
180
|
+
] }) });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { TwoFactorSetupBlock };
|
|
@@ -5,26 +5,26 @@ import { Button } from './chunk-7KIDDF3I.js';
|
|
|
5
5
|
import { MenuIcon } from './chunk-JMCSAGZ3.js';
|
|
6
6
|
import { XIcon } from './chunk-UIUMTURU.js';
|
|
7
7
|
import { useTranslations } from 'next-intl';
|
|
8
|
-
import
|
|
8
|
+
import { useState, useRef } from 'react';
|
|
9
9
|
import { useScroll, useMotionValueEvent } from 'motion/react';
|
|
10
10
|
import Link from 'next/link';
|
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
var defaultMenuItems = siteConfig.nav.header;
|
|
14
|
-
|
|
14
|
+
function HeaderBlock({
|
|
15
15
|
menuItems = defaultMenuItems,
|
|
16
16
|
loginLabel = "Login",
|
|
17
17
|
signUpLabel = "Sign Up",
|
|
18
18
|
loginHref = "#",
|
|
19
19
|
signUpHref = "#",
|
|
20
20
|
className
|
|
21
|
-
})
|
|
21
|
+
}) {
|
|
22
22
|
const t = useTranslations("blocks.headerBlock");
|
|
23
|
-
const [mobileOpen, setMobileOpen] =
|
|
24
|
-
const navBarRef =
|
|
25
|
-
const innerRef =
|
|
26
|
-
const logoRef =
|
|
27
|
-
const wasScrolledRef =
|
|
23
|
+
const [mobileOpen, setMobileOpen] = useState(false);
|
|
24
|
+
const navBarRef = useRef(null);
|
|
25
|
+
const innerRef = useRef(null);
|
|
26
|
+
const logoRef = useRef(null);
|
|
27
|
+
const wasScrolledRef = useRef(false);
|
|
28
28
|
const { scrollYProgress } = useScroll();
|
|
29
29
|
useMotionValueEvent(scrollYProgress, "change", (latest) => {
|
|
30
30
|
const scrolled = latest > 0.05;
|
|
@@ -143,6 +143,6 @@ var HeroHeader = ({
|
|
|
143
143
|
)
|
|
144
144
|
}
|
|
145
145
|
) });
|
|
146
|
-
}
|
|
146
|
+
}
|
|
147
147
|
|
|
148
|
-
export {
|
|
148
|
+
export { HeaderBlock };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { formatDistanceToNow } from 'date-fns';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var TICK_INTERVAL_MS = 3e4;
|
|
7
|
+
var listeners = [];
|
|
8
|
+
var tick = 0;
|
|
9
|
+
var intervalId = null;
|
|
10
|
+
function subscribe(callback) {
|
|
11
|
+
listeners = [...listeners, callback];
|
|
12
|
+
if (listeners.length === 1) {
|
|
13
|
+
intervalId = setInterval(() => {
|
|
14
|
+
tick++;
|
|
15
|
+
listeners.forEach((l) => l());
|
|
16
|
+
}, TICK_INTERVAL_MS);
|
|
17
|
+
}
|
|
18
|
+
return () => {
|
|
19
|
+
listeners = listeners.filter((l) => l !== callback);
|
|
20
|
+
if (listeners.length === 0 && intervalId !== null) {
|
|
21
|
+
clearInterval(intervalId);
|
|
22
|
+
intervalId = null;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function getSnapshot() {
|
|
27
|
+
return tick;
|
|
28
|
+
}
|
|
29
|
+
function getServerSnapshot() {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
function DataFreshness({
|
|
33
|
+
lastUpdated,
|
|
34
|
+
isLive = false,
|
|
35
|
+
staleThresholdMs = 3e5,
|
|
36
|
+
className,
|
|
37
|
+
ref
|
|
38
|
+
}) {
|
|
39
|
+
React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
40
|
+
const elapsedMs = Date.now() - lastUpdated.getTime();
|
|
41
|
+
const isStale = elapsedMs > staleThresholdMs;
|
|
42
|
+
const relativeTime = formatDistanceToNow(lastUpdated, { addSuffix: true });
|
|
43
|
+
let statusText;
|
|
44
|
+
if (isLive && !isStale) {
|
|
45
|
+
statusText = "Live";
|
|
46
|
+
} else if (isLive && isStale) {
|
|
47
|
+
statusText = `Stale \u2013 Updated ${relativeTime}`;
|
|
48
|
+
} else {
|
|
49
|
+
statusText = `Updated ${relativeTime}`;
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsxs(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
className: cn("flex items-center gap-2", className),
|
|
56
|
+
children: [
|
|
57
|
+
isLive && /* @__PURE__ */ jsx(
|
|
58
|
+
"span",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "freshness-dot",
|
|
61
|
+
className: cn(
|
|
62
|
+
"size-2 shrink-0 rounded-full motion-reduce:animate-none",
|
|
63
|
+
isStale ? "bg-warning" : "bg-success animate-pulse"
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-text-tertiary", children: statusText })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { DataFreshness };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Spinner } from './chunk-ZLSWCV55.js';
|
|
2
|
+
import { PasswordInput } from './chunk-UJDEGCCZ.js';
|
|
3
|
+
import { Field, FieldLabel } from './chunk-RX5EUODB.js';
|
|
4
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './chunk-AH6YSYYT.js';
|
|
5
|
+
import { Button } from './chunk-7KIDDF3I.js';
|
|
6
|
+
import { m, scaleIn } from './chunk-PD2YEH3H.js';
|
|
7
|
+
import { KeyIcon } from './chunk-QSU23VYZ.js';
|
|
8
|
+
import { CheckIcon } from './chunk-CXACRCZ4.js';
|
|
9
|
+
import { XIcon } from './chunk-UIUMTURU.js';
|
|
10
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import { useTranslations } from 'next-intl';
|
|
13
|
+
import { useReducedMotion } from 'motion/react';
|
|
14
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
var RULE_TESTS = [
|
|
17
|
+
{ key: "minLength", test: (v) => v.length >= 8 },
|
|
18
|
+
{ key: "uppercase", test: (v) => /[A-Z]/.test(v) },
|
|
19
|
+
{ key: "number", test: (v) => /\d/.test(v) },
|
|
20
|
+
{ key: "special", test: (v) => /[^A-Za-z0-9]/.test(v) }
|
|
21
|
+
];
|
|
22
|
+
function ResetPasswordBlock({
|
|
23
|
+
className,
|
|
24
|
+
onSubmit,
|
|
25
|
+
onBackToLogin,
|
|
26
|
+
title,
|
|
27
|
+
description
|
|
28
|
+
}) {
|
|
29
|
+
const prefersReduced = useReducedMotion();
|
|
30
|
+
const t = useTranslations("auth.reset");
|
|
31
|
+
const [password, setPassword] = React.useState("");
|
|
32
|
+
const [confirm, setConfirm] = React.useState("");
|
|
33
|
+
const [loading, setLoading] = React.useState(false);
|
|
34
|
+
const [error, setError] = React.useState("");
|
|
35
|
+
const resolvedTitle = title ?? t("title");
|
|
36
|
+
const resolvedDescription = description ?? t("description");
|
|
37
|
+
const rules = React.useMemo(() => RULE_TESTS.map((r) => ({ label: t(`rules.${r.key}`), test: r.test })), [t]);
|
|
38
|
+
const allRulesPass = rules.every((r) => r.test(password));
|
|
39
|
+
const passwordsMatch = password === confirm && confirm.length > 0;
|
|
40
|
+
const handleSubmit = (e) => {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
if (!allRulesPass) return;
|
|
43
|
+
if (!passwordsMatch) {
|
|
44
|
+
setError(t("passwordMismatch"));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setError("");
|
|
48
|
+
setLoading(true);
|
|
49
|
+
onSubmit?.(password);
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsx(m.div, { ...prefersReduced ? {} : scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
52
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto mb-2", children: /* @__PURE__ */ jsx(KeyIcon, { size: 32, className: "text-text-secondary" }) }),
|
|
54
|
+
/* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: resolvedTitle }),
|
|
55
|
+
/* @__PURE__ */ jsx(CardDescription, { children: resolvedDescription })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: handleSubmit, className: "grid gap-4", children: [
|
|
58
|
+
/* @__PURE__ */ jsxs(Field, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "new-password", children: t("newPassword") }),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
PasswordInput,
|
|
62
|
+
{
|
|
63
|
+
name: "password",
|
|
64
|
+
id: "new-password",
|
|
65
|
+
value: password,
|
|
66
|
+
onChange: (e) => setPassword(e.target.value),
|
|
67
|
+
placeholder: t("newPasswordPlaceholder"),
|
|
68
|
+
autoComplete: "new-password"
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsxs(Field, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: "confirm-password", children: t("confirmPassword") }),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
PasswordInput,
|
|
76
|
+
{
|
|
77
|
+
name: "confirmPassword",
|
|
78
|
+
id: "confirm-password",
|
|
79
|
+
value: confirm,
|
|
80
|
+
onChange: (e) => setConfirm(e.target.value),
|
|
81
|
+
placeholder: t("confirmPasswordPlaceholder"),
|
|
82
|
+
autoComplete: "new-password"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsxs("ul", { className: "space-y-1.5 text-xs", "aria-label": "Password requirements", children: [
|
|
87
|
+
rules.map((rule) => {
|
|
88
|
+
const pass = rule.test(password);
|
|
89
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
90
|
+
pass ? /* @__PURE__ */ jsx(CheckIcon, { size: 14, className: "text-success shrink-0" }) : /* @__PURE__ */ jsx(XIcon, { size: 14, className: "text-text-tertiary shrink-0" }),
|
|
91
|
+
/* @__PURE__ */ jsx("span", { className: pass ? "text-success" : "text-text-tertiary", children: rule.label })
|
|
92
|
+
] }, rule.label);
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
|
|
95
|
+
passwordsMatch ? /* @__PURE__ */ jsx(CheckIcon, { size: 14, className: "text-success shrink-0" }) : /* @__PURE__ */ jsx(XIcon, { size: 14, className: "text-text-tertiary shrink-0" }),
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: passwordsMatch ? "text-success" : "text-text-tertiary", children: t("rules.match") })
|
|
97
|
+
] })
|
|
98
|
+
] }),
|
|
99
|
+
!!error && /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-destructive", children: error }),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
Button,
|
|
102
|
+
{
|
|
103
|
+
variant: "accent",
|
|
104
|
+
className: "w-full",
|
|
105
|
+
disabled: loading || !allRulesPass || !passwordsMatch,
|
|
106
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Spinner, { className: "mr-2" }),
|
|
108
|
+
t("pending")
|
|
109
|
+
] }) : t("submit")
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] }) }),
|
|
113
|
+
/* @__PURE__ */ jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsx(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
type: "button",
|
|
117
|
+
onClick: onBackToLogin,
|
|
118
|
+
className: "text-sm text-text-tertiary hover:text-text-primary transition-colors",
|
|
119
|
+
children: t("backToLogin")
|
|
120
|
+
}
|
|
121
|
+
) })
|
|
122
|
+
] }) });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { ResetPasswordBlock };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Timeline } from './chunk-YQIABLDO.js';
|
|
2
|
+
import { Heading } from './chunk-WI547C47.js';
|
|
3
|
+
import { ScrollFadeIn } from './chunk-I23DDSU7.js';
|
|
4
|
+
import { Avatar, AvatarFallback } from './chunk-NAAU5IWU.js';
|
|
5
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var defaultActivities = [
|
|
9
|
+
{ id: "1", user: "Nadia", action: "deployed v2.1.0 to production", timestamp: "2 min ago" },
|
|
10
|
+
{ id: "2", user: "Alex", action: "merged PR 142 into main", timestamp: "15 min ago" },
|
|
11
|
+
{ id: "3", user: "Jordan", action: "commented on issue #87", timestamp: "1 hour ago" },
|
|
12
|
+
{ id: "4", user: "Sam", action: "created branch feature/aurora-effect", timestamp: "3 hours ago" },
|
|
13
|
+
{ id: "5", user: "Riley", action: "updated the design tokens", timestamp: "5 hours ago" }
|
|
14
|
+
];
|
|
15
|
+
function getInitials(name) {
|
|
16
|
+
return name.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2);
|
|
17
|
+
}
|
|
18
|
+
function ActivityFeedBlock({
|
|
19
|
+
activities = defaultActivities,
|
|
20
|
+
title = "Recent activity",
|
|
21
|
+
className
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx("section", { className: cn("py-16 md:py-24", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-2xl px-6", children: [
|
|
24
|
+
!!title && /* @__PURE__ */ jsx(ScrollFadeIn, { children: /* @__PURE__ */ jsx(Heading, { level: 2, size: "section", className: "mb-8 text-text-primary", children: title }) }),
|
|
25
|
+
/* @__PURE__ */ jsx(ScrollFadeIn, { delay: 0.1, children: /* @__PURE__ */ jsx(
|
|
26
|
+
Timeline,
|
|
27
|
+
{
|
|
28
|
+
items: activities.map((activity) => ({
|
|
29
|
+
icon: /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-[10px]", children: getInitials(activity.user) }) }),
|
|
30
|
+
title: activity.user,
|
|
31
|
+
description: activity.action,
|
|
32
|
+
timestamp: activity.timestamp
|
|
33
|
+
}))
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
] }) });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { ActivityFeedBlock };
|
|
@@ -1,61 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
export { AccountLockedBlock } from '../../chunk-FX23F33E.js';
|
|
3
|
+
import '../../chunk-AH6YSYYT.js';
|
|
4
|
+
import '../../chunk-GJUR6HT3.js';
|
|
5
|
+
import '../../chunk-7KIDDF3I.js';
|
|
6
|
+
import '../../chunk-PD2YEH3H.js';
|
|
6
7
|
import '../../chunk-CRY67BIF.js';
|
|
7
8
|
import '../../chunk-HJC6U46F.js';
|
|
8
|
-
import
|
|
9
|
+
import '../../chunk-RYOTIXZO.js';
|
|
9
10
|
import '../../chunk-ASKFAYYR.js';
|
|
10
|
-
import
|
|
11
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
var reasonMessages = {
|
|
14
|
-
too_many_attempts: (minutes) => `Too many failed login attempts.${minutes ? ` Try again in ${minutes} minutes.` : ""}`,
|
|
15
|
-
suspicious_activity: () => "We detected unusual activity on your account.",
|
|
16
|
-
admin: () => "Your account has been locked by an administrator."
|
|
17
|
-
};
|
|
18
|
-
function AccountLockedBlock({
|
|
19
|
-
className,
|
|
20
|
-
reason = "too_many_attempts",
|
|
21
|
-
unlockMinutes,
|
|
22
|
-
onContactSupport,
|
|
23
|
-
onBackToLogin,
|
|
24
|
-
title = "Account locked",
|
|
25
|
-
description = "Your account has been temporarily locked for security"
|
|
26
|
-
}) {
|
|
27
|
-
const motionConfig = useMotionConfig();
|
|
28
|
-
return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
|
|
29
|
-
/* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
31
|
-
m.div,
|
|
32
|
-
{
|
|
33
|
-
className: "mx-auto mb-2",
|
|
34
|
-
initial: { x: 0 },
|
|
35
|
-
animate: { x: [0, -4, 4, -4, 4, 0] },
|
|
36
|
-
transition: { ...motionSpring.gentle, delay: 0.3, ...motionConfig },
|
|
37
|
-
children: /* @__PURE__ */ jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10 shadow-[0_0_24px_rgb(var(--color-destructive)/0.2)]", children: /* @__PURE__ */ jsx(LockIcon, { size: 32, className: "text-destructive" }) })
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
/* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: title }),
|
|
41
|
-
/* @__PURE__ */ jsx(CardDescription, { children: description })
|
|
42
|
-
] }),
|
|
43
|
-
/* @__PURE__ */ jsxs(CardContent, { className: "grid gap-4", children: [
|
|
44
|
-
/* @__PURE__ */ jsx(Alert, { variant: "warning", children: /* @__PURE__ */ jsx(AlertDescription, { children: reasonMessages[reason](unlockMinutes) }) }),
|
|
45
|
-
reason === "too_many_attempts" && unlockMinutes && /* @__PURE__ */ jsx("p", { className: "text-center text-sm text-text-tertiary", children: "Your account will be automatically unlocked after the waiting period." }),
|
|
46
|
-
(reason === "suspicious_activity" || reason === "admin") && /* @__PURE__ */ jsx("p", { className: "text-center text-sm text-text-tertiary", children: "Please contact support to regain access to your account." }),
|
|
47
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", className: "w-full", onClick: onContactSupport, children: "Contact support" })
|
|
48
|
-
] }),
|
|
49
|
-
/* @__PURE__ */ jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsx(
|
|
50
|
-
"button",
|
|
51
|
-
{
|
|
52
|
-
type: "button",
|
|
53
|
-
onClick: onBackToLogin,
|
|
54
|
-
className: "text-sm text-text-tertiary hover:text-text-primary transition-colors",
|
|
55
|
-
children: "Back to login"
|
|
56
|
-
}
|
|
57
|
-
) })
|
|
58
|
-
] }) });
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { AccountLockedBlock };
|
|
11
|
+
import '../../chunk-QYZT24TS.js';
|