@vadimcomanescu/nadicode-design-system 4.0.4 → 4.0.5
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/SKILL.md +24 -3
- package/dist/catalog/catalog.d.ts +168 -0
- package/dist/catalog/catalog.js +172 -0
- package/dist/catalog/components.d.ts +24 -0
- package/dist/catalog/components.js +61 -35
- package/dist/{chunk-RMGDDOCD.js → chunk-3ZPNIY2Z.js} +2 -2
- package/dist/chunk-4KZLCCIR.js +88 -0
- package/dist/{chunk-AWZFQQGN.js → chunk-6NCLYJAI.js} +2 -2
- package/dist/{chunk-K4U67BVG.js → chunk-7ALMTY6W.js} +1 -1
- package/dist/chunk-CZ7NGW7N.js +60 -0
- package/dist/chunk-FRGZSR2P.js +86 -0
- package/dist/{chunk-LGW7FVG5.js → chunk-HMFIUUYC.js} +1 -1
- package/dist/chunk-IC3BMFHV.js +86 -0
- package/dist/chunk-JVIRZNQ6.js +37 -0
- package/dist/chunk-K5AFXZDL.js +30 -0
- package/dist/{chunk-LK2L3C7D.js → chunk-LCMAB2BX.js} +3 -3
- package/dist/chunk-LIJYUSSE.js +152 -0
- package/dist/chunk-MB6TIORE.js +103 -0
- package/dist/chunk-PV62D7H6.js +75 -0
- package/dist/chunk-QVAV4MA2.js +60 -0
- package/dist/chunk-RPVG37RB.js +24 -0
- package/dist/{chunk-QW5II6YK.js → chunk-TEWCCMRH.js} +2 -2
- package/dist/chunk-W74WK3HB.js +184 -0
- package/dist/chunk-WVKJNHQM.js +120 -0
- package/dist/chunk-XAAJBX6R.js +100 -0
- package/dist/components/blocks/ApiKeysBlock.d.ts +18 -0
- package/dist/components/blocks/ApiKeysBlock.js +128 -0
- package/dist/components/blocks/BenchmarksBlock.d.ts +20 -0
- package/dist/components/blocks/BenchmarksBlock.js +11 -0
- package/dist/components/blocks/CheckEmailBlock.d.ts +9 -0
- package/dist/components/blocks/CheckEmailBlock.js +13 -0
- package/dist/components/blocks/CommandPaletteBlock.d.ts +9 -0
- package/dist/components/blocks/CommandPaletteBlock.js +125 -0
- package/dist/components/blocks/EmailVerifiedBlock.d.ts +10 -0
- package/dist/components/blocks/EmailVerifiedBlock.js +10 -0
- package/dist/components/blocks/ForgotPasswordBlock.d.ts +14 -0
- package/dist/components/blocks/ForgotPasswordBlock.js +15 -0
- package/dist/components/blocks/IntegrationsBlock.js +3 -3
- package/dist/components/blocks/MagicLinkBlock.d.ts +12 -0
- package/dist/components/blocks/MagicLinkBlock.js +18 -0
- package/dist/components/blocks/OTPBlock.d.ts +10 -0
- package/dist/components/blocks/OTPBlock.js +121 -0
- package/dist/components/blocks/PasswordChangedBlock.d.ts +10 -0
- package/dist/components/blocks/PasswordChangedBlock.js +10 -0
- package/dist/components/blocks/PricingTableBlock.d.ts +19 -0
- package/dist/components/blocks/PricingTableBlock.js +12 -0
- package/dist/components/blocks/SavingsCalculatorBlock.d.ts +30 -0
- package/dist/components/blocks/SavingsCalculatorBlock.js +22 -0
- package/dist/components/blocks/WorkspaceSwitcherBlock.d.ts +11 -0
- package/dist/components/blocks/WorkspaceSwitcherBlock.js +129 -0
- package/dist/components/logos/index.js +2 -2
- package/dist/components/page-kits/BlogContentPageKit.js +4 -4
- package/dist/components/page-kits/CheckoutPageKit.js +3 -3
- package/dist/components/page-kits/CompanySuitePageKit.js +4 -4
- package/dist/components/page-kits/LandingPageKit.js +5 -5
- package/dist/components/page-kits/MarketingShellPageKit.js +2 -2
- package/dist/components/page-kits/PricingPageKit.js +4 -4
- package/dist/components/page-kits/ServiceSuitePageKit.js +3 -3
- package/dist/components/ui/SearchCommand.js +4 -152
- package/dist/hooks/useHotkey.js +1 -37
- package/package.json +1 -1
- package/dist/{chunk-BSCC7OQK.js → chunk-4TUJJ3UI.js} +2 -2
- package/dist/{chunk-Z233ZQZE.js → chunk-E4L6LR6P.js} +1 -1
|
@@ -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 };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SidebarMenu, SidebarMenuItem, SidebarMenuButton } from './chunk-J2DCQDXO.js';
|
|
2
|
+
import { LayoutDashboardIcon } from './chunk-O74AEVHW.js';
|
|
3
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var DEFAULT_NAME = "My Workspace";
|
|
7
|
+
var DEFAULT_PLAN = "Free Plan";
|
|
8
|
+
var DEFAULT_HREF = "/dashboard";
|
|
9
|
+
function WorkspaceSwitcherBlock({
|
|
10
|
+
name = DEFAULT_NAME,
|
|
11
|
+
plan = DEFAULT_PLAN,
|
|
12
|
+
href = DEFAULT_HREF,
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(SidebarMenu, { className: cn(className), children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, { size: "lg", asChild: true, children: /* @__PURE__ */ jsxs("a", { href, children: [
|
|
16
|
+
/* @__PURE__ */ jsx("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: /* @__PURE__ */ jsx(LayoutDashboardIcon, { size: 16 }) }),
|
|
17
|
+
/* @__PURE__ */ jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-semibold text-text-primary", children: name }),
|
|
19
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-text-tertiary", children: plan })
|
|
20
|
+
] })
|
|
21
|
+
] }) }) }) });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { WorkspaceSwitcherBlock };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MarketingShellPageKit } from './chunk-
|
|
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,184 @@
|
|
|
1
|
+
import { Heading } from './chunk-WI547C47.js';
|
|
2
|
+
import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from './chunk-PXDHNGTG.js';
|
|
3
|
+
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './chunk-W73JAOHW.js';
|
|
4
|
+
import { Input } from './chunk-AP3XXYAY.js';
|
|
5
|
+
import { Card, CardContent } from './chunk-AH6YSYYT.js';
|
|
6
|
+
import { Button } from './chunk-7KIDDF3I.js';
|
|
7
|
+
import { Trash2Icon } from './chunk-S4GKGKON.js';
|
|
8
|
+
import { PlusIcon } from './chunk-E7RBK6ML.js';
|
|
9
|
+
import { KeyIcon } from './chunk-QSU23VYZ.js';
|
|
10
|
+
import { Badge } from './chunk-S4JAHKOP.js';
|
|
11
|
+
import { CopyIcon } from './chunk-TV4RSQH4.js';
|
|
12
|
+
import { cn } from './chunk-QYZT24TS.js';
|
|
13
|
+
import { useState, useMemo } from 'react';
|
|
14
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
var DEFAULT_KEYS = [];
|
|
17
|
+
function ApiKeysBlock({
|
|
18
|
+
keys = DEFAULT_KEYS,
|
|
19
|
+
onCreate,
|
|
20
|
+
onRevoke,
|
|
21
|
+
title = "API Keys",
|
|
22
|
+
description = "Manage your API keys",
|
|
23
|
+
className
|
|
24
|
+
}) {
|
|
25
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
26
|
+
const [newKeyName, setNewKeyName] = useState("");
|
|
27
|
+
const [creating, setCreating] = useState(false);
|
|
28
|
+
const [createdKey, setCreatedKey] = useState(null);
|
|
29
|
+
const [copied, setCopied] = useState(false);
|
|
30
|
+
const sortedKeys = useMemo(() => {
|
|
31
|
+
const active = keys.filter((k) => !k.revokedAt);
|
|
32
|
+
const revoked = keys.filter((k) => k.revokedAt);
|
|
33
|
+
return [...active, ...revoked];
|
|
34
|
+
}, [keys]);
|
|
35
|
+
const handleCreate = async () => {
|
|
36
|
+
if (!newKeyName.trim() || !onCreate) return;
|
|
37
|
+
setCreating(true);
|
|
38
|
+
try {
|
|
39
|
+
const result = await onCreate(newKeyName.trim());
|
|
40
|
+
if (typeof result === "string") {
|
|
41
|
+
setCreatedKey(result);
|
|
42
|
+
} else {
|
|
43
|
+
handleDialogClose();
|
|
44
|
+
}
|
|
45
|
+
} finally {
|
|
46
|
+
setCreating(false);
|
|
47
|
+
setNewKeyName("");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleCopy = async (text) => {
|
|
51
|
+
await navigator.clipboard.writeText(text);
|
|
52
|
+
setCopied(true);
|
|
53
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
54
|
+
};
|
|
55
|
+
const handleDialogClose = () => {
|
|
56
|
+
setDialogOpen(false);
|
|
57
|
+
setCreatedKey(null);
|
|
58
|
+
setNewKeyName("");
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ jsx("section", { className: cn("py-16 md:py-24", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-4xl px-6", children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-8 flex items-center justify-between", children: [
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
63
|
+
!!title && /* @__PURE__ */ jsx(Heading, { level: 2, size: "section", className: "text-text-primary", children: title }),
|
|
64
|
+
!!description && /* @__PURE__ */ jsx("p", { className: "mt-1 text-text-secondary", children: description })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsxs(
|
|
67
|
+
Dialog,
|
|
68
|
+
{
|
|
69
|
+
open: dialogOpen,
|
|
70
|
+
onOpenChange: (open) => {
|
|
71
|
+
if (!open) handleDialogClose();
|
|
72
|
+
else setDialogOpen(true);
|
|
73
|
+
},
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(PlusIcon, { size: 16, className: "mr-2" }),
|
|
77
|
+
"Create API Key"
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ jsx(DialogContent, { children: createdKey ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
81
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "API Key Created" }),
|
|
82
|
+
/* @__PURE__ */ jsxs(DialogDescription, { children: [
|
|
83
|
+
"Copy this key now. You won",
|
|
84
|
+
"'",
|
|
85
|
+
"t be able to see it again."
|
|
86
|
+
] })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-surface/80 p-3 font-mono text-sm break-all", children: [
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1", children: createdKey }),
|
|
91
|
+
/* @__PURE__ */ jsxs(
|
|
92
|
+
Button,
|
|
93
|
+
{
|
|
94
|
+
size: "sm",
|
|
95
|
+
variant: "outline",
|
|
96
|
+
onClick: () => handleCopy(createdKey),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx(CopyIcon, { size: 14, className: "mr-1" }),
|
|
99
|
+
copied ? "Copied!" : "Copy"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-destructive/80", children: "This key will not be shown again. Store it securely." })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx(DialogFooter, { children: /* @__PURE__ */ jsx(Button, { onClick: handleDialogClose, children: "Done" }) })
|
|
107
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
109
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "Create API Key" }),
|
|
110
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: "Give your key a name to identify it later." })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4 py-4", children: /* @__PURE__ */ jsx(
|
|
113
|
+
Input,
|
|
114
|
+
{
|
|
115
|
+
name: "name",
|
|
116
|
+
placeholder: "e.g., Production server",
|
|
117
|
+
value: newKeyName,
|
|
118
|
+
onChange: (e) => setNewKeyName(e.target.value),
|
|
119
|
+
onKeyDown: (e) => {
|
|
120
|
+
if (e.key === "Enter") handleCreate();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
) }),
|
|
124
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", onClick: handleDialogClose, children: "Cancel" }),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
Button,
|
|
128
|
+
{
|
|
129
|
+
onClick: handleCreate,
|
|
130
|
+
disabled: creating || !newKeyName.trim(),
|
|
131
|
+
children: creating ? "Creating..." : "Create"
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] })
|
|
135
|
+
] }) })
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, { className: "pt-6", children: keys.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "space-y-4 py-12 text-center", children: [
|
|
141
|
+
/* @__PURE__ */ jsx(KeyIcon, { size: 40, className: "mx-auto text-text-tertiary" }),
|
|
142
|
+
/* @__PURE__ */ jsx(Heading, { level: 3, size: "label", className: "text-text-primary", children: "No API keys yet" }),
|
|
143
|
+
/* @__PURE__ */ jsx("p", { className: "text-text-secondary", children: "Create your first API key to get started." })
|
|
144
|
+
] }) : /* @__PURE__ */ jsxs(Table, { children: [
|
|
145
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
146
|
+
/* @__PURE__ */ jsx(TableHead, { children: "Name" }),
|
|
147
|
+
/* @__PURE__ */ jsx(TableHead, { children: "Key" }),
|
|
148
|
+
/* @__PURE__ */ jsx(TableHead, { className: "hidden md:table-cell", children: "Created" }),
|
|
149
|
+
/* @__PURE__ */ jsx(TableHead, { className: "hidden md:table-cell", children: "Last Used" }),
|
|
150
|
+
/* @__PURE__ */ jsx(TableHead, { children: "Status" }),
|
|
151
|
+
/* @__PURE__ */ jsx(TableHead, { className: "text-right", children: "Action" })
|
|
152
|
+
] }) }),
|
|
153
|
+
/* @__PURE__ */ jsx(TableBody, { children: sortedKeys.map((key) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
154
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-medium", children: key.name }),
|
|
155
|
+
/* @__PURE__ */ jsx(TableCell, { className: "font-mono text-xs text-text-tertiary", children: key.prefix }),
|
|
156
|
+
/* @__PURE__ */ jsx(TableCell, { className: "hidden text-text-secondary md:table-cell", children: new Date(key.createdAt).toLocaleDateString() }),
|
|
157
|
+
/* @__PURE__ */ jsx(TableCell, { className: "hidden text-text-secondary md:table-cell", children: key.lastUsedAt ? new Date(key.lastUsedAt).toLocaleDateString() : "Never" }),
|
|
158
|
+
/* @__PURE__ */ jsx(TableCell, { children: key.revokedAt ? /* @__PURE__ */ jsx(
|
|
159
|
+
Badge,
|
|
160
|
+
{
|
|
161
|
+
variant: "outline",
|
|
162
|
+
className: "text-destructive/80",
|
|
163
|
+
children: "Revoked"
|
|
164
|
+
}
|
|
165
|
+
) : /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-chart-4", children: "Active" }) }),
|
|
166
|
+
/* @__PURE__ */ jsx(TableCell, { className: "text-right", children: !key.revokedAt && onRevoke && /* @__PURE__ */ jsxs(
|
|
167
|
+
Button,
|
|
168
|
+
{
|
|
169
|
+
size: "sm",
|
|
170
|
+
variant: "outline",
|
|
171
|
+
className: "text-destructive/80 hover:text-destructive",
|
|
172
|
+
onClick: () => onRevoke(key.id),
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsx(Trash2Icon, { size: 14, className: "mr-1" }),
|
|
175
|
+
"Revoke"
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
) })
|
|
179
|
+
] }, key.id)) })
|
|
180
|
+
] }) }) })
|
|
181
|
+
] }) });
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export { ApiKeysBlock };
|