@audere/ui 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.d.ts +32 -0
- package/dist/ai/index.js +98 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/charts/index.d.ts +78 -0
- package/dist/charts/index.js +388 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/composition/index.d.ts +27 -0
- package/dist/composition/index.js +61 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/data/index.d.ts +73 -0
- package/dist/data/index.js +320 -0
- package/dist/data/index.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +1350 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +107 -0
- package/dist/layout/index.js +232 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/primitives/index.d.ts +29 -0
- package/dist/primitives/index.js +163 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/surface/index.d.ts +16 -0
- package/dist/surface/index.js +38 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/theme/index.d.ts +72 -0
- package/dist/theme/index.js +60 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/workflow/index.d.ts +38 -0
- package/dist/workflow/index.js +101 -0
- package/dist/workflow/index.js.map +1 -0
- package/package.json +108 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1350 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
6
|
+
import { ResponsiveContainer, PieChart, Pie, Cell, Tooltip, Legend, BarChart, CartesianGrid, XAxis, YAxis, ReferenceLine, Bar, AreaChart, Area } from 'recharts';
|
|
7
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
8
|
+
import { useState, useRef, useEffect } from 'react';
|
|
9
|
+
import { useLocation, Link } from 'react-router';
|
|
10
|
+
import { ChevronDown, LayoutGrid, Brain, CheckSquare, TrendingUp, MessageSquare, Home, Search, Bell, Grid, LineChart, LayoutDashboard } from 'lucide-react';
|
|
11
|
+
|
|
12
|
+
// src/surface/Surface.tsx
|
|
13
|
+
function cn(...inputs) {
|
|
14
|
+
return twMerge(clsx(inputs));
|
|
15
|
+
}
|
|
16
|
+
var surfaceVariants = cva(
|
|
17
|
+
"rounded-xl border border-border bg-card text-card-foreground shadow-sm",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
padding: {
|
|
21
|
+
none: "p-0",
|
|
22
|
+
sm: "p-4",
|
|
23
|
+
md: "p-6"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
padding: "none"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
function Surface({ className, padding, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "surface",
|
|
36
|
+
className: cn(surfaceVariants({ padding }), className),
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
function DataTable({
|
|
42
|
+
columns,
|
|
43
|
+
rows
|
|
44
|
+
}) {
|
|
45
|
+
return /* @__PURE__ */ jsx(Surface, { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-left text-sm text-foreground", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("thead", { className: "border-b border-border bg-muted/50 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: /* @__PURE__ */ jsx("tr", { children: columns.map((column) => /* @__PURE__ */ jsx(
|
|
47
|
+
"th",
|
|
48
|
+
{
|
|
49
|
+
scope: "col",
|
|
50
|
+
className: "px-6 py-3",
|
|
51
|
+
children: column.header
|
|
52
|
+
},
|
|
53
|
+
String(column.key)
|
|
54
|
+
)) }) }),
|
|
55
|
+
/* @__PURE__ */ jsx("tbody", { children: rows.map((row) => /* @__PURE__ */ jsx(
|
|
56
|
+
"tr",
|
|
57
|
+
{
|
|
58
|
+
className: "border-b border-border/60 bg-card transition-colors hover:bg-muted/40",
|
|
59
|
+
children: columns.map((column) => /* @__PURE__ */ jsx("td", { className: "px-6 py-4", children: column.render ? column.render(row) : String(row[column.key]) }, String(column.key)))
|
|
60
|
+
},
|
|
61
|
+
row.id
|
|
62
|
+
)) })
|
|
63
|
+
] }) });
|
|
64
|
+
}
|
|
65
|
+
function MetricTile({ label, value, helperText, trend }) {
|
|
66
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "sm", children: [
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium uppercase tracking-wider text-muted-foreground", children: label }),
|
|
69
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xl font-semibold text-foreground", children: value })
|
|
70
|
+
] }),
|
|
71
|
+
helperText ? /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: helperText }) : null,
|
|
72
|
+
trend ? /* @__PURE__ */ jsx("div", { className: "mt-3 text-xs", children: trend }) : null
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
var toneClasses = {
|
|
76
|
+
neutral: "",
|
|
77
|
+
warning: "border-l-4 border-l-amber-500",
|
|
78
|
+
success: "border-l-4 border-l-emerald-500"
|
|
79
|
+
};
|
|
80
|
+
function InsightCard({
|
|
81
|
+
title,
|
|
82
|
+
tone = "neutral",
|
|
83
|
+
icon,
|
|
84
|
+
children
|
|
85
|
+
}) {
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
Surface,
|
|
88
|
+
{
|
|
89
|
+
className: cn(tone !== "neutral" && toneClasses[tone]),
|
|
90
|
+
padding: "md",
|
|
91
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-4", children: [
|
|
92
|
+
icon ? /* @__PURE__ */ jsx("div", { className: "mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted", children: icon }) : null,
|
|
93
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
94
|
+
/* @__PURE__ */ jsx("h4", { className: "mb-1 text-sm font-semibold text-foreground", children: title }),
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children })
|
|
96
|
+
] })
|
|
97
|
+
] })
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
var buttonVariants = cva(
|
|
102
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
103
|
+
{
|
|
104
|
+
variants: {
|
|
105
|
+
variant: {
|
|
106
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
107
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
108
|
+
outline: "border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
109
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
110
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
111
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
112
|
+
},
|
|
113
|
+
size: {
|
|
114
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
115
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
116
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
117
|
+
icon: "size-9 rounded-md"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
defaultVariants: {
|
|
121
|
+
variant: "default",
|
|
122
|
+
size: "default"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
function Button({
|
|
127
|
+
className,
|
|
128
|
+
variant,
|
|
129
|
+
size,
|
|
130
|
+
asChild = false,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
const Comp = asChild ? Slot : "button";
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
Comp,
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "button",
|
|
138
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
139
|
+
...props
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
var badgeVariants = cva(
|
|
144
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
145
|
+
{
|
|
146
|
+
variants: {
|
|
147
|
+
variant: {
|
|
148
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
149
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
150
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
151
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
defaultVariants: {
|
|
155
|
+
variant: "default"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
function Badge({
|
|
160
|
+
className,
|
|
161
|
+
variant,
|
|
162
|
+
asChild = false,
|
|
163
|
+
...props
|
|
164
|
+
}) {
|
|
165
|
+
const Comp = asChild ? Slot : "span";
|
|
166
|
+
return /* @__PURE__ */ jsx(
|
|
167
|
+
Comp,
|
|
168
|
+
{
|
|
169
|
+
"data-slot": "badge",
|
|
170
|
+
className: cn(badgeVariants({ variant }), className),
|
|
171
|
+
...props
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function CrossAppNotificationsFeedV1({
|
|
176
|
+
panelTitle = "Cross-app Notifications",
|
|
177
|
+
listHeader = "Notifications",
|
|
178
|
+
items,
|
|
179
|
+
onMarkAllRead,
|
|
180
|
+
onItemClick,
|
|
181
|
+
className
|
|
182
|
+
}) {
|
|
183
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", className: cn("overflow-hidden", className), children: [
|
|
184
|
+
panelTitle ? /* @__PURE__ */ jsx("div", { className: "border-b border-border px-5 py-4", children: /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold tracking-tight text-foreground", children: panelTitle }) }) : null,
|
|
185
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border px-5 py-3", children: [
|
|
186
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: listHeader }),
|
|
187
|
+
onMarkAllRead ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", className: "h-auto p-0 text-sm", onClick: onMarkAllRead, children: "Mark all as read" }) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: " " })
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ jsx("ul", { className: "divide-y divide-border", role: "list", children: items.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
190
|
+
"button",
|
|
191
|
+
{
|
|
192
|
+
type: "button",
|
|
193
|
+
className: cn(
|
|
194
|
+
"flex w-full gap-3 px-5 py-4 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
195
|
+
item.read && "opacity-90"
|
|
196
|
+
),
|
|
197
|
+
onClick: () => onItemClick?.(item.id),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted text-muted-foreground", children: item.icon }),
|
|
200
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
201
|
+
/* @__PURE__ */ jsxs(
|
|
202
|
+
"span",
|
|
203
|
+
{
|
|
204
|
+
className: cn(
|
|
205
|
+
"block text-sm leading-snug text-foreground",
|
|
206
|
+
!item.read ? "font-bold" : "font-normal text-muted-foreground"
|
|
207
|
+
),
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ jsxs("span", { className: !item.read ? "font-bold" : "font-semibold", children: [
|
|
210
|
+
item.appLabel,
|
|
211
|
+
":"
|
|
212
|
+
] }),
|
|
213
|
+
" ",
|
|
214
|
+
item.message
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsxs("span", { className: "mt-1 flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
219
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-[11px]", children: "\u25F7" }),
|
|
220
|
+
item.timeAgo
|
|
221
|
+
] })
|
|
222
|
+
] })
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
) }, item.id)) })
|
|
226
|
+
] });
|
|
227
|
+
}
|
|
228
|
+
function CrossAppNotificationsFeedV2({
|
|
229
|
+
panelTitle = "Cross-app Notifications",
|
|
230
|
+
listHeader = "Notifications",
|
|
231
|
+
items,
|
|
232
|
+
onMarkAllRead,
|
|
233
|
+
onItemClick,
|
|
234
|
+
className
|
|
235
|
+
}) {
|
|
236
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", className: cn("overflow-hidden bg-muted/30", className), children: [
|
|
237
|
+
panelTitle ? /* @__PURE__ */ jsx("div", { className: "border-b border-border bg-card px-5 py-4", children: /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold tracking-tight text-foreground", children: panelTitle }) }) : null,
|
|
238
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border bg-card px-5 py-3", children: [
|
|
239
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: listHeader }),
|
|
240
|
+
onMarkAllRead ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", className: "h-auto p-0 text-sm", onClick: onMarkAllRead, children: "Mark all as read" }) : null
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2 p-3", children: items.map((item) => /* @__PURE__ */ jsx(
|
|
243
|
+
Surface,
|
|
244
|
+
{
|
|
245
|
+
padding: "none",
|
|
246
|
+
className: "border-border/80 bg-card shadow-none transition-colors hover:border-primary/25",
|
|
247
|
+
children: /* @__PURE__ */ jsxs(
|
|
248
|
+
"button",
|
|
249
|
+
{
|
|
250
|
+
type: "button",
|
|
251
|
+
className: "flex w-full gap-3 px-4 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
252
|
+
onClick: () => onItemClick?.(item.id),
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted", children: item.icon }),
|
|
255
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
256
|
+
/* @__PURE__ */ jsxs(
|
|
257
|
+
"span",
|
|
258
|
+
{
|
|
259
|
+
className: cn(
|
|
260
|
+
"block text-sm leading-snug",
|
|
261
|
+
!item.read ? "font-bold text-foreground" : "font-normal text-muted-foreground"
|
|
262
|
+
),
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ jsxs("span", { className: !item.read ? "font-bold" : "font-semibold text-foreground", children: [
|
|
265
|
+
item.appLabel,
|
|
266
|
+
":"
|
|
267
|
+
] }),
|
|
268
|
+
" ",
|
|
269
|
+
item.message
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ jsx("span", { className: "mt-1 text-xs text-muted-foreground", children: item.timeAgo })
|
|
274
|
+
] })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
},
|
|
279
|
+
item.id
|
|
280
|
+
)) })
|
|
281
|
+
] });
|
|
282
|
+
}
|
|
283
|
+
function CrossAppNotificationsFeedV3({
|
|
284
|
+
panelTitle = "Cross-app Notifications",
|
|
285
|
+
listHeader = "Notifications",
|
|
286
|
+
items,
|
|
287
|
+
onMarkAllRead,
|
|
288
|
+
onItemClick,
|
|
289
|
+
className
|
|
290
|
+
}) {
|
|
291
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", className: cn("overflow-hidden", className), children: [
|
|
292
|
+
panelTitle ? /* @__PURE__ */ jsx("div", { className: "border-b border-border px-4 py-3", children: /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold tracking-tight text-foreground", children: panelTitle }) }) : null,
|
|
293
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border px-4 py-2", children: [
|
|
294
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: listHeader }),
|
|
295
|
+
onMarkAllRead ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", className: "h-auto p-0 text-xs", onClick: onMarkAllRead, children: "Mark all read" }) : null
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ jsx("ul", { className: "divide-y divide-border", role: "list", children: items.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
298
|
+
"button",
|
|
299
|
+
{
|
|
300
|
+
type: "button",
|
|
301
|
+
className: "flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
302
|
+
onClick: () => onItemClick?.(item.id),
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-[10px]", children: item.icon }),
|
|
305
|
+
/* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "shrink-0 text-[10px]", children: item.appLabel }),
|
|
306
|
+
/* @__PURE__ */ jsx(
|
|
307
|
+
"span",
|
|
308
|
+
{
|
|
309
|
+
className: cn(
|
|
310
|
+
"min-w-0 flex-1 truncate",
|
|
311
|
+
!item.read ? "font-semibold text-foreground" : "font-normal text-muted-foreground"
|
|
312
|
+
),
|
|
313
|
+
children: item.message
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: item.timeAgo })
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
) }, item.id)) })
|
|
320
|
+
] });
|
|
321
|
+
}
|
|
322
|
+
function ChartContainer({
|
|
323
|
+
title,
|
|
324
|
+
className = "",
|
|
325
|
+
height = 280,
|
|
326
|
+
children
|
|
327
|
+
}) {
|
|
328
|
+
return /* @__PURE__ */ jsxs(Surface, { className: cn("flex flex-col overflow-hidden", className), children: [
|
|
329
|
+
title ? /* @__PURE__ */ jsx("div", { className: "px-6 pb-2 pt-4", children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: title }) }) : null,
|
|
330
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 px-4 pb-4", style: { minHeight: height }, children })
|
|
331
|
+
] });
|
|
332
|
+
}
|
|
333
|
+
var AUDERE_CHART_COLORS = [
|
|
334
|
+
"#0f172a",
|
|
335
|
+
// navy900
|
|
336
|
+
"#14b8a6",
|
|
337
|
+
// teal500
|
|
338
|
+
"#64748b",
|
|
339
|
+
// slate-500
|
|
340
|
+
"#0d9488",
|
|
341
|
+
// teal-600
|
|
342
|
+
"#94a3b8",
|
|
343
|
+
// slate-400
|
|
344
|
+
"#2dd4bf"
|
|
345
|
+
// teal-400
|
|
346
|
+
];
|
|
347
|
+
function SharedPieChart({
|
|
348
|
+
data,
|
|
349
|
+
title,
|
|
350
|
+
height = 280,
|
|
351
|
+
showLegend = true,
|
|
352
|
+
valueLabel = "Value"
|
|
353
|
+
}) {
|
|
354
|
+
return /* @__PURE__ */ jsx(ChartContainer, { title, height, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(PieChart, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
|
|
355
|
+
/* @__PURE__ */ jsx(
|
|
356
|
+
Pie,
|
|
357
|
+
{
|
|
358
|
+
data,
|
|
359
|
+
cx: "50%",
|
|
360
|
+
cy: "50%",
|
|
361
|
+
innerRadius: 60,
|
|
362
|
+
outerRadius: 90,
|
|
363
|
+
paddingAngle: 2,
|
|
364
|
+
dataKey: "value",
|
|
365
|
+
nameKey: "name",
|
|
366
|
+
label: ({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`,
|
|
367
|
+
labelLine: false,
|
|
368
|
+
children: data.map((_, index) => /* @__PURE__ */ jsx(
|
|
369
|
+
Cell,
|
|
370
|
+
{
|
|
371
|
+
fill: AUDERE_CHART_COLORS[index % AUDERE_CHART_COLORS.length],
|
|
372
|
+
stroke: "white",
|
|
373
|
+
strokeWidth: 2
|
|
374
|
+
},
|
|
375
|
+
`cell-${index}`
|
|
376
|
+
))
|
|
377
|
+
}
|
|
378
|
+
),
|
|
379
|
+
/* @__PURE__ */ jsx(
|
|
380
|
+
Tooltip,
|
|
381
|
+
{
|
|
382
|
+
formatter: (value) => [value, valueLabel],
|
|
383
|
+
contentStyle: {
|
|
384
|
+
borderRadius: "8px",
|
|
385
|
+
border: "1px solid var(--border)",
|
|
386
|
+
backgroundColor: "var(--card)",
|
|
387
|
+
color: "var(--card-foreground)",
|
|
388
|
+
boxShadow: "0 1px 3px 0 rgb(15 23 42 / 0.08)",
|
|
389
|
+
fontSize: "12px"
|
|
390
|
+
},
|
|
391
|
+
labelStyle: { color: "var(--foreground)", fontWeight: 600 }
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
395
|
+
Legend,
|
|
396
|
+
{
|
|
397
|
+
verticalAlign: "bottom",
|
|
398
|
+
height: 36,
|
|
399
|
+
formatter: (value, entry) => /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
400
|
+
value,
|
|
401
|
+
entry?.payload?.payload?.value != null && ` (${entry.payload.payload.value})`
|
|
402
|
+
] })
|
|
403
|
+
}
|
|
404
|
+
)
|
|
405
|
+
] }) }) });
|
|
406
|
+
}
|
|
407
|
+
var DEFAULT_FILL = "#14b8a6";
|
|
408
|
+
function SharedBarChart({
|
|
409
|
+
data,
|
|
410
|
+
dataKey,
|
|
411
|
+
valueKeys = ["value"],
|
|
412
|
+
title,
|
|
413
|
+
height = 260,
|
|
414
|
+
referenceLine,
|
|
415
|
+
fill = DEFAULT_FILL
|
|
416
|
+
}) {
|
|
417
|
+
const colors = ["#14b8a6", "#0f172a", "#64748b", "#0d9488"];
|
|
418
|
+
return /* @__PURE__ */ jsx(ChartContainer, { title, height, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(
|
|
419
|
+
BarChart,
|
|
420
|
+
{
|
|
421
|
+
data,
|
|
422
|
+
margin: { top: 8, right: 8, bottom: 8, left: 8 },
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false, stroke: "#e2e8f0" }),
|
|
425
|
+
/* @__PURE__ */ jsx(
|
|
426
|
+
XAxis,
|
|
427
|
+
{
|
|
428
|
+
dataKey,
|
|
429
|
+
axisLine: false,
|
|
430
|
+
tickLine: false,
|
|
431
|
+
tick: { fontSize: 12, fill: "#64748b" },
|
|
432
|
+
dy: 8
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
/* @__PURE__ */ jsx(
|
|
436
|
+
YAxis,
|
|
437
|
+
{
|
|
438
|
+
axisLine: false,
|
|
439
|
+
tickLine: false,
|
|
440
|
+
tick: { fontSize: 12, fill: "#64748b" },
|
|
441
|
+
dx: -8
|
|
442
|
+
}
|
|
443
|
+
),
|
|
444
|
+
/* @__PURE__ */ jsx(
|
|
445
|
+
Tooltip,
|
|
446
|
+
{
|
|
447
|
+
contentStyle: {
|
|
448
|
+
borderRadius: "8px",
|
|
449
|
+
border: "1px solid var(--border)",
|
|
450
|
+
backgroundColor: "var(--card)",
|
|
451
|
+
color: "var(--card-foreground)",
|
|
452
|
+
boxShadow: "0 1px 3px 0 rgb(15 23 42 / 0.08)",
|
|
453
|
+
fontSize: "12px"
|
|
454
|
+
},
|
|
455
|
+
cursor: { fill: "var(--muted)" }
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
referenceLine != null && /* @__PURE__ */ jsx(
|
|
459
|
+
ReferenceLine,
|
|
460
|
+
{
|
|
461
|
+
y: referenceLine.value,
|
|
462
|
+
stroke: "#dc2626",
|
|
463
|
+
strokeDasharray: "4 4",
|
|
464
|
+
label: {
|
|
465
|
+
value: referenceLine.label ?? "Target",
|
|
466
|
+
position: "right",
|
|
467
|
+
fontSize: 11,
|
|
468
|
+
fill: "#64748b"
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
valueKeys.map((key, idx) => /* @__PURE__ */ jsx(
|
|
473
|
+
Bar,
|
|
474
|
+
{
|
|
475
|
+
dataKey: key,
|
|
476
|
+
fill: colors[idx % colors.length],
|
|
477
|
+
radius: [4, 4, 0, 0],
|
|
478
|
+
name: key.replace(/([A-Z])/g, " $1").trim()
|
|
479
|
+
},
|
|
480
|
+
key
|
|
481
|
+
))
|
|
482
|
+
]
|
|
483
|
+
}
|
|
484
|
+
) }) });
|
|
485
|
+
}
|
|
486
|
+
var DEFAULT_FILL2 = "#0f172a";
|
|
487
|
+
var SECONDARY_FILL = "#14b8a6";
|
|
488
|
+
function SharedAreaChart({
|
|
489
|
+
data,
|
|
490
|
+
dataKey,
|
|
491
|
+
valueKey,
|
|
492
|
+
title,
|
|
493
|
+
height = 260,
|
|
494
|
+
secondaryValueKey,
|
|
495
|
+
fill = DEFAULT_FILL2
|
|
496
|
+
}) {
|
|
497
|
+
return /* @__PURE__ */ jsx(ChartContainer, { title, height, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(
|
|
498
|
+
AreaChart,
|
|
499
|
+
{
|
|
500
|
+
data,
|
|
501
|
+
margin: { top: 8, right: 8, bottom: 8, left: 8 },
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
504
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: "areaFill", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
505
|
+
/* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: fill, stopOpacity: 0.35 }),
|
|
506
|
+
/* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: fill, stopOpacity: 0 })
|
|
507
|
+
] }),
|
|
508
|
+
secondaryValueKey && /* @__PURE__ */ jsxs("linearGradient", { id: "areaFillSecondary", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
509
|
+
/* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: SECONDARY_FILL, stopOpacity: 0.35 }),
|
|
510
|
+
/* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: SECONDARY_FILL, stopOpacity: 0 })
|
|
511
|
+
] })
|
|
512
|
+
] }),
|
|
513
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false, stroke: "#e2e8f0" }),
|
|
514
|
+
/* @__PURE__ */ jsx(
|
|
515
|
+
XAxis,
|
|
516
|
+
{
|
|
517
|
+
dataKey,
|
|
518
|
+
axisLine: false,
|
|
519
|
+
tickLine: false,
|
|
520
|
+
tick: { fontSize: 12, fill: "#64748b" },
|
|
521
|
+
dy: 8
|
|
522
|
+
}
|
|
523
|
+
),
|
|
524
|
+
/* @__PURE__ */ jsx(
|
|
525
|
+
YAxis,
|
|
526
|
+
{
|
|
527
|
+
axisLine: false,
|
|
528
|
+
tickLine: false,
|
|
529
|
+
tick: { fontSize: 12, fill: "#64748b" },
|
|
530
|
+
dx: -8
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
/* @__PURE__ */ jsx(
|
|
534
|
+
Tooltip,
|
|
535
|
+
{
|
|
536
|
+
contentStyle: {
|
|
537
|
+
borderRadius: "8px",
|
|
538
|
+
border: "1px solid var(--border)",
|
|
539
|
+
backgroundColor: "var(--card)",
|
|
540
|
+
color: "var(--card-foreground)",
|
|
541
|
+
boxShadow: "0 1px 3px 0 rgb(15 23 42 / 0.08)",
|
|
542
|
+
fontSize: "12px"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
),
|
|
546
|
+
secondaryValueKey && /* @__PURE__ */ jsx(
|
|
547
|
+
Area,
|
|
548
|
+
{
|
|
549
|
+
type: "monotone",
|
|
550
|
+
dataKey: secondaryValueKey,
|
|
551
|
+
stroke: SECONDARY_FILL,
|
|
552
|
+
strokeWidth: 2,
|
|
553
|
+
fill: "url(#areaFillSecondary)"
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
/* @__PURE__ */ jsx(
|
|
557
|
+
Area,
|
|
558
|
+
{
|
|
559
|
+
type: "monotone",
|
|
560
|
+
dataKey: valueKey,
|
|
561
|
+
stroke: fill,
|
|
562
|
+
strokeWidth: 2,
|
|
563
|
+
fill: "url(#areaFill)"
|
|
564
|
+
}
|
|
565
|
+
)
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
) }) });
|
|
569
|
+
}
|
|
570
|
+
function formatValue(value, currency = "") {
|
|
571
|
+
const abs = Math.abs(value);
|
|
572
|
+
const sign = value < 0 ? "\u2212" : "";
|
|
573
|
+
if (abs >= 1e6) return `${sign}${currency}${(abs / 1e6).toFixed(1)}M`;
|
|
574
|
+
if (abs >= 1e3) return `${sign}${currency}${(abs / 1e3).toFixed(1)}k`;
|
|
575
|
+
return `${sign}${currency}${abs.toLocaleString()}`;
|
|
576
|
+
}
|
|
577
|
+
function CashflowChart({
|
|
578
|
+
data,
|
|
579
|
+
title,
|
|
580
|
+
height = 260,
|
|
581
|
+
currency = "\xA3"
|
|
582
|
+
}) {
|
|
583
|
+
const series = data.map((d) => ({
|
|
584
|
+
...d,
|
|
585
|
+
net: d.net ?? d.inflow - d.outflow
|
|
586
|
+
}));
|
|
587
|
+
return /* @__PURE__ */ jsx(ChartContainer, { title, height, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(
|
|
588
|
+
AreaChart,
|
|
589
|
+
{
|
|
590
|
+
data: series,
|
|
591
|
+
margin: { top: 8, right: 8, bottom: 8, left: 8 },
|
|
592
|
+
children: [
|
|
593
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "cashflowNet", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
594
|
+
/* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: "#14b8a6", stopOpacity: 0.4 }),
|
|
595
|
+
/* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: "#14b8a6", stopOpacity: 0 })
|
|
596
|
+
] }) }),
|
|
597
|
+
/* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", vertical: false, stroke: "#e2e8f0" }),
|
|
598
|
+
/* @__PURE__ */ jsx(
|
|
599
|
+
XAxis,
|
|
600
|
+
{
|
|
601
|
+
dataKey: "period",
|
|
602
|
+
axisLine: false,
|
|
603
|
+
tickLine: false,
|
|
604
|
+
tick: { fontSize: 12, fill: "#64748b" },
|
|
605
|
+
dy: 8
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
/* @__PURE__ */ jsx(
|
|
609
|
+
YAxis,
|
|
610
|
+
{
|
|
611
|
+
axisLine: false,
|
|
612
|
+
tickLine: false,
|
|
613
|
+
tick: { fontSize: 12, fill: "#64748b" },
|
|
614
|
+
dx: -8,
|
|
615
|
+
tickFormatter: (v) => formatValue(v, currency)
|
|
616
|
+
}
|
|
617
|
+
),
|
|
618
|
+
/* @__PURE__ */ jsx(ReferenceLine, { y: 0, stroke: "#94a3b8", strokeDasharray: "2 2" }),
|
|
619
|
+
/* @__PURE__ */ jsx(
|
|
620
|
+
Tooltip,
|
|
621
|
+
{
|
|
622
|
+
contentStyle: {
|
|
623
|
+
borderRadius: "8px",
|
|
624
|
+
border: "1px solid #e2e8f0",
|
|
625
|
+
boxShadow: "0 1px 3px 0 rgb(15 23 42 / 0.08)",
|
|
626
|
+
fontSize: "12px"
|
|
627
|
+
},
|
|
628
|
+
formatter: (value, name) => [
|
|
629
|
+
formatValue(Number(value), currency),
|
|
630
|
+
name === "inflow" ? "Inflow" : name === "outflow" ? "Outflow" : "Net"
|
|
631
|
+
],
|
|
632
|
+
labelFormatter: (label) => `Period: ${label}`,
|
|
633
|
+
content: ({ active, payload, label }) => {
|
|
634
|
+
if (!active || !payload?.length || !label) return null;
|
|
635
|
+
const row = series.find((d) => d.period === label);
|
|
636
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border bg-card px-3 py-2 text-card-foreground shadow-sm", children: [
|
|
637
|
+
/* @__PURE__ */ jsx("div", { className: "mb-1.5 text-xs font-semibold", children: label }),
|
|
638
|
+
row && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-0.5 text-xs text-muted-foreground", children: [
|
|
639
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
640
|
+
"Inflow: ",
|
|
641
|
+
formatValue(row.inflow, currency)
|
|
642
|
+
] }),
|
|
643
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
644
|
+
"Outflow: ",
|
|
645
|
+
formatValue(row.outflow, currency)
|
|
646
|
+
] }),
|
|
647
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium text-foreground", children: [
|
|
648
|
+
"Net: ",
|
|
649
|
+
formatValue(row.net ?? row.inflow - row.outflow, currency)
|
|
650
|
+
] })
|
|
651
|
+
] })
|
|
652
|
+
] });
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
),
|
|
656
|
+
/* @__PURE__ */ jsx(
|
|
657
|
+
Area,
|
|
658
|
+
{
|
|
659
|
+
type: "monotone",
|
|
660
|
+
dataKey: "net",
|
|
661
|
+
stroke: "#14b8a6",
|
|
662
|
+
strokeWidth: 2,
|
|
663
|
+
fill: "url(#cashflowNet)",
|
|
664
|
+
name: "net"
|
|
665
|
+
}
|
|
666
|
+
)
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
) }) });
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// src/theme/colors.ts
|
|
673
|
+
var cssVarName = {
|
|
674
|
+
background: "--background",
|
|
675
|
+
foreground: "--foreground",
|
|
676
|
+
card: "--card",
|
|
677
|
+
cardForeground: "--card-foreground",
|
|
678
|
+
border: "--border",
|
|
679
|
+
muted: "--muted",
|
|
680
|
+
mutedForeground: "--muted-foreground",
|
|
681
|
+
primary: "--primary",
|
|
682
|
+
primaryForeground: "--primary-foreground",
|
|
683
|
+
destructive: "--destructive",
|
|
684
|
+
accent: "--accent",
|
|
685
|
+
sidebar: "--sidebar",
|
|
686
|
+
sidebarBorder: "--sidebar-border",
|
|
687
|
+
sidebarForeground: "--sidebar-foreground",
|
|
688
|
+
chart1: "--chart-1",
|
|
689
|
+
chart2: "--chart-2",
|
|
690
|
+
chart3: "--chart-3",
|
|
691
|
+
chart4: "--chart-4",
|
|
692
|
+
chart5: "--chart-5"
|
|
693
|
+
};
|
|
694
|
+
function cssVar(token) {
|
|
695
|
+
return `var(${cssVarName[token]})`;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// src/theme/spacing.ts
|
|
699
|
+
var spacing = {
|
|
700
|
+
xs: 4,
|
|
701
|
+
sm: 8,
|
|
702
|
+
md: 12,
|
|
703
|
+
lg: 16,
|
|
704
|
+
xl: 24,
|
|
705
|
+
"2xl": 32
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
// src/theme/typography.ts
|
|
709
|
+
var typography = {
|
|
710
|
+
fontFamily: "'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif",
|
|
711
|
+
sizes: {
|
|
712
|
+
xs: 12,
|
|
713
|
+
sm: 14,
|
|
714
|
+
md: 16,
|
|
715
|
+
lg: 18,
|
|
716
|
+
xl: 20,
|
|
717
|
+
"2xl": 24,
|
|
718
|
+
"3xl": 30
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
// src/theme/shadows.ts
|
|
723
|
+
var shadows = {
|
|
724
|
+
subtle: "0 1px 2px 0 rgb(15 23 42 / 0.04)",
|
|
725
|
+
card: "0 1px 3px 0 rgb(15 23 42 / 0.08)",
|
|
726
|
+
popover: "0 10px 40px rgb(15 23 42 / 0.22)"
|
|
727
|
+
};
|
|
728
|
+
function TaskCard({
|
|
729
|
+
status,
|
|
730
|
+
title,
|
|
731
|
+
description,
|
|
732
|
+
footer,
|
|
733
|
+
actions
|
|
734
|
+
}) {
|
|
735
|
+
const statusLabel = status === "done" ? "Completed" : status === "in-progress" ? "In Progress" : "To Do";
|
|
736
|
+
return /* @__PURE__ */ jsx(
|
|
737
|
+
Surface,
|
|
738
|
+
{
|
|
739
|
+
padding: "none",
|
|
740
|
+
className: "transition-colors hover:border-primary/30",
|
|
741
|
+
children: /* @__PURE__ */ jsxs("div", { className: "px-5 pb-5 pt-5", children: [
|
|
742
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-start justify-between gap-3", children: [
|
|
743
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground", children: statusLabel }),
|
|
744
|
+
actions
|
|
745
|
+
] }),
|
|
746
|
+
/* @__PURE__ */ jsx("h3", { className: "mb-1 text-sm font-semibold leading-snug text-foreground", children: title }),
|
|
747
|
+
description ? /* @__PURE__ */ jsx("p", { className: "mb-4 line-clamp-2 text-xs text-muted-foreground", children: description }) : null,
|
|
748
|
+
footer ? /* @__PURE__ */ jsx("div", { className: "mt-4 border-t border-border pt-4 text-xs text-muted-foreground", children: footer }) : null
|
|
749
|
+
] })
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
function Checklist({ title, items }) {
|
|
754
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", children: [
|
|
755
|
+
title ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between rounded-t-[inherit] border-b border-border bg-muted/50 px-4 py-3", children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: title }) }) : null,
|
|
756
|
+
/* @__PURE__ */ jsx("div", { className: "p-2", children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
757
|
+
"div",
|
|
758
|
+
{
|
|
759
|
+
className: "group flex cursor-pointer items-start gap-3 rounded-md p-3 transition-colors hover:bg-muted/60",
|
|
760
|
+
children: [
|
|
761
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 h-5 w-5 rounded-full border border-border group-hover:border-primary" }),
|
|
762
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
763
|
+
/* @__PURE__ */ jsx(
|
|
764
|
+
"p",
|
|
765
|
+
{
|
|
766
|
+
className: item.status === "done" ? "text-sm font-medium text-muted-foreground line-through" : "text-sm font-medium text-foreground",
|
|
767
|
+
children: item.label
|
|
768
|
+
}
|
|
769
|
+
),
|
|
770
|
+
item.meta ? /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.meta }) : null
|
|
771
|
+
] })
|
|
772
|
+
]
|
|
773
|
+
},
|
|
774
|
+
item.id
|
|
775
|
+
)) })
|
|
776
|
+
] });
|
|
777
|
+
}
|
|
778
|
+
function ProgressTracker({ title, steps }) {
|
|
779
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", children: [
|
|
780
|
+
title ? /* @__PURE__ */ jsx("div", { className: "px-4 pb-2 pt-4", children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: title }) }) : null,
|
|
781
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-6 px-4 pb-6 pt-2", children: /* @__PURE__ */ jsx("div", { className: "relative ml-3 space-y-6 border-l-2 border-border", children: steps.map((step) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6", children: [
|
|
782
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute -left-[9px] top-1 flex h-4 w-4 items-center justify-center rounded-full border-2 border-border bg-card", children: [
|
|
783
|
+
step.state === "complete" ? /* @__PURE__ */ jsx("div", { className: "h-2 w-2 rounded-full bg-primary" }) : null,
|
|
784
|
+
step.state === "current" ? /* @__PURE__ */ jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-primary/80" }) : null
|
|
785
|
+
] }),
|
|
786
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold text-foreground", children: step.title }),
|
|
787
|
+
step.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: step.description }) : null
|
|
788
|
+
] }, step.id)) }) })
|
|
789
|
+
] });
|
|
790
|
+
}
|
|
791
|
+
function AIActionCard({
|
|
792
|
+
title,
|
|
793
|
+
description,
|
|
794
|
+
badge,
|
|
795
|
+
children
|
|
796
|
+
}) {
|
|
797
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "md", className: "overflow-hidden border-primary/20", children: [
|
|
798
|
+
badge ? /* @__PURE__ */ jsx("div", { className: "mb-4 flex items-center gap-2 text-sm font-semibold text-primary", children: badge }) : null,
|
|
799
|
+
/* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-medium text-foreground", children: title }),
|
|
800
|
+
/* @__PURE__ */ jsx("p", { className: "mb-6 max-w-3xl text-muted-foreground", children: description }),
|
|
801
|
+
children ? /* @__PURE__ */ jsx("div", { className: "space-y-4", children }) : null
|
|
802
|
+
] });
|
|
803
|
+
}
|
|
804
|
+
function AIInsightPanel({
|
|
805
|
+
title,
|
|
806
|
+
children,
|
|
807
|
+
headerAccessory
|
|
808
|
+
}) {
|
|
809
|
+
return /* @__PURE__ */ jsxs(
|
|
810
|
+
Surface,
|
|
811
|
+
{
|
|
812
|
+
padding: "md",
|
|
813
|
+
className: "relative overflow-hidden bg-gradient-to-br from-primary/5 via-card to-card",
|
|
814
|
+
children: [
|
|
815
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center justify-between gap-4", children: [
|
|
816
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
817
|
+
headerAccessory
|
|
818
|
+
] }),
|
|
819
|
+
/* @__PURE__ */ jsx("div", { className: "leading-relaxed text-foreground", children })
|
|
820
|
+
]
|
|
821
|
+
}
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
function AIChatPanel({ title, messages, footer, className }) {
|
|
825
|
+
return /* @__PURE__ */ jsxs(
|
|
826
|
+
Surface,
|
|
827
|
+
{
|
|
828
|
+
padding: "none",
|
|
829
|
+
className: cn("flex flex-col", className ?? "h-[400px]"),
|
|
830
|
+
children: [
|
|
831
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-between rounded-t-[inherit] border-b border-border bg-muted/40 p-4", children: /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-foreground", children: title }) }),
|
|
832
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 space-y-4 overflow-y-auto p-4", children: messages.map((message) => /* @__PURE__ */ jsx(
|
|
833
|
+
"div",
|
|
834
|
+
{
|
|
835
|
+
className: message.role === "assistant" ? "flex max-w-[85%] gap-3" : "ml-auto flex max-w-[85%] justify-end gap-3",
|
|
836
|
+
children: /* @__PURE__ */ jsx(
|
|
837
|
+
"div",
|
|
838
|
+
{
|
|
839
|
+
className: message.role === "assistant" ? "rounded-2xl rounded-tl-sm border border-border bg-muted p-3 text-sm text-foreground" : "rounded-2xl rounded-tr-sm bg-primary p-3 text-sm text-primary-foreground",
|
|
840
|
+
children: message.content
|
|
841
|
+
}
|
|
842
|
+
)
|
|
843
|
+
},
|
|
844
|
+
message.id
|
|
845
|
+
)) }),
|
|
846
|
+
footer ? /* @__PURE__ */ jsx("div", { className: "border-t border-border p-4", children: footer }) : null
|
|
847
|
+
]
|
|
848
|
+
}
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
function Input({ className, type, ...props }) {
|
|
852
|
+
return /* @__PURE__ */ jsx(
|
|
853
|
+
"input",
|
|
854
|
+
{
|
|
855
|
+
type,
|
|
856
|
+
"data-slot": "input",
|
|
857
|
+
className: cn(
|
|
858
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
859
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
860
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
861
|
+
className
|
|
862
|
+
),
|
|
863
|
+
...props
|
|
864
|
+
}
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
function Tabs({
|
|
868
|
+
className,
|
|
869
|
+
...props
|
|
870
|
+
}) {
|
|
871
|
+
return /* @__PURE__ */ jsx(
|
|
872
|
+
TabsPrimitive.Root,
|
|
873
|
+
{
|
|
874
|
+
"data-slot": "tabs",
|
|
875
|
+
className: cn("flex flex-col gap-2", className),
|
|
876
|
+
...props
|
|
877
|
+
}
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
function TabsList({
|
|
881
|
+
className,
|
|
882
|
+
...props
|
|
883
|
+
}) {
|
|
884
|
+
return /* @__PURE__ */ jsx(
|
|
885
|
+
TabsPrimitive.List,
|
|
886
|
+
{
|
|
887
|
+
"data-slot": "tabs-list",
|
|
888
|
+
className: cn(
|
|
889
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",
|
|
890
|
+
className
|
|
891
|
+
),
|
|
892
|
+
...props
|
|
893
|
+
}
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
function TabsTrigger({
|
|
897
|
+
className,
|
|
898
|
+
...props
|
|
899
|
+
}) {
|
|
900
|
+
return /* @__PURE__ */ jsx(
|
|
901
|
+
TabsPrimitive.Trigger,
|
|
902
|
+
{
|
|
903
|
+
"data-slot": "tabs-trigger",
|
|
904
|
+
className: cn(
|
|
905
|
+
"data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
906
|
+
className
|
|
907
|
+
),
|
|
908
|
+
...props
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
function TabsContent({
|
|
913
|
+
className,
|
|
914
|
+
...props
|
|
915
|
+
}) {
|
|
916
|
+
return /* @__PURE__ */ jsx(
|
|
917
|
+
TabsPrimitive.Content,
|
|
918
|
+
{
|
|
919
|
+
"data-slot": "tabs-content",
|
|
920
|
+
className: cn("flex-1 outline-none", className),
|
|
921
|
+
...props
|
|
922
|
+
}
|
|
923
|
+
);
|
|
924
|
+
}
|
|
925
|
+
function PageHeader({
|
|
926
|
+
title,
|
|
927
|
+
description,
|
|
928
|
+
actions,
|
|
929
|
+
className
|
|
930
|
+
}) {
|
|
931
|
+
return /* @__PURE__ */ jsxs(
|
|
932
|
+
"header",
|
|
933
|
+
{
|
|
934
|
+
className: cn(
|
|
935
|
+
"flex flex-col gap-4 border-b border-border pb-8 sm:flex-row sm:items-start sm:justify-between",
|
|
936
|
+
className
|
|
937
|
+
),
|
|
938
|
+
children: [
|
|
939
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
940
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-semibold tracking-tight text-foreground", children: title }),
|
|
941
|
+
description ? /* @__PURE__ */ jsx("p", { className: "text-lg text-muted-foreground", children: description }) : null
|
|
942
|
+
] }),
|
|
943
|
+
actions ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: actions }) : null
|
|
944
|
+
]
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
function Section({
|
|
949
|
+
title,
|
|
950
|
+
description,
|
|
951
|
+
children,
|
|
952
|
+
className
|
|
953
|
+
}) {
|
|
954
|
+
return /* @__PURE__ */ jsxs("section", { className: cn("space-y-4", className), children: [
|
|
955
|
+
title || description ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
956
|
+
title ? /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold tracking-tight text-foreground", children: title }) : null,
|
|
957
|
+
description ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null
|
|
958
|
+
] }) : null,
|
|
959
|
+
children
|
|
960
|
+
] });
|
|
961
|
+
}
|
|
962
|
+
function Toolbar({ children, className }) {
|
|
963
|
+
return /* @__PURE__ */ jsx(
|
|
964
|
+
"div",
|
|
965
|
+
{
|
|
966
|
+
className: cn(
|
|
967
|
+
"flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",
|
|
968
|
+
className
|
|
969
|
+
),
|
|
970
|
+
children
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
// src/layout/constants.ts
|
|
976
|
+
var audereShell = {
|
|
977
|
+
/** Sidebar column width (Tailwind `w-64`). */
|
|
978
|
+
sidebarWidthClass: "w-64",
|
|
979
|
+
/** Offset for main column beside fixed sidebar. */
|
|
980
|
+
mainGutterClass: "pl-64",
|
|
981
|
+
/** Max width of primary content well inside the shell. */
|
|
982
|
+
contentMaxWidthClass: "max-w-6xl",
|
|
983
|
+
/** Default padding around the content well. */
|
|
984
|
+
contentPaddingClass: "p-8 lg:p-12",
|
|
985
|
+
/** Full outer shell: page canvas + typography base. */
|
|
986
|
+
pageRootClass: "flex min-h-screen bg-muted/30 font-sans text-foreground antialiased",
|
|
987
|
+
/** Fixed sidebar track (border + background use sidebar tokens). */
|
|
988
|
+
asideTrackClass: "fixed inset-y-0 z-10 flex w-64 flex-shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground",
|
|
989
|
+
/** Sticky-style header strip above content. */
|
|
990
|
+
headerStripClass: "border-b border-border bg-card/80 backdrop-blur"
|
|
991
|
+
};
|
|
992
|
+
function AppLayout({ sidebar, header, children }) {
|
|
993
|
+
return /* @__PURE__ */ jsxs("div", { className: audereShell.pageRootClass, children: [
|
|
994
|
+
/* @__PURE__ */ jsx("aside", { className: audereShell.asideTrackClass, children: sidebar }),
|
|
995
|
+
/* @__PURE__ */ jsxs("main", { className: cn("flex flex-1 flex-col", audereShell.mainGutterClass), children: [
|
|
996
|
+
/* @__PURE__ */ jsx("div", { className: audereShell.headerStripClass, children: header }),
|
|
997
|
+
/* @__PURE__ */ jsx(
|
|
998
|
+
"div",
|
|
999
|
+
{
|
|
1000
|
+
className: cn(
|
|
1001
|
+
"mx-auto flex flex-1",
|
|
1002
|
+
audereShell.contentMaxWidthClass,
|
|
1003
|
+
audereShell.contentPaddingClass
|
|
1004
|
+
),
|
|
1005
|
+
children
|
|
1006
|
+
}
|
|
1007
|
+
)
|
|
1008
|
+
] })
|
|
1009
|
+
] });
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
// src/layout/feeModelerSidebarTokens.ts
|
|
1013
|
+
var feeModelerSidebarTokens = {
|
|
1014
|
+
/** Outer aside: deep navy rail */
|
|
1015
|
+
/** z-40: stay above main content (cards, sticky toolbars) so nav clicks always register */
|
|
1016
|
+
shell: "fixed inset-y-0 z-40 flex w-64 shrink-0 flex-col bg-slate-800 text-white",
|
|
1017
|
+
/** Brand / top block above nav */
|
|
1018
|
+
brandRegion: "border-b border-slate-700 p-5",
|
|
1019
|
+
/** Scrollable nav region (everything above footer) */
|
|
1020
|
+
navScroll: "min-h-0 flex-1 space-y-0.5 overflow-y-auto p-3",
|
|
1021
|
+
/** flex column wrapper: scroll + footer */
|
|
1022
|
+
navRoot: "flex min-h-0 flex-1 flex-col",
|
|
1023
|
+
/** Optional “back” link row */
|
|
1024
|
+
backLink: "mb-2 flex items-center gap-2 rounded-md px-3 py-2 text-xs font-medium text-slate-300 hover:bg-slate-700 hover:text-white",
|
|
1025
|
+
/** Home (primary rail, same size as settings footer link) */
|
|
1026
|
+
primaryRailLink: "flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",
|
|
1027
|
+
primaryRailLinkInactive: "text-slate-300 hover:bg-slate-700 hover:text-white",
|
|
1028
|
+
primaryRailLinkActive: "bg-teal-600 text-white",
|
|
1029
|
+
/** Collapsible section header button */
|
|
1030
|
+
sectionTrigger: "flex w-full items-center justify-between rounded-md px-3 py-2 text-left text-sm font-semibold uppercase tracking-wider text-slate-300 hover:bg-slate-700/60",
|
|
1031
|
+
/** Nested item under a section */
|
|
1032
|
+
nestedLink: "flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px] font-medium leading-snug transition-colors",
|
|
1033
|
+
nestedLinkInactive: "text-slate-400 hover:bg-slate-700 hover:text-white",
|
|
1034
|
+
nestedLinkActive: "bg-teal-600 text-white",
|
|
1035
|
+
nestedIcon: "h-3.5 w-3.5 shrink-0 opacity-90",
|
|
1036
|
+
primaryIcon: "h-4 w-4 shrink-0",
|
|
1037
|
+
sectionChevron: "h-3.5 w-3.5 shrink-0 transition-transform",
|
|
1038
|
+
/** Settings (and similar) pinned footer */
|
|
1039
|
+
footerRegion: "shrink-0 border-t border-slate-700 p-3 pt-2"
|
|
1040
|
+
};
|
|
1041
|
+
function ChevronRight({ open }) {
|
|
1042
|
+
return /* @__PURE__ */ jsx(
|
|
1043
|
+
"svg",
|
|
1044
|
+
{
|
|
1045
|
+
className: cn(feeModelerSidebarTokens.sectionChevron, open && "rotate-90"),
|
|
1046
|
+
viewBox: "0 0 24 24",
|
|
1047
|
+
fill: "none",
|
|
1048
|
+
stroke: "currentColor",
|
|
1049
|
+
strokeWidth: "2",
|
|
1050
|
+
strokeLinecap: "round",
|
|
1051
|
+
strokeLinejoin: "round",
|
|
1052
|
+
"aria-hidden": true,
|
|
1053
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
1054
|
+
}
|
|
1055
|
+
);
|
|
1056
|
+
}
|
|
1057
|
+
function FeeModelerAppSidebar({
|
|
1058
|
+
pathname,
|
|
1059
|
+
navigate,
|
|
1060
|
+
Link: Link2,
|
|
1061
|
+
branding,
|
|
1062
|
+
home,
|
|
1063
|
+
settings,
|
|
1064
|
+
groups,
|
|
1065
|
+
isGroupVisible,
|
|
1066
|
+
backLink,
|
|
1067
|
+
openGroupId,
|
|
1068
|
+
onOpenGroupChange,
|
|
1069
|
+
belowSettings
|
|
1070
|
+
}) {
|
|
1071
|
+
const visibleGroups = isGroupVisible ? groups.filter(isGroupVisible) : groups;
|
|
1072
|
+
const HomeIcon = home.icon;
|
|
1073
|
+
const SettingsIcon = settings.icon;
|
|
1074
|
+
return /* @__PURE__ */ jsxs("aside", { className: feeModelerSidebarTokens.shell, children: [
|
|
1075
|
+
/* @__PURE__ */ jsx("div", { className: feeModelerSidebarTokens.brandRegion, children: branding }),
|
|
1076
|
+
/* @__PURE__ */ jsxs("nav", { className: feeModelerSidebarTokens.navRoot, children: [
|
|
1077
|
+
/* @__PURE__ */ jsxs("div", { className: feeModelerSidebarTokens.navScroll, children: [
|
|
1078
|
+
backLink ? /* @__PURE__ */ jsx(Link2, { to: backLink.to, className: feeModelerSidebarTokens.backLink, children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
1079
|
+
/* @__PURE__ */ jsx(
|
|
1080
|
+
"svg",
|
|
1081
|
+
{
|
|
1082
|
+
className: "h-3 w-3",
|
|
1083
|
+
viewBox: "0 0 24 24",
|
|
1084
|
+
fill: "none",
|
|
1085
|
+
stroke: "currentColor",
|
|
1086
|
+
strokeWidth: "2",
|
|
1087
|
+
"aria-hidden": true,
|
|
1088
|
+
children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
backLink.label
|
|
1092
|
+
] }) }) : null,
|
|
1093
|
+
/* @__PURE__ */ jsxs(
|
|
1094
|
+
Link2,
|
|
1095
|
+
{
|
|
1096
|
+
to: home.path,
|
|
1097
|
+
className: cn(
|
|
1098
|
+
feeModelerSidebarTokens.primaryRailLink,
|
|
1099
|
+
pathname === home.path ? feeModelerSidebarTokens.primaryRailLinkActive : feeModelerSidebarTokens.primaryRailLinkInactive
|
|
1100
|
+
),
|
|
1101
|
+
children: [
|
|
1102
|
+
/* @__PURE__ */ jsx(HomeIcon, { className: feeModelerSidebarTokens.primaryIcon }),
|
|
1103
|
+
home.label
|
|
1104
|
+
]
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
1107
|
+
visibleGroups.map((group) => {
|
|
1108
|
+
const isOpen = openGroupId === group.id;
|
|
1109
|
+
const only = group.items.length === 1 ? group.items[0] : null;
|
|
1110
|
+
if (only) {
|
|
1111
|
+
const isActive = pathname === only.path;
|
|
1112
|
+
const OnlyIcon = only.icon;
|
|
1113
|
+
return /* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx(
|
|
1114
|
+
Link2,
|
|
1115
|
+
{
|
|
1116
|
+
to: only.path,
|
|
1117
|
+
className: cn(
|
|
1118
|
+
feeModelerSidebarTokens.sectionTrigger,
|
|
1119
|
+
"no-underline",
|
|
1120
|
+
isActive ? "bg-teal-600 text-white hover:bg-teal-600" : ""
|
|
1121
|
+
),
|
|
1122
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
1123
|
+
/* @__PURE__ */ jsx(OnlyIcon, { className: feeModelerSidebarTokens.nestedIcon }),
|
|
1124
|
+
/* @__PURE__ */ jsx("span", { children: group.label })
|
|
1125
|
+
] })
|
|
1126
|
+
}
|
|
1127
|
+
) }, group.id);
|
|
1128
|
+
}
|
|
1129
|
+
return /* @__PURE__ */ jsxs("div", { className: "mt-1", children: [
|
|
1130
|
+
/* @__PURE__ */ jsxs(
|
|
1131
|
+
"button",
|
|
1132
|
+
{
|
|
1133
|
+
type: "button",
|
|
1134
|
+
onClick: () => {
|
|
1135
|
+
if (isOpen) {
|
|
1136
|
+
onOpenGroupChange(null);
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
const first = group.items[0];
|
|
1140
|
+
if (first) {
|
|
1141
|
+
if (pathname !== first.path) {
|
|
1142
|
+
navigate(first.path);
|
|
1143
|
+
}
|
|
1144
|
+
onOpenGroupChange(group.id);
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
className: feeModelerSidebarTokens.sectionTrigger,
|
|
1148
|
+
children: [
|
|
1149
|
+
/* @__PURE__ */ jsx("span", { children: group.label }),
|
|
1150
|
+
/* @__PURE__ */ jsx(ChevronRight, { open: isOpen })
|
|
1151
|
+
]
|
|
1152
|
+
}
|
|
1153
|
+
),
|
|
1154
|
+
isOpen && /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: group.items.map((item) => {
|
|
1155
|
+
const isActive = pathname === item.path;
|
|
1156
|
+
const Icon = item.icon;
|
|
1157
|
+
return /* @__PURE__ */ jsxs(
|
|
1158
|
+
Link2,
|
|
1159
|
+
{
|
|
1160
|
+
to: item.path,
|
|
1161
|
+
className: cn(
|
|
1162
|
+
feeModelerSidebarTokens.nestedLink,
|
|
1163
|
+
isActive ? feeModelerSidebarTokens.nestedLinkActive : feeModelerSidebarTokens.nestedLinkInactive
|
|
1164
|
+
),
|
|
1165
|
+
children: [
|
|
1166
|
+
/* @__PURE__ */ jsx(Icon, { className: feeModelerSidebarTokens.nestedIcon }),
|
|
1167
|
+
item.label
|
|
1168
|
+
]
|
|
1169
|
+
},
|
|
1170
|
+
item.path
|
|
1171
|
+
);
|
|
1172
|
+
}) })
|
|
1173
|
+
] }, group.id);
|
|
1174
|
+
})
|
|
1175
|
+
] }),
|
|
1176
|
+
/* @__PURE__ */ jsxs("div", { className: feeModelerSidebarTokens.footerRegion, children: [
|
|
1177
|
+
/* @__PURE__ */ jsxs(
|
|
1178
|
+
Link2,
|
|
1179
|
+
{
|
|
1180
|
+
to: settings.path,
|
|
1181
|
+
className: cn(
|
|
1182
|
+
feeModelerSidebarTokens.primaryRailLink,
|
|
1183
|
+
pathname === settings.path ? feeModelerSidebarTokens.primaryRailLinkActive : feeModelerSidebarTokens.primaryRailLinkInactive
|
|
1184
|
+
),
|
|
1185
|
+
children: [
|
|
1186
|
+
/* @__PURE__ */ jsx(SettingsIcon, { className: feeModelerSidebarTokens.primaryIcon }),
|
|
1187
|
+
settings.label
|
|
1188
|
+
]
|
|
1189
|
+
}
|
|
1190
|
+
),
|
|
1191
|
+
belowSettings ?? null
|
|
1192
|
+
] })
|
|
1193
|
+
] })
|
|
1194
|
+
] });
|
|
1195
|
+
}
|
|
1196
|
+
var PLATFORM_APPS = [
|
|
1197
|
+
{ name: "Audere Hub", path: "/hub", icon: LayoutGrid, iconBg: "bg-slate-700" },
|
|
1198
|
+
{ name: "CoachAI", path: "/coachai", icon: Brain, iconBg: "bg-teal-600" },
|
|
1199
|
+
{ name: "RoleAudit", path: "/roleaudit", icon: CheckSquare, iconBg: "bg-blue-600" },
|
|
1200
|
+
{ name: "FeeModeler", path: "/feemodeler", icon: TrendingUp, iconBg: "bg-indigo-600" },
|
|
1201
|
+
{ name: "Marketos", path: "/marketos", icon: MessageSquare, iconBg: "bg-violet-600" },
|
|
1202
|
+
{ name: "Finsight", path: "/finsight", icon: LayoutGrid, iconBg: "bg-emerald-600" },
|
|
1203
|
+
{ name: "Practice Evolution", path: "/home", icon: Home, iconBg: "bg-slate-600" }
|
|
1204
|
+
];
|
|
1205
|
+
function getCurrentApp(pathname) {
|
|
1206
|
+
if (pathname.startsWith("/hub")) return PLATFORM_APPS[0];
|
|
1207
|
+
if (pathname.startsWith("/marketos")) return PLATFORM_APPS[4];
|
|
1208
|
+
if (pathname.startsWith("/finsight")) return PLATFORM_APPS[5];
|
|
1209
|
+
if (pathname.startsWith("/home")) return PLATFORM_APPS[6];
|
|
1210
|
+
if (pathname.startsWith("/roleaudit")) return PLATFORM_APPS[2];
|
|
1211
|
+
if (pathname.startsWith("/feemodeler")) return PLATFORM_APPS[3];
|
|
1212
|
+
if (pathname.startsWith("/coachai")) return PLATFORM_APPS[1];
|
|
1213
|
+
return PLATFORM_APPS[0];
|
|
1214
|
+
}
|
|
1215
|
+
function cn2(...inputs) {
|
|
1216
|
+
return twMerge(clsx(inputs));
|
|
1217
|
+
}
|
|
1218
|
+
function AppSwitcher({ className }) {
|
|
1219
|
+
const [open, setOpen] = useState(false);
|
|
1220
|
+
const ref = useRef(null);
|
|
1221
|
+
const location = useLocation();
|
|
1222
|
+
const current = getCurrentApp(location.pathname);
|
|
1223
|
+
useEffect(() => {
|
|
1224
|
+
function handleClickOutside(e) {
|
|
1225
|
+
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
1226
|
+
}
|
|
1227
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1228
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1229
|
+
}, []);
|
|
1230
|
+
const CurrentIcon = current.icon;
|
|
1231
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn2("relative", className), children: [
|
|
1232
|
+
/* @__PURE__ */ jsxs(
|
|
1233
|
+
"button",
|
|
1234
|
+
{
|
|
1235
|
+
type: "button",
|
|
1236
|
+
onClick: () => setOpen(!open),
|
|
1237
|
+
className: "flex items-center gap-2 h-9 px-3 rounded-md border border-slate-200 bg-white text-sm font-medium text-slate-800 hover:bg-slate-50 min-w-[140px] justify-between",
|
|
1238
|
+
children: [
|
|
1239
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 truncate", children: [
|
|
1240
|
+
/* @__PURE__ */ jsx("span", { className: cn2("flex h-5 w-5 shrink-0 items-center justify-center rounded text-white", current.iconBg), children: /* @__PURE__ */ jsx(CurrentIcon, { className: "h-3 w-3" }) }),
|
|
1241
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: current.name })
|
|
1242
|
+
] }),
|
|
1243
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: cn2("h-4 w-4 shrink-0 text-slate-400 transition-transform", open && "rotate-180") })
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
),
|
|
1247
|
+
open && /* @__PURE__ */ jsx("div", { className: "absolute left-0 top-full mt-1 w-64 rounded-lg border border-slate-200 bg-white py-1 shadow-lg z-50", children: PLATFORM_APPS.map((app) => {
|
|
1248
|
+
const Icon = app.icon;
|
|
1249
|
+
const isCurrent = app.path === current.path;
|
|
1250
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1251
|
+
/* @__PURE__ */ jsx("span", { className: cn2("flex h-6 w-6 shrink-0 items-center justify-center rounded text-white", app.iconBg), children: /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }) }),
|
|
1252
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: app.name })
|
|
1253
|
+
] });
|
|
1254
|
+
return app.path.startsWith("#") ? /* @__PURE__ */ jsx(
|
|
1255
|
+
"a",
|
|
1256
|
+
{
|
|
1257
|
+
href: app.path,
|
|
1258
|
+
className: cn2(
|
|
1259
|
+
"flex items-center gap-3 px-3 py-2 text-sm rounded-md mx-1 transition-colors",
|
|
1260
|
+
isCurrent ? "bg-teal-50 text-teal-800" : "text-slate-700 hover:bg-slate-50"
|
|
1261
|
+
),
|
|
1262
|
+
children: content
|
|
1263
|
+
},
|
|
1264
|
+
app.name
|
|
1265
|
+
) : /* @__PURE__ */ jsx(
|
|
1266
|
+
Link,
|
|
1267
|
+
{
|
|
1268
|
+
to: app.path,
|
|
1269
|
+
onClick: () => setOpen(false),
|
|
1270
|
+
className: cn2(
|
|
1271
|
+
"flex items-center gap-3 px-3 py-2 text-sm rounded-md mx-1 transition-colors",
|
|
1272
|
+
isCurrent ? "bg-teal-50 text-teal-800" : "text-slate-700 hover:bg-slate-50"
|
|
1273
|
+
),
|
|
1274
|
+
children: content
|
|
1275
|
+
},
|
|
1276
|
+
app.name
|
|
1277
|
+
);
|
|
1278
|
+
}) })
|
|
1279
|
+
] });
|
|
1280
|
+
}
|
|
1281
|
+
function WorkspaceSelector() {
|
|
1282
|
+
return /* @__PURE__ */ jsx("div", { className: "border border-slate-200 rounded-lg w-64 bg-white shadow-sm", children: /* @__PURE__ */ jsxs("button", { className: "flex w-full items-center justify-between px-4 py-3 text-sm font-medium text-slate-900 hover:bg-slate-50 rounded-lg", children: [
|
|
1283
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1284
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded-full bg-slate-100 border border-slate-200 flex items-center justify-center text-xs font-bold text-slate-600", children: "AF" }),
|
|
1285
|
+
/* @__PURE__ */ jsxs("div", { className: "text-left", children: [
|
|
1286
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-slate-900", children: "Acme Financial" }),
|
|
1287
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500", children: "Enterprise Plan" })
|
|
1288
|
+
] })
|
|
1289
|
+
] }),
|
|
1290
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 text-slate-400" })
|
|
1291
|
+
] }) });
|
|
1292
|
+
}
|
|
1293
|
+
function TopNavigation() {
|
|
1294
|
+
return /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-slate-200 bg-white shadow-sm overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex h-16 items-center justify-between border-b border-slate-100 bg-white px-6", children: [
|
|
1295
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-6", children: [
|
|
1296
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsx("span", { className: "text-base font-semibold tracking-tight text-slate-900", children: "Audere Hub" }) }),
|
|
1297
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-px bg-slate-200" }),
|
|
1298
|
+
/* @__PURE__ */ jsxs("button", { className: "flex items-center gap-2 text-sm font-medium text-slate-600 hover:text-slate-900", children: [
|
|
1299
|
+
"Acme Financial ",
|
|
1300
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 text-slate-400" })
|
|
1301
|
+
] })
|
|
1302
|
+
] }),
|
|
1303
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center px-8", children: /* @__PURE__ */ jsxs("div", { className: "group flex h-9 w-full max-w-md items-center gap-2 rounded-md border border-slate-200 bg-slate-50 px-3 text-sm text-slate-500 ring-offset-white transition-colors hover:border-slate-300 focus-within:border-teal-500 focus-within:ring-2 focus-within:ring-teal-500 focus-within:ring-offset-2", children: [
|
|
1304
|
+
/* @__PURE__ */ jsx(Search, { className: "h-4 w-4 shrink-0 text-slate-400" }),
|
|
1305
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 text-left", children: "Search anything..." }),
|
|
1306
|
+
/* @__PURE__ */ jsxs("kbd", { className: "hidden h-5 items-center gap-1 rounded border border-slate-200 bg-white px-1.5 font-mono text-[10px] font-medium text-slate-500 sm:flex", children: [
|
|
1307
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: "\u2318" }),
|
|
1308
|
+
"K"
|
|
1309
|
+
] })
|
|
1310
|
+
] }) }),
|
|
1311
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1312
|
+
/* @__PURE__ */ jsxs("button", { className: "text-slate-400 hover:text-slate-600 relative", children: [
|
|
1313
|
+
/* @__PURE__ */ jsx(Bell, { className: "h-5 w-5" }),
|
|
1314
|
+
/* @__PURE__ */ jsx("span", { className: "absolute top-0 right-0 block h-2 w-2 rounded-full bg-red-500 ring-2 ring-white" })
|
|
1315
|
+
] }),
|
|
1316
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 w-8 rounded-full bg-slate-200 flex items-center justify-center text-xs font-medium text-slate-600 border border-slate-300 cursor-pointer", children: "JS" })
|
|
1317
|
+
] })
|
|
1318
|
+
] }) });
|
|
1319
|
+
}
|
|
1320
|
+
var PLATFORM_ITEMS = [
|
|
1321
|
+
{ name: "Hub", icon: Grid, active: true },
|
|
1322
|
+
{ name: "CoachAI", icon: Brain, active: false },
|
|
1323
|
+
{ name: "RoleAudit", icon: CheckSquare, active: false },
|
|
1324
|
+
{ name: "FeeModeler", icon: LineChart, active: false },
|
|
1325
|
+
{ name: "Marketos", icon: MessageSquare, active: false },
|
|
1326
|
+
{ name: "Finsight", icon: LayoutDashboard, active: false }
|
|
1327
|
+
];
|
|
1328
|
+
function PlatformSidebarMode() {
|
|
1329
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-slate-200 bg-slate-900 p-6 shadow-sm flex flex-col justify-start", children: [
|
|
1330
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-white mb-6", children: "Platform Mode" }),
|
|
1331
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-1 w-56", children: PLATFORM_ITEMS.map((item) => {
|
|
1332
|
+
const Icon = item.icon;
|
|
1333
|
+
return /* @__PURE__ */ jsxs(
|
|
1334
|
+
"div",
|
|
1335
|
+
{
|
|
1336
|
+
className: `flex items-center gap-3 px-3 py-2 rounded-md text-sm cursor-pointer transition-colors ${item.active ? "bg-teal-500/10 text-teal-400 font-medium" : "text-slate-400 hover:bg-slate-800 hover:text-white"}`,
|
|
1337
|
+
children: [
|
|
1338
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
|
|
1339
|
+
item.name
|
|
1340
|
+
]
|
|
1341
|
+
},
|
|
1342
|
+
item.name
|
|
1343
|
+
);
|
|
1344
|
+
}) })
|
|
1345
|
+
] });
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
export { AIActionCard, AIChatPanel, AIInsightPanel, AppLayout, AppSwitcher, Badge, Button, CashflowChart, ChartContainer, Checklist, CrossAppNotificationsFeedV1, CrossAppNotificationsFeedV2, CrossAppNotificationsFeedV3, DataTable, FeeModelerAppSidebar, Input, InsightCard, MetricTile, PageHeader, ProgressTracker, Section, SharedAreaChart, SharedBarChart, SharedPieChart, PlatformSidebarMode as SidebarNavigation, Surface, Tabs, TabsContent, TabsList, TabsTrigger, TaskCard, Toolbar, TopNavigation, WorkspaceSelector, audereShell, badgeVariants, buttonVariants, cssVar, cssVarName, feeModelerSidebarTokens, shadows, spacing, surfaceVariants, typography };
|
|
1349
|
+
//# sourceMappingURL=index.js.map
|
|
1350
|
+
//# sourceMappingURL=index.js.map
|