@m3000/market 0.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/LICENSE +21 -0
- package/dist/components/blocks/auction/Auction.d.ts +49 -0
- package/dist/components/blocks/auction/Auction.js +44 -0
- package/dist/components/blocks/auction/AuctionBidForm.d.ts +11 -0
- package/dist/components/blocks/auction/AuctionBidForm.js +88 -0
- package/dist/components/blocks/auction/AuctionBidInput.d.ts +9 -0
- package/dist/components/blocks/auction/AuctionBidInput.js +99 -0
- package/dist/components/blocks/auction/AuctionContext.d.ts +71 -0
- package/dist/components/blocks/auction/AuctionContext.js +228 -0
- package/dist/components/blocks/auction/AuctionInfo.d.ts +9 -0
- package/dist/components/blocks/auction/AuctionInfo.js +37 -0
- package/dist/components/blocks/auction/AuctionLayout.d.ts +63 -0
- package/dist/components/blocks/auction/AuctionLayout.js +80 -0
- package/dist/components/blocks/auction/AuctionRankings.d.ts +16 -0
- package/dist/components/blocks/auction/AuctionRankings.js +334 -0
- package/dist/components/blocks/auction/AuctionStatusTag.d.ts +15 -0
- package/dist/components/blocks/auction/AuctionStatusTag.js +60 -0
- package/dist/components/blocks/auction/AuctionSuggestedBids.d.ts +38 -0
- package/dist/components/blocks/auction/AuctionSuggestedBids.js +116 -0
- package/dist/components/blocks/auction/AuctionYourBidCard.d.ts +27 -0
- package/dist/components/blocks/auction/AuctionYourBidCard.js +94 -0
- package/dist/components/blocks/auction/AuctionYourBids.d.ts +9 -0
- package/dist/components/blocks/auction/AuctionYourBids.js +49 -0
- package/dist/components/blocks/auction/index.d.ts +12 -0
- package/dist/components/blocks/index.d.ts +12 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/primitives/Button.d.ts +31 -0
- package/dist/components/primitives/Button.js +117 -0
- package/dist/components/primitives/Drawer.d.ts +43 -0
- package/dist/components/primitives/Drawer.js +51 -0
- package/dist/components/primitives/Feedback.d.ts +28 -0
- package/dist/components/primitives/Feedback.js +147 -0
- package/dist/components/primitives/MorphDialog.d.ts +39 -0
- package/dist/components/primitives/MorphDialog.js +87 -0
- package/dist/components/primitives/Price.d.ts +84 -0
- package/dist/components/primitives/Price.js +255 -0
- package/dist/components/primitives/PriceInput.d.ts +33 -0
- package/dist/components/primitives/PriceInput.js +25 -0
- package/dist/components/primitives/Receipt.d.ts +164 -0
- package/dist/components/primitives/Receipt.js +344 -0
- package/dist/components/primitives/Scale.d.ts +67 -0
- package/dist/components/primitives/Scale.js +132 -0
- package/dist/components/primitives/Separator.d.ts +22 -0
- package/dist/components/primitives/Separator.js +62 -0
- package/dist/components/primitives/Skeleton.d.ts +14 -0
- package/dist/components/primitives/Skeleton.js +20 -0
- package/dist/components/primitives/SteppedInput.d.ts +94 -0
- package/dist/components/primitives/SteppedInput.js +154 -0
- package/dist/components/primitives/Tabs.d.ts +37 -0
- package/dist/components/primitives/Tabs.js +99 -0
- package/dist/components/primitives/Tag.d.ts +24 -0
- package/dist/components/primitives/Tag.js +22 -0
- package/dist/components/primitives/Text.d.ts +32 -0
- package/dist/components/primitives/Text.js +65 -0
- package/dist/components/primitives/countdown/Countdown.d.ts +24 -0
- package/dist/components/primitives/countdown/Countdown.js +22 -0
- package/dist/components/primitives/framed-image/FramedImage.d.ts +13 -0
- package/dist/components/primitives/framed-image/FramedImage.js +37 -0
- package/dist/components/primitives/index.d.ts +17 -0
- package/dist/components/primitives/ranked-list/Ranking.d.ts +117 -0
- package/dist/components/primitives/ranked-list/Ranking.js +219 -0
- package/dist/components/primitives/ranked-list/index.d.ts +1 -0
- package/dist/hooks/useCountdown.d.ts +20 -0
- package/dist/hooks/useCountdown.js +75 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +36 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/cn.js +75 -0
- package/dist/lib/motion.d.ts +19 -0
- package/dist/lib/motion.js +43 -0
- package/dist/types/index.d.ts +120 -0
- package/dist/utils/format.d.ts +38 -0
- package/dist/utils/format.js +103 -0
- package/dist/utils/rank-utils.d.ts +34 -0
- package/dist/utils/rank-utils.js +80 -0
- package/dist/utils/tick-validation.d.ts +22 -0
- package/dist/utils/tick-validation.js +40 -0
- package/package.json +92 -0
- package/src/components/blocks/auction/Auction.tsx +74 -0
- package/src/components/blocks/auction/AuctionArtwork.tsx +4 -0
- package/src/components/blocks/auction/AuctionBidForm.tsx +138 -0
- package/src/components/blocks/auction/AuctionBidInput.tsx +166 -0
- package/src/components/blocks/auction/AuctionContext.tsx +401 -0
- package/src/components/blocks/auction/AuctionInfo.tsx +36 -0
- package/src/components/blocks/auction/AuctionLayout.tsx +200 -0
- package/src/components/blocks/auction/AuctionRankings.tsx +435 -0
- package/src/components/blocks/auction/AuctionStatusTag.tsx +98 -0
- package/src/components/blocks/auction/AuctionSuggestedBids.tsx +203 -0
- package/src/components/blocks/auction/AuctionYourBidCard.tsx +125 -0
- package/src/components/blocks/auction/AuctionYourBids.tsx +61 -0
- package/src/components/blocks/auction/index.ts +42 -0
- package/src/components/blocks/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/components/primitives/Button.tsx +183 -0
- package/src/components/primitives/Drawer.tsx +125 -0
- package/src/components/primitives/Feedback.tsx +185 -0
- package/src/components/primitives/MorphDialog.tsx +160 -0
- package/src/components/primitives/Price.tsx +394 -0
- package/src/components/primitives/PriceInput.tsx +48 -0
- package/src/components/primitives/Receipt.tsx +711 -0
- package/src/components/primitives/Scale.tsx +287 -0
- package/src/components/primitives/Separator.tsx +87 -0
- package/src/components/primitives/Skeleton.tsx +33 -0
- package/src/components/primitives/SteppedInput.tsx +313 -0
- package/src/components/primitives/Tabs.tsx +161 -0
- package/src/components/primitives/Tag.tsx +48 -0
- package/src/components/primitives/Text.tsx +102 -0
- package/src/components/primitives/countdown/Countdown.tsx +43 -0
- package/src/components/primitives/countdown/index.ts +2 -0
- package/src/components/primitives/framed-image/FramedImage.tsx +51 -0
- package/src/components/primitives/framed-image/index.ts +1 -0
- package/src/components/primitives/index.ts +42 -0
- package/src/components/primitives/ranked-list/RankedList.tsx +9 -0
- package/src/components/primitives/ranked-list/Ranking.tsx +454 -0
- package/src/components/primitives/ranked-list/index.ts +8 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCountdown.ts +91 -0
- package/src/index.ts +130 -0
- package/src/lib/cn.ts +81 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/motion.ts +55 -0
- package/src/public/lea-83-time-walk.png +0 -0
- package/src/public/lea-83-time-walk.webp +0 -0
- package/src/stories/Auction.stories.tsx +658 -0
- package/src/stories/AuctionLayout.stories.tsx +313 -0
- package/src/stories/AuctionStatusTag.stories.tsx +166 -0
- package/src/stories/AuctionYourBidCard.stories.tsx +257 -0
- package/src/stories/Button.stories.tsx +306 -0
- package/src/stories/Countdown.stories.tsx +158 -0
- package/src/stories/Feedback.stories.tsx +80 -0
- package/src/stories/FramedImage.stories.tsx +46 -0
- package/src/stories/MorphDialog.stories.tsx +88 -0
- package/src/stories/Price.stories.tsx +292 -0
- package/src/stories/RankedList.stories.tsx +190 -0
- package/src/stories/Receipt.stories.tsx +221 -0
- package/src/stories/Scale.stories.tsx +578 -0
- package/src/stories/Separator.stories.tsx +188 -0
- package/src/stories/Skeleton.stories.tsx +138 -0
- package/src/stories/SteppedInput.stories.tsx +321 -0
- package/src/stories/Tabs.stories.tsx +215 -0
- package/src/stories/Tag.stories.tsx +138 -0
- package/src/stories/Text.stories.tsx +245 -0
- package/src/styles/globals.css +39 -0
- package/src/styles/index.css +4 -0
- package/src/styles/theme/animation.css +11 -0
- package/src/styles/theme/color.css +185 -0
- package/src/styles/theme/index.css +3 -0
- package/src/styles/theme/typography.css +3 -0
- package/src/styles/utility.css +8 -0
- package/src/types/index.ts +149 -0
- package/src/utils/format.ts +130 -0
- package/src/utils/index.ts +16 -0
- package/src/utils/rank-utils.ts +131 -0
- package/src/utils/tick-validation.ts +65 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
AuctionDetails,
|
|
4
|
+
AuctionDetailsBody,
|
|
5
|
+
AuctionDetailsFooter,
|
|
6
|
+
AuctionDetailsHeader,
|
|
7
|
+
AuctionLayout,
|
|
8
|
+
AuctionRankingsContainer,
|
|
9
|
+
} from "@/components/blocks/auction/AuctionLayout";
|
|
10
|
+
import { Separator } from "@/components/primitives/Separator";
|
|
11
|
+
import { Text } from "@/components/primitives/Text";
|
|
12
|
+
|
|
13
|
+
const detailBids = Array.from({ length: 10 }, (_, i) => ({
|
|
14
|
+
id: `detail-bid-${i + 1}`,
|
|
15
|
+
rank: i + 1,
|
|
16
|
+
time: new Date(Date.now() - i * 3600000).toLocaleTimeString(),
|
|
17
|
+
price: (0.5 - i * 0.02).toFixed(3),
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
const rankingRows = Array.from({ length: 25 }, (_, i) => ({
|
|
21
|
+
id: `ranking-${i + 1}`,
|
|
22
|
+
rank: i + 1,
|
|
23
|
+
label: `Bidder ${i + 1}`,
|
|
24
|
+
price: (0.5 - i * 0.015).toFixed(3),
|
|
25
|
+
isLast: i === 24,
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const leaderboardRows = Array.from({ length: 25 }, (_, i) => ({
|
|
29
|
+
id: `leaderboard-${i + 1}`,
|
|
30
|
+
rank: i + 1,
|
|
31
|
+
address: `0x${(i + 1).toString(16).padStart(4, "0")}...`,
|
|
32
|
+
price: (0.5 - i * 0.015).toFixed(3),
|
|
33
|
+
timeLabel: `${i + 1}h`,
|
|
34
|
+
isOutbid: i >= 20,
|
|
35
|
+
isLast: i === 24,
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
const meta: Meta<typeof AuctionLayout> = {
|
|
39
|
+
title: "Blocks/Auction/Layout",
|
|
40
|
+
component: AuctionLayout,
|
|
41
|
+
parameters: {
|
|
42
|
+
layout: "fullscreen",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
export const Default: StoryObj<typeof AuctionLayout> = {
|
|
49
|
+
render: () => (
|
|
50
|
+
<div className="h-screen w-full bg-muted p-8">
|
|
51
|
+
<div className="mx-auto flex h-full max-w-7xl items-center justify-center">
|
|
52
|
+
<div className="size-full rounded-lg border border-border bg-background shadow-lg">
|
|
53
|
+
<AuctionLayout>
|
|
54
|
+
<AuctionDetails>
|
|
55
|
+
<AuctionDetailsHeader>
|
|
56
|
+
<Text size="4" weight="medium">
|
|
57
|
+
Auction Details Header
|
|
58
|
+
</Text>
|
|
59
|
+
<Text size="2" color="secondary" className="mt-1">
|
|
60
|
+
This is the header section with auction info
|
|
61
|
+
</Text>
|
|
62
|
+
</AuctionDetailsHeader>
|
|
63
|
+
<AuctionDetailsBody>
|
|
64
|
+
<Text size="2" color="tertiary">
|
|
65
|
+
Body content goes here. This area is scrollable when content
|
|
66
|
+
overflows.
|
|
67
|
+
</Text>
|
|
68
|
+
</AuctionDetailsBody>
|
|
69
|
+
<AuctionDetailsFooter>
|
|
70
|
+
<Text size="2">Footer with bid form</Text>
|
|
71
|
+
</AuctionDetailsFooter>
|
|
72
|
+
</AuctionDetails>
|
|
73
|
+
<AuctionRankingsContainer>
|
|
74
|
+
<div className="p-6">
|
|
75
|
+
<Text size="3" weight="medium">
|
|
76
|
+
Rankings
|
|
77
|
+
</Text>
|
|
78
|
+
<Text size="2" color="secondary" className="mt-1">
|
|
79
|
+
Bid rankings appear here
|
|
80
|
+
</Text>
|
|
81
|
+
</div>
|
|
82
|
+
</AuctionRankingsContainer>
|
|
83
|
+
</AuctionLayout>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const WithScrollableBody: StoryObj<typeof AuctionLayout> = {
|
|
91
|
+
render: () => (
|
|
92
|
+
<div className="h-screen w-full bg-muted p-8">
|
|
93
|
+
<div className="mx-auto flex h-full max-w-7xl items-center justify-center">
|
|
94
|
+
<div className="size-full rounded-lg border border-border bg-background shadow-lg">
|
|
95
|
+
<AuctionLayout height="600px">
|
|
96
|
+
<AuctionDetails>
|
|
97
|
+
<AuctionDetailsHeader>
|
|
98
|
+
<Text size="4" weight="medium">
|
|
99
|
+
Your Bids
|
|
100
|
+
</Text>
|
|
101
|
+
</AuctionDetailsHeader>
|
|
102
|
+
<AuctionDetailsBody>
|
|
103
|
+
<div className="space-y-4">
|
|
104
|
+
{detailBids.map((bid) => (
|
|
105
|
+
<div
|
|
106
|
+
key={bid.id}
|
|
107
|
+
className="rounded-lg border border-border bg-muted p-4"
|
|
108
|
+
>
|
|
109
|
+
<div className="flex justify-between">
|
|
110
|
+
<Text size="1" color="tertiary">
|
|
111
|
+
Rank #{bid.rank}
|
|
112
|
+
</Text>
|
|
113
|
+
<Text size="1" color="tertiary" tabularNums>
|
|
114
|
+
{bid.time}
|
|
115
|
+
</Text>
|
|
116
|
+
</div>
|
|
117
|
+
<Text size="2" className="mt-2" tabularNums>
|
|
118
|
+
{bid.price}
|
|
119
|
+
</Text>
|
|
120
|
+
</div>
|
|
121
|
+
))}
|
|
122
|
+
</div>
|
|
123
|
+
</AuctionDetailsBody>
|
|
124
|
+
<AuctionDetailsFooter>
|
|
125
|
+
<div className="rounded-lg border border-border p-4">
|
|
126
|
+
<Text size="2">Bid Form Placeholder</Text>
|
|
127
|
+
</div>
|
|
128
|
+
</AuctionDetailsFooter>
|
|
129
|
+
</AuctionDetails>
|
|
130
|
+
<AuctionRankingsContainer>
|
|
131
|
+
<div className="flex h-full flex-col">
|
|
132
|
+
<div className="shrink-0 border-b border-border p-4">
|
|
133
|
+
<Text size="3" weight="medium">
|
|
134
|
+
All Rankings
|
|
135
|
+
</Text>
|
|
136
|
+
</div>
|
|
137
|
+
<div className="min-h-0 flex-1 overflow-y-auto">
|
|
138
|
+
{rankingRows.map((row) => (
|
|
139
|
+
<div key={row.id}>
|
|
140
|
+
<div className="flex items-center justify-between px-6 py-3">
|
|
141
|
+
<div className="flex items-center gap-3">
|
|
142
|
+
<Text size="1" color="tertiary" className="w-6">
|
|
143
|
+
#{row.rank}
|
|
144
|
+
</Text>
|
|
145
|
+
<div className="size-6 rounded-full bg-muted" />
|
|
146
|
+
<Text size="2">{row.label}</Text>
|
|
147
|
+
</div>
|
|
148
|
+
<Text size="2" tabularNums>
|
|
149
|
+
{row.price}
|
|
150
|
+
</Text>
|
|
151
|
+
</div>
|
|
152
|
+
{!row.isLast && <Separator />}
|
|
153
|
+
</div>
|
|
154
|
+
))}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</AuctionRankingsContainer>
|
|
158
|
+
</AuctionLayout>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
),
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const CustomHeight: StoryObj<typeof AuctionLayout> = {
|
|
166
|
+
render: () => (
|
|
167
|
+
<div className="w-full bg-muted p-8">
|
|
168
|
+
<div className="mx-auto max-w-7xl">
|
|
169
|
+
<div className="rounded-lg border border-border bg-background shadow-lg">
|
|
170
|
+
<AuctionLayout height={400}>
|
|
171
|
+
<AuctionDetails>
|
|
172
|
+
<AuctionDetailsHeader>
|
|
173
|
+
<Text size="3" weight="medium">
|
|
174
|
+
Compact Layout
|
|
175
|
+
</Text>
|
|
176
|
+
</AuctionDetailsHeader>
|
|
177
|
+
<AuctionDetailsBody>
|
|
178
|
+
<Text size="2" color="secondary">
|
|
179
|
+
This layout has a fixed height of 400px
|
|
180
|
+
</Text>
|
|
181
|
+
</AuctionDetailsBody>
|
|
182
|
+
<AuctionDetailsFooter>
|
|
183
|
+
<Text size="1" color="tertiary">
|
|
184
|
+
Footer
|
|
185
|
+
</Text>
|
|
186
|
+
</AuctionDetailsFooter>
|
|
187
|
+
</AuctionDetails>
|
|
188
|
+
<AuctionRankingsContainer>
|
|
189
|
+
<div className="flex h-full items-center justify-center">
|
|
190
|
+
<Text size="2" color="tertiary">
|
|
191
|
+
Rankings Panel
|
|
192
|
+
</Text>
|
|
193
|
+
</div>
|
|
194
|
+
</AuctionRankingsContainer>
|
|
195
|
+
</AuctionLayout>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
),
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const DetailsOnly: StoryObj<typeof AuctionLayout> = {
|
|
203
|
+
render: () => (
|
|
204
|
+
<div className="h-screen w-full bg-muted p-8">
|
|
205
|
+
<div className="mx-auto flex h-full max-w-md items-center justify-center">
|
|
206
|
+
<div className="size-full max-h-150 rounded-lg border border-border bg-background shadow-lg">
|
|
207
|
+
<AuctionDetails className="h-full">
|
|
208
|
+
<AuctionDetailsHeader>
|
|
209
|
+
<Text size="4" weight="medium">
|
|
210
|
+
Auction #1234
|
|
211
|
+
</Text>
|
|
212
|
+
<Text size="2" color="secondary" className="mt-1">
|
|
213
|
+
Live - 2h 30m remaining
|
|
214
|
+
</Text>
|
|
215
|
+
</AuctionDetailsHeader>
|
|
216
|
+
<AuctionDetailsBody>
|
|
217
|
+
<div className="space-y-4">
|
|
218
|
+
<div className="flex justify-between">
|
|
219
|
+
<Text size="2" color="tertiary">
|
|
220
|
+
Reserve Price
|
|
221
|
+
</Text>
|
|
222
|
+
<Text size="2" tabularNums>
|
|
223
|
+
0.01
|
|
224
|
+
</Text>
|
|
225
|
+
</div>
|
|
226
|
+
<div className="flex justify-between">
|
|
227
|
+
<Text size="2" color="tertiary">
|
|
228
|
+
Editions
|
|
229
|
+
</Text>
|
|
230
|
+
<Text size="2">20</Text>
|
|
231
|
+
</div>
|
|
232
|
+
<div className="flex justify-between">
|
|
233
|
+
<Text size="2" color="tertiary">
|
|
234
|
+
Current Floor
|
|
235
|
+
</Text>
|
|
236
|
+
<Text size="2" tabularNums>
|
|
237
|
+
0.05
|
|
238
|
+
</Text>
|
|
239
|
+
</div>
|
|
240
|
+
<Separator />
|
|
241
|
+
<Text size="2" color="secondary">
|
|
242
|
+
Bid on one of 20 curated editions. Top 20 bidders win and pay
|
|
243
|
+
the lowest winning bid.
|
|
244
|
+
</Text>
|
|
245
|
+
</div>
|
|
246
|
+
</AuctionDetailsBody>
|
|
247
|
+
<AuctionDetailsFooter>
|
|
248
|
+
<button
|
|
249
|
+
type="button"
|
|
250
|
+
className="w-full rounded-lg bg-foreground px-4 py-3 text-background"
|
|
251
|
+
>
|
|
252
|
+
Place Bid
|
|
253
|
+
</button>
|
|
254
|
+
</AuctionDetailsFooter>
|
|
255
|
+
</AuctionDetails>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
),
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export const RankingsOnly: StoryObj<typeof AuctionLayout> = {
|
|
263
|
+
render: () => (
|
|
264
|
+
<div className="h-screen w-full bg-muted p-8">
|
|
265
|
+
<div className="mx-auto flex h-full max-w-lg items-center justify-center">
|
|
266
|
+
<div className="size-full max-h-125 rounded-lg border border-border bg-background shadow-lg">
|
|
267
|
+
<AuctionRankingsContainer className="h-full">
|
|
268
|
+
<div className="flex h-full flex-col">
|
|
269
|
+
<div className="shrink-0 border-b border-border p-4">
|
|
270
|
+
<Text size="3" weight="medium">
|
|
271
|
+
Leaderboard
|
|
272
|
+
</Text>
|
|
273
|
+
<Text size="1" color="secondary" className="mt-1">
|
|
274
|
+
Top 20 of 25 bids are winning
|
|
275
|
+
</Text>
|
|
276
|
+
</div>
|
|
277
|
+
<div className="min-h-0 flex-1 overflow-y-auto">
|
|
278
|
+
{leaderboardRows.map((row) => (
|
|
279
|
+
<div key={row.id}>
|
|
280
|
+
<div
|
|
281
|
+
className={`flex items-center justify-between px-6 py-3 ${row.isOutbid ? "opacity-50" : ""}`}
|
|
282
|
+
>
|
|
283
|
+
<div className="flex items-center gap-3">
|
|
284
|
+
<Text size="1" color="tertiary" className="w-6">
|
|
285
|
+
#{row.rank}
|
|
286
|
+
</Text>
|
|
287
|
+
<div className="size-6 rounded-full bg-muted" />
|
|
288
|
+
<Text size="2">{row.address}</Text>
|
|
289
|
+
</div>
|
|
290
|
+
<div className="flex items-center gap-3">
|
|
291
|
+
<Text size="2" tabularNums>
|
|
292
|
+
{row.price}
|
|
293
|
+
</Text>
|
|
294
|
+
<Text
|
|
295
|
+
size="1"
|
|
296
|
+
color="tertiary"
|
|
297
|
+
className="w-8 text-right"
|
|
298
|
+
>
|
|
299
|
+
{row.timeLabel}
|
|
300
|
+
</Text>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
{!row.isLast && <Separator />}
|
|
304
|
+
</div>
|
|
305
|
+
))}
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
</AuctionRankingsContainer>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
),
|
|
313
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AuctionStatusTag } from "@/components/blocks/auction/AuctionStatusTag";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof AuctionStatusTag> = {
|
|
5
|
+
title: "Blocks/Auction/StatusTag",
|
|
6
|
+
component: AuctionStatusTag,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
background: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["filled", "transparent"],
|
|
14
|
+
},
|
|
15
|
+
showCountdown: {
|
|
16
|
+
control: "boolean",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
export const Live: StoryObj<typeof AuctionStatusTag> = {
|
|
24
|
+
args: {
|
|
25
|
+
opensAt: new Date(Date.now() - 86400000),
|
|
26
|
+
endsAt: new Date(Date.now() + 86400000 * 2),
|
|
27
|
+
background: "filled",
|
|
28
|
+
showCountdown: false,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const LiveWithCountdown: StoryObj<typeof AuctionStatusTag> = {
|
|
33
|
+
args: {
|
|
34
|
+
opensAt: new Date(Date.now() - 86400000),
|
|
35
|
+
endsAt: new Date(Date.now() + 3600000),
|
|
36
|
+
background: "filled",
|
|
37
|
+
showCountdown: true,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Upcoming: StoryObj<typeof AuctionStatusTag> = {
|
|
42
|
+
args: {
|
|
43
|
+
opensAt: new Date(Date.now() + 86400000),
|
|
44
|
+
endsAt: new Date(Date.now() + 86400000 * 3),
|
|
45
|
+
background: "filled",
|
|
46
|
+
showCountdown: false,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const UpcomingWithCountdown: StoryObj<typeof AuctionStatusTag> = {
|
|
51
|
+
args: {
|
|
52
|
+
opensAt: new Date(Date.now() + 3600000 * 2),
|
|
53
|
+
endsAt: new Date(Date.now() + 86400000 * 3),
|
|
54
|
+
background: "filled",
|
|
55
|
+
showCountdown: true,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Closed: StoryObj<typeof AuctionStatusTag> = {
|
|
60
|
+
args: {
|
|
61
|
+
opensAt: new Date(Date.now() - 86400000 * 5),
|
|
62
|
+
endsAt: new Date(Date.now() - 86400000),
|
|
63
|
+
background: "filled",
|
|
64
|
+
showCountdown: false,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const TransparentBackground: StoryObj<typeof AuctionStatusTag> = {
|
|
69
|
+
render: () => (
|
|
70
|
+
<div className="flex flex-col gap-4">
|
|
71
|
+
<div>
|
|
72
|
+
<p className="mb-2 text-sm text-muted-foreground">Live (transparent)</p>
|
|
73
|
+
<AuctionStatusTag
|
|
74
|
+
opensAt={new Date(Date.now() - 86400000)}
|
|
75
|
+
endsAt={new Date(Date.now() + 86400000 * 2)}
|
|
76
|
+
background="transparent"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<p className="mb-2 text-sm text-muted-foreground">
|
|
81
|
+
Upcoming (transparent)
|
|
82
|
+
</p>
|
|
83
|
+
<AuctionStatusTag
|
|
84
|
+
opensAt={new Date(Date.now() + 86400000)}
|
|
85
|
+
endsAt={new Date(Date.now() + 86400000 * 3)}
|
|
86
|
+
background="transparent"
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<p className="mb-2 text-sm text-muted-foreground">
|
|
91
|
+
Closed (transparent)
|
|
92
|
+
</p>
|
|
93
|
+
<AuctionStatusTag
|
|
94
|
+
opensAt={new Date(Date.now() - 86400000 * 5)}
|
|
95
|
+
endsAt={new Date(Date.now() - 86400000)}
|
|
96
|
+
background="transparent"
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
),
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const AllStates: StoryObj<typeof AuctionStatusTag> = {
|
|
104
|
+
render: () => (
|
|
105
|
+
<div className="flex flex-col gap-4">
|
|
106
|
+
<div>
|
|
107
|
+
<p className="mb-2 text-sm text-muted-foreground">Live auction</p>
|
|
108
|
+
<AuctionStatusTag
|
|
109
|
+
opensAt={new Date(Date.now() - 86400000)}
|
|
110
|
+
endsAt={new Date(Date.now() + 86400000 * 2)}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
<div>
|
|
114
|
+
<p className="mb-2 text-sm text-muted-foreground">
|
|
115
|
+
Live auction with countdown
|
|
116
|
+
</p>
|
|
117
|
+
<AuctionStatusTag
|
|
118
|
+
opensAt={new Date(Date.now() - 86400000)}
|
|
119
|
+
endsAt={new Date(Date.now() + 3600000)}
|
|
120
|
+
showCountdown
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
<div>
|
|
124
|
+
<p className="mb-2 text-sm text-muted-foreground">Upcoming auction</p>
|
|
125
|
+
<AuctionStatusTag
|
|
126
|
+
opensAt={new Date(Date.now() + 86400000)}
|
|
127
|
+
endsAt={new Date(Date.now() + 86400000 * 3)}
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
<div>
|
|
131
|
+
<p className="mb-2 text-sm text-muted-foreground">
|
|
132
|
+
Upcoming auction with countdown
|
|
133
|
+
</p>
|
|
134
|
+
<AuctionStatusTag
|
|
135
|
+
opensAt={new Date(Date.now() + 3600000 * 2)}
|
|
136
|
+
endsAt={new Date(Date.now() + 86400000 * 3)}
|
|
137
|
+
showCountdown
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
<div>
|
|
141
|
+
<p className="mb-2 text-sm text-muted-foreground">Closed auction</p>
|
|
142
|
+
<AuctionStatusTag
|
|
143
|
+
opensAt={new Date(Date.now() - 86400000 * 5)}
|
|
144
|
+
endsAt={new Date(Date.now() - 86400000)}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
),
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const InCard: StoryObj<typeof AuctionStatusTag> = {
|
|
152
|
+
render: () => (
|
|
153
|
+
<div className="w-80 rounded-lg border border-border bg-background p-4">
|
|
154
|
+
<div className="flex items-center justify-between">
|
|
155
|
+
<span className="font-medium text-foreground">Auction #1234</span>
|
|
156
|
+
<AuctionStatusTag
|
|
157
|
+
opensAt={new Date(Date.now() - 86400000)}
|
|
158
|
+
endsAt={new Date(Date.now() + 86400000 * 2)}
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
162
|
+
A curated collection of 20 editions
|
|
163
|
+
</p>
|
|
164
|
+
</div>
|
|
165
|
+
),
|
|
166
|
+
};
|