@lockerverse/react 0.2.125-dev.1 → 0.2.127-dev.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.
@@ -0,0 +1,179 @@
1
+ @import "./auction-base.css";
2
+
3
+ .lockerverse-auction-result {
4
+ width: 100%;
5
+ max-width: none;
6
+ padding: 0;
7
+ background: transparent;
8
+ }
9
+ .lockerverse-auction-result__layout {
10
+ display: grid;
11
+ grid-template-columns: minmax(0, 1.16fr) minmax(280px, 420px);
12
+ gap: 40px;
13
+ align-items: center;
14
+ }
15
+ .lockerverse-auction-result__summary {
16
+ min-width: 0;
17
+ }
18
+ .lockerverse-auction-result__badge {
19
+ display: inline-flex;
20
+ gap: 10px;
21
+ align-items: center;
22
+ padding: 10px 16px;
23
+ border: 1px solid var(--lockerverse-border);
24
+ border-radius: 999px;
25
+ }
26
+ .lockerverse-auction-result .lockerverse-auction-result__community {
27
+ margin-top: 28px;
28
+ font-size: 0.85em;
29
+ }
30
+ .lockerverse-auction-result .lockerverse-auction-result__title {
31
+ margin: 16px 0;
32
+ font-size: var(
33
+ --lockerverse-auction-result-title-size,
34
+ clamp(28px, 4cqi, 52px)
35
+ );
36
+ font-weight: 600;
37
+ line-height: 1.1;
38
+ letter-spacing: -0.04em;
39
+ overflow-wrap: anywhere;
40
+ }
41
+ .lockerverse-auction-result .lockerverse-auction-result__description {
42
+ margin: 20px 0 28px;
43
+ font-size: 1.15em;
44
+ line-height: 1.8;
45
+ }
46
+ .lockerverse-auction-result__assurance {
47
+ display: flex;
48
+ gap: 16px;
49
+ padding-block: 20px;
50
+ border-top: 1px solid var(--lockerverse-border);
51
+ }
52
+ .lockerverse-auction-result__assurance > svg {
53
+ flex-shrink: 0;
54
+ margin-top: 2px;
55
+ }
56
+ .lockerverse-auction-result__assurance p {
57
+ line-height: 1.7;
58
+ }
59
+ .lockerverse-auction-result__actions {
60
+ display: flex;
61
+ flex-wrap: wrap;
62
+ gap: 12px;
63
+ margin-top: 24px;
64
+ }
65
+ .lockerverse-auction-result .lockerverse-auction-result__action {
66
+ display: inline-flex;
67
+ gap: 12px;
68
+ align-items: center;
69
+ justify-content: center;
70
+ min-height: 44px;
71
+ padding: 12px 20px;
72
+ font: inherit;
73
+ font-weight: 600;
74
+ color: var(--lockerverse-accent-contrast, #fff);
75
+ text-decoration: none;
76
+ background: var(--lockerverse-accent);
77
+ border: 1px solid transparent;
78
+ border-radius: 999px;
79
+ }
80
+ .lockerverse-auction-result .lockerverse-auction-result__action--secondary {
81
+ color: var(--lockerverse-text);
82
+ background: transparent;
83
+ border-color: var(--lockerverse-border);
84
+ }
85
+ .lockerverse-auction-result__action:focus-visible {
86
+ outline: 2px solid var(--lockerverse-accent);
87
+ outline-offset: 3px;
88
+ }
89
+ .lockerverse-auction-result__receipt {
90
+ min-width: 0;
91
+ overflow: hidden;
92
+ background: var(--lockerverse-control);
93
+ border: 1px solid var(--lockerverse-border);
94
+ border-radius: var(--lockerverse-radius);
95
+ }
96
+ .lockerverse-auction-result__image {
97
+ display: block;
98
+ width: 100%;
99
+ height: auto;
100
+ aspect-ratio: 1.4;
101
+ object-fit: cover;
102
+ }
103
+ .lockerverse-auction-result__receipt-body {
104
+ padding: 24px;
105
+ }
106
+ .lockerverse-auction-result__eyebrow {
107
+ font-size: 0.85em;
108
+ }
109
+ .lockerverse-auction-result .lockerverse-auction-result__receipt-title {
110
+ font-size: var(
111
+ --lockerverse-auction-result-receipt-title-size,
112
+ var(--lockerverse-auction-subheading-size, 30px)
113
+ );
114
+ font-weight: 600;
115
+ line-height: 1.2;
116
+ }
117
+ .lockerverse-auction-result__details {
118
+ margin: 24px 0;
119
+ border-block: 1px solid var(--lockerverse-border);
120
+ }
121
+ .lockerverse-auction-result__details > div {
122
+ display: flex;
123
+ gap: 20px;
124
+ justify-content: space-between;
125
+ padding-block: 14px;
126
+ }
127
+ .lockerverse-auction-result__details > div + div {
128
+ border-top: 1px solid var(--lockerverse-border);
129
+ }
130
+ .lockerverse-auction-result__details dt {
131
+ color: var(--lockerverse-muted);
132
+ }
133
+ .lockerverse-auction-result__details dd {
134
+ max-width: 65%;
135
+ margin: 0;
136
+ font-weight: 600;
137
+ text-align: right;
138
+ overflow-wrap: anywhere;
139
+ }
140
+ .lockerverse-auction-result__receipt h4 {
141
+ margin: 0 0 16px;
142
+ font: inherit;
143
+ font-weight: 600;
144
+ }
145
+ .lockerverse-auction-result__steps {
146
+ display: grid;
147
+ padding: 0;
148
+ margin: 0;
149
+ line-height: 1.7;
150
+ color: var(--lockerverse-muted);
151
+ list-style: none;
152
+ }
153
+ .lockerverse-auction-result__steps li {
154
+ display: grid;
155
+ grid-template-columns: 24px minmax(0, 1fr);
156
+ gap: 24px;
157
+ padding-block: 20px;
158
+ }
159
+ .lockerverse-auction-result__steps li:first-child {
160
+ padding-top: 0;
161
+ }
162
+ .lockerverse-auction-result__steps li:last-child {
163
+ padding-bottom: 0;
164
+ }
165
+ .lockerverse-auction-result__steps li + li {
166
+ border-top: 1px solid var(--lockerverse-border);
167
+ }
168
+ .lockerverse-auction-result__step-number {
169
+ padding-top: 4px;
170
+ font-size: 0.8em;
171
+ font-variant-numeric: tabular-nums;
172
+ letter-spacing: 0.2em;
173
+ }
174
+ @container (max-width: 800px) {
175
+ .lockerverse-auction-result__layout {
176
+ grid-template-columns: minmax(0, 1fr);
177
+ gap: 28px;
178
+ }
179
+ }
@@ -0,0 +1,45 @@
1
+ import { n as LockerverseTheme, t as LockerverseStyle } from "./theme.js";
2
+ //#region src/auction-result.d.ts
3
+ type AuctionPurchaseDetails = {
4
+ purchaseId: string;
5
+ unitAmountCents: number;
6
+ quantity: number;
7
+ subtotalCents: number;
8
+ serviceFeeCents: number;
9
+ totalCents: number;
10
+ };
11
+ type LockerverseAuctionOutcome = {
12
+ kind: "bid";
13
+ amountCents?: number;
14
+ } | (AuctionPurchaseDetails & {
15
+ kind: "purchase";
16
+ /** Use only after the server confirms payment. Receipt amounts alone are not proof. */
17
+ status: "paid";
18
+ }) | (AuctionPurchaseDetails & {
19
+ kind: "receipt";
20
+ });
21
+ type LockerverseAuctionResultAction = {
22
+ label: string;
23
+ href?: string;
24
+ onClick?: () => void;
25
+ };
26
+ type LockerverseAuctionResultProps = {
27
+ outcome: LockerverseAuctionOutcome;
28
+ itemName: string;
29
+ imageUrl?: string | undefined;
30
+ auctionName?: string | undefined;
31
+ communityName?: string | undefined;
32
+ closesAtLabel?: string | undefined;
33
+ primaryAction?: LockerverseAuctionResultAction | undefined;
34
+ secondaryAction?: LockerverseAuctionResultAction | undefined;
35
+ className?: string | undefined;
36
+ theme?: LockerverseTheme | undefined;
37
+ style?: LockerverseStyle | undefined;
38
+ /** Focus the result after an inline checkout completes. Defaults to false. */
39
+ focusHeading?: boolean | undefined;
40
+ };
41
+ /** Shared result view. Hosts must provide a verified outcome or a neutral receipt. */
42
+ declare function LockerverseAuctionResult(props: LockerverseAuctionResultProps): import("react").JSX.Element;
43
+ //#endregion
44
+ export { type LockerverseAuctionOutcome, LockerverseAuctionResult, type LockerverseAuctionResultAction, type LockerverseAuctionResultProps, type LockerverseStyle, type LockerverseTheme };
45
+ //# sourceMappingURL=auction-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auction-result.d.ts","names":[],"sources":["../src/auction-result.tsx"],"mappings":";;KAWK;EACH;EACA;EACA;EACA;EACA;EACA;;KAGU;EACN;EAAa;KACd;EACC;;EAEA;MAED;EAA2B;;KAEpB;EACV;EACA;EACA;;KAGU;EACV,SAAS;EACT;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB,kBAAkB;EAClB;EACA,QAAQ;EACR,QAAQ;;EAER;;;iBAwHc,yBAAyB,OAAO,gDAA6B,IAAA"}
@@ -0,0 +1 @@
1
+ import{t as e}from"./auction-result2.js";export{e as LockerverseAuctionResult};
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./format-money.js";import{ArrowRight as t,BadgeCheck as n,FileText as r,ShieldCheck as i,TimerReset as a}from"lucide-react";import{useEffect as o,useId as s,useRef as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";function f({action:e,secondary:n=!1}){let r=`lockerverse-auction-result__action${n?` lockerverse-auction-result__action--secondary`:``}`,i=d(l,{children:[e.label,n?null:u(t,{"aria-hidden":`true`,size:18})]});return e.href?u(`a`,{className:r,href:e.href,onClick:e.onClick,children:i}):u(`button`,{className:r,onClick:e.onClick,type:`button`,children:i})}const p={bid:{assurance:`A bid is not a purchase. Payment is collected only if you win at settlement.`,assuranceTitle:`Bid authorization saved`,badge:`Bid submitted`,description:`Your bid and payment method are recorded. You have not been charged for this bid.`,next:`Other bidders can still place bids until the item closes.`,nextTitle:`Follow the auction`,receiptLabel:`Bid summary`,steps:[`Your bid is recorded. This does not confirm that you have won.`,`Your saved payment method can be charged if you win at settlement.`,`Watch your email for bid updates and return to the item to check its status.`],title:`Bid received`},purchase:{assurance:`This receipt shows the amount paid for your purchase.`,assuranceTitle:`Payment processed`,badge:`Purchase confirmed`,description:`Your payment is confirmed and your purchase is recorded.`,next:`The community handles delivery or collection for this item.`,nextTitle:`Next steps`,receiptLabel:`Purchase receipt`,steps:[`Your payment is complete and your purchase is recorded.`,`The community can review your buyer and delivery details.`,`Keep your receipt number. Contact the community if you need help with your order.`],title:`Purchase complete`},receipt:{assurance:`The amounts below are the recorded purchase amounts, not proof of payment.`,assuranceTitle:`Recorded purchase`,badge:`Purchase details`,description:`Payment status is not confirmed on this page.`,next:`Contact the community if you need to confirm your payment or order status.`,nextTitle:`Next steps`,receiptLabel:`Purchase receipt`,steps:[`These are the recorded purchase details. They do not confirm payment.`,`Check your purchase confirmation for the payment result.`,`Contact the community with your receipt number if you need help.`],title:`Purchase details`}};function m({outcome:t,auctionName:n,communityName:r,closesAtLabel:i}){let a=[];return t.kind===`bid`?t.amountCents!==void 0&&a.push([`Bid amount`,e(t.amountCents)]):(a.push([`Unit price`,e(t.unitAmountCents)],[`Quantity`,String(t.quantity)],[`Subtotal`,e(t.subtotalCents)]),t.serviceFeeCents>0&&a.push([`Service fee`,e(t.serviceFeeCents)]),a.push([t.kind===`purchase`?`Total paid`:`Total`,e(t.totalCents)],[`Receipt`,t.purchaseId])),n&&a.push([`Auction`,n]),r&&a.push([`Community`,r]),i&&a.push([`Closes`,i]),a}function h(e){let{outcome:t,itemName:l,imageUrl:h,communityName:g,primaryAction:_,secondaryAction:v,className:y,theme:b=`dark`,style:x}=e,S=s(),C=c(null);o(()=>{e.focusHeading&&C.current?.focus()},[e.focusHeading]);let w=p[t.kind],T=t.kind===`receipt`?r:n,E=t.kind===`receipt`?r:i,D=m(e);return u(`section`,{"aria-labelledby":S,className:[`lockerverse-auctions lockerverse-auction-result`,y].filter(Boolean).join(` `),"data-lockerverse-theme":b,style:x,children:d(`div`,{className:`lockerverse-auction-result__layout`,children:[d(`div`,{className:`lockerverse-auction-result__summary`,children:[d(`span`,{className:`lockerverse-auction-result__badge`,children:[u(T,{"aria-hidden":`true`,size:18}),w.badge]}),g?u(`p`,{className:`lockerverse-auction-result__community`,children:g}):null,d(`h2`,{className:`lockerverse-auction-result__title`,id:S,ref:C,tabIndex:e.focusHeading?-1:void 0,children:[w.title,` for `,l,`.`]}),u(`p`,{className:`lockerverse-auction-result__description`,children:w.description}),d(`div`,{className:`lockerverse-auction-result__assurance`,children:[u(E,{"aria-hidden":`true`,size:22}),d(`div`,{children:[u(`strong`,{children:w.assuranceTitle}),u(`p`,{children:w.assurance})]})]}),d(`div`,{className:`lockerverse-auction-result__assurance`,children:[u(a,{"aria-hidden":`true`,size:22}),d(`div`,{children:[u(`strong`,{children:w.nextTitle}),u(`p`,{children:w.next})]})]}),_||v?d(`div`,{className:`lockerverse-auction-result__actions`,children:[_?u(f,{action:_}):null,v?u(f,{action:v,secondary:!0}):null]}):null]}),d(`aside`,{"aria-label":w.receiptLabel,className:`lockerverse-auction-result__receipt`,children:[h?u(`img`,{alt:l,className:`lockerverse-auction-result__image`,height:300,src:h,width:420}):null,d(`div`,{className:`lockerverse-auction-result__receipt-body`,children:[u(`p`,{className:`lockerverse-auction-result__eyebrow`,children:w.receiptLabel}),u(`h3`,{className:`lockerverse-auction-result__receipt-title`,children:l}),u(`dl`,{className:`lockerverse-auction-result__details`,children:D.map(([e,t])=>d(`div`,{children:[u(`dt`,{children:e}),u(`dd`,{children:t})]},e))}),u(`h4`,{children:`What happens next`}),u(`ol`,{className:`lockerverse-auction-result__steps`,role:`list`,children:w.steps.map((e,t)=>d(`li`,{children:[u(`span`,{"aria-hidden":`true`,className:`lockerverse-auction-result__step-number`,children:String(t+1).padStart(2,`0`)}),u(`span`,{children:e})]},e))})]})]})]})})}export{h as t};
2
+ //# sourceMappingURL=auction-result2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auction-result2.js","names":[],"sources":["../src/auction-result.tsx"],"sourcesContent":["import {\n ArrowRight,\n BadgeCheck,\n FileText,\n ShieldCheck,\n TimerReset,\n} from \"lucide-react\";\nimport { useEffect, useId, useRef } from \"react\";\nimport { formatMoney } from \"./format-money.ts\";\nimport type { LockerverseStyle, LockerverseTheme } from \"./theme.ts\";\n\ntype AuctionPurchaseDetails = {\n purchaseId: string;\n unitAmountCents: number;\n quantity: number;\n subtotalCents: number;\n serviceFeeCents: number;\n totalCents: number;\n};\n\nexport type LockerverseAuctionOutcome =\n | { kind: \"bid\"; amountCents?: number }\n | (AuctionPurchaseDetails & {\n kind: \"purchase\";\n /** Use only after the server confirms payment. Receipt amounts alone are not proof. */\n status: \"paid\";\n })\n | (AuctionPurchaseDetails & { kind: \"receipt\" });\n\nexport type LockerverseAuctionResultAction = {\n label: string;\n href?: string;\n onClick?: () => void;\n};\n\nexport type LockerverseAuctionResultProps = {\n outcome: LockerverseAuctionOutcome;\n itemName: string;\n imageUrl?: string | undefined;\n auctionName?: string | undefined;\n communityName?: string | undefined;\n closesAtLabel?: string | undefined;\n primaryAction?: LockerverseAuctionResultAction | undefined;\n secondaryAction?: LockerverseAuctionResultAction | undefined;\n className?: string | undefined;\n theme?: LockerverseTheme | undefined;\n style?: LockerverseStyle | undefined;\n /** Focus the result after an inline checkout completes. Defaults to false. */\n focusHeading?: boolean | undefined;\n};\n\nfunction ResultAction({\n action,\n secondary = false,\n}: {\n action: LockerverseAuctionResultAction;\n secondary?: boolean;\n}) {\n const className = `lockerverse-auction-result__action${secondary ? \" lockerverse-auction-result__action--secondary\" : \"\"}`;\n const content = (\n <>\n {action.label}\n {secondary ? null : <ArrowRight aria-hidden=\"true\" size={18} />}\n </>\n );\n return action.href ? (\n <a className={className} href={action.href} onClick={action.onClick}>\n {content}\n </a>\n ) : (\n <button className={className} onClick={action.onClick} type=\"button\">\n {content}\n </button>\n );\n}\n\nconst outcomeCopy = {\n bid: {\n assurance:\n \"A bid is not a purchase. Payment is collected only if you win at settlement.\",\n assuranceTitle: \"Bid authorization saved\",\n badge: \"Bid submitted\",\n description:\n \"Your bid and payment method are recorded. You have not been charged for this bid.\",\n next: \"Other bidders can still place bids until the item closes.\",\n nextTitle: \"Follow the auction\",\n receiptLabel: \"Bid summary\",\n steps: [\n \"Your bid is recorded. This does not confirm that you have won.\",\n \"Your saved payment method can be charged if you win at settlement.\",\n \"Watch your email for bid updates and return to the item to check its status.\",\n ],\n title: \"Bid received\",\n },\n purchase: {\n assurance: \"This receipt shows the amount paid for your purchase.\",\n assuranceTitle: \"Payment processed\",\n badge: \"Purchase confirmed\",\n description: \"Your payment is confirmed and your purchase is recorded.\",\n next: \"The community handles delivery or collection for this item.\",\n nextTitle: \"Next steps\",\n receiptLabel: \"Purchase receipt\",\n steps: [\n \"Your payment is complete and your purchase is recorded.\",\n \"The community can review your buyer and delivery details.\",\n \"Keep your receipt number. Contact the community if you need help with your order.\",\n ],\n title: \"Purchase complete\",\n },\n receipt: {\n assurance:\n \"The amounts below are the recorded purchase amounts, not proof of payment.\",\n assuranceTitle: \"Recorded purchase\",\n badge: \"Purchase details\",\n description: \"Payment status is not confirmed on this page.\",\n next: \"Contact the community if you need to confirm your payment or order status.\",\n nextTitle: \"Next steps\",\n receiptLabel: \"Purchase receipt\",\n steps: [\n \"These are the recorded purchase details. They do not confirm payment.\",\n \"Check your purchase confirmation for the payment result.\",\n \"Contact the community with your receipt number if you need help.\",\n ],\n title: \"Purchase details\",\n },\n};\n\nfunction getResultDetails({\n outcome,\n auctionName,\n communityName,\n closesAtLabel,\n}: LockerverseAuctionResultProps) {\n const details: [string, string][] = [];\n if (outcome.kind === \"bid\") {\n if (outcome.amountCents !== undefined) {\n details.push([\"Bid amount\", formatMoney(outcome.amountCents)]);\n }\n } else {\n details.push(\n [\"Unit price\", formatMoney(outcome.unitAmountCents)],\n [\"Quantity\", String(outcome.quantity)],\n [\"Subtotal\", formatMoney(outcome.subtotalCents)]\n );\n if (outcome.serviceFeeCents > 0) {\n details.push([\"Service fee\", formatMoney(outcome.serviceFeeCents)]);\n }\n details.push(\n [\n outcome.kind === \"purchase\" ? \"Total paid\" : \"Total\",\n formatMoney(outcome.totalCents),\n ],\n [\"Receipt\", outcome.purchaseId]\n );\n }\n if (auctionName) {\n details.push([\"Auction\", auctionName]);\n }\n if (communityName) {\n details.push([\"Community\", communityName]);\n }\n if (closesAtLabel) {\n details.push([\"Closes\", closesAtLabel]);\n }\n return details;\n}\n\n/** Shared result view. Hosts must provide a verified outcome or a neutral receipt. */\nexport function LockerverseAuctionResult(props: LockerverseAuctionResultProps) {\n const {\n outcome,\n itemName,\n imageUrl,\n communityName,\n primaryAction,\n secondaryAction,\n className,\n theme = \"dark\",\n style,\n } = props;\n const titleId = useId();\n const headingRef = useRef<HTMLHeadingElement>(null);\n useEffect(() => {\n if (props.focusHeading) {\n headingRef.current?.focus();\n }\n }, [props.focusHeading]);\n const copy = outcomeCopy[outcome.kind];\n const StatusIcon = outcome.kind === \"receipt\" ? FileText : BadgeCheck;\n const AssuranceIcon = outcome.kind === \"receipt\" ? FileText : ShieldCheck;\n const details = getResultDetails(props);\n return (\n <section\n aria-labelledby={titleId}\n className={[\"lockerverse-auctions lockerverse-auction-result\", className]\n .filter(Boolean)\n .join(\" \")}\n data-lockerverse-theme={theme}\n style={style}\n >\n <div className=\"lockerverse-auction-result__layout\">\n <div className=\"lockerverse-auction-result__summary\">\n <span className=\"lockerverse-auction-result__badge\">\n <StatusIcon aria-hidden=\"true\" size={18} />\n {copy.badge}\n </span>\n {communityName ? (\n <p className=\"lockerverse-auction-result__community\">\n {communityName}\n </p>\n ) : null}\n <h2\n className=\"lockerverse-auction-result__title\"\n id={titleId}\n ref={headingRef}\n tabIndex={props.focusHeading ? -1 : undefined}\n >\n {copy.title} for {itemName}.\n </h2>\n <p className=\"lockerverse-auction-result__description\">\n {copy.description}\n </p>\n <div className=\"lockerverse-auction-result__assurance\">\n <AssuranceIcon aria-hidden=\"true\" size={22} />\n <div>\n <strong>{copy.assuranceTitle}</strong>\n <p>{copy.assurance}</p>\n </div>\n </div>\n <div className=\"lockerverse-auction-result__assurance\">\n <TimerReset aria-hidden=\"true\" size={22} />\n <div>\n <strong>{copy.nextTitle}</strong>\n <p>{copy.next}</p>\n </div>\n </div>\n {primaryAction || secondaryAction ? (\n <div className=\"lockerverse-auction-result__actions\">\n {primaryAction ? <ResultAction action={primaryAction} /> : null}\n {secondaryAction ? (\n <ResultAction action={secondaryAction} secondary />\n ) : null}\n </div>\n ) : null}\n </div>\n <aside\n aria-label={copy.receiptLabel}\n className=\"lockerverse-auction-result__receipt\"\n >\n {imageUrl ? (\n <img\n alt={itemName}\n className=\"lockerverse-auction-result__image\"\n height={300}\n src={imageUrl}\n width={420}\n />\n ) : null}\n <div className=\"lockerverse-auction-result__receipt-body\">\n <p className=\"lockerverse-auction-result__eyebrow\">\n {copy.receiptLabel}\n </p>\n <h3 className=\"lockerverse-auction-result__receipt-title\">\n {itemName}\n </h3>\n <dl className=\"lockerverse-auction-result__details\">\n {details.map(([label, value]) => (\n <div key={label}>\n <dt>{label}</dt>\n <dd>{value}</dd>\n </div>\n ))}\n </dl>\n <h4>What happens next</h4>\n {/* biome-ignore lint/a11y/noRedundantRoles: Keep list semantics in Safari when visual markers replace list-style. */}\n <ol className=\"lockerverse-auction-result__steps\" role=\"list\">\n {copy.steps.map((step, index) => (\n <li key={step}>\n <span\n aria-hidden=\"true\"\n className=\"lockerverse-auction-result__step-number\"\n >\n {String(index + 1).padStart(2, \"0\")}\n </span>\n <span>{step}</span>\n </li>\n ))}\n </ol>\n </div>\n </aside>\n </div>\n </section>\n );\n}\n"],"mappings":"wQAmDA,SAAS,EAAa,CACpB,SACA,YAAY,IAIX,CACD,IAAM,EAAY,qCAAqC,EAAY,iDAAmD,KAChH,EACJ,EAAA,EAAA,CAAA,SAAA,CACG,EAAO,MACP,EAAY,KAAO,EAAC,EAAD,CAAY,cAAY,OAAO,KAAM,EAAK,CAAA,CAC9D,CAAA,CAAA,EAEJ,OAAO,EAAO,KACZ,EAAC,IAAD,CAAc,YAAW,KAAM,EAAO,KAAM,QAAS,EAAO,QACzD,SAAA,CACA,CAAA,EAEH,EAAC,SAAD,CAAmB,YAAW,QAAS,EAAO,QAAS,KAAK,SACzD,SAAA,CACK,CAAA,CAEZ,CAEA,MAAM,EAAc,CAClB,IAAK,CACH,UACE,+EACF,eAAgB,0BAChB,MAAO,gBACP,YACE,oFACF,KAAM,4DACN,UAAW,qBACX,aAAc,cACd,MAAO,CACL,iEACA,qEACA,8EACF,EACA,MAAO,cACT,EACA,SAAU,CACR,UAAW,wDACX,eAAgB,oBAChB,MAAO,qBACP,YAAa,2DACb,KAAM,8DACN,UAAW,aACX,aAAc,mBACd,MAAO,CACL,0DACA,4DACA,mFACF,EACA,MAAO,mBACT,EACA,QAAS,CACP,UACE,6EACF,eAAgB,oBAChB,MAAO,mBACP,YAAa,gDACb,KAAM,6EACN,UAAW,aACX,aAAc,mBACd,MAAO,CACL,wEACA,2DACA,kEACF,EACA,MAAO,kBACT,CACF,EAEA,SAAS,EAAiB,CACxB,UACA,cACA,gBACA,iBACgC,CAChC,IAAM,EAA8B,CAAC,EA+BrC,OA9BI,EAAQ,OAAS,MACf,EAAQ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AAC,IAAD,CAAG,UAAU,sCACV,SAAA,EAAK,YACL,CAAA,EACH,EAAC,KAAD,CAAI,UAAU,4CACX,SAAA,CACC,CAAA,EACJ,EAAC,KAAD,CAAI,UAAU,sCACX,SAAA,EAAQ,KAAK,CAAC,EAAO,KACpB,EAAC,MAAD,CAAA,SAAA,CACE,EAAC,KAAD,CAAA,SAAK,CAAU,CAAA,EACf,EAAC,KAAD,CAAA,SAAK,CAAU,CAAA,CACZ,CAAA,EAHK,CAGL,CACN,CACC,CAAA,EACJ,EAAC,KAAD,CAAA,SAAI,mBAAqB,CAAA,EAEzB,EAAC,KAAD,CAAI,UAAU,oCAAoC,KAAK,OACpD,SAAA,EAAK,MAAM,KAAK,EAAM,IACrB,EAAC,KAAD,CAAA,SAAA,CACE,EAAC,OAAD,CACE,cAAY,OACZ,UAAU,0CAET,SAAA,OAAO,EAAQ,CAAC,CAAC,CAAC,SAAS,EAAG,GAAG,CAC9B,CAAA,EACN,EAAC,OAAD,CAAA,SAAO,CAAW,CAAA,CAChB,CAAA,EARK,CAQL,CACL,CACC,CAAA,CACD,CACA,CAAA,CAAA,CACJ,CAAA,CAAA,GACE,CAAA,CAEb"}
package/dist/auction.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { n as LockerverseTheme, t as LockerverseStyle } from "./theme.js";
2
- import { a as LockerverseAuctionProps, i as LockerverseAuctionItemRenderContext, n as LockerverseAuctionItemCardProps, r as LockerverseAuction, t as LockerverseAuctionItemCard } from "./lockerverse-auction-item-card.js";
3
- export { LockerverseAuction, LockerverseAuctionItemCard, type LockerverseAuctionItemCardProps, type LockerverseAuctionItemRenderContext, type LockerverseAuctionProps, type LockerverseStyle, type LockerverseTheme };
2
+ import { a as LockerverseAuctionItemRenderContext, i as LockerverseAuctionItemFilter, n as LockerverseAuctionItemCardProps, o as LockerverseAuctionProps, r as LockerverseAuction, t as LockerverseAuctionItemCard } from "./lockerverse-auction-item-card.js";
3
+ export { LockerverseAuction, LockerverseAuctionItemCard, type LockerverseAuctionItemCardProps, type LockerverseAuctionItemFilter, type LockerverseAuctionItemRenderContext, type LockerverseAuctionProps, type LockerverseStyle, type LockerverseTheme };
package/dist/auctions.css CHANGED
@@ -3,3 +3,4 @@
3
3
  @import "./auction-checkout.css";
4
4
  @import "./auction-base.css";
5
5
  @import "./auction-item-layout.css";
6
+ @import "./auction-result.css";
@@ -1,12 +1,15 @@
1
1
  import { n as useLockerverseAuctions, t as UseLockerverseAuctionsResult } from "./use-lockerverse-auctions.js";
2
2
  import { n as LockerverseTheme, t as LockerverseStyle } from "./theme.js";
3
- import { a as LockerverseAuctionProps, i as LockerverseAuctionItemRenderContext, n as LockerverseAuctionItemCardProps, r as LockerverseAuction, t as LockerverseAuctionItemCard } from "./lockerverse-auction-item-card.js";
3
+ import { a as LockerverseAuctionItemRenderContext, i as LockerverseAuctionItemFilter, n as LockerverseAuctionItemCardProps, o as LockerverseAuctionProps, r as LockerverseAuction, t as LockerverseAuctionItemCard } from "./lockerverse-auction-item-card.js";
4
+ import { LockerverseAuction as LockerverseAuction$1 } from "@lockerverse/sdk/auctions";
4
5
  //#region src/lockerverse-auctions.d.ts
5
6
  type LockerverseAuctionsProps = Omit<LockerverseAuctionProps, "auction" | "onBack"> & {
6
7
  auctions: UseLockerverseAuctionsResult;
8
+ getAuctionHref?: (auction: LockerverseAuction$1) => string;
9
+ onSelectAuction?: (auction: LockerverseAuction$1) => void;
7
10
  };
8
11
  /** Optional auction browser. Select an auction to show its items. */
9
- declare function LockerverseAuctions({ auctions, onSelectItem, theme, style, className, showFilters, showHeader, showLineup, renderItem }: LockerverseAuctionsProps): import("react").JSX.Element;
12
+ declare function LockerverseAuctions({ auctions, theme, style, className, showFilters, showHeader, showLineup, getAuctionHref, onSelectAuction, ...contentProps }: LockerverseAuctionsProps): import("react").JSX.Element;
10
13
  //#endregion
11
- export { LockerverseAuction, LockerverseAuctionItemCard, type LockerverseAuctionItemCardProps, type LockerverseAuctionItemRenderContext, type LockerverseAuctionProps, LockerverseAuctions, type LockerverseAuctionsProps, type LockerverseStyle, type LockerverseTheme, type UseLockerverseAuctionsResult, useLockerverseAuctions };
14
+ export { LockerverseAuction, LockerverseAuctionItemCard, type LockerverseAuctionItemCardProps, type LockerverseAuctionItemFilter, type LockerverseAuctionItemRenderContext, type LockerverseAuctionProps, LockerverseAuctions, type LockerverseAuctionsProps, type LockerverseStyle, type LockerverseTheme, type UseLockerverseAuctionsResult, useLockerverseAuctions };
12
15
  //# sourceMappingURL=auctions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auctions.d.ts","names":[],"sources":["../src/lockerverse-auctions.tsx"],"mappings":";;;;KAkBY,2BAA2B,KACrC;EAGA,UAAU;;;iBA8EI,sBACd,UACA,cACA,OACA,OACA,WACA,aACA,YACA,YACA,cACC,2CAAwB,IAAA"}
1
+ {"version":3,"file":"auctions.d.ts","names":[],"sources":["../src/lockerverse-auctions.tsx"],"mappings":";;;;;KAkBY,2BAA2B,KACrC;EAGA,UAAU;EACV,kBAAkB,SAAS;EAC3B,mBAAmB,SAAS;;;iBA0Gd,sBACd,UACA,OACA,OACA,WACA,aACA,YACA,YACA,gBACA,oBACG,gBACF,2CAAwB,IAAA"}
package/dist/auctions.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as e,s as t,t as n}from"./use-auction-boundary.js";import{a as r,i,n as a,o,r as s,s as c,t as l}from"./lockerverse-auction.js";import{t as u}from"./use-lockerverse-auctions.js";import{ArrowRight as d,Gavel as f,ListChecks as p}from"lucide-react";import{useEffect as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";function b({auction:a,onSelect:s}){n(a.startAt,a.endAt,a.items);let l=a.configuration.image||a.items.find(e=>e.image||e.images.length)?.image||a.items.find(e=>e.images.length)?.images[0]||a.community?.banner||a.community?.thumbnail,u=a.description||{active:`Bidding is open on available items.`,draft:`Preview the lineup before bidding opens.`,finished:`Bidding has wrapped. Review the completed items.`}[e(a)];return y(`article`,{className:`lockerverse-auctions__catalog-card`,children:[v(`button`,{"aria-label":`View items in ${a.name}`,className:`lockerverse-auctions__catalog-select`,"data-auction-id":a.id,onClick:s,type:`button`}),y(`div`,{className:`lockerverse-auctions__catalog-media`,children:[v(i,{fallback:l,name:a.name}),y(`div`,{className:`lockerverse-auctions__catalog-chips`,children:[v(`span`,{className:`lockerverse-auctions__catalog-chip`,children:o[e(a)]}),v(c,{auction:a})]}),y(`dl`,{className:`lockerverse-auctions__catalog-metrics`,children:[v(r,{icon:v(p,{"aria-hidden":`true`,size:16}),label:`Items`,value:String(a.items.length)}),v(r,{icon:v(f,{"aria-hidden":`true`,size:16}),label:`Bids`,value:String(a.items.reduce((e,t)=>e+t.bidCount,0))})]})]}),y(`div`,{className:`lockerverse-auctions__catalog-body`,children:[v(`h3`,{children:a.name}),v(t,{className:`lockerverse-auctions__catalog-description`,description:u}),y(`div`,{className:`lockerverse-auctions__catalog-footer`,children:[v(`span`,{className:`lockerverse-auctions__catalog-cta`,children:e(a)===`draft`?`Preview items`:`View items`}),v(`span`,{className:`lockerverse-auctions__catalog-arrow`,children:v(d,{"aria-hidden":`true`,size:16})})]})]})]})}function x({auctions:e,onSelectItem:t,theme:n=`dark`,style:r,className:i,showFilters:a=!0,showHeader:o=!0,showLineup:s=!0,renderItem:c}){let[u,d]=g(null),f=h(null),p=h(null),_=h(u),b=e.auctions?.find(e=>e.id===u);return m(()=>{if(_.current!==u){if(u===null){let e=[...p.current?.querySelectorAll(`button[data-auction-id]`)??[]].find(e=>e.dataset.auctionId===_.current);(f.current??e??p.current)?.focus()}_.current=u}},[u]),y(`section`,{"aria-busy":e.loading,"aria-label":`Auctions`,className:[`lockerverse-auctions`,`lockerverse-auctions--catalog`,i].filter(Boolean).join(` `),"data-lockerverse-theme":n,ref:p,style:r,tabIndex:-1,children:[!b&&o?v(`header`,{className:`lockerverse-auctions__catalog-header`,children:v(`h2`,{ref:f,tabIndex:-1,children:`Auctions`})}):null,e.loading?v(`p`,{role:`status`,children:`Loading auctions…`}):null,e.error?y(`div`,{role:`alert`,children:[v(`p`,{children:e.error.message}),v(`button`,{onClick:e.refresh,type:`button`,children:`Try again`})]}):null,b?v(l,{auction:b,onBack:()=>d(null),onSelectItem:t,showFilters:a,showHeader:o,showLineup:s,theme:n,...r?{style:r}:{},...c?{renderItem:c}:{}},b.id):v(S,{auctions:e.auctions,onSelectAuction:d,showLineup:s})]})}function S({auctions:e,showLineup:t,onSelectAuction:n}){return e?e.length?y(_,{children:[t?y(`div`,{className:`lockerverse-auctions__catalog-lineup`,children:[y(`div`,{children:[v(`h3`,{children:`Auction lineup`}),v(`p`,{children:`Browse the current collection.`})]}),y(`span`,{children:[e.length,` `,e.length===1?`auction`:`auctions`]})]}):null,v(`ul`,{className:`lockerverse-auctions__catalog-grid`,children:e.map(e=>v(`li`,{children:v(b,{auction:e,onSelect:()=>n(e.id)})},e.id))})]}):y(`div`,{className:`lockerverse-auctions__catalog-empty`,children:[v(`h3`,{children:`No auctions yet.`}),v(`p`,{children:`Published auctions will appear here once they are available.`})]}):null}export{a as LockerverseAuction,s as LockerverseAuctionItemCard,x as LockerverseAuctions,u as useLockerverseAuctions};
1
+ import{a as e,c as t,t as n}from"./use-auction-boundary.js";import{a as r,i,n as a,o,r as s,s as c,t as l}from"./lockerverse-auction.js";import{t as u}from"./use-lockerverse-auctions.js";import{ArrowRight as d,Gavel as f,ListChecks as p}from"lucide-react";import{useEffect as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";function b({auction:a,onSelect:s,href:l}){n(a.startAt,a.endAt,a.items);let u=a.configuration.image||a.items.find(e=>e.image||e.images.length)?.image||a.items.find(e=>e.images.length)?.images[0]||a.community?.banner||a.community?.thumbnail,m=a.description||{active:`Bidding is open on available items.`,draft:`Preview the lineup before bidding opens.`,finished:`Bidding has wrapped. Review the completed items.`}[e(a)];return y(`article`,{className:`lockerverse-auctions__catalog-card`,children:[l?v(`a`,{"aria-label":`View items in ${a.name}`,className:`lockerverse-auctions__catalog-select`,"data-auction-id":a.id,href:l,onClick:e=>{s&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),s())},children:y(`span`,{className:`lockerverse-auctions__visually-hidden`,children:[`View items in `,a.name]})}):v(`button`,{"aria-label":`View items in ${a.name}`,className:`lockerverse-auctions__catalog-select`,"data-auction-id":a.id,onClick:s,type:`button`}),y(`div`,{className:`lockerverse-auctions__catalog-media`,children:[v(i,{fallback:u,name:a.name}),y(`div`,{className:`lockerverse-auctions__catalog-chips`,children:[v(`span`,{className:`lockerverse-auctions__catalog-chip`,children:o[e(a)]}),v(c,{auction:a})]}),y(`dl`,{className:`lockerverse-auctions__catalog-metrics`,children:[v(r,{icon:v(p,{"aria-hidden":`true`,size:16}),label:`Items`,value:String(a.items.length)}),v(r,{icon:v(f,{"aria-hidden":`true`,size:16}),label:`Bids`,value:String(a.items.reduce((e,t)=>e+t.bidCount,0))})]})]}),y(`div`,{className:`lockerverse-auctions__catalog-body`,children:[v(`h3`,{children:a.name}),v(t,{className:`lockerverse-auctions__catalog-description`,description:m}),y(`div`,{className:`lockerverse-auctions__catalog-footer`,children:[v(`span`,{className:`lockerverse-auctions__catalog-cta`,children:e(a)===`draft`?`Preview items`:`View items`}),v(`span`,{className:`lockerverse-auctions__catalog-arrow`,children:v(d,{"aria-hidden":`true`,size:16})})]})]})]})}function x({auctions:e,theme:t=`dark`,style:n,className:r,showFilters:i=!0,showHeader:a=!0,showLineup:o=!0,getAuctionHref:s,onSelectAuction:c,...u}){let[d,f]=g(null),p=h(null),_=h(null),b=h(d),x=e.auctions?.find(e=>e.id===d);return m(()=>{if(b.current!==d){if(d===null){let e=[..._.current?.querySelectorAll(`button[data-auction-id]`)??[]].find(e=>e.dataset.auctionId===b.current);(p.current??e??_.current)?.focus()}b.current=d}},[d]),y(`section`,{"aria-busy":e.loading,"aria-label":`Auctions`,className:[`lockerverse-auctions`,`lockerverse-auctions--catalog`,r].filter(Boolean).join(` `),"data-lockerverse-theme":t,ref:_,style:n,tabIndex:-1,children:[!x&&a?v(`header`,{className:`lockerverse-auctions__catalog-header`,children:v(`h2`,{ref:p,tabIndex:-1,children:`Auctions`})}):null,e.loading?v(`p`,{role:`status`,children:`Loading auctions…`}):null,e.error?y(`div`,{role:`alert`,children:[v(`p`,{children:e.error.message}),v(`button`,{onClick:e.refresh,type:`button`,children:`Try again`})]}):null,x?v(l,{auction:x,onBack:()=>f(null),...u,showFilters:i,showHeader:a,showLineup:o,theme:t,...n?{style:n}:{}},x.id):v(S,{auctions:e.auctions,onSelectAuction:e=>{c?c(e):f(e.id)},...s?{getAuctionHref:s}:{},interceptLinks:!!c,showLineup:o})]})}function S({auctions:e,showLineup:t,onSelectAuction:n,getAuctionHref:r,interceptLinks:i}){return e?e.length?y(_,{children:[t?y(`div`,{className:`lockerverse-auctions__catalog-lineup`,children:[y(`div`,{children:[v(`h3`,{children:`Auction lineup`}),v(`p`,{children:`Browse the current collection.`})]}),y(`span`,{children:[e.length,` `,e.length===1?`auction`:`auctions`]})]}):null,v(`ul`,{className:`lockerverse-auctions__catalog-grid`,children:e.map(e=>v(`li`,{children:v(b,{auction:e,...r?{href:r(e)}:{},...!r||i?{onSelect:()=>n(e)}:{}})},e.id))})]}):y(`div`,{className:`lockerverse-auctions__catalog-empty`,children:[v(`h3`,{children:`No auctions yet.`}),v(`p`,{children:`Published auctions will appear here once they are available.`})]}):null}export{a as LockerverseAuction,s as LockerverseAuctionItemCard,x as LockerverseAuctions,u as useLockerverseAuctions};
2
2
  //# sourceMappingURL=auctions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auctions.js","names":[],"sources":["../src/lockerverse-auctions.tsx"],"sourcesContent":["import type { LockerverseAuction as Auction } from \"@lockerverse/sdk/auctions\";\nimport { ArrowRight, Gavel, ListChecks } from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n CatalogImage,\n Metric,\n STATUS_LABELS,\n Timing,\n} from \"./auction-catalog-parts.tsx\";\nimport { AuctionDescription } from \"./auction-description.tsx\";\nimport { getAuctionDisplayStatus } from \"./auction-display.ts\";\nimport {\n AuctionContent,\n type LockerverseAuctionProps,\n} from \"./lockerverse-auction.tsx\";\nimport { useAuctionBoundary } from \"./use-auction-boundary.ts\";\nimport type { UseLockerverseAuctionsResult } from \"./use-lockerverse-auctions.ts\";\n\nexport type LockerverseAuctionsProps = Omit<\n LockerverseAuctionProps,\n \"auction\" | \"onBack\"\n> & {\n auctions: UseLockerverseAuctionsResult;\n};\n\nfunction AuctionCard({\n auction,\n onSelect,\n}: {\n auction: Auction;\n onSelect: () => void;\n}) {\n useAuctionBoundary(auction.startAt, auction.endAt, auction.items);\n const fallback =\n auction.configuration.image ||\n auction.items.find((item) => item.image || item.images.length)?.image ||\n auction.items.find((item) => item.images.length)?.images[0] ||\n auction.community?.banner ||\n auction.community?.thumbnail;\n const description =\n auction.description ||\n {\n active: \"Bidding is open on available items.\",\n draft: \"Preview the lineup before bidding opens.\",\n finished: \"Bidding has wrapped. Review the completed items.\",\n }[getAuctionDisplayStatus(auction)];\n return (\n <article className=\"lockerverse-auctions__catalog-card\">\n <button\n aria-label={`View items in ${auction.name}`}\n className=\"lockerverse-auctions__catalog-select\"\n data-auction-id={auction.id}\n onClick={onSelect}\n type=\"button\"\n />\n <div className=\"lockerverse-auctions__catalog-media\">\n <CatalogImage fallback={fallback} name={auction.name} />\n <div className=\"lockerverse-auctions__catalog-chips\">\n <span className=\"lockerverse-auctions__catalog-chip\">\n {STATUS_LABELS[getAuctionDisplayStatus(auction)]}\n </span>\n <Timing auction={auction} />\n </div>\n <dl className=\"lockerverse-auctions__catalog-metrics\">\n <Metric\n icon={<ListChecks aria-hidden=\"true\" size={16} />}\n label=\"Items\"\n value={String(auction.items.length)}\n />\n <Metric\n icon={<Gavel aria-hidden=\"true\" size={16} />}\n label=\"Bids\"\n value={String(\n auction.items.reduce((sum, item) => sum + item.bidCount, 0)\n )}\n />\n </dl>\n </div>\n <div className=\"lockerverse-auctions__catalog-body\">\n <h3>{auction.name}</h3>\n <AuctionDescription\n className=\"lockerverse-auctions__catalog-description\"\n description={description}\n />\n <div className=\"lockerverse-auctions__catalog-footer\">\n <span className=\"lockerverse-auctions__catalog-cta\">\n {getAuctionDisplayStatus(auction) === \"draft\"\n ? \"Preview items\"\n : \"View items\"}\n </span>\n <span className=\"lockerverse-auctions__catalog-arrow\">\n <ArrowRight aria-hidden=\"true\" size={16} />\n </span>\n </div>\n </div>\n </article>\n );\n}\n\n/** Optional auction browser. Select an auction to show its items. */\nexport function LockerverseAuctions({\n auctions,\n onSelectItem,\n theme = \"dark\",\n style,\n className,\n showFilters = true,\n showHeader = true,\n showLineup = true,\n renderItem,\n}: LockerverseAuctionsProps) {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const headingRef = useRef<HTMLHeadingElement>(null);\n const sectionRef = useRef<HTMLElement>(null);\n const previousId = useRef(selectedId);\n const selected = auctions.auctions?.find(\n (auction) => auction.id === selectedId\n );\n useEffect(() => {\n if (previousId.current !== selectedId) {\n if (selectedId === null) {\n const card = [\n ...(sectionRef.current?.querySelectorAll<HTMLButtonElement>(\n \"button[data-auction-id]\"\n ) ?? []),\n ].find((button) => button.dataset.auctionId === previousId.current);\n (headingRef.current ?? card ?? sectionRef.current)?.focus();\n }\n previousId.current = selectedId;\n }\n }, [selectedId]);\n return (\n <section\n aria-busy={auctions.loading}\n aria-label=\"Auctions\"\n className={[\n \"lockerverse-auctions\",\n \"lockerverse-auctions--catalog\",\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n data-lockerverse-theme={theme}\n ref={sectionRef}\n style={style}\n tabIndex={-1}\n >\n {!selected && showHeader ? (\n <header className=\"lockerverse-auctions__catalog-header\">\n <h2 ref={headingRef} tabIndex={-1}>\n Auctions\n </h2>\n </header>\n ) : null}\n {auctions.loading ? <p role=\"status\">Loading auctions…</p> : null}\n {auctions.error ? (\n <div role=\"alert\">\n <p>{auctions.error.message}</p>\n <button onClick={auctions.refresh} type=\"button\">\n Try again\n </button>\n </div>\n ) : null}\n {selected ? (\n <AuctionContent\n auction={selected}\n key={selected.id}\n onBack={() => setSelectedId(null)}\n onSelectItem={onSelectItem}\n showFilters={showFilters}\n showHeader={showHeader}\n showLineup={showLineup}\n theme={theme}\n {...(style ? { style } : {})}\n {...(renderItem ? { renderItem } : {})}\n />\n ) : (\n <AuctionList\n auctions={auctions.auctions}\n onSelectAuction={setSelectedId}\n showLineup={showLineup}\n />\n )}\n </section>\n );\n}\n\nfunction AuctionList({\n auctions,\n showLineup,\n onSelectAuction,\n}: {\n auctions: Auction[] | null;\n showLineup: boolean;\n onSelectAuction: (id: string) => void;\n}) {\n if (!auctions) {\n return null;\n }\n if (!auctions.length) {\n return (\n <div className=\"lockerverse-auctions__catalog-empty\">\n <h3>No auctions yet.</h3>\n <p>Published auctions will appear here once they are available.</p>\n </div>\n );\n }\n return (\n <>\n {showLineup ? (\n <div className=\"lockerverse-auctions__catalog-lineup\">\n <div>\n <h3>Auction lineup</h3>\n <p>Browse the current collection.</p>\n </div>\n <span>\n {auctions.length} {auctions.length === 1 ? \"auction\" : \"auctions\"}\n </span>\n </div>\n ) : null}\n <ul className=\"lockerverse-auctions__catalog-grid\">\n {auctions.map((auction) => (\n <li key={auction.id}>\n <AuctionCard\n auction={auction}\n onSelect={() => onSelectAuction(auction.id)}\n />\n </li>\n ))}\n </ul>\n </>\n );\n}\n"],"mappings":"4XAyBA,SAAS,EAAY,CACnB,UACA,YAIC,CACD,EAAmB,EAAQ,QAAS,EAAQ,MAAO,EAAQ,KAAK,EAChE,IAAM,EACJ,EAAQ,cAAc,OACtB,EAAQ,MAAM,KAAM,GAAS,EAAK,OAAS,EAAK,OAAO,MAAM,CAAC,EAAE,OAChE,EAAQ,MAAM,KAAM,GAAS,EAAK,OAAO,MAAM,CAAC,EAAE,OAAO,IACzD,EAAQ,WAAW,QACnB,EAAQ,WAAW,UACf,EACJ,EAAQ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,IAAI,EAClB,eACD,cACD,aACA,aACL,QACP,GAAK,EAAQ,CAAE,OAAM,EAAI,CAAC,EAC1B,GAAK,EAAa,CAAE,YAAW,EAAI,CAAC,CACrC,EATM,EAAS,EASf,EAED,EAAC,EAAD,CACE,SAAU,EAAS,SACnB,gBAAiB,EACL,YACb,CAAA,CAEI,GAEb,CAEA,SAAS,EAAY,CACnB,WACA,aACA,mBAKC,CAYD,OAXK,EAGA,EAAS,OASZ,EAAA,EAAA,CAAA,SAAA,CACG,EACC,EAAC,MAAD,CAAK,UAAU,uCAAf,SAAA,CACE,EAAC,MAAD,CAAA,SAAA,CACE,EAAC,KAAD,CAAA,SAAI,gBAAkB,CAAA,EACtB,EAAC,IAAD,CAAA,SAAG,gCAAiC,CAAA,CACjC,CAAA,CAAA,EACL,EAAC,OAAD,CAAA,SAAA,CACG,EAAS,OAAO,IAAE,EAAS,SAAW,EAAI,UAAY,UACnD,CAAA,CAAA,CACH,CACH,CAAA,EAAA,KACJ,EAAC,KAAD,CAAI,UAAU,qCACX,SAAA,EAAS,IAAK,GACb,EAAC,KAAD,CAAA,SACE,EAAC,EAAD,CACW,UACT,aAAgB,EAAgB,EAAQ,EAAE,CAC3C,CAAA,CACC,EALK,EAAQ,EAKb,CACL,CACC,CAAA,CACJ,CAAA,CAAA,EA7BA,EAAC,MAAD,CAAK,UAAU,sCAAf,SAAA,CACE,EAAC,KAAD,CAAA,SAAI,kBAAoB,CAAA,EACxB,EAAC,IAAD,CAAA,SAAG,8DAA+D,CAAA,CAC/D,IAPA,IAmCX"}
1
+ {"version":3,"file":"auctions.js","names":[],"sources":["../src/lockerverse-auctions.tsx"],"sourcesContent":["import type { LockerverseAuction as Auction } from \"@lockerverse/sdk/auctions\";\nimport { ArrowRight, Gavel, ListChecks } from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n CatalogImage,\n Metric,\n STATUS_LABELS,\n Timing,\n} from \"./auction-catalog-parts.tsx\";\nimport { AuctionDescription } from \"./auction-description.tsx\";\nimport { getAuctionDisplayStatus } from \"./auction-display.ts\";\nimport {\n AuctionContent,\n type LockerverseAuctionProps,\n} from \"./lockerverse-auction.tsx\";\nimport { useAuctionBoundary } from \"./use-auction-boundary.ts\";\nimport type { UseLockerverseAuctionsResult } from \"./use-lockerverse-auctions.ts\";\n\nexport type LockerverseAuctionsProps = Omit<\n LockerverseAuctionProps,\n \"auction\" | \"onBack\"\n> & {\n auctions: UseLockerverseAuctionsResult;\n getAuctionHref?: (auction: Auction) => string;\n onSelectAuction?: (auction: Auction) => void;\n};\n\nfunction AuctionCard({\n auction,\n onSelect,\n href,\n}: {\n auction: Auction;\n onSelect?: () => void;\n href?: string;\n}) {\n useAuctionBoundary(auction.startAt, auction.endAt, auction.items);\n const fallback =\n auction.configuration.image ||\n auction.items.find((item) => item.image || item.images.length)?.image ||\n auction.items.find((item) => item.images.length)?.images[0] ||\n auction.community?.banner ||\n auction.community?.thumbnail;\n const description =\n auction.description ||\n {\n active: \"Bidding is open on available items.\",\n draft: \"Preview the lineup before bidding opens.\",\n finished: \"Bidding has wrapped. Review the completed items.\",\n }[getAuctionDisplayStatus(auction)];\n return (\n <article className=\"lockerverse-auctions__catalog-card\">\n {href ? (\n <a\n aria-label={`View items in ${auction.name}`}\n className=\"lockerverse-auctions__catalog-select\"\n data-auction-id={auction.id}\n href={href}\n onClick={(event) => {\n if (\n onSelect &&\n event.button === 0 &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey\n ) {\n event.preventDefault();\n onSelect();\n }\n }}\n >\n <span className=\"lockerverse-auctions__visually-hidden\">\n View items in {auction.name}\n </span>\n </a>\n ) : (\n <button\n aria-label={`View items in ${auction.name}`}\n className=\"lockerverse-auctions__catalog-select\"\n data-auction-id={auction.id}\n onClick={onSelect}\n type=\"button\"\n />\n )}\n <div className=\"lockerverse-auctions__catalog-media\">\n <CatalogImage fallback={fallback} name={auction.name} />\n <div className=\"lockerverse-auctions__catalog-chips\">\n <span className=\"lockerverse-auctions__catalog-chip\">\n {STATUS_LABELS[getAuctionDisplayStatus(auction)]}\n </span>\n <Timing auction={auction} />\n </div>\n <dl className=\"lockerverse-auctions__catalog-metrics\">\n <Metric\n icon={<ListChecks aria-hidden=\"true\" size={16} />}\n label=\"Items\"\n value={String(auction.items.length)}\n />\n <Metric\n icon={<Gavel aria-hidden=\"true\" size={16} />}\n label=\"Bids\"\n value={String(\n auction.items.reduce((sum, item) => sum + item.bidCount, 0)\n )}\n />\n </dl>\n </div>\n <div className=\"lockerverse-auctions__catalog-body\">\n <h3>{auction.name}</h3>\n <AuctionDescription\n className=\"lockerverse-auctions__catalog-description\"\n description={description}\n />\n <div className=\"lockerverse-auctions__catalog-footer\">\n <span className=\"lockerverse-auctions__catalog-cta\">\n {getAuctionDisplayStatus(auction) === \"draft\"\n ? \"Preview items\"\n : \"View items\"}\n </span>\n <span className=\"lockerverse-auctions__catalog-arrow\">\n <ArrowRight aria-hidden=\"true\" size={16} />\n </span>\n </div>\n </div>\n </article>\n );\n}\n\n/** Optional auction browser. Select an auction to show its items. */\nexport function LockerverseAuctions({\n auctions,\n theme = \"dark\",\n style,\n className,\n showFilters = true,\n showHeader = true,\n showLineup = true,\n getAuctionHref,\n onSelectAuction,\n ...contentProps\n}: LockerverseAuctionsProps) {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const headingRef = useRef<HTMLHeadingElement>(null);\n const sectionRef = useRef<HTMLElement>(null);\n const previousId = useRef(selectedId);\n const selected = auctions.auctions?.find(\n (auction) => auction.id === selectedId\n );\n useEffect(() => {\n if (previousId.current !== selectedId) {\n if (selectedId === null) {\n const card = [\n ...(sectionRef.current?.querySelectorAll<HTMLButtonElement>(\n \"button[data-auction-id]\"\n ) ?? []),\n ].find((button) => button.dataset.auctionId === previousId.current);\n (headingRef.current ?? card ?? sectionRef.current)?.focus();\n }\n previousId.current = selectedId;\n }\n }, [selectedId]);\n return (\n <section\n aria-busy={auctions.loading}\n aria-label=\"Auctions\"\n className={[\n \"lockerverse-auctions\",\n \"lockerverse-auctions--catalog\",\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n data-lockerverse-theme={theme}\n ref={sectionRef}\n style={style}\n tabIndex={-1}\n >\n {!selected && showHeader ? (\n <header className=\"lockerverse-auctions__catalog-header\">\n <h2 ref={headingRef} tabIndex={-1}>\n Auctions\n </h2>\n </header>\n ) : null}\n {auctions.loading ? <p role=\"status\">Loading auctions…</p> : null}\n {auctions.error ? (\n <div role=\"alert\">\n <p>{auctions.error.message}</p>\n <button onClick={auctions.refresh} type=\"button\">\n Try again\n </button>\n </div>\n ) : null}\n {selected ? (\n <AuctionContent\n auction={selected}\n key={selected.id}\n onBack={() => setSelectedId(null)}\n {...contentProps}\n showFilters={showFilters}\n showHeader={showHeader}\n showLineup={showLineup}\n theme={theme}\n {...(style ? { style } : {})}\n />\n ) : (\n <AuctionList\n auctions={auctions.auctions}\n onSelectAuction={(auction) => {\n if (onSelectAuction) {\n onSelectAuction(auction);\n } else {\n setSelectedId(auction.id);\n }\n }}\n {...(getAuctionHref ? { getAuctionHref } : {})}\n interceptLinks={Boolean(onSelectAuction)}\n showLineup={showLineup}\n />\n )}\n </section>\n );\n}\n\nfunction AuctionList({\n auctions,\n showLineup,\n onSelectAuction,\n getAuctionHref,\n interceptLinks,\n}: {\n auctions: Auction[] | null;\n showLineup: boolean;\n onSelectAuction: (auction: Auction) => void;\n getAuctionHref?: (auction: Auction) => string;\n interceptLinks: boolean;\n}) {\n if (!auctions) {\n return null;\n }\n if (!auctions.length) {\n return (\n <div className=\"lockerverse-auctions__catalog-empty\">\n <h3>No auctions yet.</h3>\n <p>Published auctions will appear here once they are available.</p>\n </div>\n );\n }\n return (\n <>\n {showLineup ? (\n <div className=\"lockerverse-auctions__catalog-lineup\">\n <div>\n <h3>Auction lineup</h3>\n <p>Browse the current collection.</p>\n </div>\n <span>\n {auctions.length} {auctions.length === 1 ? \"auction\" : \"auctions\"}\n </span>\n </div>\n ) : null}\n <ul className=\"lockerverse-auctions__catalog-grid\">\n {auctions.map((auction) => (\n <li key={auction.id}>\n <AuctionCard\n auction={auction}\n {...(getAuctionHref ? { href: getAuctionHref(auction) } : {})}\n {...(!getAuctionHref || interceptLinks\n ? { onSelect: () => onSelectAuction(auction) }\n : {})}\n />\n </li>\n ))}\n </ul>\n </>\n );\n}\n"],"mappings":"4XA2BA,SAAS,EAAY,CACnB,UACA,WACA,QAKC,CACD,EAAmB,EAAQ,QAAS,EAAQ,MAAO,EAAQ,KAAK,EAChE,IAAM,EACJ,EAAQ,cAAc,OACtB,EAAQ,MAAM,KAAM,GAAS,EAAK,OAAS,EAAK,OAAO,MAAM,CAAC,EAAE,OAChE,EAAQ,MAAM,KAAM,GAAS,EAAK,OAAO,MAAM,CAAC,EAAE,OAAO,IACzD,EAAQ,WAAW,QACnB,EAAQ,WAAW,UACf,EACJ,EAAQ,aACR,CACE,OAAQ,sCACR,MAAO,2CACP,SAAU,kDACZ,EAAE,EAAwB,CAAO,GACnC,OACE,EAAC,UAAD,CAAS,UAAU,qCAAnB,SAAA,CACG,EACC,EAAC,IAAD,CACE,aAAY,iBAAiB,EAAQ,OACrC,UAAU,uCACV,kBAAiB,EAAQ,GACnB,OACN,QAAU,GAAU,CAEhB,GACA,EAAM,SAAW,GACjB,CAAC,EAAM,SACP,CAAC,EAAM,SACP,CAAC,EAAM,UACP,CAAC,EAAM,SAEP,EAAM,eAAe,EACrB,EAAS,EAEb,EAEA,SAAA,EAAC,OAAD,CAAM,UAAU,wCAAhB,SAAA,CAAwD,iBACvC,EAAQ,IACnB,GACL,CAAA,EAEH,EAAC,SAAD,CACE,aAAY,iBAAiB,EAAQ,OACrC,UAAU,uCACV,kBAAiB,EAAQ,GACzB,QAAS,EACT,KAAK,QACN,CAAA,EAEH,EAAC,MAAD,CAAK,UAAU,sCAAf,SAAA,CACE,EAAC,EAAD,CAAwB,WAAU,KAAM,EAAQ,IAAO,CAAA,EACvD,EAAC,MAAD,CAAK,UAAU,s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BACA,iBACA,kBAOC,CAYD,OAXK,EAGA,EAAS,OASZ,EAAA,EAAA,CAAA,SAAA,CACG,EACC,EAAC,MAAD,CAAK,UAAU,uCAAf,SAAA,CACE,EAAC,MAAD,CAAA,SAAA,CACE,EAAC,KAAD,CAAA,SAAI,gBAAkB,CAAA,EACtB,EAAC,IAAD,CAAA,SAAG,gCAAiC,CAAA,CACjC,CAAA,CAAA,EACL,EAAC,OAAD,CAAA,SAAA,CACG,EAAS,OAAO,IAAE,EAAS,SAAW,EAAI,UAAY,UACnD,CAAA,CAAA,CACH,CACH,CAAA,EAAA,KACJ,EAAC,KAAD,CAAI,UAAU,qCACX,SAAA,EAAS,IAAK,GACb,EAAC,KAAD,CAAA,SACE,EAAC,EAAD,CACW,UACT,GAAK,EAAiB,CAAE,KAAM,EAAe,CAAO,CAAE,EAAI,CAAC,EAC3D,GAAK,CAAC,GAAkB,EACpB,CAAE,aAAgB,EAAgB,CAAO,CAAE,EAC3C,CAAC,CACN,CAAA,CACC,EARK,EAAQ,EAQb,CACL,CACC,CAAA,CACJ,CAAA,CAAA,EAhCA,EAAC,MAAD,CAAK,UAAU,sCAAf,SAAA,CACE,EAAC,KAAD,CAAA,SAAI,kBAAoB,CAAA,EACxB,EAAC,IAAD,CAAA,SAAG,8DAA+D,CAAA,CAC/D,IAPA,IAsCX"}
@@ -7,14 +7,24 @@ type LockerverseAuctionItemRenderContext = {
7
7
  item: LockerverseAuctionItem;
8
8
  /** Effective auction and item status, including elapsed closing dates. */
9
9
  status: LockerverseAuctionStatus;
10
+ /** Calls the host selection callback when one is supplied. Use href for native navigation. */
10
11
  onSelect: () => void;
12
+ href?: string;
11
13
  /** Parent theme and Lockerverse CSS custom properties for default-card reuse. */
12
14
  theme: LockerverseTheme;
13
15
  style?: LockerverseStyle;
14
16
  };
15
17
  type LockerverseAuctionProps = {
16
18
  auction: LockerverseAuction;
17
- onSelectItem: (auction: LockerverseAuction, item: LockerverseAuctionItem) => void;
19
+ onSelectItem?: (auction: LockerverseAuction, item: LockerverseAuctionItem) => void;
20
+ /** Controlled item status filter. Omit to use the internal filter state. */
21
+ filter?: LockerverseAuctionItemFilter;
22
+ onFilterChange?: (filter: LockerverseAuctionItemFilter) => void;
23
+ /** Native links preserve opening filters and items in another tab. */
24
+ getFilterHref?: (filter: LockerverseAuctionItemFilter) => string;
25
+ getItemHref?: (auction: LockerverseAuction, item: LockerverseAuctionItem) => string;
26
+ /** Rotate catalog photos. Static images are the default. */
27
+ autoRotateImages?: boolean;
18
28
  theme?: LockerverseTheme;
19
29
  style?: LockerverseStyle;
20
30
  className?: string;
@@ -25,14 +35,31 @@ type LockerverseAuctionProps = {
25
35
  /** Replace the card inside each list item. Keep onSelect connected to your item view. */
26
36
  renderItem?: (context: LockerverseAuctionItemRenderContext) => ReactNode;
27
37
  };
38
+ declare const FILTERS: readonly [{
39
+ readonly label: "All";
40
+ readonly value: "all";
41
+ }, {
42
+ readonly label: "Live";
43
+ readonly value: "active";
44
+ }, {
45
+ readonly label: "Upcoming";
46
+ readonly value: "draft";
47
+ }, {
48
+ readonly label: "Closed";
49
+ readonly value: "finished";
50
+ }];
51
+ type LockerverseAuctionItemFilter = (typeof FILTERS)[number]["value"];
28
52
  /** Display one loaded auction. Fetching and item navigation stay with the host. */
29
- declare function LockerverseAuction$1({ auction, onSelectItem, theme, style, className, showFilters, showHeader, showLineup, onBack, renderItem }: LockerverseAuctionProps): import("react").JSX.Element;
53
+ declare function LockerverseAuction$1({ auction, onSelectItem, filter: controlledFilter, onFilterChange, getFilterHref, getItemHref, autoRotateImages, theme, style, className, showFilters, showHeader, showLineup, onBack, renderItem }: LockerverseAuctionProps): import("react").JSX.Element;
30
54
  //#endregion
31
55
  //#region src/lockerverse-auction-item-card.d.ts
32
56
  type LockerverseAuctionItemCardProps = {
33
57
  auction: LockerverseAuction;
34
58
  item: LockerverseAuctionItem;
35
- onSelect: () => void;
59
+ onSelect?: () => void;
60
+ href?: string;
61
+ /** Rotate photos every five seconds. Static by default. */
62
+ autoRotateImages?: boolean;
36
63
  theme?: LockerverseTheme;
37
64
  /** Applied to the scoped card container. */
38
65
  className?: string;
@@ -41,7 +68,7 @@ type LockerverseAuctionItemCardProps = {
41
68
  showMetrics?: boolean;
42
69
  showTiming?: boolean;
43
70
  };
44
- declare function LockerverseAuctionItemCard({ auction, item, onSelect, theme, className, style, showDescription, showMetrics, showTiming }: LockerverseAuctionItemCardProps): import("react").JSX.Element;
71
+ declare function LockerverseAuctionItemCard({ auction, item, onSelect, href, autoRotateImages, theme, className, style, showDescription, showMetrics, showTiming }: LockerverseAuctionItemCardProps): import("react").JSX.Element;
45
72
  //#endregion
46
- export { LockerverseAuctionProps as a, LockerverseAuctionItemRenderContext as i, LockerverseAuctionItemCardProps as n, LockerverseAuction$1 as r, LockerverseAuctionItemCard as t };
73
+ export { LockerverseAuctionItemRenderContext as a, LockerverseAuctionItemFilter as i, LockerverseAuctionItemCardProps as n, LockerverseAuctionProps as o, LockerverseAuction$1 as r, LockerverseAuctionItemCard as t };
47
74
  //# sourceMappingURL=lockerverse-auction-item-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lockerverse-auction-item-card.d.ts","names":[],"sources":["../src/lockerverse-auction.tsx","../src/lockerverse-auction-item-card.tsx"],"mappings":";;;;KAaY;EACV,SAAS;EACT,MAAM;;EAEN,QAAQ;EACR;;EAEA,OAAO;EACP,QAAQ;;KAEE;EACV,SAAS;EACT,eAAe,SAAS,oBAAS,MAAM;EACvC,QAAQ;EACR,QAAQ;EACR;EACA;EACA;EACA;EACA;;EAEA,cAAc,SAAS,wCAAwC;;;iBAWjD,uBACd,SACA,cACA,OACA,OACA,WACA,aACA,YACA,YACA,QACA,cACC,0CAAuB,IAAA;;;KCnCd;EACV,SAAS;EACT,MAAM;EACN;EACA,QAAQ;;EAER;EACA,QAAQ;EACR;EACA;EACA;;iBAoCc,6BACd,SACA,MACA,UACA,OACA,WACA,OACA,iBACA,aACA,cACC,kDAA+B,IAAA"}
1
+ {"version":3,"file":"lockerverse-auction-item-card.d.ts","names":[],"sources":["../src/lockerverse-auction.tsx","../src/lockerverse-auction-item-card.tsx"],"mappings":";;;;KAiBY;EACV,SAAS;EACT,MAAM;;EAEN,QAAQ;;EAER;EACA;;EAEA,OAAO;EACP,QAAQ;;KAEE;EACV,SAAS;EACT,gBAAgB,SAAS,oBAAS,MAAM;;EAExC,SAAS;EACT,kBAAkB,QAAQ;;EAE1B,iBAAiB,QAAQ;EACzB,eAAe,SAAS,oBAAS,MAAM;;EAEvC;EACA,QAAQ;EACR,QAAQ;EACR;EACA;EACA;EACA;EACA;;EAEA,cAAc,SAAS,wCAAwC;;cAE3D;;;;;;;;;;;;;KAMM,uCAAuC;;iBAGnC,uBACd,SACA,cACA,QAAQ,kBACR,gBACA,eACA,aACA,kBACA,OACA,OACA,WACA,aACA,YACA,YACA,QACA,cACC,0CAAuB,IAAA;;;KCtDd;EACV,SAAS;EACT,MAAM;EACN;EACA;;EAEA;EACA,QAAQ;;EAER;EACA,QAAQ;EACR;EACA;EACA;;iBAoCc,6BACd,SACA,MACA,UACA,MACA,kBACA,OACA,WACA,OACA,iBACA,aACA,cACC,kDAA+B,IAAA"}
@@ -1,2 +1,2 @@
1
- import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./use-auction-boundary.js";import{ArrowRight as s,ChevronLeft as c,Clock3 as l,Gavel as u,ShoppingBag as d}from"lucide-react";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";const y={active:`Live now`,draft:`Coming soon`,finished:`Closed`};function b({images:e,fallback:t,name:r}){let i=p(()=>{let n=[...new Set(e?.filter(Boolean))];return!n.length&&t&&n.push(t),n},[e,t]),[a,o]=h(0),{ref:s,visible:c}=n(),[l,u]=h(!0),[d,g]=h(!1),v=m(new Set),y=i.length,b=y?a%y:0;return f(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>u(e.matches);t(),e.addEventListener(`change`,t);let n=s.current?.closest(`article`),r=()=>g(!!n?.matches(`:hover, :focus-within`)),i=e=>g(!!(n?.matches(`:hover`)||e.relatedTarget instanceof Node&&n?.contains(e.relatedTarget)));return r(),n?.addEventListener(`mouseenter`,r),n?.addEventListener(`mouseleave`,r),n?.addEventListener(`focusin`,r),n?.addEventListener(`focusout`,i),()=>{e.removeEventListener(`change`,t),n?.removeEventListener(`mouseenter`,r),n?.removeEventListener(`mouseleave`,r),n?.removeEventListener(`focusin`,r),n?.removeEventListener(`focusout`,i)}},[s]),f(()=>{if(y<2||!c||l||d)return;let e=window.setInterval(()=>{o(e=>v.current.has(i[(e+1)%y]??``)?(e+1)%y:e)},5e3);return()=>window.clearInterval(e)},[y,i,c,l,d]),_(`div`,{className:`lockerverse-auctions__catalog-images`,ref:s,children:y?[b,...y>1?[(b+1)%y]:[]].map(e=>_(`img`,{alt:e===b?r:``,"aria-hidden":e!==b,className:`lockerverse-auctions__catalog-photo`,"data-visible":e===b,height:500,loading:`lazy`,onLoad:()=>v.current.add(i[e]??``),src:i[e],width:640},i[e])):null})}function x({icon:e,label:t,value:n}){return v(`div`,{className:`lockerverse-auctions__catalog-metric`,children:[v(`dt`,{children:[e,t]}),_(`dd`,{children:n})]})}function S({auction:t,status:n=e(t),item:r}){let a=``;return n===`draft`&&(a=!r&&Date.parse(t.startAt)<=Date.now()?`Next opens `:`Opens `),n===`active`&&(a=r?`Closes `:`Ends `),v(`span`,{className:`lockerverse-auctions__catalog-timing`,children:[a,i(t,n,r)]})}function C(e,n){if(e.saleMode===`buy_now`){let i=r(e),a=n===`active`?`Buy now`:y[n];return{chip:i?`Sold out`:a,cta:i?`Sold out`:{active:`Buy now`,draft:`Preview item`,finished:`View item`}[n],price:t(e.buyNowPriceAmount??0),priceLabel:`Buy Now`,secondary:e.availableQuantity===null?`Available`:String(e.availableQuantity)}}return{chip:n===`active`?`Live`:y[n],cta:{active:`Bid now`,draft:`Preview item`,finished:`View item`}[n],price:n===`finished`&&!e.maxBidAmount?`No bids`:t(e.maxBidAmount??0),priceLabel:n===`finished`?`Final bid`:`Current`,secondary:t(e.minBidAmount??0)}}function w({auction:t,item:n,onSelect:r,theme:i=`dark`,className:c,style:f,showDescription:p=!0,showMetrics:m=!0,showTiming:h=!0}){o(n.startAt??t.startAt,n.endAt??t.endAt);let g=e(t,n),y=n.saleMode===`buy_now`,w=C(n,g);return _(`div`,{className:[`lockerverse-auctions`,`lockerverse-auctions--card`,c].filter(Boolean).join(` `),"data-lockerverse-theme":i,style:f,children:v(`article`,{className:`lockerverse-auctions__catalog-card`,children:[_(`button`,{"aria-label":`View ${n.name}`,className:`lockerverse-auctions__catalog-select`,onClick:r,type:`button`}),v(`div`,{className:`lockerverse-auctions__catalog-media`,children:[_(b,{fallback:n.image||t.configuration.image||t.community?.banner||t.community?.thumbnail,images:n.images,name:n.name}),v(`div`,{className:`lockerverse-auctions__catalog-chips`,children:[_(`span`,{className:`lockerverse-auctions__catalog-chip`,"data-live":g===`active`,children:w.chip}),h?_(S,{auction:t,item:n,status:g}):null]}),m?v(`dl`,{className:`lockerverse-auctions__catalog-metrics`,children:[_(x,{icon:_(y?d:u,{"aria-hidden":`true`,size:16}),label:w.priceLabel,value:w.price}),_(x,{icon:_(l,{"aria-hidden":`true`,size:16}),label:y?`Available`:`Floor`,value:w.secondary})]}):null]}),v(`div`,{className:`lockerverse-auctions__catalog-body`,children:[_(`h3`,{children:n.name}),p?_(a,{className:`lockerverse-auctions__catalog-description`,description:n.description||`View auction item details.`}):null,_(`div`,{className:`lockerverse-auctions__catalog-footer lockerverse-auctions__catalog-footer--item`,children:v(`span`,{className:`lockerverse-auctions__catalog-cta`,children:[w.cta,_(s,{"aria-hidden":`true`,size:16})]})})]})]})})}const T=[{label:`All`,value:`all`},{label:`Live`,value:`active`},{label:`Upcoming`,value:`draft`},{label:`Closed`,value:`finished`}];function E({auction:e,onSelectItem:t,theme:n=`dark`,style:r,className:i,showFilters:a=!0,showHeader:o=!0,showLineup:s=!0,onBack:c,renderItem:l}){return _(`section`,{"aria-label":e.name,className:[`lockerverse-auctions`,`lockerverse-auctions--catalog`,i].filter(Boolean).join(` `),"data-lockerverse-theme":n,style:r,children:_(D,{auction:e,onSelectItem:t,showFilters:a,showHeader:o,showLineup:s,theme:n,...r?{style:r}:{},...c?{onBack:c}:{},...l?{renderItem:l}:{}})})}function D({auction:t,onSelectItem:n,theme:r=`dark`,style:i,showFilters:s=!0,showHeader:l=!0,showLineup:u=!0,onBack:d,renderItem:p}){o(t.startAt,t.endAt,t.items);let[y,b]=h({auctionId:t.id,value:`all`}),x=m(null),S=m(null),C=s&&y.auctionId===t.id?y.value:`all`;f(()=>{b({auctionId:t.id,value:`all`})},[t.id,s]);let E=!!d;f(()=>{E&&(x.current??S.current)?.focus()},[t.id,E,l]);let D=i?Object.fromEntries(Object.entries(i).filter(([e])=>e.startsWith(`--lockerverse-`))):void 0,O=[...t.items].sort((e,t)=>e.position-t.position||e.createdAt.localeCompare(t.createdAt)),k=O.filter(n=>C===`all`||e(t,n)===C);return v(g,{children:[d?v(`button`,{className:`lockerverse-auctions__catalog-back`,onClick:d,ref:S,type:`button`,children:[_(c,{"aria-hidden":`true`,size:16}),`Auctions`]}):null,l?v(`header`,{className:`lockerverse-auctions__catalog-header`,children:[_(`h2`,{ref:x,tabIndex:-1,children:t.name}),t.description?_(a,{description:t.description}):null]}):null,u?v(`div`,{className:`lockerverse-auctions__catalog-lineup`,children:[v(`div`,{children:[_(`h3`,{children:`Auction lineup`}),_(`p`,{children:`Browse the current collection.`})]}),v(`span`,{children:[k.length,` `,k.length===1?`item`:`items`]})]}):null,s?_(`fieldset`,{"aria-label":`Filter auction items`,className:`lockerverse-auctions__catalog-filters`,children:T.map(n=>v(`button`,{"aria-pressed":C===n.value,onClick:()=>b({auctionId:t.id,value:n.value}),type:`button`,children:[n.label,_(`span`,{children:n.value===`all`?O.length:O.filter(r=>e(t,r)===n.value).length})]},n.value))}):null,k.length?_(`ul`,{className:`lockerverse-auctions__catalog-grid`,children:k.map(i=>{let a={auction:t,item:i,onSelect:()=>n(t,i),status:e(t,i),theme:r};return D&&(a.style=D),_(`li`,{children:p?p(a):_(w,{...a})},i.id)})}):_(`p`,{className:`lockerverse-auctions__catalog-empty`,children:`No items match this auction view.`})]})}export{x as a,b as i,E as n,y as o,w as r,S as s,D as t};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./use-auction-boundary.js";import{ArrowRight as c,ChevronLeft as l,Clock3 as u,Gavel as d,ShoppingBag as f}from"lucide-react";import{useEffect as p,useMemo as m,useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";const b={active:`Live now`,draft:`Coming soon`,finished:`Closed`};function x({images:e,autoRotate:t=!1,fallback:n,name:i}){let a=m(()=>{let t=[...new Set(e?.filter(Boolean))];return!t.length&&n&&t.push(n),t},[e,n]),[o,s]=g(0),{ref:c,visible:l}=r(),[u,d]=g(!0),[f,_]=g(!1),y=h(new Set),b=a.length,x=t&&b?o%b:0;return p(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>d(e.matches);t(),e.addEventListener(`change`,t);let n=c.current?.closest(`article`),r=()=>_(!!n?.matches(`:hover, :focus-within`)),i=e=>_(!!(n?.matches(`:hover`)||e.relatedTarget instanceof Node&&n?.contains(e.relatedTarget)));return r(),n?.addEventListener(`mouseenter`,r),n?.addEventListener(`mouseleave`,r),n?.addEventListener(`focusin`,r),n?.addEventListener(`focusout`,i),()=>{e.removeEventListener(`change`,t),n?.removeEventListener(`mouseenter`,r),n?.removeEventListener(`mouseleave`,r),n?.removeEventListener(`focusin`,r),n?.removeEventListener(`focusout`,i)}},[c]),p(()=>{if(!t||b<2||!l||u||f)return;let e=window.setInterval(()=>{s(e=>y.current.has(a[(e+1)%b]??``)?(e+1)%b:e)},5e3);return()=>window.clearInterval(e)},[t,b,a,l,u,f]),v(`div`,{className:`lockerverse-auctions__catalog-images`,ref:c,children:b?[x,...t&&b>1?[(x+1)%b]:[]].map(e=>v(`img`,{alt:e===x?i:``,"aria-hidden":e!==x,className:`lockerverse-auctions__catalog-photo`,"data-visible":e===x,height:500,loading:`lazy`,onLoad:()=>y.current.add(a[e]??``),src:a[e],width:640},a[e])):null})}function S({icon:e,label:t,value:n}){return y(`div`,{className:`lockerverse-auctions__catalog-metric`,children:[y(`dt`,{children:[e,t]}),v(`dd`,{children:n})]})}function C({auction:t,status:n=e(t),item:r}){let i=``;return n===`draft`&&(i=!r&&Date.parse(t.startAt)<=Date.now()?`Next opens `:`Opens `),n===`active`&&(i=r?`Closes `:`Ends `),y(`span`,{className:`lockerverse-auctions__catalog-timing`,children:[i,a(t,n,r)]})}function w(e,t){if(e.saleMode===`buy_now`){let r=o(e),i=t===`active`?`Buy now`:b[t];return{chip:r?`Sold out`:i,cta:r?`Sold out`:{active:`Buy now`,draft:`Preview item`,finished:`View item`}[t],price:n(e.buyNowPriceAmount??0),priceLabel:`Buy Now`,secondary:e.availableQuantity===null?`Available`:String(e.availableQuantity)}}return{chip:t===`active`?`Live`:b[t],cta:{active:`Bid now`,draft:`Preview item`,finished:`View item`}[t],price:t===`finished`&&!e.maxBidAmount?`No bids`:n(e.maxBidAmount??0),priceLabel:t===`finished`?`Final bid`:`Current`,secondary:n(e.minBidAmount??0)}}function T({auction:n,item:r,onSelect:i,href:a,autoRotateImages:o=!1,theme:l=`dark`,className:p,style:m,showDescription:h=!0,showMetrics:g=!0,showTiming:_=!0}){s(r.startAt??n.startAt,r.endAt??n.endAt);let b=e(n,r),T=r.saleMode===`buy_now`,E=w(r,b);return v(`div`,{className:[`lockerverse-auctions`,`lockerverse-auctions--card`,p].filter(Boolean).join(` `),"data-lockerverse-theme":l,style:m,children:y(`article`,{className:`lockerverse-auctions__catalog-card`,children:[a?v(`a`,{"aria-label":`View ${r.name}`,className:`lockerverse-auctions__catalog-select`,href:a,onClick:e=>{i&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),i())},children:y(`span`,{className:`lockerverse-auctions__visually-hidden`,children:[`View `,r.name]})}):v(`button`,{"aria-label":`View ${r.name}`,className:`lockerverse-auctions__catalog-select`,onClick:i,type:`button`}),y(`div`,{className:`lockerverse-auctions__catalog-media`,children:[v(x,{autoRotate:o,fallback:r.image||n.configuration.image||n.community?.banner||n.community?.thumbnail,images:r.images,name:r.name}),y(`div`,{className:`lockerverse-auctions__catalog-chips`,children:[v(`span`,{className:`lockerverse-auctions__catalog-chip`,"data-live":b===`active`,children:E.chip}),_?v(C,{auction:n,item:r,status:b}):null]}),g?y(`dl`,{className:`lockerverse-auctions__catalog-metrics`,children:[v(S,{icon:v(T?f:d,{"aria-hidden":`true`,size:16}),label:E.priceLabel,value:E.price}),v(S,{icon:v(u,{"aria-hidden":`true`,size:16}),label:T?`Available`:`Floor`,value:E.secondary})]}):null]}),y(`div`,{className:`lockerverse-auctions__catalog-body`,children:[v(`h3`,{children:r.name}),h?v(t,{className:`lockerverse-auctions__catalog-description`,description:r.description||`View auction item details.`}):null,v(`div`,{className:`lockerverse-auctions__catalog-footer lockerverse-auctions__catalog-footer--item`,children:y(`span`,{className:`lockerverse-auctions__catalog-cta`,children:[E.cta,v(c,{"aria-hidden":`true`,size:16})]})})]})]})})}const E=[{label:`All`,value:`all`},{label:`Live`,value:`active`},{label:`Upcoming`,value:`draft`},{label:`Closed`,value:`finished`}];function D({auction:e,onSelectItem:t,filter:n,onFilterChange:r,getFilterHref:i,getItemHref:a,autoRotateImages:o=!1,theme:s=`dark`,style:c,className:l,showFilters:u=!0,showHeader:d=!0,showLineup:f=!0,onBack:p,renderItem:m}){return v(`section`,{"aria-label":e.name,className:[`lockerverse-auctions`,`lockerverse-auctions--catalog`,l].filter(Boolean).join(` `),"data-lockerverse-theme":s,style:c,children:v(O,{auction:e,...t?{onSelectItem:t}:{},...n?{filter:n}:{},...r?{onFilterChange:r}:{},...i?{getFilterHref:i}:{},...a?{getItemHref:a}:{},autoRotateImages:o,showFilters:u,showHeader:d,showLineup:f,theme:s,...c?{style:c}:{},...p?{onBack:p}:{},...m?{renderItem:m}:{}})})}function O({auction:n,onSelectItem:r,filter:o,onFilterChange:c,getFilterHref:u,getItemHref:d,autoRotateImages:f=!1,theme:m=`dark`,style:b,showFilters:x=!0,showHeader:S=!0,showLineup:C=!0,onBack:w,renderItem:D}){s(n.startAt,n.endAt,n.items);let[O,k]=g({auctionId:n.id,value:`all`}),A=h(null),j=h(null),M=x?o??(O.auctionId===n.id?O.value:`all`):`all`;p(()=>{k({auctionId:n.id,value:`all`})},[n.id,x]);let N=e=>{k({auctionId:n.id,value:e}),c?.(e)},P=i(n),F=!!w;p(()=>{F&&(A.current??j.current)?.focus()},[n.id,F,S]);let I=b?Object.fromEntries(Object.entries(b).filter(([e])=>e.startsWith(`--lockerverse-`))):void 0,L=[...n.items].sort((e,t)=>e.position-t.position||e.createdAt.localeCompare(t.createdAt)),R=L.filter(t=>M===`all`||e(n,t)===M);return y(_,{children:[w?y(`button`,{className:`lockerverse-auctions__catalog-back`,onClick:w,ref:j,type:`button`,children:[v(l,{"aria-hidden":`true`,size:16}),`Auctions`]}):null,S?y(`header`,{className:`lockerverse-auctions__catalog-header`,children:[v(`h2`,{ref:A,tabIndex:-1,children:n.name}),y(`p`,{className:`lockerverse-auctions__catalog-period`,children:[a({...n,items:[]},`draft`),` —`,` `,a(n,`active`)]}),n.status!==`finished`&&P?y(`p`,{className:`lockerverse-auctions__catalog-next`,children:[`Next opens `,a(n,`draft`,P)]}):null,n.description?v(t,{description:n.description}):null]}):null,C?y(`div`,{className:`lockerverse-auctions__catalog-lineup`,children:[y(`div`,{children:[v(`h3`,{children:`Auction lineup`}),v(`p`,{children:`Browse the current collection.`})]}),y(`span`,{children:[R.length,` `,R.length===1?`item`:`items`]})]}):null,x?v(`fieldset`,{"aria-label":`Filter auction items`,className:`lockerverse-auctions__catalog-filters`,children:E.map(t=>{let r=u?.(t.value),i=y(_,{children:[t.label,v(`span`,{children:t.value===`all`?L.length:L.filter(r=>e(n,r)===t.value).length})]});return r?v(`a`,{"aria-current":M===t.value?`page`:void 0,href:r,onClick:e=>{c&&e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),N(t.value))},children:i},t.value):v(`button`,{"aria-pressed":M===t.value,onClick:()=>N(t.value),type:`button`,children:i},t.value)})}):null,R.length?v(`ul`,{className:`lockerverse-auctions__catalog-grid`,children:R.map(t=>{let i={auction:n,item:t,onSelect:()=>r?.(n,t),status:e(n,t),theme:m};d&&(i.href=d(n,t)),I&&(i.style=I);let{onSelect:a,...o}=i;return v(`li`,{children:D?D(i):v(T,{...o,...r?{onSelect:a}:{},autoRotateImages:f})},t.id)})}):v(`p`,{className:`lockerverse-auctions__catalog-empty`,children:`No items match this auction view.`})]})}export{S as a,x as i,D as n,b as o,T as r,C as s,O as t};
2
2
  //# sourceMappingURL=lockerverse-auction.js.map