@retinalabsllc/zairusjs 18.0.0 → 18.0.1
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 +22 -5
- package/dist/index.mjs +22 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5481,13 +5481,30 @@ function OpenBidHome({
|
|
|
5481
5481
|
visitorCount = 0
|
|
5482
5482
|
}) {
|
|
5483
5483
|
const topRef = (0, import_react92.useRef)(null);
|
|
5484
|
-
const [bidAmount, setBidAmount] = (0, import_react92.useState)(
|
|
5484
|
+
const [bidAmount, setBidAmount] = (0, import_react92.useState)(1);
|
|
5485
5485
|
const [identity, setIdentity] = (0, import_react92.useState)("");
|
|
5486
|
+
const hasInitializedBid = (0, import_react92.useRef)(false);
|
|
5486
5487
|
const [selectedCategory, setSelectedCategory] = (0, import_react92.useState)(CATEGORIES[0]);
|
|
5487
5488
|
const [isCategoryModalOpen, setIsCategoryModalOpen] = (0, import_react92.useState)(false);
|
|
5488
5489
|
const [isActivityExpanded, setIsActivityExpanded] = (0, import_react92.useState)(false);
|
|
5490
|
+
(0, import_react92.useEffect)(() => {
|
|
5491
|
+
if (data.length > 0 && !hasInitializedBid.current) {
|
|
5492
|
+
setBidAmount(data[0].amount + 1);
|
|
5493
|
+
hasInitializedBid.current = true;
|
|
5494
|
+
}
|
|
5495
|
+
}, [data]);
|
|
5496
|
+
const getProjectedRank = (amount) => {
|
|
5497
|
+
if (!data || data.length === 0) return 1;
|
|
5498
|
+
for (let i = 0; i < data.length; i++) {
|
|
5499
|
+
if (amount > data[i].amount) {
|
|
5500
|
+
return data[i].rank;
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5503
|
+
return data[data.length - 1].rank + 1;
|
|
5504
|
+
};
|
|
5505
|
+
const projectedRank = getProjectedRank(bidAmount);
|
|
5489
5506
|
const handleBidChange = (delta) => {
|
|
5490
|
-
setBidAmount((prev) => Math.max(
|
|
5507
|
+
setBidAmount((prev) => Math.max(1, prev + delta));
|
|
5491
5508
|
};
|
|
5492
5509
|
const handleClaimRankClick = (requiredAmount) => {
|
|
5493
5510
|
setBidAmount(requiredAmount);
|
|
@@ -5504,15 +5521,15 @@ function OpenBidHome({
|
|
|
5504
5521
|
setIdentity(val);
|
|
5505
5522
|
onIdentityChange(val);
|
|
5506
5523
|
};
|
|
5507
|
-
return /* @__PURE__ */ import_react92.default.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col px-4 pt-12 pb-24 animate-in fade-in duration-300" }, /* @__PURE__ */ import_react92.default.createElement("header", { className: "mb-12 px-2 text-center", ref: topRef }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "inline-block max-w-full bg-white rounded-full px-4 py-2 text-xs text-neutral-500 transition-colors hover:text-black cursor-pointer leading-relaxed text-balance" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "inline-flex items-center gap-1.5 text-emerald-600 align-text-bottom whitespace-nowrap" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "relative flex h-2 w-2 shrink-0" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" }), /* @__PURE__ */ import_react92.default.createElement("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-emerald-500" })), /* @__PURE__ */ import_react92.default.createElement("span", null, onlineCount.toLocaleString(), " online")), /* @__PURE__ */ import_react92.default.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ import_react92.default.createElement("span", null, visitorCount.toLocaleString(), " visitors since launch"), /* @__PURE__ */ import_react92.default.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ import_react92.default.createElement("span", { className: "text-black underline decoration-neutral-300 hover:decoration-black transition-colors whitespace-nowrap" }, "Live stats"))), /* @__PURE__ */ import_react92.default.createElement("section", { className: "flex flex-col items-center mb-16" }, /* @__PURE__ */ import_react92.default.createElement("h2", { className: "flex flex-wrap items-center justify-center gap-x-3 text-center text-3xl md:text-5xl tracking-tight text-black mb-3" }, /* @__PURE__ */ import_react92.default.createElement("span", null, "Claim #
|
|
5524
|
+
return /* @__PURE__ */ import_react92.default.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col px-4 pt-12 pb-24 animate-in fade-in duration-300" }, /* @__PURE__ */ import_react92.default.createElement("header", { className: "mb-12 px-2 text-center", ref: topRef }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "inline-block max-w-full bg-white rounded-full px-4 py-2 text-xs text-neutral-500 transition-colors hover:text-black cursor-pointer leading-relaxed text-balance" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "inline-flex items-center gap-1.5 text-emerald-600 align-text-bottom whitespace-nowrap" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "relative flex h-2 w-2 shrink-0" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" }), /* @__PURE__ */ import_react92.default.createElement("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-emerald-500" })), /* @__PURE__ */ import_react92.default.createElement("span", null, onlineCount.toLocaleString(), " online")), /* @__PURE__ */ import_react92.default.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ import_react92.default.createElement("span", null, visitorCount.toLocaleString(), " visitors since launch"), /* @__PURE__ */ import_react92.default.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ import_react92.default.createElement("span", { className: "text-black underline decoration-neutral-300 hover:decoration-black transition-colors whitespace-nowrap" }, "Live stats"))), /* @__PURE__ */ import_react92.default.createElement("section", { className: "flex flex-col items-center mb-16" }, /* @__PURE__ */ import_react92.default.createElement("h2", { className: "flex flex-wrap items-center justify-center gap-x-3 text-center text-3xl md:text-5xl tracking-tight text-black mb-3" }, /* @__PURE__ */ import_react92.default.createElement("span", null, "Claim #", projectedRank, " for"), /* @__PURE__ */ import_react92.default.createElement("span", { className: "inline-flex items-center gap-3 bg-neutral-100 rounded-full p-1.5 border border-neutral-200" }, /* @__PURE__ */ import_react92.default.createElement("button", { onClick: () => handleBidChange(-1), type: "button", className: "w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-full bg-white text-black hover:bg-neutral-50 transition-colors outline-none text-lg" }, "\u2212"), /* @__PURE__ */ import_react92.default.createElement("div", { className: "flex items-center tracking-tight px-2 w-24 justify-center" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "text-[#068afe] mr-0.5" }, "$"), /* @__PURE__ */ import_react92.default.createElement(
|
|
5508
5525
|
"input",
|
|
5509
5526
|
{
|
|
5510
5527
|
type: "number",
|
|
5511
5528
|
value: bidAmount,
|
|
5512
|
-
onChange: (e) => setBidAmount(Number(e.target.value)),
|
|
5529
|
+
onChange: (e) => setBidAmount(Math.max(1, Number(e.target.value))),
|
|
5513
5530
|
className: "w-full bg-transparent p-0 outline-none text-center tabular-nums text-[#068afe] "
|
|
5514
5531
|
}
|
|
5515
|
-
)), /* @__PURE__ */ import_react92.default.createElement("button", { onClick: () => handleBidChange(1), type: "button", className: "w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-full bg-white text-black hover:bg-neutral-50 transition-colors outline-none text-lg" }, "+"))), /* @__PURE__ */ import_react92.default.createElement("p", { className: "text-center text-sm text-neutral-500 max-w-md" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "text-[#068afe]" }, "New spots start at $
|
|
5532
|
+
)), /* @__PURE__ */ import_react92.default.createElement("button", { onClick: () => handleBidChange(1), type: "button", className: "w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-full bg-white text-black hover:bg-neutral-50 transition-colors outline-none text-lg" }, "+"))), /* @__PURE__ */ import_react92.default.createElement("p", { className: "text-center text-sm text-neutral-500 max-w-md" }, /* @__PURE__ */ import_react92.default.createElement("span", { className: "text-[#068afe]" }, "New spots start at $1."), " Paying less than the #1 price puts you on the board at whatever rank your bid secures."), /* @__PURE__ */ import_react92.default.createElement("form", { onSubmit: handleSubmit, className: "mt-8 flex flex-col md:flex-row items-stretch md:items-center gap-3 w-full max-w-3xl bg-white p-2 rounded-2xl md:rounded-full" }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "relative flex-1 min-w-0" }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "absolute inset-y-0 left-0 pl-3 md:pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ import_react92.default.createElement("div", { className: "w-7 h-7 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden" }, inputFaviconSrc ? /* @__PURE__ */ import_react92.default.createElement("img", { src: inputFaviconSrc, alt: "", className: "w-full h-full object-cover" }) : /* @__PURE__ */ import_react92.default.createElement(import_react93.HugeiconsIcon, { icon: import_core_free_icons35.Link01Icon, size: 14, className: "text-neutral-400" }))), /* @__PURE__ */ import_react92.default.createElement(
|
|
5516
5533
|
"input",
|
|
5517
5534
|
{
|
|
5518
5535
|
id: "identity-input",
|
package/dist/index.mjs
CHANGED
|
@@ -5534,13 +5534,30 @@ function OpenBidHome({
|
|
|
5534
5534
|
visitorCount = 0
|
|
5535
5535
|
}) {
|
|
5536
5536
|
const topRef = useRef14(null);
|
|
5537
|
-
const [bidAmount, setBidAmount] = useState39(
|
|
5537
|
+
const [bidAmount, setBidAmount] = useState39(1);
|
|
5538
5538
|
const [identity, setIdentity] = useState39("");
|
|
5539
|
+
const hasInitializedBid = useRef14(false);
|
|
5539
5540
|
const [selectedCategory, setSelectedCategory] = useState39(CATEGORIES[0]);
|
|
5540
5541
|
const [isCategoryModalOpen, setIsCategoryModalOpen] = useState39(false);
|
|
5541
5542
|
const [isActivityExpanded, setIsActivityExpanded] = useState39(false);
|
|
5543
|
+
useEffect21(() => {
|
|
5544
|
+
if (data.length > 0 && !hasInitializedBid.current) {
|
|
5545
|
+
setBidAmount(data[0].amount + 1);
|
|
5546
|
+
hasInitializedBid.current = true;
|
|
5547
|
+
}
|
|
5548
|
+
}, [data]);
|
|
5549
|
+
const getProjectedRank = (amount) => {
|
|
5550
|
+
if (!data || data.length === 0) return 1;
|
|
5551
|
+
for (let i = 0; i < data.length; i++) {
|
|
5552
|
+
if (amount > data[i].amount) {
|
|
5553
|
+
return data[i].rank;
|
|
5554
|
+
}
|
|
5555
|
+
}
|
|
5556
|
+
return data[data.length - 1].rank + 1;
|
|
5557
|
+
};
|
|
5558
|
+
const projectedRank = getProjectedRank(bidAmount);
|
|
5542
5559
|
const handleBidChange = (delta) => {
|
|
5543
|
-
setBidAmount((prev) => Math.max(
|
|
5560
|
+
setBidAmount((prev) => Math.max(1, prev + delta));
|
|
5544
5561
|
};
|
|
5545
5562
|
const handleClaimRankClick = (requiredAmount) => {
|
|
5546
5563
|
setBidAmount(requiredAmount);
|
|
@@ -5557,15 +5574,15 @@ function OpenBidHome({
|
|
|
5557
5574
|
setIdentity(val);
|
|
5558
5575
|
onIdentityChange(val);
|
|
5559
5576
|
};
|
|
5560
|
-
return /* @__PURE__ */ React53.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col px-4 pt-12 pb-24 animate-in fade-in duration-300" }, /* @__PURE__ */ React53.createElement("header", { className: "mb-12 px-2 text-center", ref: topRef }, /* @__PURE__ */ React53.createElement("div", { className: "inline-block max-w-full bg-white rounded-full px-4 py-2 text-xs text-neutral-500 transition-colors hover:text-black cursor-pointer leading-relaxed text-balance" }, /* @__PURE__ */ React53.createElement("span", { className: "inline-flex items-center gap-1.5 text-emerald-600 align-text-bottom whitespace-nowrap" }, /* @__PURE__ */ React53.createElement("span", { className: "relative flex h-2 w-2 shrink-0" }, /* @__PURE__ */ React53.createElement("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" }), /* @__PURE__ */ React53.createElement("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-emerald-500" })), /* @__PURE__ */ React53.createElement("span", null, onlineCount.toLocaleString(), " online")), /* @__PURE__ */ React53.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ React53.createElement("span", null, visitorCount.toLocaleString(), " visitors since launch"), /* @__PURE__ */ React53.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ React53.createElement("span", { className: "text-black underline decoration-neutral-300 hover:decoration-black transition-colors whitespace-nowrap" }, "Live stats"))), /* @__PURE__ */ React53.createElement("section", { className: "flex flex-col items-center mb-16" }, /* @__PURE__ */ React53.createElement("h2", { className: "flex flex-wrap items-center justify-center gap-x-3 text-center text-3xl md:text-5xl tracking-tight text-black mb-3" }, /* @__PURE__ */ React53.createElement("span", null, "Claim #
|
|
5577
|
+
return /* @__PURE__ */ React53.createElement("div", { className: "w-full max-w-4xl mx-auto flex flex-col px-4 pt-12 pb-24 animate-in fade-in duration-300" }, /* @__PURE__ */ React53.createElement("header", { className: "mb-12 px-2 text-center", ref: topRef }, /* @__PURE__ */ React53.createElement("div", { className: "inline-block max-w-full bg-white rounded-full px-4 py-2 text-xs text-neutral-500 transition-colors hover:text-black cursor-pointer leading-relaxed text-balance" }, /* @__PURE__ */ React53.createElement("span", { className: "inline-flex items-center gap-1.5 text-emerald-600 align-text-bottom whitespace-nowrap" }, /* @__PURE__ */ React53.createElement("span", { className: "relative flex h-2 w-2 shrink-0" }, /* @__PURE__ */ React53.createElement("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75" }), /* @__PURE__ */ React53.createElement("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-emerald-500" })), /* @__PURE__ */ React53.createElement("span", null, onlineCount.toLocaleString(), " online")), /* @__PURE__ */ React53.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ React53.createElement("span", null, visitorCount.toLocaleString(), " visitors since launch"), /* @__PURE__ */ React53.createElement("span", { className: "mx-1.5" }, "\xB7"), /* @__PURE__ */ React53.createElement("span", { className: "text-black underline decoration-neutral-300 hover:decoration-black transition-colors whitespace-nowrap" }, "Live stats"))), /* @__PURE__ */ React53.createElement("section", { className: "flex flex-col items-center mb-16" }, /* @__PURE__ */ React53.createElement("h2", { className: "flex flex-wrap items-center justify-center gap-x-3 text-center text-3xl md:text-5xl tracking-tight text-black mb-3" }, /* @__PURE__ */ React53.createElement("span", null, "Claim #", projectedRank, " for"), /* @__PURE__ */ React53.createElement("span", { className: "inline-flex items-center gap-3 bg-neutral-100 rounded-full p-1.5 border border-neutral-200" }, /* @__PURE__ */ React53.createElement("button", { onClick: () => handleBidChange(-1), type: "button", className: "w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-full bg-white text-black hover:bg-neutral-50 transition-colors outline-none text-lg" }, "\u2212"), /* @__PURE__ */ React53.createElement("div", { className: "flex items-center tracking-tight px-2 w-24 justify-center" }, /* @__PURE__ */ React53.createElement("span", { className: "text-[#068afe] mr-0.5" }, "$"), /* @__PURE__ */ React53.createElement(
|
|
5561
5578
|
"input",
|
|
5562
5579
|
{
|
|
5563
5580
|
type: "number",
|
|
5564
5581
|
value: bidAmount,
|
|
5565
|
-
onChange: (e) => setBidAmount(Number(e.target.value)),
|
|
5582
|
+
onChange: (e) => setBidAmount(Math.max(1, Number(e.target.value))),
|
|
5566
5583
|
className: "w-full bg-transparent p-0 outline-none text-center tabular-nums text-[#068afe] "
|
|
5567
5584
|
}
|
|
5568
|
-
)), /* @__PURE__ */ React53.createElement("button", { onClick: () => handleBidChange(1), type: "button", className: "w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-full bg-white text-black hover:bg-neutral-50 transition-colors outline-none text-lg" }, "+"))), /* @__PURE__ */ React53.createElement("p", { className: "text-center text-sm text-neutral-500 max-w-md" }, /* @__PURE__ */ React53.createElement("span", { className: "text-[#068afe]" }, "New spots start at $
|
|
5585
|
+
)), /* @__PURE__ */ React53.createElement("button", { onClick: () => handleBidChange(1), type: "button", className: "w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-full bg-white text-black hover:bg-neutral-50 transition-colors outline-none text-lg" }, "+"))), /* @__PURE__ */ React53.createElement("p", { className: "text-center text-sm text-neutral-500 max-w-md" }, /* @__PURE__ */ React53.createElement("span", { className: "text-[#068afe]" }, "New spots start at $1."), " Paying less than the #1 price puts you on the board at whatever rank your bid secures."), /* @__PURE__ */ React53.createElement("form", { onSubmit: handleSubmit, className: "mt-8 flex flex-col md:flex-row items-stretch md:items-center gap-3 w-full max-w-3xl bg-white p-2 rounded-2xl md:rounded-full" }, /* @__PURE__ */ React53.createElement("div", { className: "relative flex-1 min-w-0" }, /* @__PURE__ */ React53.createElement("div", { className: "absolute inset-y-0 left-0 pl-3 md:pl-4 flex items-center pointer-events-none" }, /* @__PURE__ */ React53.createElement("div", { className: "w-7 h-7 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden" }, inputFaviconSrc ? /* @__PURE__ */ React53.createElement("img", { src: inputFaviconSrc, alt: "", className: "w-full h-full object-cover" }) : /* @__PURE__ */ React53.createElement(HugeiconsIcon40, { icon: Link01Icon, size: 14, className: "text-neutral-400" }))), /* @__PURE__ */ React53.createElement(
|
|
5569
5586
|
"input",
|
|
5570
5587
|
{
|
|
5571
5588
|
id: "identity-input",
|