@vadimcomanescu/nadicode-design-system 4.0.4 → 4.0.6

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.
Files changed (63) hide show
  1. package/.agents/skills/seed/SKILL.md +24 -3
  2. package/dist/catalog/catalog.d.ts +168 -0
  3. package/dist/catalog/catalog.js +172 -0
  4. package/dist/catalog/components.d.ts +24 -0
  5. package/dist/catalog/components.js +61 -35
  6. package/dist/chunk-2LUDPRRG.js +24 -0
  7. package/dist/{chunk-RMGDDOCD.js → chunk-3ZPNIY2Z.js} +2 -2
  8. package/dist/chunk-4KZLCCIR.js +88 -0
  9. package/dist/{chunk-AWZFQQGN.js → chunk-6NCLYJAI.js} +2 -2
  10. package/dist/{chunk-K4U67BVG.js → chunk-7ALMTY6W.js} +1 -1
  11. package/dist/chunk-CZ7NGW7N.js +60 -0
  12. package/dist/chunk-FRGZSR2P.js +86 -0
  13. package/dist/{chunk-LGW7FVG5.js → chunk-HMFIUUYC.js} +1 -1
  14. package/dist/chunk-IC3BMFHV.js +86 -0
  15. package/dist/chunk-JVIRZNQ6.js +37 -0
  16. package/dist/chunk-K5AFXZDL.js +30 -0
  17. package/dist/{chunk-LK2L3C7D.js → chunk-LCMAB2BX.js} +3 -3
  18. package/dist/chunk-LIJYUSSE.js +152 -0
  19. package/dist/chunk-MB6TIORE.js +103 -0
  20. package/dist/chunk-PV62D7H6.js +75 -0
  21. package/dist/chunk-QVAV4MA2.js +60 -0
  22. package/dist/{chunk-QW5II6YK.js → chunk-TEWCCMRH.js} +2 -2
  23. package/dist/chunk-WVKJNHQM.js +120 -0
  24. package/dist/chunk-YQCDWJBT.js +184 -0
  25. package/dist/chunk-YZWC4EY4.js +101 -0
  26. package/dist/components/blocks/ApiKeysBlock.d.ts +18 -0
  27. package/dist/components/blocks/ApiKeysBlock.js +128 -0
  28. package/dist/components/blocks/BenchmarksBlock.d.ts +20 -0
  29. package/dist/components/blocks/BenchmarksBlock.js +11 -0
  30. package/dist/components/blocks/CheckEmailBlock.d.ts +9 -0
  31. package/dist/components/blocks/CheckEmailBlock.js +13 -0
  32. package/dist/components/blocks/CommandPaletteBlock.d.ts +9 -0
  33. package/dist/components/blocks/CommandPaletteBlock.js +125 -0
  34. package/dist/components/blocks/EmailVerifiedBlock.d.ts +10 -0
  35. package/dist/components/blocks/EmailVerifiedBlock.js +10 -0
  36. package/dist/components/blocks/ForgotPasswordBlock.d.ts +14 -0
  37. package/dist/components/blocks/ForgotPasswordBlock.js +15 -0
  38. package/dist/components/blocks/IntegrationsBlock.js +3 -3
  39. package/dist/components/blocks/MagicLinkBlock.d.ts +12 -0
  40. package/dist/components/blocks/MagicLinkBlock.js +18 -0
  41. package/dist/components/blocks/OTPBlock.d.ts +10 -0
  42. package/dist/components/blocks/OTPBlock.js +121 -0
  43. package/dist/components/blocks/PasswordChangedBlock.d.ts +10 -0
  44. package/dist/components/blocks/PasswordChangedBlock.js +10 -0
  45. package/dist/components/blocks/PricingTableBlock.d.ts +19 -0
  46. package/dist/components/blocks/PricingTableBlock.js +13 -0
  47. package/dist/components/blocks/SavingsCalculatorBlock.d.ts +30 -0
  48. package/dist/components/blocks/SavingsCalculatorBlock.js +22 -0
  49. package/dist/components/blocks/WorkspaceSwitcherBlock.d.ts +11 -0
  50. package/dist/components/blocks/WorkspaceSwitcherBlock.js +129 -0
  51. package/dist/components/logos/index.js +2 -2
  52. package/dist/components/page-kits/BlogContentPageKit.js +4 -4
  53. package/dist/components/page-kits/CheckoutPageKit.js +3 -3
  54. package/dist/components/page-kits/CompanySuitePageKit.js +4 -4
  55. package/dist/components/page-kits/LandingPageKit.js +5 -5
  56. package/dist/components/page-kits/MarketingShellPageKit.js +2 -2
  57. package/dist/components/page-kits/PricingPageKit.js +4 -4
  58. package/dist/components/page-kits/ServiceSuitePageKit.js +3 -3
  59. package/dist/components/ui/SearchCommand.js +4 -152
  60. package/dist/hooks/useHotkey.js +1 -37
  61. package/package.json +1 -1
  62. package/dist/{chunk-BSCC7OQK.js → chunk-4TUJJ3UI.js} +2 -2
  63. package/dist/{chunk-Z233ZQZE.js → chunk-E4L6LR6P.js} +1 -1
@@ -0,0 +1,30 @@
1
+ import { InputOTP, InputOTPGroup, InputOTPSlot } from './chunk-WN5ONOHC.js';
2
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent } from './chunk-AH6YSYYT.js';
3
+ import { Button } from './chunk-7KIDDF3I.js';
4
+ import { m, scaleIn } from './chunk-PD2YEH3H.js';
5
+ import { cn } from './chunk-QYZT24TS.js';
6
+ import * as React from 'react';
7
+ import { jsx, jsxs } from 'react/jsx-runtime';
8
+
9
+ function OTPBlock({
10
+ className,
11
+ title = "One-Time Password",
12
+ description = "Please enter the one-time password sent to your phone.",
13
+ maxLength = 6,
14
+ buttonText = "Verify",
15
+ onVerify
16
+ }) {
17
+ const [otp, setOtp] = React.useState("");
18
+ return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { className: "text-center", children: [
19
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
20
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: title }),
21
+ /* @__PURE__ */ jsx(CardDescription, { children: description })
22
+ ] }),
23
+ /* @__PURE__ */ jsxs(CardContent, { className: "grid gap-4 justify-center", children: [
24
+ /* @__PURE__ */ jsx(InputOTP, { maxLength, value: otp, onChange: setOtp, children: /* @__PURE__ */ jsx(InputOTPGroup, { children: Array.from({ length: maxLength }, (_, i) => /* @__PURE__ */ jsx(InputOTPSlot, { index: i }, i)) }) }),
25
+ /* @__PURE__ */ jsx(Button, { className: "w-full", onClick: () => onVerify?.(otp), children: buttonText })
26
+ ] })
27
+ ] }) });
28
+ }
29
+
30
+ export { OTPBlock };
@@ -1,8 +1,8 @@
1
- import { MarketingShellPageKit } from './chunk-Z233ZQZE.js';
2
- import { SocialProofBlock } from './chunk-C7WHMSF3.js';
1
+ import { MarketingShellPageKit } from './chunk-E4L6LR6P.js';
3
2
  import { StatsMarketingBlock } from './chunk-QIHA7S3A.js';
4
- import { NewsletterBlock } from './chunk-K7NQ6ZAW.js';
5
3
  import { PricingBlock } from './chunk-VNNAL4A6.js';
4
+ import { SocialProofBlock } from './chunk-C7WHMSF3.js';
5
+ import { NewsletterBlock } from './chunk-K7NQ6ZAW.js';
6
6
  import { HeroBlock } from './chunk-GJ557DGH.js';
7
7
  import { FAQBlock } from './chunk-NEHCPO53.js';
8
8
  import { FeatureBlock } from './chunk-HJ3A2YNO.js';
@@ -0,0 +1,152 @@
1
+ import { SearchIcon } from './chunk-T6BRD7TS.js';
2
+ import { CornerDownLeftIcon } from './chunk-4FEAWXJD.js';
3
+ import { cn } from './chunk-QYZT24TS.js';
4
+ import * as React from 'react';
5
+ import { useTranslations } from 'next-intl';
6
+ import { cva } from 'class-variance-authority';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+
9
+ var searchCommandVariants = cva(
10
+ "flex flex-col rounded-xl glass-panel overflow-hidden",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "",
15
+ floating: "shadow-lg shadow-black/20"
16
+ },
17
+ size: {
18
+ sm: "max-w-sm",
19
+ default: "max-w-lg",
20
+ lg: "max-w-2xl"
21
+ }
22
+ },
23
+ defaultVariants: {
24
+ variant: "default",
25
+ size: "default"
26
+ }
27
+ }
28
+ );
29
+ var EMPTY_RESULTS = [];
30
+ function SearchCommand({
31
+ className,
32
+ variant,
33
+ size,
34
+ value = "",
35
+ onChange,
36
+ results = EMPTY_RESULTS,
37
+ onSelect,
38
+ placeholder,
39
+ loading = false,
40
+ showShortcut = true,
41
+ ref,
42
+ ...props
43
+ }) {
44
+ const t = useTranslations("components.searchCommand");
45
+ const resolvedPlaceholder = placeholder ?? t("placeholder");
46
+ const [selectedIndex, setSelectedIndex] = React.useState(0);
47
+ const inputRef = React.useRef(null);
48
+ const prevResultsRef = React.useRef(results);
49
+ if (prevResultsRef.current !== results) {
50
+ prevResultsRef.current = results;
51
+ if (selectedIndex !== 0) setSelectedIndex(0);
52
+ }
53
+ const handleKeyDown = (e) => {
54
+ if (e.key === "ArrowDown") {
55
+ e.preventDefault();
56
+ setSelectedIndex((prev) => (prev + 1) % Math.max(results.length, 1));
57
+ } else if (e.key === "ArrowUp") {
58
+ e.preventDefault();
59
+ setSelectedIndex(
60
+ (prev) => prev <= 0 ? Math.max(results.length - 1, 0) : prev - 1
61
+ );
62
+ } else if (e.key === "Enter" && results[selectedIndex]) {
63
+ e.preventDefault();
64
+ onSelect?.(results[selectedIndex]);
65
+ }
66
+ };
67
+ const groupedResults = React.useMemo(() => results.reduce(
68
+ (acc, result) => {
69
+ const category = result.category ?? "Results";
70
+ if (!acc[category]) acc[category] = [];
71
+ acc[category].push(result);
72
+ return acc;
73
+ },
74
+ {}
75
+ ), [results]);
76
+ let flatIndex = -1;
77
+ return /* @__PURE__ */ jsxs(
78
+ "div",
79
+ {
80
+ ref,
81
+ className: cn(searchCommandVariants({ variant, size }), "w-full", className),
82
+ role: "combobox",
83
+ "aria-expanded": results.length > 0,
84
+ "aria-controls": "search-command-listbox",
85
+ "aria-haspopup": "listbox",
86
+ ...props,
87
+ children: [
88
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b border-border pl-4 pr-12 transition-[border-color]", children: [
89
+ /* @__PURE__ */ jsx(SearchIcon, { size: 16, className: "shrink-0 text-text-tertiary" }),
90
+ /* @__PURE__ */ jsx(
91
+ "input",
92
+ {
93
+ ref: inputRef,
94
+ className: "flex-1 bg-transparent py-4 text-sm text-text-primary placeholder:text-text-tertiary outline-none focus-visible:outline-1 focus-visible:outline-border",
95
+ placeholder: resolvedPlaceholder,
96
+ value,
97
+ onChange: (e) => onChange?.(e.target.value),
98
+ onKeyDown: handleKeyDown,
99
+ role: "searchbox",
100
+ "aria-label": "Search",
101
+ "aria-autocomplete": "list",
102
+ "aria-activedescendant": results[selectedIndex] ? `search-option-${results[selectedIndex].id}` : void 0
103
+ }
104
+ ),
105
+ !!showShortcut && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 text-text-tertiary", children: /* @__PURE__ */ jsx(CornerDownLeftIcon, { size: 12 }) })
106
+ ] }),
107
+ !!loading && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ jsx("span", { className: "text-sm text-text-tertiary animate-pulse", children: t("searching") }) }),
108
+ !loading && results.length > 0 && /* @__PURE__ */ jsx(
109
+ "ul",
110
+ {
111
+ id: "search-command-listbox",
112
+ className: "max-h-[300px] overflow-y-auto py-1.5",
113
+ role: "listbox",
114
+ "aria-label": "Search results",
115
+ children: Object.entries(groupedResults).map(([category, items]) => /* @__PURE__ */ jsxs("li", { role: "presentation", children: [
116
+ /* @__PURE__ */ jsx("div", { className: "px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-text-tertiary", children: category }),
117
+ /* @__PURE__ */ jsx("ul", { role: "group", "aria-label": category, children: items.map((result) => {
118
+ flatIndex++;
119
+ const idx = flatIndex;
120
+ return /* @__PURE__ */ jsxs(
121
+ "li",
122
+ {
123
+ id: `search-option-${result.id}`,
124
+ role: "option",
125
+ "aria-selected": idx === selectedIndex,
126
+ className: cn(
127
+ "flex items-center gap-4 cursor-pointer px-4 py-2 text-sm transition-colors",
128
+ idx === selectedIndex ? "bg-accent/10 text-accent" : "text-text-primary hover:bg-surface-hover"
129
+ ),
130
+ onClick: () => onSelect?.(result),
131
+ onMouseEnter: () => setSelectedIndex(idx),
132
+ children: [
133
+ result.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-text-tertiary", children: result.icon }),
134
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
135
+ /* @__PURE__ */ jsx("p", { className: "truncate", children: result.title }),
136
+ result.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-text-tertiary truncate", children: result.description })
137
+ ] })
138
+ ]
139
+ },
140
+ result.id
141
+ );
142
+ }) })
143
+ ] }, category))
144
+ }
145
+ ),
146
+ !loading && value && results.length === 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-6", children: /* @__PURE__ */ jsx("span", { className: "text-sm text-text-tertiary", children: t("noResults") }) })
147
+ ]
148
+ }
149
+ );
150
+ }
151
+
152
+ export { SearchCommand, searchCommandVariants };
@@ -0,0 +1,103 @@
1
+ import { StaggerChildren } from './chunk-DQPK2XRL.js';
2
+ import { Heading } from './chunk-WI547C47.js';
3
+ import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from './chunk-PXDHNGTG.js';
4
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent } from './chunk-AH6YSYYT.js';
5
+ import { Badge } from './chunk-S4JAHKOP.js';
6
+ import { cn } from './chunk-QYZT24TS.js';
7
+ import { jsx, jsxs } from 'react/jsx-runtime';
8
+
9
+ var DEFAULT_DATASETS = [
10
+ {
11
+ name: "Latency (p95)",
12
+ description: "End-to-end response time under load",
13
+ columns: ["Configuration", "p95 (ms)", "Throughput"],
14
+ rows: [
15
+ { cells: ["Baseline", "420ms", "1.2K rps"] },
16
+ { cells: ["+ Cache layer", "185ms", "3.1K rps"], highlight: true },
17
+ { cells: ["+ Connection pool", "210ms", "2.8K rps"] }
18
+ ]
19
+ },
20
+ {
21
+ name: "Accuracy",
22
+ description: "Precision and recall across evaluation sets",
23
+ columns: ["Model", "Precision", "Recall"],
24
+ rows: [
25
+ { cells: ["v1.0", "82.3%", "78.1%"] },
26
+ { cells: ["v2.0", "89.7%", "85.4%"] },
27
+ { cells: ["v2.1 (current)", "91.2%", "88.6%"], highlight: true }
28
+ ]
29
+ },
30
+ {
31
+ name: "Resource usage",
32
+ description: "Memory and CPU utilization per instance",
33
+ columns: ["Tier", "Memory", "CPU"],
34
+ rows: [
35
+ { cells: ["Small", "256 MB", "0.25 vCPU"] },
36
+ { cells: ["Medium", "512 MB", "0.5 vCPU"], highlight: true },
37
+ { cells: ["Large", "1024 MB", "1.0 vCPU"] }
38
+ ]
39
+ },
40
+ {
41
+ name: "Cost efficiency",
42
+ description: "Normalized cost per 1M operations",
43
+ columns: ["Provider", "Cost", "Savings"],
44
+ rows: [
45
+ { cells: ["Legacy", "$4.20", "-"] },
46
+ { cells: ["Current", "$1.85", "56%"], highlight: true },
47
+ { cells: ["Projected", "$0.92", "78%"] }
48
+ ]
49
+ }
50
+ ];
51
+ function BenchmarksBlock({
52
+ badgeLabel = "Benchmarks",
53
+ title = "Performance at a glance",
54
+ subtitle = "Key metrics across latency, accuracy, resource usage, and cost.",
55
+ datasets = DEFAULT_DATASETS,
56
+ staggerMs = 120,
57
+ className
58
+ }) {
59
+ return /* @__PURE__ */ jsx("section", { className: cn("py-16 md:py-24", className), children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-6 lg:px-8", children: [
60
+ /* @__PURE__ */ jsxs("div", { className: "text-center mb-16 max-w-2xl mx-auto", children: [
61
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "mb-4", children: badgeLabel }),
62
+ /* @__PURE__ */ jsx(Heading, { level: 2, className: "mb-4", children: title }),
63
+ /* @__PURE__ */ jsx("p", { className: "text-text-secondary text-lg", children: subtitle })
64
+ ] }),
65
+ datasets.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-center text-text-secondary py-12", children: "No benchmark data available." }) : /* @__PURE__ */ jsx(StaggerChildren, { staggerMs, className: "grid gap-8 lg:grid-cols-2 [grid-auto-rows:1fr]", children: datasets.map((dataset) => /* @__PURE__ */ jsxs(Card, { className: "h-full", children: [
66
+ /* @__PURE__ */ jsxs(CardHeader, { children: [
67
+ /* @__PURE__ */ jsx(CardTitle, { children: dataset.name }),
68
+ /* @__PURE__ */ jsx(CardDescription, { children: dataset.description })
69
+ ] }),
70
+ /* @__PURE__ */ jsx(CardContent, { className: "flex-1 overflow-x-auto", children: /* @__PURE__ */ jsxs(Table, { children: [
71
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: dataset.columns.map((col) => /* @__PURE__ */ jsx(
72
+ TableHead,
73
+ {
74
+ className: col === dataset.columns[0] ? void 0 : "text-right",
75
+ children: col
76
+ },
77
+ col
78
+ )) }) }),
79
+ /* @__PURE__ */ jsx(TableBody, { children: dataset.rows.map((row, rowIdx) => /* @__PURE__ */ jsx(
80
+ TableRow,
81
+ {
82
+ className: row.highlight ? "bg-accent/5 font-semibold" : void 0,
83
+ children: row.cells.map((cell, cellIdx) => /* @__PURE__ */ jsx(
84
+ TableCell,
85
+ {
86
+ className: cn(
87
+ cellIdx === 0 ? "font-medium" : "text-right",
88
+ row.highlight && cellIdx === 0 && "text-accent",
89
+ row.highlight && cellIdx > 0 && "text-chart-4"
90
+ ),
91
+ children: cell
92
+ },
93
+ cellIdx
94
+ ))
95
+ },
96
+ rowIdx
97
+ )) })
98
+ ] }) })
99
+ ] }, dataset.name)) })
100
+ ] }) });
101
+ }
102
+
103
+ export { BenchmarksBlock };
@@ -0,0 +1,75 @@
1
+ import { Spinner } from './chunk-ZLSWCV55.js';
2
+ import { Field, FieldLabel } from './chunk-RX5EUODB.js';
3
+ import { Input } from './chunk-AP3XXYAY.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 { MailIcon } from './chunk-XQ2UDMPO.js';
8
+ import { CheckIcon } from './chunk-CXACRCZ4.js';
9
+ import { cn } from './chunk-QYZT24TS.js';
10
+ import * as React from 'react';
11
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
+
13
+ function ForgotPasswordBlock({
14
+ className,
15
+ onSubmit,
16
+ onBackToLogin,
17
+ title = "Forgot password?",
18
+ description = "Enter your email to reset your password",
19
+ successTitle = "Email sent",
20
+ submitLabel = "Send reset link",
21
+ loadingLabel = "Sending...",
22
+ backLabel = "Back to login",
23
+ emailPlaceholder = "name@example.com"
24
+ }) {
25
+ const [email, setEmail] = React.useState("");
26
+ const [state, setState] = React.useState("idle");
27
+ const handleSubmit = (e) => {
28
+ e.preventDefault();
29
+ if (!email) return;
30
+ setState("loading");
31
+ onSubmit?.(email);
32
+ setTimeout(() => setState("success"), 1500);
33
+ };
34
+ return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
35
+ /* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
36
+ state === "success" ? /* @__PURE__ */ jsx("div", { className: "mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-full bg-success/10 shadow-[0_0_24px_rgba(61,214,140,0.2)]", children: /* @__PURE__ */ jsx(CheckIcon, { size: 32, className: "text-success" }) }) : /* @__PURE__ */ jsx("div", { className: "mx-auto mb-2", children: /* @__PURE__ */ jsx(MailIcon, { size: 32, className: "text-text-secondary" }) }),
37
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: state === "success" ? successTitle : title }),
38
+ /* @__PURE__ */ jsx(CardDescription, { children: state === "success" ? `We sent a reset link to ${email}` : description })
39
+ ] }),
40
+ state !== "success" && /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: handleSubmit, className: "grid gap-4", children: [
41
+ /* @__PURE__ */ jsxs(Field, { children: [
42
+ /* @__PURE__ */ jsx(FieldLabel, { htmlFor: "forgot-email", children: "Email" }),
43
+ /* @__PURE__ */ jsx(
44
+ Input,
45
+ {
46
+ id: "forgot-email",
47
+ name: "email",
48
+ type: "email",
49
+ placeholder: emailPlaceholder,
50
+ value: email,
51
+ onChange: (e) => setEmail(e.target.value),
52
+ autoComplete: "email",
53
+ required: true
54
+ }
55
+ )
56
+ ] }),
57
+ /* @__PURE__ */ jsx(Button, { variant: "accent", className: "w-full", disabled: state === "loading", children: state === "loading" ? /* @__PURE__ */ jsxs(Fragment, { children: [
58
+ /* @__PURE__ */ jsx(Spinner, { className: "mr-2" }),
59
+ loadingLabel
60
+ ] }) : submitLabel })
61
+ ] }) }),
62
+ /* @__PURE__ */ jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsx(
63
+ "button",
64
+ {
65
+ type: "button",
66
+ onClick: onBackToLogin,
67
+ "aria-label": backLabel,
68
+ className: "text-sm text-text-tertiary hover:text-text-primary transition-colors",
69
+ children: backLabel
70
+ }
71
+ ) })
72
+ ] }) });
73
+ }
74
+
75
+ export { ForgotPasswordBlock };
@@ -0,0 +1,60 @@
1
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent } from './chunk-AH6YSYYT.js';
2
+ import { Button } from './chunk-7KIDDF3I.js';
3
+ import { useMotionConfig, m, scaleIn, motionSpring } from './chunk-PD2YEH3H.js';
4
+ import { ShieldCheckIcon } from './chunk-BFLN54VR.js';
5
+ import { cn } from './chunk-QYZT24TS.js';
6
+ import * as React from 'react';
7
+ import { jsx, jsxs } from 'react/jsx-runtime';
8
+
9
+ function PasswordChangedBlock({
10
+ className,
11
+ onContinue,
12
+ autoRedirectSeconds,
13
+ title = "Password changed!",
14
+ description = "Your password has been successfully updated.",
15
+ buttonLabel = "Continue to login"
16
+ }) {
17
+ const motionConfig = useMotionConfig();
18
+ const [countdown, setCountdown] = React.useState(autoRedirectSeconds ?? 0);
19
+ React.useEffect(() => {
20
+ if (!autoRedirectSeconds) return;
21
+ setCountdown(autoRedirectSeconds);
22
+ const interval = setInterval(() => {
23
+ setCountdown((prev) => {
24
+ if (prev <= 1) {
25
+ clearInterval(interval);
26
+ onContinue?.();
27
+ return 0;
28
+ }
29
+ return prev - 1;
30
+ });
31
+ }, 1e3);
32
+ return () => clearInterval(interval);
33
+ }, [autoRedirectSeconds, onContinue]);
34
+ return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
35
+ /* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
36
+ /* @__PURE__ */ jsx(
37
+ m.div,
38
+ {
39
+ className: "mx-auto mb-2",
40
+ initial: { scale: 0.8, opacity: 0 },
41
+ animate: { scale: 1, opacity: 1 },
42
+ transition: { ...motionSpring.bouncy, ...motionConfig },
43
+ children: /* @__PURE__ */ jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-success/10 shadow-[0_0_24px_rgba(61,214,140,0.2)]", children: /* @__PURE__ */ jsx(ShieldCheckIcon, { size: 32, className: "text-success" }) })
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: title }),
47
+ /* @__PURE__ */ jsx(CardDescription, { children: description })
48
+ ] }),
49
+ /* @__PURE__ */ jsxs(CardContent, { className: "grid gap-4", children: [
50
+ autoRedirectSeconds !== void 0 && countdown > 0 && /* @__PURE__ */ jsxs("p", { className: "text-center text-sm text-text-tertiary tabular-nums", children: [
51
+ "Redirecting in ",
52
+ countdown,
53
+ "..."
54
+ ] }),
55
+ /* @__PURE__ */ jsx(Button, { variant: "accent", className: "w-full", onClick: onContinue, children: buttonLabel })
56
+ ] })
57
+ ] }) });
58
+ }
59
+
60
+ export { PasswordChangedBlock };
@@ -1,7 +1,7 @@
1
- import { MarketingShellPageKit } from './chunk-Z233ZQZE.js';
1
+ import { MarketingShellPageKit } from './chunk-E4L6LR6P.js';
2
2
  import { TeamBlock } from './chunk-VBZQ4DBE.js';
3
- import { ContactBlock } from './chunk-U4GYSYGN.js';
4
3
  import { FAQBlock } from './chunk-NEHCPO53.js';
4
+ import { ContactBlock } from './chunk-U4GYSYGN.js';
5
5
  import { CallToActionBlock } from './chunk-GJPTPLCQ.js';
6
6
  import { Typography } from './chunk-N53OMWW2.js';
7
7
  import { Card, CardHeader, CardTitle, CardContent } from './chunk-AH6YSYYT.js';
@@ -0,0 +1,120 @@
1
+ import { Spinner } from './chunk-ZLSWCV55.js';
2
+ import { Field, FieldLabel } from './chunk-RX5EUODB.js';
3
+ import { Separator } from './chunk-CUZJIDU7.js';
4
+ import { Input } from './chunk-AP3XXYAY.js';
5
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './chunk-AH6YSYYT.js';
6
+ import { Alert, AlertDescription } from './chunk-GJUR6HT3.js';
7
+ import { Button } from './chunk-7KIDDF3I.js';
8
+ import { m, scaleIn } from './chunk-PD2YEH3H.js';
9
+ import { SparklesIcon } from './chunk-CGUCH322.js';
10
+ import { MailIcon } from './chunk-XQ2UDMPO.js';
11
+ import { CheckIcon } from './chunk-CXACRCZ4.js';
12
+ import { cn } from './chunk-QYZT24TS.js';
13
+ import * as React from 'react';
14
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
+
16
+ function MagicLinkBlock({
17
+ className,
18
+ onSubmit,
19
+ onBackToLogin,
20
+ title = "Sign in with magic link",
21
+ subtitle = "No password needed",
22
+ successTitle = "Check your email",
23
+ expiryMinutes = 15,
24
+ placeholder = "name@example.com"
25
+ }) {
26
+ const [email, setEmail] = React.useState("");
27
+ const [state, setState] = React.useState("idle");
28
+ const handleSubmit = (e) => {
29
+ e.preventDefault();
30
+ if (!email) return;
31
+ setState("loading");
32
+ onSubmit?.(email);
33
+ setTimeout(() => setState("success"), 1500);
34
+ };
35
+ if (state === "success") {
36
+ return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
37
+ /* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
38
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-2", children: /* @__PURE__ */ jsx(MailIcon, { size: 48, className: "text-accent" }) }),
39
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: successTitle }),
40
+ /* @__PURE__ */ jsxs(CardDescription, { children: [
41
+ "We sent a magic link to ",
42
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-text-primary", children: email })
43
+ ] })
44
+ ] }),
45
+ /* @__PURE__ */ jsx(CardContent, { className: "grid gap-4", children: /* @__PURE__ */ jsxs("ul", { className: "space-y-2 text-sm text-text-secondary", children: [
46
+ /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2", children: [
47
+ /* @__PURE__ */ jsx(CheckIcon, { size: 16, className: "text-success mt-0.5 shrink-0" }),
48
+ /* @__PURE__ */ jsx("span", { children: "Click the link in the email to sign in" })
49
+ ] }),
50
+ /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2", children: [
51
+ /* @__PURE__ */ jsx(CheckIcon, { size: 16, className: "text-success mt-0.5 shrink-0" }),
52
+ /* @__PURE__ */ jsxs("span", { children: [
53
+ "The link expires in ",
54
+ expiryMinutes,
55
+ " minutes"
56
+ ] })
57
+ ] })
58
+ ] }) }),
59
+ /* @__PURE__ */ jsx(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsx(
60
+ "button",
61
+ {
62
+ type: "button",
63
+ onClick: onBackToLogin,
64
+ className: "text-sm text-text-tertiary hover:text-text-primary transition-colors",
65
+ children: "Back to login"
66
+ }
67
+ ) })
68
+ ] }) });
69
+ }
70
+ return /* @__PURE__ */ jsx(m.div, { ...scaleIn, className: cn("w-full max-w-sm mx-auto", className), children: /* @__PURE__ */ jsxs(Card, { children: [
71
+ /* @__PURE__ */ jsxs(CardHeader, { className: "text-center", children: [
72
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-2", children: /* @__PURE__ */ jsx(SparklesIcon, { size: 32, className: "text-accent" }) }),
73
+ /* @__PURE__ */ jsx(CardTitle, { className: "text-2xl", children: title }),
74
+ /* @__PURE__ */ jsx(CardDescription, { children: subtitle })
75
+ ] }),
76
+ /* @__PURE__ */ jsxs(CardContent, { children: [
77
+ /* @__PURE__ */ jsxs("form", { noValidate: true, onSubmit: handleSubmit, className: "grid gap-4", children: [
78
+ /* @__PURE__ */ jsxs(Field, { children: [
79
+ /* @__PURE__ */ jsx(FieldLabel, { htmlFor: "magic-email", children: "Email" }),
80
+ /* @__PURE__ */ jsx(
81
+ Input,
82
+ {
83
+ id: "magic-email",
84
+ name: "email",
85
+ type: "email",
86
+ placeholder,
87
+ value: email,
88
+ onChange: (e) => setEmail(e.target.value),
89
+ autoComplete: "email",
90
+ required: true
91
+ }
92
+ )
93
+ ] }),
94
+ /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsxs(AlertDescription, { className: "text-xs text-text-tertiary", children: [
95
+ "We",
96
+ "'",
97
+ "ll send you a link that expires in ",
98
+ expiryMinutes,
99
+ " minutes."
100
+ ] }) }),
101
+ /* @__PURE__ */ jsx(Button, { variant: "accent", className: "w-full", disabled: state === "loading", children: state === "loading" ? /* @__PURE__ */ jsxs(Fragment, { children: [
102
+ /* @__PURE__ */ jsx(Spinner, { className: "mr-2" }),
103
+ "Sending..."
104
+ ] }) : "Send magic link" })
105
+ ] }),
106
+ /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
107
+ /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(
108
+ "button",
109
+ {
110
+ type: "button",
111
+ onClick: onBackToLogin,
112
+ className: "text-sm text-text-tertiary hover:text-text-primary transition-colors",
113
+ children: "Prefer password? Sign in normally"
114
+ }
115
+ ) })
116
+ ] })
117
+ ] }) });
118
+ }
119
+
120
+ export { MagicLinkBlock };