@loafmarkets/ui 0.0.6 → 0.0.8
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/index.d.mts +22 -16
- package/dist/index.d.ts +22 -16
- package/dist/index.js +510 -286
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +511 -287
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { cva } from 'class-variance-authority';
|
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import {
|
|
7
|
+
import { Newspaper, BedDouble, Bath, CarFront } from 'lucide-react';
|
|
8
8
|
import { createChart } from 'lightweight-charts';
|
|
9
9
|
|
|
10
10
|
// src/components/button.tsx
|
|
@@ -146,8 +146,8 @@ var PortfolioSummary = React5.forwardRef(
|
|
|
146
146
|
onResetAccount,
|
|
147
147
|
positionsHeading = "Current Positions",
|
|
148
148
|
emptyPositionsText = "No positions yet. Start trading to build your portfolio!",
|
|
149
|
-
formatCurrency = defaultFormatCurrency,
|
|
150
|
-
formatPercent = defaultFormatPercent,
|
|
149
|
+
formatCurrency: formatCurrency2 = defaultFormatCurrency,
|
|
150
|
+
formatPercent: formatPercent2 = defaultFormatPercent,
|
|
151
151
|
formatSignedCurrency = defaultFormatSignedCurrency,
|
|
152
152
|
className,
|
|
153
153
|
children,
|
|
@@ -184,15 +184,15 @@ var PortfolioSummary = React5.forwardRef(
|
|
|
184
184
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
185
185
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
186
186
|
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Available Cash" }),
|
|
187
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children:
|
|
187
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children: formatCurrency2(availableCash) })
|
|
188
188
|
] }),
|
|
189
189
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
190
190
|
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Portfolio Value" }),
|
|
191
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children:
|
|
191
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-[1.25rem] font-semibold text-white", children: formatCurrency2(portfolioValue) })
|
|
192
192
|
] }),
|
|
193
193
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
194
194
|
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Total Return" }),
|
|
195
|
-
/* @__PURE__ */ jsx("p", { className: cn("mt-1 text-[1.25rem] font-semibold", totalReturnClassName), children:
|
|
195
|
+
/* @__PURE__ */ jsx("p", { className: cn("mt-1 text-[1.25rem] font-semibold", totalReturnClassName), children: formatPercent2(totalReturnPercent) })
|
|
196
196
|
] }),
|
|
197
197
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
198
198
|
/* @__PURE__ */ jsx("p", { className: "text-xs uppercase tracking-[0.5px] text-white/50", children: "Unrealized P&L" }),
|
|
@@ -819,6 +819,9 @@ function DepthRow({
|
|
|
819
819
|
] });
|
|
820
820
|
}
|
|
821
821
|
var clamp2 = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
822
|
+
var LEVEL_ROWS_VISIBLE = 6;
|
|
823
|
+
var DEPTH_ROW_HEIGHT_PX = 34;
|
|
824
|
+
var SECTION_HEIGHT = LEVEL_ROWS_VISIBLE * DEPTH_ROW_HEIGHT_PX;
|
|
822
825
|
var Orderbook = React5.forwardRef(
|
|
823
826
|
({
|
|
824
827
|
asks,
|
|
@@ -959,18 +962,25 @@ var Orderbook = React5.forwardRef(
|
|
|
959
962
|
] }, `${trade.type}-${trade.price}-${trade.amount}-${trade.time ?? i}`)) })
|
|
960
963
|
}
|
|
961
964
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
962
|
-
/* @__PURE__ */ jsx(
|
|
963
|
-
|
|
965
|
+
/* @__PURE__ */ jsx(
|
|
966
|
+
"div",
|
|
964
967
|
{
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
968
|
+
className: "divide-y divide-white/5 overflow-y-auto",
|
|
969
|
+
style: { height: `${SECTION_HEIGHT}px`, scrollbarGutter: "stable" },
|
|
970
|
+
children: asks.map((l, idx) => /* @__PURE__ */ jsx(
|
|
971
|
+
DepthRow,
|
|
972
|
+
{
|
|
973
|
+
side: "ask",
|
|
974
|
+
price: l.price,
|
|
975
|
+
amount: l.amount,
|
|
976
|
+
depthPct: (l.depth ?? l.amount) / maxAskDepth * 100,
|
|
977
|
+
precision,
|
|
978
|
+
amountPrecision
|
|
979
|
+
},
|
|
980
|
+
`ask-${idx}-${l.price}-${l.amount}`
|
|
981
|
+
))
|
|
982
|
+
}
|
|
983
|
+
),
|
|
974
984
|
/* @__PURE__ */ jsxs("div", { className: "mt-2 grid grid-cols-2 items-center gap-3 bg-[#0b1a24] px-3 py-2", children: [
|
|
975
985
|
/* @__PURE__ */ jsxs("div", { className: cn("text-lg font-semibold tabular-nums", midClass), children: [
|
|
976
986
|
"$",
|
|
@@ -983,18 +993,25 @@ var Orderbook = React5.forwardRef(
|
|
|
983
993
|
] }),
|
|
984
994
|
/* @__PURE__ */ jsx("div", {})
|
|
985
995
|
] }),
|
|
986
|
-
/* @__PURE__ */ jsx(
|
|
987
|
-
|
|
996
|
+
/* @__PURE__ */ jsx(
|
|
997
|
+
"div",
|
|
988
998
|
{
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
999
|
+
className: "divide-y divide-white/5 overflow-y-auto",
|
|
1000
|
+
style: { height: `${SECTION_HEIGHT}px`, scrollbarGutter: "stable" },
|
|
1001
|
+
children: bids.map((l, idx) => /* @__PURE__ */ jsx(
|
|
1002
|
+
DepthRow,
|
|
1003
|
+
{
|
|
1004
|
+
side: "bid",
|
|
1005
|
+
price: l.price,
|
|
1006
|
+
amount: l.amount,
|
|
1007
|
+
depthPct: (l.depth ?? l.amount) / maxBidDepth * 100,
|
|
1008
|
+
precision,
|
|
1009
|
+
amountPrecision
|
|
1010
|
+
},
|
|
1011
|
+
`bid-${idx}-${l.price}-${l.amount}`
|
|
1012
|
+
))
|
|
1013
|
+
}
|
|
1014
|
+
)
|
|
998
1015
|
] })
|
|
999
1016
|
] })
|
|
1000
1017
|
]
|
|
@@ -1096,132 +1113,208 @@ var PropertyTour = React5.forwardRef(
|
|
|
1096
1113
|
}
|
|
1097
1114
|
);
|
|
1098
1115
|
PropertyTour.displayName = "PropertyTour";
|
|
1099
|
-
var
|
|
1116
|
+
var ITEMS_PER_PAGE = 4;
|
|
1117
|
+
var ROW_HEIGHT_PX = 86;
|
|
1118
|
+
var ensureAnimationsInjected = () => {
|
|
1119
|
+
if (typeof document === "undefined") return;
|
|
1120
|
+
if (document.getElementById("property-news-updates-animations")) return;
|
|
1121
|
+
const style = document.createElement("style");
|
|
1122
|
+
style.id = "property-news-updates-animations";
|
|
1123
|
+
style.textContent = `
|
|
1124
|
+
@keyframes propertyNewsPulse {
|
|
1125
|
+
0% { opacity: 0.6; transform: scale(0.9); }
|
|
1126
|
+
50% { opacity: 1; transform: scale(1); }
|
|
1127
|
+
100% { opacity: 0.6; transform: scale(0.9); }
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
@keyframes propertyNewsSlideIn {
|
|
1131
|
+
from { transform: translateY(-6px); opacity: 0; }
|
|
1132
|
+
to { transform: translateY(0); opacity: 1; }
|
|
1133
|
+
}
|
|
1134
|
+
`;
|
|
1135
|
+
document.head.appendChild(style);
|
|
1136
|
+
};
|
|
1137
|
+
var categoryStyles = {
|
|
1100
1138
|
property: {
|
|
1101
1139
|
label: "Property Update",
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
pillColor: "#f8d12f",
|
|
1106
|
-
icon: Building2
|
|
1140
|
+
backgroundColor: "rgba(14, 203, 129, 0.15)",
|
|
1141
|
+
borderColor: "rgba(14, 203, 129, 0.45)",
|
|
1142
|
+
color: "#0ecb81"
|
|
1107
1143
|
},
|
|
1108
1144
|
market: {
|
|
1109
|
-
label: "Market
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
pillColor: "#0ecb81",
|
|
1114
|
-
icon: LineChart
|
|
1115
|
-
},
|
|
1116
|
-
portfolio: {
|
|
1117
|
-
label: "Portfolio Signal",
|
|
1118
|
-
accent: "#6c8cff",
|
|
1119
|
-
pillBg: "rgba(108, 140, 255, 0.12)",
|
|
1120
|
-
pillBorder: "rgba(108, 140, 255, 0.45)",
|
|
1121
|
-
pillColor: "#c9d5ff",
|
|
1122
|
-
icon: Sparkles
|
|
1145
|
+
label: "Market News",
|
|
1146
|
+
backgroundColor: "rgba(248, 209, 47, 0.15)",
|
|
1147
|
+
borderColor: "rgba(248, 209, 47, 0.45)",
|
|
1148
|
+
color: "#f8d12f"
|
|
1123
1149
|
}
|
|
1124
1150
|
};
|
|
1125
|
-
var getTypeMeta = (type) => {
|
|
1126
|
-
if (!type) return TYPE_META.property;
|
|
1127
|
-
const key = type;
|
|
1128
|
-
if (key in TYPE_META) return TYPE_META[key];
|
|
1129
|
-
return {
|
|
1130
|
-
label: type.toString(),
|
|
1131
|
-
accent: "#f5f5f5",
|
|
1132
|
-
pillBg: "rgba(255,255,255,0.08)",
|
|
1133
|
-
pillBorder: "rgba(255,255,255,0.25)",
|
|
1134
|
-
pillColor: "#ffffff",
|
|
1135
|
-
icon: Newspaper
|
|
1136
|
-
};
|
|
1137
|
-
};
|
|
1138
1151
|
var formatDate = (value) => {
|
|
1139
|
-
|
|
1140
|
-
if (Number.isNaN(
|
|
1141
|
-
return
|
|
1152
|
+
if (typeof value === "string") return value;
|
|
1153
|
+
if (!(value instanceof Date) || Number.isNaN(value.getTime())) return "";
|
|
1154
|
+
return value.toLocaleDateString(void 0, {
|
|
1142
1155
|
month: "short",
|
|
1143
1156
|
day: "numeric",
|
|
1144
1157
|
year: "numeric"
|
|
1145
1158
|
});
|
|
1146
1159
|
};
|
|
1147
1160
|
var PropertyNewsUpdates = React5.forwardRef(
|
|
1148
|
-
({
|
|
1161
|
+
({
|
|
1162
|
+
className,
|
|
1163
|
+
heading = "Property News & Headlines",
|
|
1164
|
+
subheading,
|
|
1165
|
+
items,
|
|
1166
|
+
emptyState,
|
|
1167
|
+
highlightFirst = true,
|
|
1168
|
+
...props
|
|
1169
|
+
}, ref) => {
|
|
1170
|
+
const [page, setPage] = React5.useState(0);
|
|
1171
|
+
React5.useEffect(() => {
|
|
1172
|
+
ensureAnimationsInjected();
|
|
1173
|
+
}, []);
|
|
1149
1174
|
const hasItems = Array.isArray(items) && items.length > 0;
|
|
1175
|
+
const totalPages = React5.useMemo(() => hasItems ? Math.max(1, Math.ceil(items.length / ITEMS_PER_PAGE)) : 1, [hasItems, items.length]);
|
|
1176
|
+
React5.useEffect(() => {
|
|
1177
|
+
setPage((prev) => Math.min(prev, totalPages - 1));
|
|
1178
|
+
}, [totalPages]);
|
|
1179
|
+
const paginatedItems = hasItems ? items.slice(page * ITEMS_PER_PAGE, page * ITEMS_PER_PAGE + ITEMS_PER_PAGE) : [];
|
|
1150
1180
|
return /* @__PURE__ */ jsxs(
|
|
1151
1181
|
"div",
|
|
1152
1182
|
{
|
|
1153
1183
|
ref,
|
|
1154
1184
|
className: cn(
|
|
1155
|
-
"w-full max-w-[
|
|
1185
|
+
"w-full max-w-[840px] rounded-2xl border border-white/10 bg-[#0b0e10] p-5 text-white shadow-[0_20px_40px_rgba(0,0,0,0.35)]",
|
|
1156
1186
|
className
|
|
1157
1187
|
),
|
|
1158
1188
|
...props,
|
|
1159
1189
|
children: [
|
|
1160
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
const Icon = meta.icon;
|
|
1167
|
-
const key = item.id ?? `${item.title}-${index}`;
|
|
1168
|
-
const content = /* @__PURE__ */ jsxs(
|
|
1190
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1191
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1192
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold text-white", children: heading }),
|
|
1193
|
+
subheading ? /* @__PURE__ */ jsx("p", { className: "text-sm text-white/60", children: subheading }) : null
|
|
1194
|
+
] }),
|
|
1195
|
+
/* @__PURE__ */ jsxs(
|
|
1169
1196
|
"div",
|
|
1170
1197
|
{
|
|
1171
|
-
className: "
|
|
1198
|
+
className: "inline-flex items-center font-semibold uppercase text-emerald-300",
|
|
1199
|
+
style: { gap: "0.35rem", fontSize: "0.8rem", letterSpacing: "0.15em" },
|
|
1172
1200
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
{
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" })
|
|
1184
|
-
}
|
|
1185
|
-
),
|
|
1186
|
-
index !== items.length - 1 ? /* @__PURE__ */ jsx("div", { className: "mt-2 h-full w-px flex-1 bg-white/10" }) : null
|
|
1187
|
-
] }),
|
|
1188
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col", children: [
|
|
1189
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
1190
|
-
/* @__PURE__ */ jsx("span", { className: "text-[0.7rem] font-semibold uppercase tracking-[0.3em]", style: { color: meta.accent }, children: meta.label }),
|
|
1191
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center text-xs text-white/60", children: [
|
|
1192
|
-
/* @__PURE__ */ jsx(CalendarDays, { className: "mr-1 h-3.5 w-3.5" }),
|
|
1193
|
-
formatDate(item.date)
|
|
1194
|
-
] })
|
|
1195
|
-
] }),
|
|
1196
|
-
/* @__PURE__ */ jsx("p", { className: "mt-2 text-base font-semibold leading-snug", children: item.title }),
|
|
1197
|
-
item.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-white/65", children: item.description }) : null,
|
|
1198
|
-
(item.href || item.onAction) && item.actionLabel ? /* @__PURE__ */ jsxs(
|
|
1199
|
-
"button",
|
|
1200
|
-
{
|
|
1201
|
-
type: "button",
|
|
1202
|
-
className: "group mt-3 inline-flex items-center gap-1 text-sm font-semibold text-white transition hover:text-white/80",
|
|
1203
|
-
onClick: () => {
|
|
1204
|
-
if (item.href) {
|
|
1205
|
-
window?.open?.(item.href, "_blank", "noopener,noreferrer");
|
|
1206
|
-
}
|
|
1207
|
-
item.onAction?.(item);
|
|
1208
|
-
},
|
|
1209
|
-
children: [
|
|
1210
|
-
item.actionLabel,
|
|
1211
|
-
/* @__PURE__ */ jsx(ArrowUpRight, { className: "h-4 w-4 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5" })
|
|
1212
|
-
]
|
|
1201
|
+
/* @__PURE__ */ jsx(
|
|
1202
|
+
"span",
|
|
1203
|
+
{
|
|
1204
|
+
style: {
|
|
1205
|
+
display: "inline-block",
|
|
1206
|
+
width: "6px",
|
|
1207
|
+
height: "6px",
|
|
1208
|
+
borderRadius: "50%",
|
|
1209
|
+
backgroundColor: "#34d399",
|
|
1210
|
+
animation: "propertyNewsPulse 2s infinite"
|
|
1213
1211
|
}
|
|
1214
|
-
|
|
1215
|
-
|
|
1212
|
+
}
|
|
1213
|
+
),
|
|
1214
|
+
"LIVE"
|
|
1216
1215
|
]
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1216
|
+
}
|
|
1217
|
+
)
|
|
1218
|
+
] }),
|
|
1219
|
+
/* @__PURE__ */ jsx(
|
|
1220
|
+
"div",
|
|
1221
|
+
{
|
|
1222
|
+
className: "mt-4 flex flex-col gap-3",
|
|
1223
|
+
style: { minHeight: `${ITEMS_PER_PAGE * ROW_HEIGHT_PX}px` },
|
|
1224
|
+
children: hasItems ? paginatedItems.map((item, index) => {
|
|
1225
|
+
const absoluteIndex = page * ITEMS_PER_PAGE + index;
|
|
1226
|
+
const key = item.displayId ?? item.id ?? `${item.title}-${absoluteIndex}`;
|
|
1227
|
+
const styles = categoryStyles[item.type] ?? categoryStyles.market;
|
|
1228
|
+
const dateLabel = item.isNew ?? (highlightFirst && absoluteIndex === 0) ? "Just now" : typeof item.date === "string" && item.date.trim().length > 0 ? item.date : formatDate(item.date);
|
|
1229
|
+
const isHighlighted = item.isNew ?? (highlightFirst && absoluteIndex === 0);
|
|
1230
|
+
return /* @__PURE__ */ jsxs(
|
|
1231
|
+
"div",
|
|
1232
|
+
{
|
|
1233
|
+
style: {
|
|
1234
|
+
padding: "0.75rem",
|
|
1235
|
+
borderRadius: "6px",
|
|
1236
|
+
backgroundColor: isHighlighted ? "rgba(14, 203, 129, 0.1)" : "transparent",
|
|
1237
|
+
border: "1px solid transparent",
|
|
1238
|
+
transition: "background-color 0.2s",
|
|
1239
|
+
animation: item.isNew ? "propertyNewsSlideIn 0.5s ease-out" : void 0
|
|
1240
|
+
},
|
|
1241
|
+
children: [
|
|
1242
|
+
/* @__PURE__ */ jsx("p", { style: { fontSize: "0.9375rem", fontWeight: 500, marginBottom: "0.35rem" }, children: item.title }),
|
|
1243
|
+
/* @__PURE__ */ jsxs(
|
|
1244
|
+
"div",
|
|
1245
|
+
{
|
|
1246
|
+
style: {
|
|
1247
|
+
display: "flex",
|
|
1248
|
+
justifyContent: "space-between",
|
|
1249
|
+
alignItems: "center",
|
|
1250
|
+
fontSize: "0.75rem",
|
|
1251
|
+
color: "#b5b8c5"
|
|
1252
|
+
},
|
|
1253
|
+
children: [
|
|
1254
|
+
/* @__PURE__ */ jsx("span", { style: { color: isHighlighted ? "#0ecb81" : "inherit" }, children: dateLabel }),
|
|
1255
|
+
/* @__PURE__ */ jsx(
|
|
1256
|
+
"span",
|
|
1257
|
+
{
|
|
1258
|
+
style: {
|
|
1259
|
+
padding: "0.25rem 0.6rem",
|
|
1260
|
+
borderRadius: "4px",
|
|
1261
|
+
border: `1px solid ${styles.borderColor}`,
|
|
1262
|
+
backgroundColor: styles.backgroundColor,
|
|
1263
|
+
color: styles.color,
|
|
1264
|
+
fontSize: "0.68rem",
|
|
1265
|
+
fontWeight: 600,
|
|
1266
|
+
textTransform: "uppercase"
|
|
1267
|
+
},
|
|
1268
|
+
children: item.type === "property" ? styles.label : "Market News"
|
|
1269
|
+
}
|
|
1270
|
+
)
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
)
|
|
1274
|
+
]
|
|
1275
|
+
},
|
|
1276
|
+
key
|
|
1277
|
+
);
|
|
1278
|
+
}) : emptyState ?? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/20 px-6 py-10 text-center text-sm text-white/60", children: [
|
|
1279
|
+
/* @__PURE__ */ jsx(Newspaper, { className: "mb-3 h-8 w-8 text-white/40" }),
|
|
1280
|
+
"No property news yet. Updates will land here as soon as we receive new intelligence."
|
|
1281
|
+
] })
|
|
1282
|
+
}
|
|
1283
|
+
),
|
|
1284
|
+
hasItems && totalPages > 1 ? /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center justify-between text-xs text-white/60", children: [
|
|
1285
|
+
/* @__PURE__ */ jsx(
|
|
1286
|
+
"button",
|
|
1287
|
+
{
|
|
1288
|
+
type: "button",
|
|
1289
|
+
onClick: () => setPage((prev) => Math.max(0, prev - 1)),
|
|
1290
|
+
disabled: page === 0,
|
|
1291
|
+
className: cn(
|
|
1292
|
+
"rounded-full border border-white/15 px-3 py-1 uppercase tracking-[0.2em]",
|
|
1293
|
+
page === 0 ? "opacity-40 cursor-not-allowed" : "hover:border-white/40"
|
|
1294
|
+
),
|
|
1295
|
+
children: "Prev"
|
|
1296
|
+
}
|
|
1297
|
+
),
|
|
1298
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium text-white/70", children: [
|
|
1299
|
+
"Page ",
|
|
1300
|
+
page + 1,
|
|
1301
|
+
" / ",
|
|
1302
|
+
totalPages
|
|
1303
|
+
] }),
|
|
1304
|
+
/* @__PURE__ */ jsx(
|
|
1305
|
+
"button",
|
|
1306
|
+
{
|
|
1307
|
+
type: "button",
|
|
1308
|
+
onClick: () => setPage((prev) => Math.min(totalPages - 1, prev + 1)),
|
|
1309
|
+
disabled: page >= totalPages - 1,
|
|
1310
|
+
className: cn(
|
|
1311
|
+
"rounded-full border border-white/15 px-3 py-1 uppercase tracking-[0.2em]",
|
|
1312
|
+
page >= totalPages - 1 ? "opacity-40 cursor-not-allowed" : "hover:border-white/40"
|
|
1313
|
+
),
|
|
1314
|
+
children: "Next"
|
|
1315
|
+
}
|
|
1316
|
+
)
|
|
1317
|
+
] }) : null
|
|
1225
1318
|
]
|
|
1226
1319
|
}
|
|
1227
1320
|
);
|
|
@@ -1366,152 +1459,264 @@ var PropertyCompareBar = React5.forwardRef(
|
|
|
1366
1459
|
}
|
|
1367
1460
|
);
|
|
1368
1461
|
PropertyCompareBar.displayName = "PropertyCompareBar";
|
|
1369
|
-
var
|
|
1370
|
-
|
|
1371
|
-
"
|
|
1372
|
-
{
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1462
|
+
var TABS = [
|
|
1463
|
+
{ id: "portfolio", label: "Portfolio" },
|
|
1464
|
+
{ id: "openOrders", label: "Open Orders" },
|
|
1465
|
+
{ id: "tradeHistory", label: "Trade History" },
|
|
1466
|
+
{ id: "orderHistory", label: "Order History" }
|
|
1467
|
+
];
|
|
1468
|
+
var panelStyle = {
|
|
1469
|
+
width: "100%",
|
|
1470
|
+
borderRadius: "16px",
|
|
1471
|
+
backgroundColor: "#111111",
|
|
1472
|
+
border: "1px solid rgba(255,255,255,0.08)",
|
|
1473
|
+
color: "#ffffff",
|
|
1474
|
+
display: "flex",
|
|
1475
|
+
flexDirection: "column"
|
|
1476
|
+
};
|
|
1477
|
+
var headerStyle = {
|
|
1478
|
+
padding: "1.25rem 1.5rem 0.5rem"
|
|
1479
|
+
};
|
|
1480
|
+
var titleStyle = {
|
|
1481
|
+
margin: 0,
|
|
1482
|
+
fontSize: "1.1rem",
|
|
1483
|
+
fontWeight: 600
|
|
1484
|
+
};
|
|
1485
|
+
var tabsRowStyle = {
|
|
1486
|
+
display: "flex",
|
|
1487
|
+
gap: "0.5rem",
|
|
1488
|
+
padding: "0 1.5rem",
|
|
1489
|
+
borderBottom: "1px solid rgba(255,255,255,0.08)"
|
|
1490
|
+
};
|
|
1491
|
+
var tabButtonBase = {
|
|
1492
|
+
background: "none",
|
|
1493
|
+
border: "none",
|
|
1494
|
+
color: "rgba(255,255,255,0.5)",
|
|
1495
|
+
fontSize: "0.9rem",
|
|
1496
|
+
fontWeight: 400,
|
|
1497
|
+
padding: "0.75rem 1rem",
|
|
1498
|
+
cursor: "pointer",
|
|
1499
|
+
position: "relative",
|
|
1500
|
+
transition: "color 0.2s ease"
|
|
1501
|
+
};
|
|
1502
|
+
var tabContentWrapper = {
|
|
1503
|
+
padding: "1.25rem 1.5rem 1.5rem",
|
|
1504
|
+
display: "flex",
|
|
1505
|
+
flexDirection: "column",
|
|
1506
|
+
gap: "0.75rem",
|
|
1507
|
+
flex: 1
|
|
1508
|
+
};
|
|
1509
|
+
var tableHeaderStyle = {
|
|
1510
|
+
display: "grid",
|
|
1511
|
+
gridTemplateColumns: "1.8fr 0.9fr 0.7fr 0.8fr 0.8fr 1fr",
|
|
1512
|
+
gap: "0.5rem",
|
|
1513
|
+
paddingBottom: "0.75rem",
|
|
1514
|
+
borderBottom: "1px solid rgba(255,255,255,0.1)",
|
|
1515
|
+
minWidth: "700px"
|
|
1516
|
+
};
|
|
1517
|
+
var tableHeaderCell = {
|
|
1518
|
+
fontSize: "0.7rem",
|
|
1519
|
+
fontWeight: 700,
|
|
1520
|
+
color: "#ffffff",
|
|
1521
|
+
textTransform: "uppercase",
|
|
1522
|
+
letterSpacing: "0.3px"
|
|
1523
|
+
};
|
|
1524
|
+
var emptyStateStyle = {
|
|
1525
|
+
flex: 1,
|
|
1526
|
+
display: "flex",
|
|
1527
|
+
alignItems: "center",
|
|
1528
|
+
justifyContent: "center",
|
|
1529
|
+
textAlign: "center",
|
|
1530
|
+
color: "rgba(255,255,255,0.6)",
|
|
1531
|
+
fontSize: "0.95rem",
|
|
1532
|
+
border: "1px dashed rgba(255,255,255,0.12)",
|
|
1533
|
+
borderRadius: "8px",
|
|
1534
|
+
minHeight: "220px"
|
|
1535
|
+
};
|
|
1536
|
+
var rowStyle = {
|
|
1537
|
+
display: "grid",
|
|
1538
|
+
gridTemplateColumns: "1.8fr 0.9fr 0.7fr 0.8fr 0.8fr 1fr",
|
|
1539
|
+
gap: "0.5rem",
|
|
1540
|
+
alignItems: "center",
|
|
1541
|
+
minWidth: "700px",
|
|
1542
|
+
padding: "0.75rem 0",
|
|
1543
|
+
borderBottom: "1px solid rgba(255,255,255,0.08)"
|
|
1544
|
+
};
|
|
1545
|
+
var formatCurrency = (value) => {
|
|
1546
|
+
if (value == null || Number.isNaN(value)) return "\u2014";
|
|
1547
|
+
return `$${value.toLocaleString(void 0, {
|
|
1548
|
+
minimumFractionDigits: 2,
|
|
1549
|
+
maximumFractionDigits: 2
|
|
1550
|
+
})}`;
|
|
1551
|
+
};
|
|
1552
|
+
var formatPercent = (value, fractionDigits = 2) => {
|
|
1553
|
+
if (value == null || Number.isNaN(value)) return "\u2014";
|
|
1554
|
+
return `${value.toFixed(fractionDigits)}%`;
|
|
1555
|
+
};
|
|
1401
1556
|
var YourOrders = React5.forwardRef(
|
|
1402
|
-
({
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
)
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
"button",
|
|
1455
|
-
{
|
|
1456
|
-
type: "button",
|
|
1457
|
-
onClick: canEditPrice ? () => onEditPrice?.(order) : void 0,
|
|
1458
|
-
className: cn(
|
|
1459
|
-
"ml-1 inline-flex items-center justify-center text-white/60 transition-colors",
|
|
1460
|
-
canEditPrice ? "cursor-pointer hover:text-[#C9A227] active:translate-y-px" : "cursor-default"
|
|
1461
|
-
),
|
|
1462
|
-
"aria-label": "Edit price",
|
|
1463
|
-
children: /* @__PURE__ */ jsx(EditIcon, { className: "h-[14px] w-[14px]" })
|
|
1464
|
-
}
|
|
1465
|
-
)
|
|
1466
|
-
] }),
|
|
1467
|
-
/* @__PURE__ */ jsxs("div", { className: "px-2 font-medium", children: [
|
|
1468
|
-
/* @__PURE__ */ jsx("span", { className: "tabular-nums", children: order.amount.toLocaleString() }),
|
|
1469
|
-
/* @__PURE__ */ jsx(
|
|
1470
|
-
"button",
|
|
1557
|
+
({ className, title = "Portfolio Holdings (Demo)", orders, renderOrderActions, ...props }, ref) => {
|
|
1558
|
+
const [activeTab, setActiveTab] = React5.useState("portfolio");
|
|
1559
|
+
const hasOrders = Array.isArray(orders) && orders.length > 0;
|
|
1560
|
+
const renderPortfolio = () => {
|
|
1561
|
+
if (!hasOrders) {
|
|
1562
|
+
return /* @__PURE__ */ jsx("div", { style: emptyStateStyle, children: "No holdings yet. Start trading to build your portfolio." });
|
|
1563
|
+
}
|
|
1564
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1565
|
+
/* @__PURE__ */ jsxs("div", { style: tableHeaderStyle, children: [
|
|
1566
|
+
/* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Property" }),
|
|
1567
|
+
/* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Value" }),
|
|
1568
|
+
/* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Holding" }),
|
|
1569
|
+
/* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "% of Property" }),
|
|
1570
|
+
/* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "Avg Price" }),
|
|
1571
|
+
/* @__PURE__ */ jsx("div", { style: tableHeaderCell, children: "P&L" })
|
|
1572
|
+
] }),
|
|
1573
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "0.65rem" }, children: orders.map((order) => {
|
|
1574
|
+
const propertyName = order.asset;
|
|
1575
|
+
const holding = order.holdingLabel ?? `${order.amount.toLocaleString(void 0, {
|
|
1576
|
+
minimumFractionDigits: 0,
|
|
1577
|
+
maximumFractionDigits: 2
|
|
1578
|
+
})} ${propertyName}`;
|
|
1579
|
+
const value = order.value ?? order.total;
|
|
1580
|
+
const portfolioShare = order.portfolioSharePercent != null ? `${order.portfolioSharePercent.toFixed(1)}% of portfolio` : void 0;
|
|
1581
|
+
const propertyPercent = order.propertyPercent;
|
|
1582
|
+
const avgPrice = order.avgEntryPrice ?? order.price;
|
|
1583
|
+
const pnlValue = order.pnlValue;
|
|
1584
|
+
const pnlPercent = order.pnlPercent;
|
|
1585
|
+
const pnlPositive = pnlValue != null ? pnlValue >= 0 : (pnlPercent ?? 0) >= 0;
|
|
1586
|
+
const currentPrice = order.currentPrice ?? order.price;
|
|
1587
|
+
const priceChangePercent = order.priceChangePercent ?? order.pnlPercent;
|
|
1588
|
+
const priceChangePositive = order.priceChangePositive ?? (priceChangePercent != null ? priceChangePercent >= 0 : void 0);
|
|
1589
|
+
return /* @__PURE__ */ jsxs("div", { style: { ...rowStyle, gridTemplateColumns: renderOrderActions ? "1.8fr 0.8fr 0.7fr 0.8fr 0.8fr 0.9fr 0.8fr" : "1.8fr 0.9fr 0.7fr 0.8fr 0.8fr 1fr" }, children: [
|
|
1590
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "1rem", alignItems: "center" }, children: [
|
|
1591
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "0.15rem" }, children: [
|
|
1592
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", fontWeight: 500 }, children: propertyName }),
|
|
1593
|
+
portfolioShare ? /* @__PURE__ */ jsx("div", { style: { fontSize: "0.72rem", color: "rgba(255,255,255,0.5)" }, children: portfolioShare }) : null
|
|
1594
|
+
] }),
|
|
1595
|
+
currentPrice != null ? /* @__PURE__ */ jsxs("div", { children: [
|
|
1596
|
+
/* @__PURE__ */ jsxs(
|
|
1597
|
+
"div",
|
|
1598
|
+
{
|
|
1599
|
+
style: {
|
|
1600
|
+
fontSize: "0.9rem",
|
|
1601
|
+
color: "var(--color-text, #ffffff)",
|
|
1602
|
+
display: "flex",
|
|
1603
|
+
alignItems: "center",
|
|
1604
|
+
gap: "0.25rem"
|
|
1605
|
+
},
|
|
1606
|
+
children: [
|
|
1607
|
+
priceChangePositive != null ? /* @__PURE__ */ jsx(
|
|
1608
|
+
"span",
|
|
1471
1609
|
{
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
),
|
|
1478
|
-
"aria-label": "Edit amount",
|
|
1479
|
-
children: /* @__PURE__ */ jsx(EditIcon, { className: "h-[14px] w-[14px]" })
|
|
1610
|
+
style: {
|
|
1611
|
+
color: priceChangePositive ? "#0ecb81" : "#f6465d",
|
|
1612
|
+
fontSize: "0.7em"
|
|
1613
|
+
},
|
|
1614
|
+
children: priceChangePositive ? "\u25B2" : "\u25BC"
|
|
1480
1615
|
}
|
|
1481
|
-
)
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
"
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1616
|
+
) : null,
|
|
1617
|
+
formatCurrency(currentPrice)
|
|
1618
|
+
]
|
|
1619
|
+
}
|
|
1620
|
+
),
|
|
1621
|
+
priceChangePercent != null ? /* @__PURE__ */ jsxs(
|
|
1622
|
+
"div",
|
|
1623
|
+
{
|
|
1624
|
+
style: {
|
|
1625
|
+
fontSize: "0.7rem",
|
|
1626
|
+
color: priceChangePositive ? "#0ecb81" : "#f6465d"
|
|
1627
|
+
},
|
|
1628
|
+
children: [
|
|
1629
|
+
"(",
|
|
1630
|
+
priceChangePositive ? "+" : "",
|
|
1631
|
+
priceChangePercent.toFixed(2),
|
|
1632
|
+
"%)"
|
|
1633
|
+
]
|
|
1634
|
+
}
|
|
1635
|
+
) : null
|
|
1636
|
+
] }) : null
|
|
1637
|
+
] }),
|
|
1638
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", fontWeight: 500, color: "#D4AF37" }, children: formatCurrency(value) }),
|
|
1639
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", color: "rgba(255,255,255,0.92)" }, children: holding }),
|
|
1640
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", color: "rgba(255,255,255,0.8)" }, children: formatPercent(propertyPercent, 3) }),
|
|
1641
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: "0.9rem", color: "rgba(255,255,255,0.9)" }, children: formatCurrency(avgPrice) }),
|
|
1642
|
+
/* @__PURE__ */ jsxs(
|
|
1643
|
+
"div",
|
|
1644
|
+
{
|
|
1645
|
+
style: {
|
|
1646
|
+
fontSize: "0.9rem",
|
|
1647
|
+
fontWeight: 500,
|
|
1648
|
+
color: pnlPositive ? "#0ecb81" : "#f6465d"
|
|
1507
1649
|
},
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1650
|
+
children: [
|
|
1651
|
+
pnlValue != null ? `${pnlPositive ? "+" : "-"}${formatCurrency(Math.abs(pnlValue))}` : formatCurrency(pnlValue),
|
|
1652
|
+
pnlPercent != null ? /* @__PURE__ */ jsxs("span", { style: { marginLeft: "0.35rem", fontSize: "0.75rem", color: "rgba(255,255,255,0.6)" }, children: [
|
|
1653
|
+
"(",
|
|
1654
|
+
pnlPositive ? "+" : "",
|
|
1655
|
+
pnlPercent.toFixed(1),
|
|
1656
|
+
"%)"
|
|
1657
|
+
] }) : null
|
|
1658
|
+
]
|
|
1659
|
+
}
|
|
1660
|
+
),
|
|
1661
|
+
renderOrderActions ? /* @__PURE__ */ jsx("div", { style: { display: "flex", justifyContent: "flex-end" }, children: renderOrderActions(order) }) : null
|
|
1662
|
+
] }, order.id);
|
|
1663
|
+
}) })
|
|
1664
|
+
] });
|
|
1665
|
+
};
|
|
1666
|
+
const renderOtherTab = (label) => /* @__PURE__ */ jsx("div", { style: emptyStateStyle, children: `No ${label.toLowerCase()} data available.` });
|
|
1667
|
+
let tabContent = null;
|
|
1668
|
+
switch (activeTab) {
|
|
1669
|
+
case "portfolio":
|
|
1670
|
+
tabContent = renderPortfolio();
|
|
1671
|
+
break;
|
|
1672
|
+
case "openOrders":
|
|
1673
|
+
tabContent = renderOtherTab("Open Orders");
|
|
1674
|
+
break;
|
|
1675
|
+
case "tradeHistory":
|
|
1676
|
+
tabContent = renderOtherTab("Trade History");
|
|
1677
|
+
break;
|
|
1678
|
+
case "orderHistory":
|
|
1679
|
+
tabContent = renderOtherTab("Order History");
|
|
1680
|
+
break;
|
|
1681
|
+
default:
|
|
1682
|
+
tabContent = null;
|
|
1683
|
+
}
|
|
1684
|
+
return /* @__PURE__ */ jsxs("div", { ref, style: panelStyle, className, ...props, children: [
|
|
1685
|
+
/* @__PURE__ */ jsx("div", { style: headerStyle, children: /* @__PURE__ */ jsx("h3", { style: titleStyle, children: title }) }),
|
|
1686
|
+
/* @__PURE__ */ jsx("div", { style: tabsRowStyle, children: TABS.map((tab) => {
|
|
1687
|
+
const isActive = activeTab === tab.id;
|
|
1688
|
+
return /* @__PURE__ */ jsxs(
|
|
1689
|
+
"button",
|
|
1690
|
+
{
|
|
1691
|
+
type: "button",
|
|
1692
|
+
onClick: () => setActiveTab(tab.id),
|
|
1693
|
+
style: {
|
|
1694
|
+
...tabButtonBase,
|
|
1695
|
+
color: isActive ? "#ffffff" : "rgba(255,255,255,0.55)",
|
|
1696
|
+
fontWeight: isActive ? 600 : 400
|
|
1697
|
+
},
|
|
1698
|
+
children: [
|
|
1699
|
+
tab.label,
|
|
1700
|
+
isActive ? /* @__PURE__ */ jsx(
|
|
1701
|
+
"div",
|
|
1702
|
+
{
|
|
1703
|
+
style: {
|
|
1704
|
+
position: "absolute",
|
|
1705
|
+
bottom: "-1px",
|
|
1706
|
+
left: 0,
|
|
1707
|
+
right: 0,
|
|
1708
|
+
height: "2px",
|
|
1709
|
+
background: "#f0b90b"
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
) : null
|
|
1713
|
+
]
|
|
1714
|
+
},
|
|
1715
|
+
tab.id
|
|
1716
|
+
);
|
|
1717
|
+
}) }),
|
|
1718
|
+
/* @__PURE__ */ jsx("div", { style: tabContentWrapper, children: tabContent })
|
|
1719
|
+
] });
|
|
1515
1720
|
}
|
|
1516
1721
|
);
|
|
1517
1722
|
YourOrders.displayName = "YourOrders";
|
|
@@ -1721,7 +1926,10 @@ var PropertyHeroHeader = React5.forwardRef(
|
|
|
1721
1926
|
...props
|
|
1722
1927
|
}, ref) => {
|
|
1723
1928
|
const isPositive = changePercent == null ? void 0 : changePercent >= 0;
|
|
1724
|
-
const
|
|
1929
|
+
const accentColor = "#e6c87e";
|
|
1930
|
+
const tradeHoverColor = "#f5dd9a";
|
|
1931
|
+
const [isTradeInteracting, setIsTradeInteracting] = React5.useState(false);
|
|
1932
|
+
const [isOfferInteracting, setIsOfferInteracting] = React5.useState(false);
|
|
1725
1933
|
return /* @__PURE__ */ jsxs(
|
|
1726
1934
|
"div",
|
|
1727
1935
|
{
|
|
@@ -1807,20 +2015,30 @@ var PropertyHeroHeader = React5.forwardRef(
|
|
|
1807
2015
|
propertyTypeLabel == null ? null : /* @__PURE__ */ jsx("div", { children: propertyTypeLabel })
|
|
1808
2016
|
] })
|
|
1809
2017
|
] }),
|
|
1810
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-
|
|
2018
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 max-[768px]:w-full max-[768px]:justify-between max-[768px]:gap-2 max-[480px]:gap-2", children: [
|
|
1811
2019
|
/* @__PURE__ */ jsx(
|
|
1812
2020
|
"button",
|
|
1813
2021
|
{
|
|
1814
2022
|
type: "button",
|
|
1815
2023
|
onClick: onTrade,
|
|
1816
|
-
className: "
|
|
1817
|
-
style: {
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
2024
|
+
className: "flex items-center justify-center rounded border font-semibold transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_8px_rgba(0,0,0,0.2)] active:translate-y-0 active:shadow-[0_2px_4px_rgba(0,0,0,0.1)] text-[0.95rem] max-[480px]:text-[0.9rem]",
|
|
2025
|
+
style: {
|
|
2026
|
+
backgroundColor: isTradeInteracting ? tradeHoverColor : accentColor,
|
|
2027
|
+
color: "black",
|
|
2028
|
+
width: "88.06px",
|
|
2029
|
+
height: "43px",
|
|
2030
|
+
minWidth: "88.06px",
|
|
2031
|
+
borderColor: isTradeInteracting ? accentColor : "transparent",
|
|
2032
|
+
boxShadow: isTradeInteracting ? `0 0 0 2px rgba(0,0,0,0.4), 0 0 0 4px ${accentColor}` : "none"
|
|
1823
2033
|
},
|
|
2034
|
+
onMouseEnter: () => setIsTradeInteracting(true),
|
|
2035
|
+
onMouseLeave: () => setIsTradeInteracting(false),
|
|
2036
|
+
onMouseDown: () => setIsTradeInteracting(true),
|
|
2037
|
+
onMouseUp: () => setIsTradeInteracting(false),
|
|
2038
|
+
onFocus: () => setIsTradeInteracting(true),
|
|
2039
|
+
onBlur: () => setIsTradeInteracting(false),
|
|
2040
|
+
onTouchStart: () => setIsTradeInteracting(true),
|
|
2041
|
+
onTouchEnd: () => setIsTradeInteracting(false),
|
|
1824
2042
|
children: "Trade"
|
|
1825
2043
|
}
|
|
1826
2044
|
),
|
|
@@ -1829,18 +2047,24 @@ var PropertyHeroHeader = React5.forwardRef(
|
|
|
1829
2047
|
{
|
|
1830
2048
|
type: "button",
|
|
1831
2049
|
onClick: onMakeOffer,
|
|
1832
|
-
className: "
|
|
2050
|
+
className: "flex items-center justify-center rounded border font-semibold transition-all duration-200 hover:-translate-y-0.5 hover:shadow-[0_4px_8px_rgba(0,0,0,0.2)] active:translate-y-0 active:shadow-[0_2px_4px_rgba(0,0,0,0.1)] text-[0.95rem] max-[480px]:text-[0.9rem]",
|
|
1833
2051
|
style: {
|
|
1834
|
-
backgroundColor: "transparent",
|
|
1835
|
-
borderColor:
|
|
1836
|
-
color: "
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
onMouseLeave: (e) => {
|
|
1842
|
-
e.currentTarget.style.backgroundColor = "transparent";
|
|
2052
|
+
backgroundColor: isOfferInteracting ? accentColor : "transparent",
|
|
2053
|
+
borderColor: accentColor,
|
|
2054
|
+
color: isOfferInteracting ? "black" : accentColor,
|
|
2055
|
+
width: "127.14px",
|
|
2056
|
+
height: "43px",
|
|
2057
|
+
minWidth: "127.14px",
|
|
2058
|
+
boxShadow: isOfferInteracting ? `0 0 0 2px rgba(0,0,0,0.4), 0 0 0 4px ${accentColor}` : "none"
|
|
1843
2059
|
},
|
|
2060
|
+
onMouseEnter: () => setIsOfferInteracting(true),
|
|
2061
|
+
onMouseLeave: () => setIsOfferInteracting(false),
|
|
2062
|
+
onMouseDown: () => setIsOfferInteracting(true),
|
|
2063
|
+
onMouseUp: () => setIsOfferInteracting(false),
|
|
2064
|
+
onFocus: () => setIsOfferInteracting(true),
|
|
2065
|
+
onBlur: () => setIsOfferInteracting(false),
|
|
2066
|
+
onTouchStart: () => setIsOfferInteracting(true),
|
|
2067
|
+
onTouchEnd: () => setIsOfferInteracting(false),
|
|
1844
2068
|
children: "Make Offer"
|
|
1845
2069
|
}
|
|
1846
2070
|
)
|