@medialane/ui 0.57.2 → 0.59.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/components/listing-card.cjs +2 -2
- package/dist/components/listing-card.cjs.map +1 -1
- package/dist/components/listing-card.d.cts +8 -1
- package/dist/components/listing-card.d.ts +8 -1
- package/dist/components/listing-card.js +2 -2
- package/dist/components/listing-card.js.map +1 -1
- package/dist/components/portfolio-header.cjs +101 -0
- package/dist/components/portfolio-header.cjs.map +1 -0
- package/dist/components/portfolio-header.d.cts +32 -0
- package/dist/components/portfolio-header.d.ts +32 -0
- package/dist/components/portfolio-header.js +67 -0
- package/dist/components/portfolio-header.js.map +1 -0
- package/dist/components/portfolio-nav.cjs +128 -0
- package/dist/components/portfolio-nav.cjs.map +1 -0
- package/dist/components/portfolio-nav.d.cts +36 -0
- package/dist/components/portfolio-nav.d.ts +36 -0
- package/dist/components/portfolio-nav.js +94 -0
- package/dist/components/portfolio-nav.js.map +1 -0
- package/dist/components/portfolio-overview.cjs +147 -0
- package/dist/components/portfolio-overview.cjs.map +1 -0
- package/dist/components/portfolio-overview.d.cts +41 -0
- package/dist/components/portfolio-overview.d.ts +41 -0
- package/dist/components/portfolio-overview.js +113 -0
- package/dist/components/portfolio-overview.js.map +1 -0
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/portfolio-subnav.cjs +0 -94
- package/dist/components/portfolio-subnav.cjs.map +0 -1
- package/dist/components/portfolio-subnav.d.cts +0 -27
- package/dist/components/portfolio-subnav.d.ts +0 -27
- package/dist/components/portfolio-subnav.js +0 -60
- package/dist/components/portfolio-subnav.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type PortfolioBadgeVariant = "destructive" | "primary" | "warning";
|
|
4
|
+
interface PortfolioNavChild {
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
/** Optional count badge. `key` indexes `badgeCounts`; `variant` sets color. */
|
|
8
|
+
badge?: {
|
|
9
|
+
key: string;
|
|
10
|
+
variant?: PortfolioBadgeVariant;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface PortfolioNavSection {
|
|
14
|
+
label: string;
|
|
15
|
+
/** Where the top-level tab links. For sections with children this is the first child. */
|
|
16
|
+
href: string;
|
|
17
|
+
/** Inner segments rendered as a pill row when the section is active. */
|
|
18
|
+
children?: PortfolioNavChild[];
|
|
19
|
+
}
|
|
20
|
+
interface PortfolioNavProps {
|
|
21
|
+
sections: PortfolioNavSection[];
|
|
22
|
+
/** Current pathname — caller passes `usePathname()`. */
|
|
23
|
+
pathname: string;
|
|
24
|
+
/** Badge counts keyed by `child.badge.key`. A badge renders only when > 0. */
|
|
25
|
+
badgeCounts?: Record<string, number>;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Two-level portfolio navigation: top-level underline tabs + a segmented pill
|
|
30
|
+
* row when the active section has children. The active section is resolved by
|
|
31
|
+
* the longest href match across section hrefs and child hrefs, so a root
|
|
32
|
+
* "Overview" section (`/portfolio`) doesn't swallow every route.
|
|
33
|
+
*/
|
|
34
|
+
declare function PortfolioNav({ sections, pathname, badgeCounts, className, }: PortfolioNavProps): react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
export { type PortfolioBadgeVariant, PortfolioNav, type PortfolioNavChild, type PortfolioNavProps, type PortfolioNavSection };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type PortfolioBadgeVariant = "destructive" | "primary" | "warning";
|
|
4
|
+
interface PortfolioNavChild {
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
/** Optional count badge. `key` indexes `badgeCounts`; `variant` sets color. */
|
|
8
|
+
badge?: {
|
|
9
|
+
key: string;
|
|
10
|
+
variant?: PortfolioBadgeVariant;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface PortfolioNavSection {
|
|
14
|
+
label: string;
|
|
15
|
+
/** Where the top-level tab links. For sections with children this is the first child. */
|
|
16
|
+
href: string;
|
|
17
|
+
/** Inner segments rendered as a pill row when the section is active. */
|
|
18
|
+
children?: PortfolioNavChild[];
|
|
19
|
+
}
|
|
20
|
+
interface PortfolioNavProps {
|
|
21
|
+
sections: PortfolioNavSection[];
|
|
22
|
+
/** Current pathname — caller passes `usePathname()`. */
|
|
23
|
+
pathname: string;
|
|
24
|
+
/** Badge counts keyed by `child.badge.key`. A badge renders only when > 0. */
|
|
25
|
+
badgeCounts?: Record<string, number>;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Two-level portfolio navigation: top-level underline tabs + a segmented pill
|
|
30
|
+
* row when the active section has children. The active section is resolved by
|
|
31
|
+
* the longest href match across section hrefs and child hrefs, so a root
|
|
32
|
+
* "Overview" section (`/portfolio`) doesn't swallow every route.
|
|
33
|
+
*/
|
|
34
|
+
declare function PortfolioNav({ sections, pathname, badgeCounts, className, }: PortfolioNavProps): react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
export { type PortfolioBadgeVariant, PortfolioNav, type PortfolioNavChild, type PortfolioNavProps, type PortfolioNavSection };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { cn } from "../utils/cn.js";
|
|
5
|
+
const BADGE_VARIANT_CLASS = {
|
|
6
|
+
destructive: "bg-destructive text-destructive-foreground",
|
|
7
|
+
primary: "bg-primary text-primary-foreground",
|
|
8
|
+
warning: "bg-amber-500 text-white"
|
|
9
|
+
};
|
|
10
|
+
function CountBadge({
|
|
11
|
+
count,
|
|
12
|
+
variant
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"span",
|
|
16
|
+
{
|
|
17
|
+
className: cn(
|
|
18
|
+
"h-4 min-w-4 rounded-full text-[10px] font-bold flex items-center justify-center px-1",
|
|
19
|
+
BADGE_VARIANT_CLASS[variant ?? "primary"]
|
|
20
|
+
),
|
|
21
|
+
children: count
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function matches(pathname, href) {
|
|
26
|
+
return pathname === href || pathname.startsWith(href + "/");
|
|
27
|
+
}
|
|
28
|
+
function PortfolioNav({
|
|
29
|
+
sections,
|
|
30
|
+
pathname,
|
|
31
|
+
badgeCounts = {},
|
|
32
|
+
className
|
|
33
|
+
}) {
|
|
34
|
+
const count = (badge) => badge ? badgeCounts[badge.key] ?? 0 : 0;
|
|
35
|
+
let activeSection = null;
|
|
36
|
+
let bestLen = -1;
|
|
37
|
+
for (const section of sections) {
|
|
38
|
+
const hrefs = [section.href, ...(section.children ?? []).map((c) => c.href)];
|
|
39
|
+
for (const href of hrefs) {
|
|
40
|
+
if (matches(pathname, href) && href.length > bestLen) {
|
|
41
|
+
bestLen = href.length;
|
|
42
|
+
activeSection = section;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const edgeBleed = "overflow-x-auto scrollbar-hide -mx-4 px-4 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8";
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
48
|
+
/* @__PURE__ */ jsx("nav", { className: cn(edgeBleed, "border-b border-border/60"), children: /* @__PURE__ */ jsx("div", { className: "flex items-center min-w-max", children: sections.map((section) => {
|
|
49
|
+
const active = section === activeSection;
|
|
50
|
+
const rollup = (section.children ?? []).reduce(
|
|
51
|
+
(sum, child) => sum + count(child.badge),
|
|
52
|
+
0
|
|
53
|
+
);
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
Link,
|
|
56
|
+
{
|
|
57
|
+
href: section.href,
|
|
58
|
+
className: cn(
|
|
59
|
+
"relative flex items-center gap-1.5 px-3 py-2.5 text-sm whitespace-nowrap transition-colors shrink-0 border-b-2 min-h-10",
|
|
60
|
+
active ? "border-primary text-foreground font-medium" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
61
|
+
),
|
|
62
|
+
children: [
|
|
63
|
+
section.label,
|
|
64
|
+
rollup > 0 && !active && /* @__PURE__ */ jsx(CountBadge, { count: rollup, variant: "destructive" })
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
section.href
|
|
68
|
+
);
|
|
69
|
+
}) }) }),
|
|
70
|
+
activeSection?.children && activeSection.children.length > 0 && /* @__PURE__ */ jsx("nav", { className: cn(edgeBleed, "pt-3"), children: /* @__PURE__ */ jsx("div", { className: "flex items-center min-w-max gap-1.5", children: activeSection.children.map((child) => {
|
|
71
|
+
const active = matches(pathname, child.href);
|
|
72
|
+
const childCount = count(child.badge);
|
|
73
|
+
return /* @__PURE__ */ jsxs(
|
|
74
|
+
Link,
|
|
75
|
+
{
|
|
76
|
+
href: child.href,
|
|
77
|
+
className: cn(
|
|
78
|
+
"flex items-center gap-1.5 rounded-full px-3.5 py-1.5 text-[13px] whitespace-nowrap transition-colors shrink-0",
|
|
79
|
+
active ? "bg-primary text-primary-foreground font-medium" : "bg-muted text-muted-foreground hover:text-foreground"
|
|
80
|
+
),
|
|
81
|
+
children: [
|
|
82
|
+
child.label,
|
|
83
|
+
child.badge && childCount > 0 && /* @__PURE__ */ jsx(CountBadge, { count: childCount, variant: child.badge.variant })
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
child.href
|
|
87
|
+
);
|
|
88
|
+
}) }) })
|
|
89
|
+
] });
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
PortfolioNav
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=portfolio-nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport { cn } from \"../utils/cn.js\";\n\nexport type PortfolioBadgeVariant = \"destructive\" | \"primary\" | \"warning\";\n\nexport interface PortfolioNavChild {\n label: string;\n href: string;\n /** Optional count badge. `key` indexes `badgeCounts`; `variant` sets color. */\n badge?: { key: string; variant?: PortfolioBadgeVariant };\n}\n\nexport interface PortfolioNavSection {\n label: string;\n /** Where the top-level tab links. For sections with children this is the first child. */\n href: string;\n /** Inner segments rendered as a pill row when the section is active. */\n children?: PortfolioNavChild[];\n}\n\nexport interface PortfolioNavProps {\n sections: PortfolioNavSection[];\n /** Current pathname — caller passes `usePathname()`. */\n pathname: string;\n /** Badge counts keyed by `child.badge.key`. A badge renders only when > 0. */\n badgeCounts?: Record<string, number>;\n className?: string;\n}\n\nconst BADGE_VARIANT_CLASS: Record<PortfolioBadgeVariant, string> = {\n destructive: \"bg-destructive text-destructive-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n warning: \"bg-amber-500 text-white\",\n};\n\nfunction CountBadge({\n count,\n variant,\n}: {\n count: number;\n variant?: PortfolioBadgeVariant;\n}) {\n return (\n <span\n className={cn(\n \"h-4 min-w-4 rounded-full text-[10px] font-bold flex items-center justify-center px-1\",\n BADGE_VARIANT_CLASS[variant ?? \"primary\"],\n )}\n >\n {count}\n </span>\n );\n}\n\nfunction matches(pathname: string, href: string): boolean {\n return pathname === href || pathname.startsWith(href + \"/\");\n}\n\n/**\n * Two-level portfolio navigation: top-level underline tabs + a segmented pill\n * row when the active section has children. The active section is resolved by\n * the longest href match across section hrefs and child hrefs, so a root\n * \"Overview\" section (`/portfolio`) doesn't swallow every route.\n */\nexport function PortfolioNav({\n sections,\n pathname,\n badgeCounts = {},\n className,\n}: PortfolioNavProps) {\n const count = (badge?: { key: string }) =>\n badge ? (badgeCounts[badge.key] ?? 0) : 0;\n\n // Longest-match resolution of the active section.\n let activeSection: PortfolioNavSection | null = null;\n let bestLen = -1;\n for (const section of sections) {\n const hrefs = [section.href, ...(section.children ?? []).map((c) => c.href)];\n for (const href of hrefs) {\n if (matches(pathname, href) && href.length > bestLen) {\n bestLen = href.length;\n activeSection = section;\n }\n }\n }\n\n const edgeBleed =\n \"overflow-x-auto scrollbar-hide -mx-4 px-4 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8\";\n\n return (\n <div className={className}>\n <nav className={cn(edgeBleed, \"border-b border-border/60\")}>\n <div className=\"flex items-center min-w-max\">\n {sections.map((section) => {\n const active = section === activeSection;\n // Rolled-up pending count across the section's children.\n const rollup = (section.children ?? []).reduce(\n (sum, child) => sum + count(child.badge),\n 0,\n );\n return (\n <Link\n key={section.href}\n href={section.href}\n className={cn(\n \"relative flex items-center gap-1.5 px-3 py-2.5 text-sm whitespace-nowrap transition-colors shrink-0 border-b-2 min-h-10\",\n active\n ? \"border-primary text-foreground font-medium\"\n : \"border-transparent text-muted-foreground hover:text-foreground\",\n )}\n >\n {section.label}\n {rollup > 0 && !active && (\n <CountBadge count={rollup} variant=\"destructive\" />\n )}\n </Link>\n );\n })}\n </div>\n </nav>\n {activeSection?.children && activeSection.children.length > 0 && (\n <nav className={cn(edgeBleed, \"pt-3\")}>\n <div className=\"flex items-center min-w-max gap-1.5\">\n {activeSection.children.map((child) => {\n const active = matches(pathname, child.href);\n const childCount = count(child.badge);\n return (\n <Link\n key={child.href}\n href={child.href}\n className={cn(\n \"flex items-center gap-1.5 rounded-full px-3.5 py-1.5 text-[13px] whitespace-nowrap transition-colors shrink-0\",\n active\n ? \"bg-primary text-primary-foreground font-medium\"\n : \"bg-muted text-muted-foreground hover:text-foreground\",\n )}\n >\n {child.label}\n {child.badge && childCount > 0 && (\n <CountBadge count={childCount} variant={child.badge.variant} />\n )}\n </Link>\n );\n })}\n </div>\n </nav>\n )}\n </div>\n );\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,UAEC,MAAM,QAAQ;AAAA,UACd,WAAW;AAAA,YACT;AAAA,YACA,SACI,+CACA;AAAA,UACN;AAAA,UAEC;AAAA,oBAAQ;AAAA,YACR,SAAS,KAAK,CAAC,UACd,oBAAC,cAAW,OAAO,QAAQ,SAAQ,eAAc;AAAA;AAAA;AAAA,QAX9C,QAAQ;AAAA,MAaf;AAAA,IAEJ,CAAC,GACH,GACF;AAAA,IACC,eAAe,YAAY,cAAc,SAAS,SAAS,KAC1D,oBAAC,SAAI,WAAW,GAAG,WAAW,MAAM,GAClC,8BAAC,SAAI,WAAU,uCACZ,wBAAc,SAAS,IAAI,CAAC,UAAU;AACrC,YAAM,SAAS,QAAQ,UAAU,MAAM,IAAI;AAC3C,YAAM,aAAa,MAAM,MAAM,KAAK;AACpC,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM,MAAM;AAAA,UACZ,WAAW;AAAA,YACT;AAAA,YACA,SACI,mDACA;AAAA,UACN;AAAA,UAEC;AAAA,kBAAM;AAAA,YACN,MAAM,SAAS,aAAa,KAC3B,oBAAC,cAAW,OAAO,YAAY,SAAS,MAAM,MAAM,SAAS;AAAA;AAAA;AAAA,QAX1D,MAAM;AAAA,MAab;AAAA,IAEJ,CAAC,GACH,GACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var portfolio_overview_exports = {};
|
|
31
|
+
__export(portfolio_overview_exports, {
|
|
32
|
+
PortfolioOverview: () => PortfolioOverview
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(portfolio_overview_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
37
|
+
var import_lucide_react = require("lucide-react");
|
|
38
|
+
var import_cn = require("../utils/cn.js");
|
|
39
|
+
var import_stat_tile = require("./stat-tile.js");
|
|
40
|
+
const ATTENTION_DOT = {
|
|
41
|
+
destructive: "bg-destructive",
|
|
42
|
+
warning: "bg-amber-500",
|
|
43
|
+
primary: "bg-primary"
|
|
44
|
+
};
|
|
45
|
+
function SectionHeading({
|
|
46
|
+
title,
|
|
47
|
+
href
|
|
48
|
+
}) {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
51
|
+
href && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
52
|
+
import_link.default,
|
|
53
|
+
{
|
|
54
|
+
href,
|
|
55
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",
|
|
56
|
+
children: [
|
|
57
|
+
"View all",
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-3 w-3" })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
function PortfolioOverview({
|
|
65
|
+
attention,
|
|
66
|
+
stats,
|
|
67
|
+
assetsSlot,
|
|
68
|
+
assetsHref,
|
|
69
|
+
activitySlot,
|
|
70
|
+
activityHref,
|
|
71
|
+
isEmpty,
|
|
72
|
+
emptyState,
|
|
73
|
+
className
|
|
74
|
+
}) {
|
|
75
|
+
const pending = (attention ?? []).filter((item) => item.count > 0);
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("space-y-6", className), children: [
|
|
77
|
+
pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "rounded-xl border border-primary/25 bg-primary/[0.04] p-4 sm:p-5 space-y-3", children: [
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-primary", children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.BellRing, { className: "h-4 w-4" }),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-semibold", children: "Needs your attention" })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-2 sm:grid-cols-2", children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
83
|
+
import_link.default,
|
|
84
|
+
{
|
|
85
|
+
href: item.href,
|
|
86
|
+
className: "flex items-center justify-between gap-3 rounded-lg bg-card border border-border/60 px-3.5 py-2.5 active:opacity-80 hover:border-border transition-colors",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: (0, import_cn.cn)(
|
|
93
|
+
"h-2 w-2 rounded-full shrink-0",
|
|
94
|
+
ATTENTION_DOT[item.tone ?? "primary"]
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "min-w-0", children: [
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block text-sm font-medium text-foreground truncate", children: item.label }),
|
|
100
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block text-xs text-muted-foreground truncate", children: item.description })
|
|
101
|
+
] })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-4 w-4 text-muted-foreground shrink-0" })
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
item.href + item.label
|
|
107
|
+
)) })
|
|
108
|
+
] }),
|
|
109
|
+
stats && stats.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3", children: stats.map(
|
|
110
|
+
(stat) => stat.href ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: stat.href, className: "active:opacity-80", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
111
|
+
import_stat_tile.StatTile,
|
|
112
|
+
{
|
|
113
|
+
label: stat.label,
|
|
114
|
+
value: stat.value ?? "\u2014",
|
|
115
|
+
sub: stat.sub,
|
|
116
|
+
big: true,
|
|
117
|
+
className: "h-full"
|
|
118
|
+
}
|
|
119
|
+
) }, stat.label) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
+
import_stat_tile.StatTile,
|
|
121
|
+
{
|
|
122
|
+
label: stat.label,
|
|
123
|
+
value: stat.value ?? "\u2014",
|
|
124
|
+
sub: stat.sub,
|
|
125
|
+
big: true,
|
|
126
|
+
className: "h-full"
|
|
127
|
+
},
|
|
128
|
+
stat.label
|
|
129
|
+
)
|
|
130
|
+
) }),
|
|
131
|
+
isEmpty ? emptyState : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-6 lg:grid-cols-5", children: [
|
|
132
|
+
assetsSlot && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "lg:col-span-3 space-y-3", children: [
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionHeading, { title: "Your assets", href: assetsHref }),
|
|
134
|
+
assetsSlot
|
|
135
|
+
] }),
|
|
136
|
+
activitySlot && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "lg:col-span-2 space-y-3", children: [
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionHeading, { title: "Recent activity", href: activityHref }),
|
|
138
|
+
activitySlot
|
|
139
|
+
] })
|
|
140
|
+
] })
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
PortfolioOverview
|
|
146
|
+
});
|
|
147
|
+
//# sourceMappingURL=portfolio-overview.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-overview.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport { ArrowRight, BellRing } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { StatTile } from \"./stat-tile.js\";\n\nexport interface PortfolioAttentionItem {\n /** e.g. \"2 offers received\" — caller composes count + label. */\n label: string;\n /** Short helper line, e.g. \"Accept, counter, or decline\". */\n description?: string;\n href: string;\n count: number;\n tone?: \"destructive\" | \"warning\" | \"primary\";\n}\n\nexport interface PortfolioOverviewStat {\n label: string;\n /** Pass null while loading. */\n value: string | number | null;\n sub?: string;\n href?: string;\n}\n\nexport interface PortfolioOverviewProps {\n /** Pending items needing action. The panel renders only when a count > 0. */\n attention?: PortfolioAttentionItem[];\n stats?: PortfolioOverviewStat[];\n /** Recent-assets cards, rendered by the app. */\n assetsSlot?: React.ReactNode;\n assetsHref?: string;\n /** Recent-activity rows, rendered by the app. */\n activitySlot?: React.ReactNode;\n activityHref?: string;\n /** First-run state; rendered instead of the columns when `isEmpty`. */\n isEmpty?: boolean;\n emptyState?: React.ReactNode;\n className?: string;\n}\n\nconst ATTENTION_DOT: Record<\n NonNullable<PortfolioAttentionItem[\"tone\"]>,\n string\n> = {\n destructive: \"bg-destructive\",\n warning: \"bg-amber-500\",\n primary: \"bg-primary\",\n};\n\nfunction SectionHeading({\n title,\n href,\n}: {\n title: string;\n href?: string;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n {href && (\n <Link\n href={href}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors\"\n >\n View all\n <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n </div>\n );\n}\n\n/**\n * Portfolio landing page layout: needs-attention panel, clickable stat tiles,\n * and recent assets/activity columns. Pure presentation — the app injects\n * counts, stats, and rendered cards.\n */\nexport function PortfolioOverview({\n attention,\n stats,\n assetsSlot,\n assetsHref,\n activitySlot,\n activityHref,\n isEmpty,\n emptyState,\n className,\n}: PortfolioOverviewProps) {\n const pending = (attention ?? []).filter((item) => item.count > 0);\n\n return (\n <div className={cn(\"space-y-6\", className)}>\n {pending.length > 0 && (\n <section className=\"rounded-xl border border-primary/25 bg-primary/[0.04] p-4 sm:p-5 space-y-3\">\n <div className=\"flex items-center gap-2 text-primary\">\n <BellRing className=\"h-4 w-4\" />\n <h2 className=\"text-sm font-semibold\">Needs your attention</h2>\n </div>\n <div className=\"grid gap-2 sm:grid-cols-2\">\n {pending.map((item) => (\n <Link\n key={item.href + item.label}\n href={item.href}\n className=\"flex items-center justify-between gap-3 rounded-lg bg-card border border-border/60 px-3.5 py-2.5 active:opacity-80 hover:border-border transition-colors\"\n >\n <span className=\"flex items-center gap-2.5 min-w-0\">\n <span\n className={cn(\n \"h-2 w-2 rounded-full shrink-0\",\n ATTENTION_DOT[item.tone ?? \"primary\"],\n )}\n />\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium text-foreground truncate\">\n {item.label}\n </span>\n {item.description && (\n <span className=\"block text-xs text-muted-foreground truncate\">\n {item.description}\n </span>\n )}\n </span>\n </span>\n <ArrowRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n ))}\n </div>\n </section>\n )}\n\n {stats && stats.length > 0 && (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n {stats.map((stat) =>\n stat.href ? (\n <Link key={stat.label} href={stat.href} className=\"active:opacity-80\">\n <StatTile\n label={stat.label}\n value={stat.value ?? \"—\"}\n sub={stat.sub}\n big\n className=\"h-full\"\n />\n </Link>\n ) : (\n <StatTile\n key={stat.label}\n label={stat.label}\n value={stat.value ?? \"—\"}\n sub={stat.sub}\n big\n className=\"h-full\"\n />\n ),\n )}\n </div>\n )}\n\n {isEmpty ? (\n emptyState\n ) : (\n <div className=\"grid gap-6 lg:grid-cols-5\">\n {assetsSlot && (\n <section className=\"lg:col-span-3 space-y-3\">\n <SectionHeading title=\"Your assets\" href={assetsHref} />\n {assetsSlot}\n </section>\n )}\n {activitySlot && (\n <section className=\"lg:col-span-2 space-y-3\">\n <SectionHeading title=\"Recent activity\" href={activityHref} />\n {activitySlot}\n </section>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2DM;AAzDN,kBAAiB;AACjB,0BAAqC;AACrC,gBAAmB;AACnB,uBAAyB;AAoCzB,MAAM,gBAGF;AAAA,EACF,aAAa;AAAA,EACb,SAAS;AAAA,EACT,SAAS;AACX;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AACF,GAGG;AACD,SACE,6CAAC,SAAI,WAAU,2CACb;AAAA,gDAAC,QAAG,WAAU,yCAAyC,iBAAM;AAAA,IAC5D,QACC;AAAA,MAAC,YAAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QACX;AAAA;AAAA,UAEC,4CAAC,kCAAW,WAAU,WAAU;AAAA;AAAA;AAAA,IAClC;AAAA,KAEJ;AAEJ;AAOO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA2B;AACzB,QAAM,WAAW,aAAa,CAAC,GAAG,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC;AAEjE,SACE,6CAAC,SAAI,eAAW,cAAG,aAAa,SAAS,GACtC;AAAA,YAAQ,SAAS,KAChB,6CAAC,aAAQ,WAAU,8EACjB;AAAA,mDAAC,SAAI,WAAU,wCACb;AAAA,oDAAC,gCAAS,WAAU,WAAU;AAAA,QAC9B,4CAAC,QAAG,WAAU,yBAAwB,kCAAoB;AAAA,SAC5D;AAAA,MACA,4CAAC,SAAI,WAAU,6BACZ,kBAAQ,IAAI,CAAC,SACZ;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UAEC,MAAM,KAAK;AAAA,UAC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3D;AAAA,SACH;AAAA,OAEJ;AAAA,KAEJ;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface PortfolioAttentionItem {
|
|
4
|
+
/** e.g. "2 offers received" — caller composes count + label. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Short helper line, e.g. "Accept, counter, or decline". */
|
|
7
|
+
description?: string;
|
|
8
|
+
href: string;
|
|
9
|
+
count: number;
|
|
10
|
+
tone?: "destructive" | "warning" | "primary";
|
|
11
|
+
}
|
|
12
|
+
interface PortfolioOverviewStat {
|
|
13
|
+
label: string;
|
|
14
|
+
/** Pass null while loading. */
|
|
15
|
+
value: string | number | null;
|
|
16
|
+
sub?: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
}
|
|
19
|
+
interface PortfolioOverviewProps {
|
|
20
|
+
/** Pending items needing action. The panel renders only when a count > 0. */
|
|
21
|
+
attention?: PortfolioAttentionItem[];
|
|
22
|
+
stats?: PortfolioOverviewStat[];
|
|
23
|
+
/** Recent-assets cards, rendered by the app. */
|
|
24
|
+
assetsSlot?: React.ReactNode;
|
|
25
|
+
assetsHref?: string;
|
|
26
|
+
/** Recent-activity rows, rendered by the app. */
|
|
27
|
+
activitySlot?: React.ReactNode;
|
|
28
|
+
activityHref?: string;
|
|
29
|
+
/** First-run state; rendered instead of the columns when `isEmpty`. */
|
|
30
|
+
isEmpty?: boolean;
|
|
31
|
+
emptyState?: React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Portfolio landing page layout: needs-attention panel, clickable stat tiles,
|
|
36
|
+
* and recent assets/activity columns. Pure presentation — the app injects
|
|
37
|
+
* counts, stats, and rendered cards.
|
|
38
|
+
*/
|
|
39
|
+
declare function PortfolioOverview({ attention, stats, assetsSlot, assetsHref, activitySlot, activityHref, isEmpty, emptyState, className, }: PortfolioOverviewProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
|
|
41
|
+
export { type PortfolioAttentionItem, PortfolioOverview, type PortfolioOverviewProps, type PortfolioOverviewStat };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface PortfolioAttentionItem {
|
|
4
|
+
/** e.g. "2 offers received" — caller composes count + label. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Short helper line, e.g. "Accept, counter, or decline". */
|
|
7
|
+
description?: string;
|
|
8
|
+
href: string;
|
|
9
|
+
count: number;
|
|
10
|
+
tone?: "destructive" | "warning" | "primary";
|
|
11
|
+
}
|
|
12
|
+
interface PortfolioOverviewStat {
|
|
13
|
+
label: string;
|
|
14
|
+
/** Pass null while loading. */
|
|
15
|
+
value: string | number | null;
|
|
16
|
+
sub?: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
}
|
|
19
|
+
interface PortfolioOverviewProps {
|
|
20
|
+
/** Pending items needing action. The panel renders only when a count > 0. */
|
|
21
|
+
attention?: PortfolioAttentionItem[];
|
|
22
|
+
stats?: PortfolioOverviewStat[];
|
|
23
|
+
/** Recent-assets cards, rendered by the app. */
|
|
24
|
+
assetsSlot?: React.ReactNode;
|
|
25
|
+
assetsHref?: string;
|
|
26
|
+
/** Recent-activity rows, rendered by the app. */
|
|
27
|
+
activitySlot?: React.ReactNode;
|
|
28
|
+
activityHref?: string;
|
|
29
|
+
/** First-run state; rendered instead of the columns when `isEmpty`. */
|
|
30
|
+
isEmpty?: boolean;
|
|
31
|
+
emptyState?: React.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Portfolio landing page layout: needs-attention panel, clickable stat tiles,
|
|
36
|
+
* and recent assets/activity columns. Pure presentation — the app injects
|
|
37
|
+
* counts, stats, and rendered cards.
|
|
38
|
+
*/
|
|
39
|
+
declare function PortfolioOverview({ attention, stats, assetsSlot, assetsHref, activitySlot, activityHref, isEmpty, emptyState, className, }: PortfolioOverviewProps): react_jsx_runtime.JSX.Element;
|
|
40
|
+
|
|
41
|
+
export { type PortfolioAttentionItem, PortfolioOverview, type PortfolioOverviewProps, type PortfolioOverviewStat };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { ArrowRight, BellRing } from "lucide-react";
|
|
5
|
+
import { cn } from "../utils/cn.js";
|
|
6
|
+
import { StatTile } from "./stat-tile.js";
|
|
7
|
+
const ATTENTION_DOT = {
|
|
8
|
+
destructive: "bg-destructive",
|
|
9
|
+
warning: "bg-amber-500",
|
|
10
|
+
primary: "bg-primary"
|
|
11
|
+
};
|
|
12
|
+
function SectionHeading({
|
|
13
|
+
title,
|
|
14
|
+
href
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
17
|
+
/* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground", children: title }),
|
|
18
|
+
href && /* @__PURE__ */ jsxs(
|
|
19
|
+
Link,
|
|
20
|
+
{
|
|
21
|
+
href,
|
|
22
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",
|
|
23
|
+
children: [
|
|
24
|
+
"View all",
|
|
25
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-3 w-3" })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
function PortfolioOverview({
|
|
32
|
+
attention,
|
|
33
|
+
stats,
|
|
34
|
+
assetsSlot,
|
|
35
|
+
assetsHref,
|
|
36
|
+
activitySlot,
|
|
37
|
+
activityHref,
|
|
38
|
+
isEmpty,
|
|
39
|
+
emptyState,
|
|
40
|
+
className
|
|
41
|
+
}) {
|
|
42
|
+
const pending = (attention ?? []).filter((item) => item.count > 0);
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-6", className), children: [
|
|
44
|
+
pending.length > 0 && /* @__PURE__ */ jsxs("section", { className: "rounded-xl border border-primary/25 bg-primary/[0.04] p-4 sm:p-5 space-y-3", children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-primary", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(BellRing, { className: "h-4 w-4" }),
|
|
47
|
+
/* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold", children: "Needs your attention" })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-2 sm:grid-cols-2", children: pending.map((item) => /* @__PURE__ */ jsxs(
|
|
50
|
+
Link,
|
|
51
|
+
{
|
|
52
|
+
href: item.href,
|
|
53
|
+
className: "flex items-center justify-between gap-3 rounded-lg bg-card border border-border/60 px-3.5 py-2.5 active:opacity-80 hover:border-border transition-colors",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: cn(
|
|
60
|
+
"h-2 w-2 rounded-full shrink-0",
|
|
61
|
+
ATTENTION_DOT[item.tone ?? "primary"]
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
66
|
+
/* @__PURE__ */ jsx("span", { className: "block text-sm font-medium text-foreground truncate", children: item.label }),
|
|
67
|
+
item.description && /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground truncate", children: item.description })
|
|
68
|
+
] })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4 text-muted-foreground shrink-0" })
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
item.href + item.label
|
|
74
|
+
)) })
|
|
75
|
+
] }),
|
|
76
|
+
stats && stats.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3", children: stats.map(
|
|
77
|
+
(stat) => stat.href ? /* @__PURE__ */ jsx(Link, { href: stat.href, className: "active:opacity-80", children: /* @__PURE__ */ jsx(
|
|
78
|
+
StatTile,
|
|
79
|
+
{
|
|
80
|
+
label: stat.label,
|
|
81
|
+
value: stat.value ?? "\u2014",
|
|
82
|
+
sub: stat.sub,
|
|
83
|
+
big: true,
|
|
84
|
+
className: "h-full"
|
|
85
|
+
}
|
|
86
|
+
) }, stat.label) : /* @__PURE__ */ jsx(
|
|
87
|
+
StatTile,
|
|
88
|
+
{
|
|
89
|
+
label: stat.label,
|
|
90
|
+
value: stat.value ?? "\u2014",
|
|
91
|
+
sub: stat.sub,
|
|
92
|
+
big: true,
|
|
93
|
+
className: "h-full"
|
|
94
|
+
},
|
|
95
|
+
stat.label
|
|
96
|
+
)
|
|
97
|
+
) }),
|
|
98
|
+
isEmpty ? emptyState : /* @__PURE__ */ jsxs("div", { className: "grid gap-6 lg:grid-cols-5", children: [
|
|
99
|
+
assetsSlot && /* @__PURE__ */ jsxs("section", { className: "lg:col-span-3 space-y-3", children: [
|
|
100
|
+
/* @__PURE__ */ jsx(SectionHeading, { title: "Your assets", href: assetsHref }),
|
|
101
|
+
assetsSlot
|
|
102
|
+
] }),
|
|
103
|
+
activitySlot && /* @__PURE__ */ jsxs("section", { className: "lg:col-span-2 space-y-3", children: [
|
|
104
|
+
/* @__PURE__ */ jsx(SectionHeading, { title: "Recent activity", href: activityHref }),
|
|
105
|
+
activitySlot
|
|
106
|
+
] })
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
PortfolioOverview
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=portfolio-overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-overview.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"next/link\";\nimport { ArrowRight, BellRing } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { StatTile } from \"./stat-tile.js\";\n\nexport interface PortfolioAttentionItem {\n /** e.g. \"2 offers received\" — caller composes count + label. */\n label: string;\n /** Short helper line, e.g. \"Accept, counter, or decline\". */\n description?: string;\n href: string;\n count: number;\n tone?: \"destructive\" | \"warning\" | \"primary\";\n}\n\nexport interface PortfolioOverviewStat {\n label: string;\n /** Pass null while loading. */\n value: string | number | null;\n sub?: string;\n href?: string;\n}\n\nexport interface PortfolioOverviewProps {\n /** Pending items needing action. The panel renders only when a count > 0. */\n attention?: PortfolioAttentionItem[];\n stats?: PortfolioOverviewStat[];\n /** Recent-assets cards, rendered by the app. */\n assetsSlot?: React.ReactNode;\n assetsHref?: string;\n /** Recent-activity rows, rendered by the app. */\n activitySlot?: React.ReactNode;\n activityHref?: string;\n /** First-run state; rendered instead of the columns when `isEmpty`. */\n isEmpty?: boolean;\n emptyState?: React.ReactNode;\n className?: string;\n}\n\nconst ATTENTION_DOT: Record<\n NonNullable<PortfolioAttentionItem[\"tone\"]>,\n string\n> = {\n destructive: \"bg-destructive\",\n warning: \"bg-amber-500\",\n primary: \"bg-primary\",\n};\n\nfunction SectionHeading({\n title,\n href,\n}: {\n title: string;\n href?: string;\n}) {\n return (\n <div className=\"flex items-center justify-between gap-3\">\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n {href && (\n <Link\n href={href}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors\"\n >\n View all\n <ArrowRight className=\"h-3 w-3\" />\n </Link>\n )}\n </div>\n );\n}\n\n/**\n * Portfolio landing page layout: needs-attention panel, clickable stat tiles,\n * and recent assets/activity columns. Pure presentation — the app injects\n * counts, stats, and rendered cards.\n */\nexport function PortfolioOverview({\n attention,\n stats,\n assetsSlot,\n assetsHref,\n activitySlot,\n activityHref,\n isEmpty,\n emptyState,\n className,\n}: PortfolioOverviewProps) {\n const pending = (attention ?? []).filter((item) => item.count > 0);\n\n return (\n <div className={cn(\"space-y-6\", className)}>\n {pending.length > 0 && (\n <section className=\"rounded-xl border border-primary/25 bg-primary/[0.04] p-4 sm:p-5 space-y-3\">\n <div className=\"flex items-center gap-2 text-primary\">\n <BellRing className=\"h-4 w-4\" />\n <h2 className=\"text-sm font-semibold\">Needs your attention</h2>\n </div>\n <div className=\"grid gap-2 sm:grid-cols-2\">\n {pending.map((item) => (\n <Link\n key={item.href + item.label}\n href={item.href}\n className=\"flex items-center justify-between gap-3 rounded-lg bg-card border border-border/60 px-3.5 py-2.5 active:opacity-80 hover:border-border transition-colors\"\n >\n <span className=\"flex items-center gap-2.5 min-w-0\">\n <span\n className={cn(\n \"h-2 w-2 rounded-full shrink-0\",\n ATTENTION_DOT[item.tone ?? \"primary\"],\n )}\n />\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium text-foreground truncate\">\n {item.label}\n </span>\n {item.description && (\n <span className=\"block text-xs text-muted-foreground truncate\">\n {item.description}\n </span>\n )}\n </span>\n </span>\n <ArrowRight className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n </Link>\n ))}\n </div>\n </section>\n )}\n\n {stats && stats.length > 0 && (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n {stats.map((stat) =>\n stat.href ? (\n <Link key={stat.label} href={stat.href} className=\"active:opacity-80\">\n <StatTile\n label={stat.label}\n value={stat.value ?? \"—\"}\n sub={stat.sub}\n big\n className=\"h-full\"\n />\n </Link>\n ) : (\n <StatTile\n key={stat.label}\n label={stat.label}\n value={stat.value ?? \"—\"}\n sub={stat.sub}\n big\n className=\"h-full\"\n />\n ),\n )}\n </div>\n )}\n\n {isEmpty ? (\n emptyState\n ) : (\n <div className=\"grid gap-6 lg:grid-cols-5\">\n {assetsSlot && (\n <section className=\"lg:col-span-3 space-y-3\">\n <SectionHeading title=\"Your assets\" href={assetsHref} />\n {assetsSlot}\n </section>\n )}\n {activitySlot && (\n <section className=\"lg:col-span-2 space-y-3\">\n <SectionHeading title=\"Recent activity\" href={activityHref} />\n {activitySlot}\n </section>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";AA2DM,cAEE,YAFF;AAzDN,OAAO,UAAU;AACjB,SAAS,YAAY,gBAAgB;AACrC,SAAS,UAAU;AACnB,SAAS,gBAAgB;AAoCzB,MAAM,gBAGF;AAAA,EACF,aAAa;AAAA,EACb,SAAS;AAAA,EACT,SAAS;AACX;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AACF,GAGG;AACD,SACE,qBAAC,SAAI,WAAU,2CACb;AAAA,wBAAC,QAAG,WAAU,yCAAyC,iBAAM;AAAA,IAC5D,QACC;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QACX;AAAA;AAAA,UAEC,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,IAClC;AAAA,KAEJ;AAEJ;AAOO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA2B;AACzB,QAAM,WAAW,aAAa,CAAC,GAAG,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC;AAEjE,SACE,qBAAC,SAAI,WAAW,GAAG,aAAa,SAAS,GACtC;AAAA,YAAQ,SAAS,KAChB,qBAAC,aAAQ,WAAU,8EACjB;AAAA,2BAAC,SAAI,WAAU,wCACb;AAAA,4BAAC,YAAS,WAAU,WAAU;AAAA,QAC9B,oBAAC,QAAG,WAAU,yBAAwB,kCAAoB;AAAA,SAC5D;AAAA,MACA,oBAAC,SAAI,WAAU,6BACZ,kBAAQ,IAAI,CAAC,SACZ;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM,KAAK;AAAA,UACX,WA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,OAEJ;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -100,7 +100,9 @@ __export(index_exports, {
|
|
|
100
100
|
NavCommandMenu: () => import_nav_command_menu.NavCommandMenu,
|
|
101
101
|
PageContainer: () => import_page_container.PageContainer,
|
|
102
102
|
ParentAttributionBanner: () => import_parent_attribution_banner.ParentAttributionBanner,
|
|
103
|
-
|
|
103
|
+
PortfolioHeader: () => import_portfolio_header.PortfolioHeader,
|
|
104
|
+
PortfolioNav: () => import_portfolio_nav.PortfolioNav,
|
|
105
|
+
PortfolioOverview: () => import_portfolio_overview.PortfolioOverview,
|
|
104
106
|
SERVICE_HUES: () => import_launchpad_services.SERVICE_HUES,
|
|
105
107
|
SOCIAL_PLATFORM_META: () => import_ip_templates.SOCIAL_PLATFORM_META,
|
|
106
108
|
SPRING: () => import_motion_primitives.SPRING,
|
|
@@ -191,7 +193,9 @@ var import_launchpad_filter_bar = require("./components/launchpad-filter-bar.js"
|
|
|
191
193
|
var import_launchpad_strip = require("./components/launchpad-strip.js");
|
|
192
194
|
var import_launchpad_services2 = require("./data/launchpad-services.js");
|
|
193
195
|
var import_nav_command_menu = require("./components/nav-command-menu.js");
|
|
194
|
-
var
|
|
196
|
+
var import_portfolio_nav = require("./components/portfolio-nav.js");
|
|
197
|
+
var import_portfolio_header = require("./components/portfolio-header.js");
|
|
198
|
+
var import_portfolio_overview = require("./components/portfolio-overview.js");
|
|
195
199
|
var import_portfolio_counts = require("./utils/portfolio-counts.js");
|
|
196
200
|
var import_service_header = require("./components/service-header.js");
|
|
197
201
|
var import_claim_rail = require("./components/claim-rail.js");
|
|
@@ -296,7 +300,9 @@ var import_action_dialog = require("./components/action-dialog.js");
|
|
|
296
300
|
NavCommandMenu,
|
|
297
301
|
PageContainer,
|
|
298
302
|
ParentAttributionBanner,
|
|
299
|
-
|
|
303
|
+
PortfolioHeader,
|
|
304
|
+
PortfolioNav,
|
|
305
|
+
PortfolioOverview,
|
|
300
306
|
SERVICE_HUES,
|
|
301
307
|
SOCIAL_PLATFORM_META,
|
|
302
308
|
SPRING,
|