@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,215 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Tab, Tabs, TabsList, TabsPanel } from "@/components/primitives/Tabs";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Tabs> = {
|
|
5
|
+
title: "Primitives/Tabs",
|
|
6
|
+
component: Tabs,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
layout: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["default", "centered"],
|
|
14
|
+
},
|
|
15
|
+
variant: {
|
|
16
|
+
control: "select",
|
|
17
|
+
options: ["default", "underline"],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
export const Default: StoryObj<typeof Tabs> = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<Tabs defaultValue="tab1" className="w-96">
|
|
27
|
+
<TabsList>
|
|
28
|
+
<Tab value="tab1">Overview</Tab>
|
|
29
|
+
<Tab value="tab2">Activity</Tab>
|
|
30
|
+
<Tab value="tab3">Settings</Tab>
|
|
31
|
+
</TabsList>
|
|
32
|
+
<TabsPanel value="tab1" className="pt-4">
|
|
33
|
+
<p className="text-foreground">Overview content goes here.</p>
|
|
34
|
+
</TabsPanel>
|
|
35
|
+
<TabsPanel value="tab2" className="pt-4">
|
|
36
|
+
<p className="text-foreground">Activity content goes here.</p>
|
|
37
|
+
</TabsPanel>
|
|
38
|
+
<TabsPanel value="tab3" className="pt-4">
|
|
39
|
+
<p className="text-foreground">Settings content goes here.</p>
|
|
40
|
+
</TabsPanel>
|
|
41
|
+
</Tabs>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Underline: StoryObj<typeof Tabs> = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<Tabs defaultValue="tab1" variant="underline" className="w-96">
|
|
48
|
+
<TabsList>
|
|
49
|
+
<Tab value="tab1">Overview</Tab>
|
|
50
|
+
<Tab value="tab2">Activity</Tab>
|
|
51
|
+
<Tab value="tab3">Settings</Tab>
|
|
52
|
+
</TabsList>
|
|
53
|
+
<TabsPanel value="tab1" className="pt-4">
|
|
54
|
+
<p className="text-foreground">
|
|
55
|
+
Overview content with underline indicator.
|
|
56
|
+
</p>
|
|
57
|
+
</TabsPanel>
|
|
58
|
+
<TabsPanel value="tab2" className="pt-4">
|
|
59
|
+
<p className="text-foreground">
|
|
60
|
+
Activity content with underline indicator.
|
|
61
|
+
</p>
|
|
62
|
+
</TabsPanel>
|
|
63
|
+
<TabsPanel value="tab3" className="pt-4">
|
|
64
|
+
<p className="text-foreground">
|
|
65
|
+
Settings content with underline indicator.
|
|
66
|
+
</p>
|
|
67
|
+
</TabsPanel>
|
|
68
|
+
</Tabs>
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Centered: StoryObj<typeof Tabs> = {
|
|
73
|
+
render: () => (
|
|
74
|
+
<Tabs defaultValue="tab1" layout="centered" className="w-96">
|
|
75
|
+
<TabsList>
|
|
76
|
+
<Tab value="tab1">Bids</Tab>
|
|
77
|
+
<Tab value="tab2">Rankings</Tab>
|
|
78
|
+
<Tab value="tab3">Your Bids</Tab>
|
|
79
|
+
</TabsList>
|
|
80
|
+
<TabsPanel value="tab1" className="pt-4">
|
|
81
|
+
<p className="text-foreground">Bids content (centered layout).</p>
|
|
82
|
+
</TabsPanel>
|
|
83
|
+
<TabsPanel value="tab2" className="pt-4">
|
|
84
|
+
<p className="text-foreground">Rankings content (centered layout).</p>
|
|
85
|
+
</TabsPanel>
|
|
86
|
+
<TabsPanel value="tab3" className="pt-4">
|
|
87
|
+
<p className="text-foreground">Your Bids content (centered layout).</p>
|
|
88
|
+
</TabsPanel>
|
|
89
|
+
</Tabs>
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const CenteredUnderline: StoryObj<typeof Tabs> = {
|
|
94
|
+
render: () => (
|
|
95
|
+
<Tabs
|
|
96
|
+
defaultValue="tab1"
|
|
97
|
+
layout="centered"
|
|
98
|
+
variant="underline"
|
|
99
|
+
className="w-96"
|
|
100
|
+
>
|
|
101
|
+
<TabsList>
|
|
102
|
+
<Tab value="tab1">Bids</Tab>
|
|
103
|
+
<Tab value="tab2">Rankings</Tab>
|
|
104
|
+
<Tab value="tab3">Your Bids</Tab>
|
|
105
|
+
</TabsList>
|
|
106
|
+
<TabsPanel value="tab1" className="pt-4">
|
|
107
|
+
<p className="text-foreground">Bids content (centered + underline).</p>
|
|
108
|
+
</TabsPanel>
|
|
109
|
+
<TabsPanel value="tab2" className="pt-4">
|
|
110
|
+
<p className="text-foreground">
|
|
111
|
+
Rankings content (centered + underline).
|
|
112
|
+
</p>
|
|
113
|
+
</TabsPanel>
|
|
114
|
+
<TabsPanel value="tab3" className="pt-4">
|
|
115
|
+
<p className="text-foreground">
|
|
116
|
+
Your Bids content (centered + underline).
|
|
117
|
+
</p>
|
|
118
|
+
</TabsPanel>
|
|
119
|
+
</Tabs>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const TwoTabs: StoryObj<typeof Tabs> = {
|
|
124
|
+
render: () => (
|
|
125
|
+
<Tabs defaultValue="details" variant="underline" className="w-80">
|
|
126
|
+
<TabsList>
|
|
127
|
+
<Tab value="details">Details</Tab>
|
|
128
|
+
<Tab value="history">History</Tab>
|
|
129
|
+
</TabsList>
|
|
130
|
+
<TabsPanel value="details" className="pt-4">
|
|
131
|
+
<div className="space-y-2">
|
|
132
|
+
<div className="flex justify-between">
|
|
133
|
+
<span className="text-muted-foreground">Reserve Price</span>
|
|
134
|
+
<span className="text-foreground">0.01 ETH</span>
|
|
135
|
+
</div>
|
|
136
|
+
<div className="flex justify-between">
|
|
137
|
+
<span className="text-muted-foreground">Editions</span>
|
|
138
|
+
<span className="text-foreground">20</span>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</TabsPanel>
|
|
142
|
+
<TabsPanel value="history" className="pt-4">
|
|
143
|
+
<p className="text-muted-foreground">No history yet.</p>
|
|
144
|
+
</TabsPanel>
|
|
145
|
+
</Tabs>
|
|
146
|
+
),
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const ManyTabs: StoryObj<typeof Tabs> = {
|
|
150
|
+
render: () => (
|
|
151
|
+
<Tabs defaultValue="tab1" className="w-[600px]">
|
|
152
|
+
<TabsList>
|
|
153
|
+
<Tab value="tab1">Home</Tab>
|
|
154
|
+
<Tab value="tab2">Explore</Tab>
|
|
155
|
+
<Tab value="tab3">Collections</Tab>
|
|
156
|
+
<Tab value="tab4">Activity</Tab>
|
|
157
|
+
<Tab value="tab5">Profile</Tab>
|
|
158
|
+
<Tab value="tab6">Settings</Tab>
|
|
159
|
+
</TabsList>
|
|
160
|
+
<TabsPanel value="tab1" className="pt-4">
|
|
161
|
+
<p className="text-foreground">Home content</p>
|
|
162
|
+
</TabsPanel>
|
|
163
|
+
<TabsPanel value="tab2" className="pt-4">
|
|
164
|
+
<p className="text-foreground">Explore content</p>
|
|
165
|
+
</TabsPanel>
|
|
166
|
+
<TabsPanel value="tab3" className="pt-4">
|
|
167
|
+
<p className="text-foreground">Collections content</p>
|
|
168
|
+
</TabsPanel>
|
|
169
|
+
<TabsPanel value="tab4" className="pt-4">
|
|
170
|
+
<p className="text-foreground">Activity content</p>
|
|
171
|
+
</TabsPanel>
|
|
172
|
+
<TabsPanel value="tab5" className="pt-4">
|
|
173
|
+
<p className="text-foreground">Profile content</p>
|
|
174
|
+
</TabsPanel>
|
|
175
|
+
<TabsPanel value="tab6" className="pt-4">
|
|
176
|
+
<p className="text-foreground">Settings content</p>
|
|
177
|
+
</TabsPanel>
|
|
178
|
+
</Tabs>
|
|
179
|
+
),
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const InCard: StoryObj<typeof Tabs> = {
|
|
183
|
+
render: () => (
|
|
184
|
+
<div className="w-96 rounded-lg border border-border bg-background p-4">
|
|
185
|
+
<h3 className="mb-4 font-medium text-foreground">Auction Details</h3>
|
|
186
|
+
<Tabs defaultValue="info" variant="underline">
|
|
187
|
+
<TabsList>
|
|
188
|
+
<Tab value="info">Info</Tab>
|
|
189
|
+
<Tab value="bids">Bids</Tab>
|
|
190
|
+
<Tab value="rules">Rules</Tab>
|
|
191
|
+
</TabsList>
|
|
192
|
+
<TabsPanel value="info" className="pt-4">
|
|
193
|
+
<div className="space-y-2 text-sm">
|
|
194
|
+
<div className="flex justify-between">
|
|
195
|
+
<span className="text-muted-foreground">Status</span>
|
|
196
|
+
<span className="text-success">Live</span>
|
|
197
|
+
</div>
|
|
198
|
+
<div className="flex justify-between">
|
|
199
|
+
<span className="text-muted-foreground">Time Left</span>
|
|
200
|
+
<span className="text-foreground">2h 30m</span>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</TabsPanel>
|
|
204
|
+
<TabsPanel value="bids" className="pt-4">
|
|
205
|
+
<p className="text-sm text-muted-foreground">25 bids placed</p>
|
|
206
|
+
</TabsPanel>
|
|
207
|
+
<TabsPanel value="rules" className="pt-4">
|
|
208
|
+
<p className="text-sm text-muted-foreground">
|
|
209
|
+
Top 20 bidders win and pay the lowest winning bid.
|
|
210
|
+
</p>
|
|
211
|
+
</TabsPanel>
|
|
212
|
+
</Tabs>
|
|
213
|
+
</div>
|
|
214
|
+
),
|
|
215
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Tag } from "@/components/primitives/Tag";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Tag> = {
|
|
5
|
+
title: "Primitives/Tag",
|
|
6
|
+
component: Tag,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["informative", "interactive"],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
export const Informative: StoryObj<typeof Tag> = {
|
|
21
|
+
args: {
|
|
22
|
+
children: "NFT",
|
|
23
|
+
type: "informative",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Interactive: StoryObj<typeof Tag> = {
|
|
28
|
+
render: () => (
|
|
29
|
+
<Tag type="interactive" onClick={() => console.log("Tag clicked")}>
|
|
30
|
+
Click me
|
|
31
|
+
</Tag>
|
|
32
|
+
),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const StatusTags: StoryObj<typeof Tag> = {
|
|
36
|
+
render: () => (
|
|
37
|
+
<div className="flex flex-wrap gap-2">
|
|
38
|
+
<Tag>Live</Tag>
|
|
39
|
+
<Tag>Upcoming</Tag>
|
|
40
|
+
<Tag>Closed</Tag>
|
|
41
|
+
<Tag>Sold Out</Tag>
|
|
42
|
+
</div>
|
|
43
|
+
),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const CategoryTags: StoryObj<typeof Tag> = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<div className="flex flex-wrap gap-2">
|
|
49
|
+
<Tag>Art</Tag>
|
|
50
|
+
<Tag>Photography</Tag>
|
|
51
|
+
<Tag>Music</Tag>
|
|
52
|
+
<Tag>Collectibles</Tag>
|
|
53
|
+
<Tag>Gaming</Tag>
|
|
54
|
+
</div>
|
|
55
|
+
),
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const InteractiveTags: StoryObj<typeof Tag> = {
|
|
59
|
+
render: () => (
|
|
60
|
+
<div className="flex flex-wrap gap-2">
|
|
61
|
+
<Tag type="interactive" onClick={() => console.log("Art")}>
|
|
62
|
+
Art
|
|
63
|
+
</Tag>
|
|
64
|
+
<Tag type="interactive" onClick={() => console.log("Photography")}>
|
|
65
|
+
Photography
|
|
66
|
+
</Tag>
|
|
67
|
+
<Tag type="interactive" onClick={() => console.log("Music")}>
|
|
68
|
+
Music
|
|
69
|
+
</Tag>
|
|
70
|
+
<Tag type="interactive" onClick={() => console.log("Collectibles")}>
|
|
71
|
+
Collectibles
|
|
72
|
+
</Tag>
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const WithNumbers: StoryObj<typeof Tag> = {
|
|
78
|
+
render: () => (
|
|
79
|
+
<div className="flex flex-wrap gap-2">
|
|
80
|
+
<Tag>Edition #1</Tag>
|
|
81
|
+
<Tag>Rank #5</Tag>
|
|
82
|
+
<Tag>0.5 ETH</Tag>
|
|
83
|
+
<Tag>20 editions</Tag>
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const InContext: StoryObj<typeof Tag> = {
|
|
89
|
+
render: () => (
|
|
90
|
+
<div className="w-80 rounded-lg border border-border bg-background p-4">
|
|
91
|
+
<div className="flex items-center justify-between">
|
|
92
|
+
<h3 className="font-medium text-foreground">Auction #1234</h3>
|
|
93
|
+
<Tag>Live</Tag>
|
|
94
|
+
</div>
|
|
95
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
96
|
+
A curated collection of digital art
|
|
97
|
+
</p>
|
|
98
|
+
<div className="mt-3 flex flex-wrap gap-1">
|
|
99
|
+
<Tag>Art</Tag>
|
|
100
|
+
<Tag>Digital</Tag>
|
|
101
|
+
<Tag>Limited</Tag>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
),
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const AllTypes: StoryObj<typeof Tag> = {
|
|
108
|
+
render: () => (
|
|
109
|
+
<div className="flex flex-col gap-4">
|
|
110
|
+
<div>
|
|
111
|
+
<p className="mb-2 text-sm text-muted-foreground">
|
|
112
|
+
Informative (default)
|
|
113
|
+
</p>
|
|
114
|
+
<div className="flex gap-2">
|
|
115
|
+
<Tag type="informative">Status</Tag>
|
|
116
|
+
<Tag type="informative">Category</Tag>
|
|
117
|
+
<Tag type="informative">Label</Tag>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div>
|
|
121
|
+
<p className="mb-2 text-sm text-muted-foreground">
|
|
122
|
+
Interactive (clickable)
|
|
123
|
+
</p>
|
|
124
|
+
<div className="flex gap-2">
|
|
125
|
+
<Tag type="interactive" onClick={() => console.log("1")}>
|
|
126
|
+
Filter 1
|
|
127
|
+
</Tag>
|
|
128
|
+
<Tag type="interactive" onClick={() => console.log("2")}>
|
|
129
|
+
Filter 2
|
|
130
|
+
</Tag>
|
|
131
|
+
<Tag type="interactive" onClick={() => console.log("3")}>
|
|
132
|
+
Filter 3
|
|
133
|
+
</Tag>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
),
|
|
138
|
+
};
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Text } from "@/components/primitives/Text";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Text> = {
|
|
5
|
+
title: "Primitives/Text",
|
|
6
|
+
component: Text,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
size: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
14
|
+
},
|
|
15
|
+
weight: {
|
|
16
|
+
control: "select",
|
|
17
|
+
options: ["regular", "medium", "semibold"],
|
|
18
|
+
},
|
|
19
|
+
color: {
|
|
20
|
+
control: "select",
|
|
21
|
+
options: [
|
|
22
|
+
"primary",
|
|
23
|
+
"secondary",
|
|
24
|
+
"tertiary",
|
|
25
|
+
"disabled",
|
|
26
|
+
"current",
|
|
27
|
+
"success",
|
|
28
|
+
"error",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
align: {
|
|
32
|
+
control: "select",
|
|
33
|
+
options: ["left", "center", "right"],
|
|
34
|
+
},
|
|
35
|
+
tabularNums: {
|
|
36
|
+
control: "boolean",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
export const Default: StoryObj<typeof Text> = {
|
|
44
|
+
args: {
|
|
45
|
+
children: "Default text",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Sizes: StoryObj<typeof Text> = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<div className="flex flex-col gap-2">
|
|
52
|
+
<Text size="1">Size 1 - Smallest text</Text>
|
|
53
|
+
<Text size="2">Size 2 - Default text</Text>
|
|
54
|
+
<Text size="3">Size 3 - Slightly larger</Text>
|
|
55
|
+
<Text size="4">Size 4 - Medium text</Text>
|
|
56
|
+
<Text size="5">Size 5 - Large text</Text>
|
|
57
|
+
<Text size="6">Size 6 - Extra large</Text>
|
|
58
|
+
<Text size="7">Size 7 - Heading</Text>
|
|
59
|
+
<Text size="8">Size 8 - Display</Text>
|
|
60
|
+
<Text size="9">Size 9 - Hero</Text>
|
|
61
|
+
</div>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Weights: StoryObj<typeof Text> = {
|
|
66
|
+
render: () => (
|
|
67
|
+
<div className="flex flex-col gap-2">
|
|
68
|
+
<Text weight="regular">Regular weight (default)</Text>
|
|
69
|
+
<Text weight="medium">Medium weight</Text>
|
|
70
|
+
<Text weight="semibold">Semibold weight</Text>
|
|
71
|
+
</div>
|
|
72
|
+
),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Colors: StoryObj<typeof Text> = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<div className="flex flex-col gap-2">
|
|
78
|
+
<Text color="primary">Primary color (default)</Text>
|
|
79
|
+
<Text color="secondary">Secondary color</Text>
|
|
80
|
+
<Text color="tertiary">Tertiary color</Text>
|
|
81
|
+
<Text color="disabled">Disabled color</Text>
|
|
82
|
+
<Text color="success">Success color</Text>
|
|
83
|
+
<Text color="error">Error color</Text>
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const Alignment: StoryObj<typeof Text> = {
|
|
89
|
+
render: () => (
|
|
90
|
+
<div className="flex w-64 flex-col gap-2 border border-border p-2">
|
|
91
|
+
<Text align="left">Left aligned text</Text>
|
|
92
|
+
<Text align="center">Center aligned text</Text>
|
|
93
|
+
<Text align="right">Right aligned text</Text>
|
|
94
|
+
</div>
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const TabularNumbers: StoryObj<typeof Text> = {
|
|
99
|
+
render: () => (
|
|
100
|
+
<div className="flex flex-col gap-2">
|
|
101
|
+
<div>
|
|
102
|
+
<p className="mb-1 text-xs text-muted-foreground">
|
|
103
|
+
Without tabular nums:
|
|
104
|
+
</p>
|
|
105
|
+
<div className="flex flex-col">
|
|
106
|
+
<Text>0.001 ETH</Text>
|
|
107
|
+
<Text>0.111 ETH</Text>
|
|
108
|
+
<Text>1.234 ETH</Text>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div>
|
|
112
|
+
<p className="mb-1 text-xs text-muted-foreground">With tabular nums:</p>
|
|
113
|
+
<div className="flex flex-col">
|
|
114
|
+
<Text tabularNums>0.001 ETH</Text>
|
|
115
|
+
<Text tabularNums>0.111 ETH</Text>
|
|
116
|
+
<Text tabularNums>1.234 ETH</Text>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const AsHeading: StoryObj<typeof Text> = {
|
|
124
|
+
render: () => (
|
|
125
|
+
<div className="flex flex-col gap-4">
|
|
126
|
+
<Text as="h1" size="8" weight="semibold" aria-label="Heading level 1">
|
|
127
|
+
Heading 1
|
|
128
|
+
</Text>
|
|
129
|
+
<Text as="h2" size="7" weight="semibold" aria-label="Heading level 2">
|
|
130
|
+
Heading 2
|
|
131
|
+
</Text>
|
|
132
|
+
<Text as="h3" size="6" weight="medium" aria-label="Heading level 3">
|
|
133
|
+
Heading 3
|
|
134
|
+
</Text>
|
|
135
|
+
<Text as="h4" size="5" weight="medium" aria-label="Heading level 4">
|
|
136
|
+
Heading 4
|
|
137
|
+
</Text>
|
|
138
|
+
<Text render={<p />} size="2">
|
|
139
|
+
Paragraph text that follows the headings.
|
|
140
|
+
</Text>
|
|
141
|
+
</div>
|
|
142
|
+
),
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const AsParagraph: StoryObj<typeof Text> = {
|
|
146
|
+
render: () => (
|
|
147
|
+
<div className="max-w-md">
|
|
148
|
+
<Text render={<p />} size="2" color="primary">
|
|
149
|
+
This is a paragraph of text rendered using the Text component. It
|
|
150
|
+
supports multiple sizes, weights, and colors. The text automatically
|
|
151
|
+
wraps and maintains proper line height for readability.
|
|
152
|
+
</Text>
|
|
153
|
+
</div>
|
|
154
|
+
),
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const PriceDisplay: StoryObj<typeof Text> = {
|
|
158
|
+
render: () => (
|
|
159
|
+
<div className="flex flex-col gap-4">
|
|
160
|
+
<div className="flex items-baseline gap-2">
|
|
161
|
+
<Text size="5" weight="semibold" tabularNums>
|
|
162
|
+
0.500
|
|
163
|
+
</Text>
|
|
164
|
+
<Text size="3" color="secondary">
|
|
165
|
+
ETH
|
|
166
|
+
</Text>
|
|
167
|
+
</div>
|
|
168
|
+
<div className="flex items-center gap-2">
|
|
169
|
+
<Text size="2" color="success" tabularNums>
|
|
170
|
+
+12.5%
|
|
171
|
+
</Text>
|
|
172
|
+
<Text size="1" color="tertiary">
|
|
173
|
+
24h change
|
|
174
|
+
</Text>
|
|
175
|
+
</div>
|
|
176
|
+
<div className="flex items-center gap-2">
|
|
177
|
+
<Text size="2" color="error" tabularNums>
|
|
178
|
+
-5.2%
|
|
179
|
+
</Text>
|
|
180
|
+
<Text size="1" color="tertiary">
|
|
181
|
+
7d change
|
|
182
|
+
</Text>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
),
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const AuctionInfo: StoryObj<typeof Text> = {
|
|
189
|
+
render: () => (
|
|
190
|
+
<div className="w-80 rounded-lg border border-border bg-background p-4">
|
|
191
|
+
<Text as="h3" size="4" weight="medium" aria-label="Auction title">
|
|
192
|
+
Ranked Auction #42
|
|
193
|
+
</Text>
|
|
194
|
+
<Text render={<p />} size="2" color="secondary" className="mt-1">
|
|
195
|
+
Bid on one of 20 curated editions. Top 20 bidders win and pay the lowest
|
|
196
|
+
winning bid.
|
|
197
|
+
</Text>
|
|
198
|
+
<div className="mt-4 space-y-2">
|
|
199
|
+
<div className="flex justify-between">
|
|
200
|
+
<Text size="2" color="tertiary">
|
|
201
|
+
Reserve Price
|
|
202
|
+
</Text>
|
|
203
|
+
<Text size="2" weight="medium" tabularNums>
|
|
204
|
+
0.01 ETH
|
|
205
|
+
</Text>
|
|
206
|
+
</div>
|
|
207
|
+
<div className="flex justify-between">
|
|
208
|
+
<Text size="2" color="tertiary">
|
|
209
|
+
Current Floor
|
|
210
|
+
</Text>
|
|
211
|
+
<Text size="2" weight="medium" tabularNums>
|
|
212
|
+
0.05 ETH
|
|
213
|
+
</Text>
|
|
214
|
+
</div>
|
|
215
|
+
<div className="flex justify-between">
|
|
216
|
+
<Text size="2" color="tertiary">
|
|
217
|
+
Status
|
|
218
|
+
</Text>
|
|
219
|
+
<Text size="2" color="success" weight="medium">
|
|
220
|
+
Live
|
|
221
|
+
</Text>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
),
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export const AllCombinations: StoryObj<typeof Text> = {
|
|
229
|
+
render: () => (
|
|
230
|
+
<div className="grid grid-cols-3 gap-4">
|
|
231
|
+
{(["regular", "medium", "semibold"] as const).map((weight) => (
|
|
232
|
+
<div key={weight} className="space-y-2">
|
|
233
|
+
<p className="text-xs text-muted-foreground capitalize">{weight}</p>
|
|
234
|
+
{(["primary", "secondary", "success", "error"] as const).map(
|
|
235
|
+
(color) => (
|
|
236
|
+
<Text key={color} weight={weight} color={color} size="2">
|
|
237
|
+
{color}
|
|
238
|
+
</Text>
|
|
239
|
+
),
|
|
240
|
+
)}
|
|
241
|
+
</div>
|
|
242
|
+
))}
|
|
243
|
+
</div>
|
|
244
|
+
),
|
|
245
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
-webkit-font-smoothing: antialiased;
|
|
4
|
+
background-color: var(--color-background);
|
|
5
|
+
color: var(--color-foreground);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
kbd {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
min-width: 1.5rem;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
border: 1px solid color-mix(in srgb, var(--color-border) 88%, transparent);
|
|
14
|
+
border-bottom-color: color-mix(
|
|
15
|
+
in srgb,
|
|
16
|
+
var(--color-input) 92%,
|
|
17
|
+
var(--color-border)
|
|
18
|
+
);
|
|
19
|
+
border-radius: 0.45rem;
|
|
20
|
+
background: linear-gradient(
|
|
21
|
+
180deg,
|
|
22
|
+
color-mix(in srgb, var(--color-background) 92%, var(--color-muted)) 0%,
|
|
23
|
+
color-mix(in srgb, var(--color-muted) 82%, var(--color-background)) 100%
|
|
24
|
+
);
|
|
25
|
+
box-shadow:
|
|
26
|
+
inset 0 1px 0 color-mix(in srgb, var(--color-white) 65%, transparent),
|
|
27
|
+
0 1px 0 color-mix(in srgb, var(--color-border) 55%, transparent),
|
|
28
|
+
0 2px 6px color-mix(in srgb, var(--color-black) 6%, transparent);
|
|
29
|
+
padding: 0.125rem 0.375rem;
|
|
30
|
+
font-family:
|
|
31
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
32
|
+
"Courier New", monospace;
|
|
33
|
+
font-size: 0.75rem;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
line-height: 1;
|
|
36
|
+
color: var(--color-foreground);
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
}
|