@loafmarkets/ui 0.1.65 → 0.1.67
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.js +32 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2875,7 +2875,6 @@ var PropertyNewsUpdates = React5.forwardRef(
|
|
|
2875
2875
|
const [homePage, setHomePage] = React5.useState(0);
|
|
2876
2876
|
const purchaseItems = purchasesProp ?? [];
|
|
2877
2877
|
const [page, setPage] = React5.useState(0);
|
|
2878
|
-
const [expandedId, setExpandedId] = React5.useState(null);
|
|
2879
2878
|
const [selectedItem, setSelectedItem] = React5.useState(null);
|
|
2880
2879
|
React5.useEffect(() => {
|
|
2881
2880
|
ensureAnimationsInjected();
|
|
@@ -2901,9 +2900,6 @@ var PropertyNewsUpdates = React5.forwardRef(
|
|
|
2901
2900
|
[homeFilteredItems.length]
|
|
2902
2901
|
);
|
|
2903
2902
|
const homePaginatedItems = homeFilteredItems.slice(homePage * ITEMS_PER_PAGE, (homePage + 1) * ITEMS_PER_PAGE);
|
|
2904
|
-
const toggleExpand = React5.useCallback((key) => {
|
|
2905
|
-
setExpandedId((prev) => prev === key ? null : key);
|
|
2906
|
-
}, []);
|
|
2907
2903
|
return /* @__PURE__ */ jsxs(
|
|
2908
2904
|
"div",
|
|
2909
2905
|
{
|
|
@@ -2988,37 +2984,40 @@ var PropertyNewsUpdates = React5.forwardRef(
|
|
|
2988
2984
|
const key = item.displayId ?? item.id ?? `${item.title}-${index}`;
|
|
2989
2985
|
const isProperty = item.type === "property";
|
|
2990
2986
|
const sentimentInfo = getSentimentInfo(item.sentimentScore);
|
|
2991
|
-
const isExpanded = expandedId === key;
|
|
2992
2987
|
return /* @__PURE__ */ jsxs(
|
|
2993
|
-
"
|
|
2988
|
+
"button",
|
|
2994
2989
|
{
|
|
2995
|
-
|
|
2990
|
+
type: "button",
|
|
2991
|
+
onClick: () => setSelectedItem(item),
|
|
2992
|
+
style: {
|
|
2993
|
+
width: "100%",
|
|
2994
|
+
textAlign: "left",
|
|
2995
|
+
background: "transparent",
|
|
2996
|
+
border: "none",
|
|
2997
|
+
cursor: "pointer",
|
|
2998
|
+
padding: "0.75rem 0",
|
|
2999
|
+
borderBottom: index < homePaginatedItems.length - 1 ? "1px solid rgba(255,255,255,0.05)" : "none",
|
|
3000
|
+
display: "flex",
|
|
3001
|
+
justifyContent: "space-between",
|
|
3002
|
+
alignItems: "flex-start",
|
|
3003
|
+
gap: "0.5rem",
|
|
3004
|
+
color: "inherit"
|
|
3005
|
+
},
|
|
2996
3006
|
children: [
|
|
2997
|
-
/* @__PURE__ */ jsxs(
|
|
2998
|
-
"
|
|
2999
|
-
{
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
style: {
|
|
3003
|
-
children: [
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
sentimentInfo.arrow,
|
|
3012
|
-
" ",
|
|
3013
|
-
sentimentInfo.label
|
|
3014
|
-
] })
|
|
3015
|
-
] })
|
|
3016
|
-
] }),
|
|
3017
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", color: "#848e9c", marginLeft: "0.5rem", paddingTop: "2px" }, children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", style: { transition: "transform 0.2s", transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)" }, children: /* @__PURE__ */ jsx("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) }) })
|
|
3018
|
-
]
|
|
3019
|
-
}
|
|
3020
|
-
),
|
|
3021
|
-
isExpanded && /* @__PURE__ */ jsx("div", { style: { marginTop: "0.625rem", padding: "0.75rem", background: "rgba(255,255,255,0.04)", borderRadius: "6px", borderLeft: `3px solid ${sentimentInfo?.color ?? "rgba(255,255,255,0.15)"}`, animation: "propertyNewsSlideIn 0.2s ease-out" }, children: item.summary ? /* @__PURE__ */ jsx("p", { style: { fontSize: "0.8rem", color: "rgba(255,255,255,0.72)", lineHeight: 1.65, margin: 0 }, children: item.summary }) : /* @__PURE__ */ jsx("p", { style: { fontSize: "0.78rem", color: "rgba(255,255,255,0.35)", fontStyle: "italic", margin: 0 }, children: "Summary not available." }) })
|
|
3007
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
3008
|
+
/* @__PURE__ */ jsx("h3", { style: { fontSize: "0.85rem", fontWeight: 400, marginBottom: "0.25rem", color: "#f8f9fa", lineHeight: 1.4 }, children: item.title }),
|
|
3009
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center", flexWrap: "wrap" }, children: [
|
|
3010
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#848e9c", fontSize: "0.7rem" }, children: typeof item.date === "string" ? item.date : formatDate(item.date) }),
|
|
3011
|
+
item.source && /* @__PURE__ */ jsx("span", { style: { padding: "0.1rem 0.4rem", borderRadius: "3px", fontSize: "0.62rem", fontWeight: 500, backgroundColor: "rgba(255,255,255,0.07)", color: "#848e9c", whiteSpace: "nowrap" }, children: item.source }),
|
|
3012
|
+
/* @__PURE__ */ jsx("span", { style: { padding: "0.15rem 0.4rem", borderRadius: "2px", fontSize: "0.65rem", fontWeight: 500, backgroundColor: isProperty ? "rgba(14,203,129,0.1)" : "rgba(240,185,11,0.1)", color: isProperty ? "#0ecb81" : "#f0b90b" }, children: isProperty ? "Property Update" : "Market News" }),
|
|
3013
|
+
sentimentInfo && /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.65rem", fontWeight: 600, color: sentimentInfo.color }, children: [
|
|
3014
|
+
sentimentInfo.arrow,
|
|
3015
|
+
" ",
|
|
3016
|
+
sentimentInfo.label
|
|
3017
|
+
] })
|
|
3018
|
+
] })
|
|
3019
|
+
] }),
|
|
3020
|
+
/* @__PURE__ */ jsx("div", { style: { color: "#848e9c", paddingTop: "2px", flexShrink: 0 }, children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }) }) })
|
|
3022
3021
|
]
|
|
3023
3022
|
},
|
|
3024
3023
|
key
|
|
@@ -3144,7 +3143,7 @@ var PropertyNewsUpdates = React5.forwardRef(
|
|
|
3144
3143
|
}
|
|
3145
3144
|
)
|
|
3146
3145
|
] }),
|
|
3147
|
-
selectedItem && !
|
|
3146
|
+
selectedItem && !isPurchaseVariant && /* @__PURE__ */ jsx(NewsArticleModal, { item: selectedItem, onClose: () => setSelectedItem(null) })
|
|
3148
3147
|
]
|
|
3149
3148
|
}
|
|
3150
3149
|
);
|