@gsk_poc/untitled-ui-base 0.1.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/README.md +44 -0
- package/components/application/app-navigation/base-components/featured-cards.demo.tsx +86 -0
- package/components/application/app-navigation/base-components/featured-cards.story.tsx +49 -0
- package/components/application/app-navigation/header-navigation.demo.tsx +59 -0
- package/components/application/app-navigation/header-navigation.story.tsx +23 -0
- package/components/application/app-navigation/sidebar-navigation.demo.tsx +409 -0
- package/components/application/app-navigation/sidebar-navigation.story.tsx +47 -0
- package/components/application/carousel/carousel.demo.tsx +107 -0
- package/components/application/carousel/carousel.story.tsx +21 -0
- package/components/application/charts/activity-gauges.demo.tsx +251 -0
- package/components/application/charts/activity-gauges.story.tsx +27 -0
- package/components/application/charts/bar-charts.demo.tsx +506 -0
- package/components/application/charts/bar-charts.story.tsx +36 -0
- package/components/application/charts/line-charts.demo.tsx +604 -0
- package/components/application/charts/line-charts.story.tsx +43 -0
- package/components/application/charts/pie-charts.demo.tsx +193 -0
- package/components/application/charts/pie-charts.story.tsx +30 -0
- package/components/application/charts/progress-circles.demo.tsx +110 -0
- package/components/application/charts/progress-circles.story.tsx +33 -0
- package/components/application/charts/radar-charts.demo.tsx +203 -0
- package/components/application/charts/radar-charts.story.tsx +18 -0
- package/components/application/date-picker/date-picker.demo.tsx +217 -0
- package/components/application/date-picker/date-picker.story.tsx +44 -0
- package/components/application/file-upload/file-upload.demo.tsx +292 -0
- package/components/application/file-upload/file-upload.story.tsx +70 -0
- package/components/application/loading-indicator/loading-indicator.demo.tsx +73 -0
- package/components/application/loading-indicator/loading-indicator.story.tsx +22 -0
- package/components/application/pagination/pagination.demo.tsx +104 -0
- package/components/application/pagination/pagination.story.tsx +54 -0
- package/components/application/table/table.demo.tsx +1038 -0
- package/components/application/table/table.story.tsx +119 -0
- package/components/application/tabs/tabs.demo.tsx +322 -0
- package/components/application/tabs/tabs.story.tsx +43 -0
- package/components/base/avatar/avatar.demo.tsx +865 -0
- package/components/base/avatar/avatar.story.tsx +27 -0
- package/components/base/badges/badge-groups.demo.tsx +357 -0
- package/components/base/badges/badge-groups.story.tsx +25 -0
- package/components/base/badges/badges.demo.tsx +497 -0
- package/components/base/badges/badges.story.tsx +83 -0
- package/components/base/button-group/button-group.demo.tsx +131 -0
- package/components/base/button-group/button-group.story.tsx +16 -0
- package/components/base/buttons/app-store-buttons.demo.tsx +129 -0
- package/components/base/buttons/app-store-buttons.story.tsx +13 -0
- package/components/base/buttons/buttons.demo.tsx +1022 -0
- package/components/base/buttons/buttons.story.tsx +42 -0
- package/components/base/buttons/social-buttons.demo.tsx +432 -0
- package/components/base/buttons/social-buttons.story.tsx +20 -0
- package/components/base/checkbox/checkbox.demo.tsx +62 -0
- package/components/base/checkbox/checkbox.story.tsx +18 -0
- package/components/base/dropdown/dropdown.demo.tsx +137 -0
- package/components/base/dropdown/dropdown.story.tsx +22 -0
- package/components/base/input/inputs.demo.tsx +758 -0
- package/components/base/input/inputs.story.tsx +52 -0
- package/components/base/pin-input/pin-input.demo.tsx +126 -0
- package/components/base/pin-input/pin-input.story.tsx +22 -0
- package/components/base/progress-indicators/progress-indicators.demo.tsx +54 -0
- package/components/base/progress-indicators/progress-indicators.story.tsx +57 -0
- package/components/base/radio-buttons/radio-buttons.demo.tsx +77 -0
- package/components/base/radio-buttons/radio-buttons.story.tsx +19 -0
- package/components/base/select/select.demo.tsx +936 -0
- package/components/base/select/select.story.tsx +43 -0
- package/components/base/slider/slider.demo.tsx +19 -0
- package/components/base/slider/slider.story.tsx +26 -0
- package/components/base/tags/tags.demo.tsx +341 -0
- package/components/base/tags/tags.story.tsx +28 -0
- package/components/base/textarea/textarea.demo.tsx +25 -0
- package/components/base/textarea/textarea.story.tsx +15 -0
- package/components/base/toggle/toggle.demo.tsx +76 -0
- package/components/base/toggle/toggle.story.tsx +23 -0
- package/components/base/tooltip/tooltip.demo.tsx +125 -0
- package/components/base/tooltip/tooltip.story.tsx +21 -0
- package/components/foundations/featured-icon/featured-icon.demo.tsx +160 -0
- package/components/foundations/featured-icon/featured-icon.story.tsx +25 -0
- package/components/shared-assets/credit-card/credit-card.demo.tsx +106 -0
- package/components/shared-assets/credit-card/credit-card.story.tsx +41 -0
- package/dist/index.d.mts +1417 -0
- package/dist/index.d.ts +1417 -0
- package/dist/index.js +10435 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +10345 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +126 -0
- package/styles/globals.css +65 -0
- package/styles/theme.css +430 -0
- package/styles/tokens-mapped.css +233 -0
- package/styles/tokens.css +807 -0
- package/styles/typography.css +430 -0
- package/tokens/design-tokens.dtcg.json +3515 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ArrowRight, ArrowUp, Plus } from "@untitledui/icons";
|
|
4
|
+
import type { BadgeColors } from "@/components/base/badges/badge-types";
|
|
5
|
+
import { Badge, BadgeIcon, BadgeWithButton, BadgeWithDot, BadgeWithFlag, BadgeWithIcon, BadgeWithImage, filledColors } from "@/components/base/badges/badges";
|
|
6
|
+
|
|
7
|
+
export const Default = () => {
|
|
8
|
+
return (
|
|
9
|
+
<div className="flex flex-col items-start gap-4">
|
|
10
|
+
<div className="flex items-start gap-4">
|
|
11
|
+
<BadgeWithDot type="pill-color" color="brand">
|
|
12
|
+
Label
|
|
13
|
+
</BadgeWithDot>
|
|
14
|
+
<BadgeWithDot type="color" color="brand">
|
|
15
|
+
Label
|
|
16
|
+
</BadgeWithDot>
|
|
17
|
+
<BadgeWithDot type="modern" color="brand">
|
|
18
|
+
Label
|
|
19
|
+
</BadgeWithDot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const PillColor = () => {
|
|
26
|
+
return (
|
|
27
|
+
<div className="flex flex-col items-start gap-4">
|
|
28
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
29
|
+
<div key={color} className="flex items-start gap-4">
|
|
30
|
+
<Badge color={color} size="sm" type="pill-color">
|
|
31
|
+
Label
|
|
32
|
+
</Badge>
|
|
33
|
+
<Badge color={color} size="md" type="pill-color">
|
|
34
|
+
Label
|
|
35
|
+
</Badge>
|
|
36
|
+
<Badge color={color} size="lg" type="pill-color">
|
|
37
|
+
Label
|
|
38
|
+
</Badge>
|
|
39
|
+
</div>
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const BadgeColor = () => {
|
|
46
|
+
return (
|
|
47
|
+
<div className="flex flex-col items-start gap-4">
|
|
48
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
49
|
+
<div key={color} className="flex items-start gap-4">
|
|
50
|
+
<Badge color={color} size="sm" type="color">
|
|
51
|
+
Label
|
|
52
|
+
</Badge>
|
|
53
|
+
<Badge color={color} size="md" type="color">
|
|
54
|
+
Label
|
|
55
|
+
</Badge>
|
|
56
|
+
<Badge color={color} size="lg" type="color">
|
|
57
|
+
Label
|
|
58
|
+
</Badge>
|
|
59
|
+
</div>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const BadgeModern = () => {
|
|
66
|
+
return (
|
|
67
|
+
<div className="flex flex-col items-start gap-4">
|
|
68
|
+
<div className="flex items-start gap-4">
|
|
69
|
+
<Badge color="gray" size="sm" type="modern">
|
|
70
|
+
Label
|
|
71
|
+
</Badge>
|
|
72
|
+
<Badge color="gray" size="md" type="modern">
|
|
73
|
+
Label
|
|
74
|
+
</Badge>
|
|
75
|
+
<Badge color="gray" size="lg" type="modern">
|
|
76
|
+
Label
|
|
77
|
+
</Badge>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const WithDot = () => {
|
|
84
|
+
return (
|
|
85
|
+
<div className="flex flex-col items-start gap-4">
|
|
86
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
87
|
+
<div key={color} className="flex items-start gap-4">
|
|
88
|
+
<BadgeWithDot color={color} size="sm" type="pill-color">
|
|
89
|
+
Label
|
|
90
|
+
</BadgeWithDot>
|
|
91
|
+
<BadgeWithDot color={color} size="md" type="pill-color">
|
|
92
|
+
Label
|
|
93
|
+
</BadgeWithDot>
|
|
94
|
+
<BadgeWithDot color={color} size="lg" type="pill-color">
|
|
95
|
+
Label
|
|
96
|
+
</BadgeWithDot>
|
|
97
|
+
</div>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const WithDotBadgeColor = () => {
|
|
104
|
+
return (
|
|
105
|
+
<div className="flex flex-col items-start gap-4">
|
|
106
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
107
|
+
<div key={color} className="flex items-start gap-4">
|
|
108
|
+
<BadgeWithDot color={color} size="sm" type="color">
|
|
109
|
+
Label
|
|
110
|
+
</BadgeWithDot>
|
|
111
|
+
<BadgeWithDot color={color} size="md" type="color">
|
|
112
|
+
Label
|
|
113
|
+
</BadgeWithDot>
|
|
114
|
+
<BadgeWithDot color={color} size="lg" type="color">
|
|
115
|
+
Label
|
|
116
|
+
</BadgeWithDot>
|
|
117
|
+
</div>
|
|
118
|
+
))}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const WithDotBadgeModern = () => {
|
|
124
|
+
return (
|
|
125
|
+
<div className="flex flex-col items-start gap-4">
|
|
126
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
127
|
+
<div key={color} className="flex items-start gap-4">
|
|
128
|
+
<BadgeWithDot color={color} size="sm" type="modern">
|
|
129
|
+
Label
|
|
130
|
+
</BadgeWithDot>
|
|
131
|
+
<BadgeWithDot color={color} size="md" type="modern">
|
|
132
|
+
Label
|
|
133
|
+
</BadgeWithDot>
|
|
134
|
+
<BadgeWithDot color={color} size="lg" type="modern">
|
|
135
|
+
Label
|
|
136
|
+
</BadgeWithDot>
|
|
137
|
+
</div>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const WithFlag = () => {
|
|
144
|
+
return (
|
|
145
|
+
<div className="flex flex-col items-start gap-4">
|
|
146
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
147
|
+
<div key={color} className="flex items-start gap-4">
|
|
148
|
+
<BadgeWithFlag color={color} size="sm" flag="AU" type="pill-color">
|
|
149
|
+
Label
|
|
150
|
+
</BadgeWithFlag>
|
|
151
|
+
<BadgeWithFlag color={color} size="md" flag="AU" type="pill-color">
|
|
152
|
+
Label
|
|
153
|
+
</BadgeWithFlag>
|
|
154
|
+
<BadgeWithFlag color={color} size="lg" flag="AU" type="pill-color">
|
|
155
|
+
Label
|
|
156
|
+
</BadgeWithFlag>
|
|
157
|
+
</div>
|
|
158
|
+
))}
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const WithFlagBadgeColor = () => {
|
|
164
|
+
return (
|
|
165
|
+
<div className="flex flex-col items-start gap-4">
|
|
166
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
167
|
+
<div key={color} className="flex items-start gap-4">
|
|
168
|
+
<BadgeWithFlag color={color} size="sm" flag="AU" type="color">
|
|
169
|
+
Label
|
|
170
|
+
</BadgeWithFlag>
|
|
171
|
+
<BadgeWithFlag color={color} size="md" flag="AU" type="color">
|
|
172
|
+
Label
|
|
173
|
+
</BadgeWithFlag>
|
|
174
|
+
<BadgeWithFlag color={color} size="lg" flag="AU" type="color">
|
|
175
|
+
Label
|
|
176
|
+
</BadgeWithFlag>
|
|
177
|
+
</div>
|
|
178
|
+
))}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export const WithFlagBadgeModern = () => {
|
|
184
|
+
return (
|
|
185
|
+
<div className="flex flex-col items-start gap-4">
|
|
186
|
+
<div className="flex items-start gap-4">
|
|
187
|
+
<BadgeWithFlag color="gray" size="sm" flag="AU" type="modern">
|
|
188
|
+
Label
|
|
189
|
+
</BadgeWithFlag>
|
|
190
|
+
<BadgeWithFlag color="gray" size="md" flag="AU" type="modern">
|
|
191
|
+
Label
|
|
192
|
+
</BadgeWithFlag>
|
|
193
|
+
<BadgeWithFlag color="gray" size="lg" flag="AU" type="modern">
|
|
194
|
+
Label
|
|
195
|
+
</BadgeWithFlag>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const WithAvatar = () => {
|
|
202
|
+
return (
|
|
203
|
+
<div className="flex flex-col items-start gap-4">
|
|
204
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
205
|
+
<div key={color} className="flex items-start gap-4">
|
|
206
|
+
<BadgeWithImage color={color} size="sm" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">
|
|
207
|
+
Label
|
|
208
|
+
</BadgeWithImage>
|
|
209
|
+
<BadgeWithImage color={color} size="md" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">
|
|
210
|
+
Label
|
|
211
|
+
</BadgeWithImage>
|
|
212
|
+
<BadgeWithImage color={color} size="lg" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">
|
|
213
|
+
Label
|
|
214
|
+
</BadgeWithImage>
|
|
215
|
+
</div>
|
|
216
|
+
))}
|
|
217
|
+
</div>
|
|
218
|
+
);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const WithAvatarBadgeColor = () => {
|
|
222
|
+
return (
|
|
223
|
+
<div className="flex flex-col items-start gap-4">
|
|
224
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
225
|
+
<div key={color} className="flex items-start gap-4">
|
|
226
|
+
<BadgeWithImage color={color} size="sm" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" type="color">
|
|
227
|
+
Label
|
|
228
|
+
</BadgeWithImage>
|
|
229
|
+
<BadgeWithImage color={color} size="md" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" type="color">
|
|
230
|
+
Label
|
|
231
|
+
</BadgeWithImage>
|
|
232
|
+
<BadgeWithImage color={color} size="lg" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" type="color">
|
|
233
|
+
Label
|
|
234
|
+
</BadgeWithImage>
|
|
235
|
+
</div>
|
|
236
|
+
))}
|
|
237
|
+
</div>
|
|
238
|
+
);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export const WithAvatarBadgeModern = () => {
|
|
242
|
+
return (
|
|
243
|
+
<div className="flex flex-col items-start gap-4">
|
|
244
|
+
<div className="flex items-start gap-4">
|
|
245
|
+
<BadgeWithImage color="gray" size="sm" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" type="modern">
|
|
246
|
+
Label
|
|
247
|
+
</BadgeWithImage>
|
|
248
|
+
<BadgeWithImage color="gray" size="md" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" type="modern">
|
|
249
|
+
Label
|
|
250
|
+
</BadgeWithImage>
|
|
251
|
+
<BadgeWithImage color="gray" size="lg" imgSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" type="modern">
|
|
252
|
+
Label
|
|
253
|
+
</BadgeWithImage>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export const WithCloseX = () => {
|
|
260
|
+
return (
|
|
261
|
+
<div className="flex flex-col items-start gap-4">
|
|
262
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
263
|
+
<div key={color} className="flex items-start gap-4">
|
|
264
|
+
<BadgeWithButton color={color} size="sm" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
265
|
+
Label
|
|
266
|
+
</BadgeWithButton>
|
|
267
|
+
<BadgeWithButton color={color} size="md" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
268
|
+
Label
|
|
269
|
+
</BadgeWithButton>
|
|
270
|
+
<BadgeWithButton color={color} size="lg" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
271
|
+
Label
|
|
272
|
+
</BadgeWithButton>
|
|
273
|
+
</div>
|
|
274
|
+
))}
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export const WithCloseXBadgeColor = () => {
|
|
280
|
+
return (
|
|
281
|
+
<div className="flex flex-col items-start gap-4">
|
|
282
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
283
|
+
<div key={color} className="flex items-start gap-4">
|
|
284
|
+
<BadgeWithButton color={color} size="sm" type="color" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
285
|
+
Label
|
|
286
|
+
</BadgeWithButton>
|
|
287
|
+
<BadgeWithButton color={color} size="md" type="color" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
288
|
+
Label
|
|
289
|
+
</BadgeWithButton>
|
|
290
|
+
<BadgeWithButton color={color} size="lg" type="color" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
291
|
+
Label
|
|
292
|
+
</BadgeWithButton>
|
|
293
|
+
</div>
|
|
294
|
+
))}
|
|
295
|
+
</div>
|
|
296
|
+
);
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
export const WithCloseXBadgeModern = () => {
|
|
300
|
+
return (
|
|
301
|
+
<div className="flex flex-col items-start gap-4">
|
|
302
|
+
<div className="flex items-start gap-4">
|
|
303
|
+
<BadgeWithButton color="gray" size="sm" type="modern" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
304
|
+
Label
|
|
305
|
+
</BadgeWithButton>
|
|
306
|
+
<BadgeWithButton color="gray" size="md" type="modern" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
307
|
+
Label
|
|
308
|
+
</BadgeWithButton>
|
|
309
|
+
<BadgeWithButton color="gray" size="lg" type="modern" buttonLabel="Clear" onButtonClick={() => {}}>
|
|
310
|
+
Label
|
|
311
|
+
</BadgeWithButton>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export const WithIconTrailing = () => {
|
|
318
|
+
return (
|
|
319
|
+
<div className="flex flex-col items-start gap-4">
|
|
320
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
321
|
+
<div key={color} className="flex items-start gap-4">
|
|
322
|
+
<BadgeWithIcon color={color} size="sm" iconTrailing={ArrowRight}>
|
|
323
|
+
Label
|
|
324
|
+
</BadgeWithIcon>
|
|
325
|
+
<BadgeWithIcon color={color} size="md" iconTrailing={ArrowRight}>
|
|
326
|
+
Label
|
|
327
|
+
</BadgeWithIcon>
|
|
328
|
+
<BadgeWithIcon color={color} size="lg" iconTrailing={ArrowRight}>
|
|
329
|
+
Label
|
|
330
|
+
</BadgeWithIcon>
|
|
331
|
+
</div>
|
|
332
|
+
))}
|
|
333
|
+
</div>
|
|
334
|
+
);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export const WithIconTrailingBadgeColor = () => {
|
|
338
|
+
return (
|
|
339
|
+
<div className="flex flex-col items-start gap-4">
|
|
340
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
341
|
+
<div key={color} className="flex items-start gap-4">
|
|
342
|
+
<BadgeWithIcon color={color} size="sm" iconTrailing={ArrowRight} type="color">
|
|
343
|
+
Label
|
|
344
|
+
</BadgeWithIcon>
|
|
345
|
+
<BadgeWithIcon color={color} size="md" iconTrailing={ArrowRight} type="color">
|
|
346
|
+
Label
|
|
347
|
+
</BadgeWithIcon>
|
|
348
|
+
<BadgeWithIcon color={color} size="lg" iconTrailing={ArrowRight} type="color">
|
|
349
|
+
Label
|
|
350
|
+
</BadgeWithIcon>
|
|
351
|
+
</div>
|
|
352
|
+
))}
|
|
353
|
+
</div>
|
|
354
|
+
);
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export const WithIconTrailingBadgeModern = () => {
|
|
358
|
+
return (
|
|
359
|
+
<div className="flex flex-col items-start gap-4">
|
|
360
|
+
<div className="flex items-start gap-4">
|
|
361
|
+
<BadgeWithIcon color="gray" size="sm" iconTrailing={ArrowRight} type="modern">
|
|
362
|
+
Label
|
|
363
|
+
</BadgeWithIcon>
|
|
364
|
+
<BadgeWithIcon color="gray" size="md" iconTrailing={ArrowRight} type="modern">
|
|
365
|
+
Label
|
|
366
|
+
</BadgeWithIcon>
|
|
367
|
+
<BadgeWithIcon color="gray" size="lg" iconTrailing={ArrowRight} type="modern">
|
|
368
|
+
Label
|
|
369
|
+
</BadgeWithIcon>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
);
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
export const WithIconLeading = () => {
|
|
376
|
+
return (
|
|
377
|
+
<div className="flex flex-col items-start gap-4">
|
|
378
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
379
|
+
<div key={color} className="flex items-start gap-4">
|
|
380
|
+
<BadgeWithIcon color={color} size="sm" iconLeading={ArrowUp}>
|
|
381
|
+
Label
|
|
382
|
+
</BadgeWithIcon>
|
|
383
|
+
<BadgeWithIcon color={color} size="md" iconLeading={ArrowUp}>
|
|
384
|
+
Label
|
|
385
|
+
</BadgeWithIcon>
|
|
386
|
+
<BadgeWithIcon color={color} size="lg" iconLeading={ArrowUp}>
|
|
387
|
+
Label
|
|
388
|
+
</BadgeWithIcon>
|
|
389
|
+
</div>
|
|
390
|
+
))}
|
|
391
|
+
</div>
|
|
392
|
+
);
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
export const WithIconLeadingBadgeColor = () => {
|
|
396
|
+
return (
|
|
397
|
+
<div className="flex flex-col items-start gap-4">
|
|
398
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
399
|
+
<div key={color} className="flex items-start gap-4">
|
|
400
|
+
<BadgeWithIcon color={color} size="sm" iconLeading={ArrowUp} type="color">
|
|
401
|
+
Label
|
|
402
|
+
</BadgeWithIcon>
|
|
403
|
+
<BadgeWithIcon color={color} size="md" iconLeading={ArrowUp} type="color">
|
|
404
|
+
Label
|
|
405
|
+
</BadgeWithIcon>
|
|
406
|
+
<BadgeWithIcon color={color} size="lg" iconLeading={ArrowUp} type="color">
|
|
407
|
+
Label
|
|
408
|
+
</BadgeWithIcon>
|
|
409
|
+
</div>
|
|
410
|
+
))}
|
|
411
|
+
</div>
|
|
412
|
+
);
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export const WithIconLeadingBadgeModern = () => {
|
|
416
|
+
return (
|
|
417
|
+
<div className="flex flex-col items-start gap-4">
|
|
418
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
419
|
+
<div key={color} className="flex items-start gap-4">
|
|
420
|
+
<BadgeWithIcon color={color} size="sm" iconLeading={ArrowUp} type="modern">
|
|
421
|
+
Label
|
|
422
|
+
</BadgeWithIcon>
|
|
423
|
+
<BadgeWithIcon color={color} size="md" iconLeading={ArrowUp} type="modern">
|
|
424
|
+
Label
|
|
425
|
+
</BadgeWithIcon>
|
|
426
|
+
<BadgeWithIcon color={color} size="lg" iconLeading={ArrowUp} type="modern">
|
|
427
|
+
Label
|
|
428
|
+
</BadgeWithIcon>
|
|
429
|
+
</div>
|
|
430
|
+
))}
|
|
431
|
+
</div>
|
|
432
|
+
);
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
export const WithIconOnly = () => {
|
|
436
|
+
return (
|
|
437
|
+
<div className="flex flex-col items-start gap-4">
|
|
438
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
439
|
+
<div key={color} className="flex items-start gap-4">
|
|
440
|
+
<button aria-label="Add" className="cursor-pointer rounded-full outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
441
|
+
<BadgeIcon color={color} size="sm" icon={Plus} />
|
|
442
|
+
</button>
|
|
443
|
+
|
|
444
|
+
<button aria-label="Add" className="cursor-pointer rounded-full outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
445
|
+
<BadgeIcon color={color} size="md" icon={Plus} />
|
|
446
|
+
</button>
|
|
447
|
+
|
|
448
|
+
<button aria-label="Add" className="cursor-pointer rounded-full outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
449
|
+
<BadgeIcon color={color} size="lg" icon={Plus} />
|
|
450
|
+
</button>
|
|
451
|
+
</div>
|
|
452
|
+
))}
|
|
453
|
+
</div>
|
|
454
|
+
);
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export const WithIconOnlyBadgeColor = () => {
|
|
458
|
+
return (
|
|
459
|
+
<div className="flex flex-col items-start gap-4">
|
|
460
|
+
{(Object.keys(filledColors) as BadgeColors[]).map((color) => (
|
|
461
|
+
<div key={color} className="flex items-start gap-4">
|
|
462
|
+
<button aria-label="Add" className="cursor-pointer rounded-md outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
463
|
+
<BadgeIcon color={color} size="sm" icon={Plus} type="color" />
|
|
464
|
+
</button>
|
|
465
|
+
|
|
466
|
+
<button aria-label="Add" className="cursor-pointer rounded-md outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
467
|
+
<BadgeIcon color={color} size="md" icon={Plus} type="color" />
|
|
468
|
+
</button>
|
|
469
|
+
|
|
470
|
+
<button aria-label="Add" className="cursor-pointer rounded-md outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
471
|
+
<BadgeIcon color={color} size="lg" icon={Plus} type="color" />
|
|
472
|
+
</button>
|
|
473
|
+
</div>
|
|
474
|
+
))}
|
|
475
|
+
</div>
|
|
476
|
+
);
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
export const WithIconOnlyBadgeModern = () => {
|
|
480
|
+
return (
|
|
481
|
+
<div className="flex flex-col items-start gap-4">
|
|
482
|
+
<div className="flex items-start gap-4">
|
|
483
|
+
<button aria-label="Add" className="cursor-pointer rounded-md outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
484
|
+
<BadgeIcon color="gray" size="sm" icon={Plus} type="modern" />
|
|
485
|
+
</button>
|
|
486
|
+
|
|
487
|
+
<button aria-label="Add" className="cursor-pointer rounded-md outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
488
|
+
<BadgeIcon color="gray" size="md" icon={Plus} type="modern" />
|
|
489
|
+
</button>
|
|
490
|
+
|
|
491
|
+
<button aria-label="Add" className="cursor-pointer rounded-md outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2">
|
|
492
|
+
<BadgeIcon color="gray" size="lg" icon={Plus} type="modern" />
|
|
493
|
+
</button>
|
|
494
|
+
</div>
|
|
495
|
+
</div>
|
|
496
|
+
);
|
|
497
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import * as Badges from "@/components/base/badges/badges.demo";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Base components/Badges",
|
|
6
|
+
decorators: [
|
|
7
|
+
(Story: FC) => (
|
|
8
|
+
<div className="flex h-screen w-full bg-primary p-4">
|
|
9
|
+
<Story />
|
|
10
|
+
</div>
|
|
11
|
+
),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const PillColor = () => <Badges.PillColor />;
|
|
16
|
+
PillColor.storyName = "Pill color";
|
|
17
|
+
|
|
18
|
+
export const BadgeColor = () => <Badges.BadgeColor />;
|
|
19
|
+
BadgeColor.storyName = "Badge color";
|
|
20
|
+
|
|
21
|
+
export const BadgeModern = () => <Badges.BadgeModern />;
|
|
22
|
+
BadgeModern.storyName = "Badge modern";
|
|
23
|
+
|
|
24
|
+
export const WithDot = () => <Badges.WithDot />;
|
|
25
|
+
WithDot.storyName = "With dot";
|
|
26
|
+
|
|
27
|
+
export const WithDotBadgeColor = () => <Badges.WithDotBadgeColor />;
|
|
28
|
+
WithDotBadgeColor.storyName = "With dot badge color";
|
|
29
|
+
|
|
30
|
+
export const WithDotBadgeModern = () => <Badges.WithDotBadgeModern />;
|
|
31
|
+
WithDotBadgeModern.storyName = "With dot badge modern";
|
|
32
|
+
|
|
33
|
+
export const WithFlag = () => <Badges.WithFlag />;
|
|
34
|
+
WithFlag.storyName = "With flag";
|
|
35
|
+
|
|
36
|
+
export const WithFlagBadgeColor = () => <Badges.WithFlagBadgeColor />;
|
|
37
|
+
WithFlagBadgeColor.storyName = "With flag badge color";
|
|
38
|
+
|
|
39
|
+
export const WithFlagBadgeModern = () => <Badges.WithFlagBadgeModern />;
|
|
40
|
+
WithFlagBadgeModern.storyName = "With flag badge modern";
|
|
41
|
+
|
|
42
|
+
export const WithAvatar = () => <Badges.WithAvatar />;
|
|
43
|
+
WithAvatar.storyName = "With avatar";
|
|
44
|
+
|
|
45
|
+
export const WithAvatarBadgeColor = () => <Badges.WithAvatarBadgeColor />;
|
|
46
|
+
WithAvatarBadgeColor.storyName = "With avatar badge color";
|
|
47
|
+
|
|
48
|
+
export const WithAvatarBadgeModern = () => <Badges.WithAvatarBadgeModern />;
|
|
49
|
+
WithAvatarBadgeModern.storyName = "With avatar badge modern";
|
|
50
|
+
|
|
51
|
+
export const WithCloseX = () => <Badges.WithCloseX />;
|
|
52
|
+
WithCloseX.storyName = "With close X";
|
|
53
|
+
|
|
54
|
+
export const WithCloseXBadgeColor = () => <Badges.WithCloseXBadgeColor />;
|
|
55
|
+
WithCloseXBadgeColor.storyName = "With close X badge color";
|
|
56
|
+
export const WithCloseXBadgeModern = () => <Badges.WithCloseXBadgeModern />;
|
|
57
|
+
|
|
58
|
+
export const WithIconTrailing = () => <Badges.WithIconTrailing />;
|
|
59
|
+
WithIconTrailing.storyName = "With icon trailing";
|
|
60
|
+
|
|
61
|
+
export const WithIconTrailingBadgeColor = () => <Badges.WithIconTrailingBadgeColor />;
|
|
62
|
+
WithIconTrailingBadgeColor.storyName = "With icon trailing badge color";
|
|
63
|
+
|
|
64
|
+
export const WithIconTrailingBadgeModern = () => <Badges.WithIconTrailingBadgeModern />;
|
|
65
|
+
WithIconTrailingBadgeModern.storyName = "With icon trailing badge modern";
|
|
66
|
+
|
|
67
|
+
export const WithIconLeading = () => <Badges.WithIconLeading />;
|
|
68
|
+
WithIconLeading.storyName = "With icon leading";
|
|
69
|
+
|
|
70
|
+
export const WithIconLeadingBadgeColor = () => <Badges.WithIconLeadingBadgeColor />;
|
|
71
|
+
WithIconLeadingBadgeColor.storyName = "With icon leading badge color";
|
|
72
|
+
|
|
73
|
+
export const WithIconLeadingBadgeModern = () => <Badges.WithIconLeadingBadgeModern />;
|
|
74
|
+
WithIconLeadingBadgeModern.storyName = "With icon leading badge modern";
|
|
75
|
+
|
|
76
|
+
export const WithIconOnly = () => <Badges.WithIconOnly />;
|
|
77
|
+
WithIconOnly.storyName = "With icon only";
|
|
78
|
+
|
|
79
|
+
export const WithIconOnlyBadgeColor = () => <Badges.WithIconOnlyBadgeColor />;
|
|
80
|
+
WithIconOnlyBadgeColor.storyName = "With icon only badge color";
|
|
81
|
+
|
|
82
|
+
export const WithIconOnlyBadgeModern = () => <Badges.WithIconOnlyBadgeModern />;
|
|
83
|
+
WithIconOnlyBadgeModern.storyName = "With icon only badge modern";
|