@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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/components/application/app-navigation/base-components/featured-cards.demo.tsx +86 -0
  4. package/components/application/app-navigation/base-components/featured-cards.story.tsx +49 -0
  5. package/components/application/app-navigation/header-navigation.demo.tsx +59 -0
  6. package/components/application/app-navigation/header-navigation.story.tsx +23 -0
  7. package/components/application/app-navigation/sidebar-navigation.demo.tsx +409 -0
  8. package/components/application/app-navigation/sidebar-navigation.story.tsx +47 -0
  9. package/components/application/carousel/carousel.demo.tsx +107 -0
  10. package/components/application/carousel/carousel.story.tsx +21 -0
  11. package/components/application/charts/activity-gauges.demo.tsx +251 -0
  12. package/components/application/charts/activity-gauges.story.tsx +27 -0
  13. package/components/application/charts/bar-charts.demo.tsx +506 -0
  14. package/components/application/charts/bar-charts.story.tsx +36 -0
  15. package/components/application/charts/line-charts.demo.tsx +604 -0
  16. package/components/application/charts/line-charts.story.tsx +43 -0
  17. package/components/application/charts/pie-charts.demo.tsx +193 -0
  18. package/components/application/charts/pie-charts.story.tsx +30 -0
  19. package/components/application/charts/progress-circles.demo.tsx +110 -0
  20. package/components/application/charts/progress-circles.story.tsx +33 -0
  21. package/components/application/charts/radar-charts.demo.tsx +203 -0
  22. package/components/application/charts/radar-charts.story.tsx +18 -0
  23. package/components/application/date-picker/date-picker.demo.tsx +217 -0
  24. package/components/application/date-picker/date-picker.story.tsx +44 -0
  25. package/components/application/file-upload/file-upload.demo.tsx +292 -0
  26. package/components/application/file-upload/file-upload.story.tsx +70 -0
  27. package/components/application/loading-indicator/loading-indicator.demo.tsx +73 -0
  28. package/components/application/loading-indicator/loading-indicator.story.tsx +22 -0
  29. package/components/application/pagination/pagination.demo.tsx +104 -0
  30. package/components/application/pagination/pagination.story.tsx +54 -0
  31. package/components/application/table/table.demo.tsx +1038 -0
  32. package/components/application/table/table.story.tsx +119 -0
  33. package/components/application/tabs/tabs.demo.tsx +322 -0
  34. package/components/application/tabs/tabs.story.tsx +43 -0
  35. package/components/base/avatar/avatar.demo.tsx +865 -0
  36. package/components/base/avatar/avatar.story.tsx +27 -0
  37. package/components/base/badges/badge-groups.demo.tsx +357 -0
  38. package/components/base/badges/badge-groups.story.tsx +25 -0
  39. package/components/base/badges/badges.demo.tsx +497 -0
  40. package/components/base/badges/badges.story.tsx +83 -0
  41. package/components/base/button-group/button-group.demo.tsx +131 -0
  42. package/components/base/button-group/button-group.story.tsx +16 -0
  43. package/components/base/buttons/app-store-buttons.demo.tsx +129 -0
  44. package/components/base/buttons/app-store-buttons.story.tsx +13 -0
  45. package/components/base/buttons/buttons.demo.tsx +1022 -0
  46. package/components/base/buttons/buttons.story.tsx +42 -0
  47. package/components/base/buttons/social-buttons.demo.tsx +432 -0
  48. package/components/base/buttons/social-buttons.story.tsx +20 -0
  49. package/components/base/checkbox/checkbox.demo.tsx +62 -0
  50. package/components/base/checkbox/checkbox.story.tsx +18 -0
  51. package/components/base/dropdown/dropdown.demo.tsx +137 -0
  52. package/components/base/dropdown/dropdown.story.tsx +22 -0
  53. package/components/base/input/inputs.demo.tsx +758 -0
  54. package/components/base/input/inputs.story.tsx +52 -0
  55. package/components/base/pin-input/pin-input.demo.tsx +126 -0
  56. package/components/base/pin-input/pin-input.story.tsx +22 -0
  57. package/components/base/progress-indicators/progress-indicators.demo.tsx +54 -0
  58. package/components/base/progress-indicators/progress-indicators.story.tsx +57 -0
  59. package/components/base/radio-buttons/radio-buttons.demo.tsx +77 -0
  60. package/components/base/radio-buttons/radio-buttons.story.tsx +19 -0
  61. package/components/base/select/select.demo.tsx +936 -0
  62. package/components/base/select/select.story.tsx +43 -0
  63. package/components/base/slider/slider.demo.tsx +19 -0
  64. package/components/base/slider/slider.story.tsx +26 -0
  65. package/components/base/tags/tags.demo.tsx +341 -0
  66. package/components/base/tags/tags.story.tsx +28 -0
  67. package/components/base/textarea/textarea.demo.tsx +25 -0
  68. package/components/base/textarea/textarea.story.tsx +15 -0
  69. package/components/base/toggle/toggle.demo.tsx +76 -0
  70. package/components/base/toggle/toggle.story.tsx +23 -0
  71. package/components/base/tooltip/tooltip.demo.tsx +125 -0
  72. package/components/base/tooltip/tooltip.story.tsx +21 -0
  73. package/components/foundations/featured-icon/featured-icon.demo.tsx +160 -0
  74. package/components/foundations/featured-icon/featured-icon.story.tsx +25 -0
  75. package/components/shared-assets/credit-card/credit-card.demo.tsx +106 -0
  76. package/components/shared-assets/credit-card/credit-card.story.tsx +41 -0
  77. package/dist/index.d.mts +1417 -0
  78. package/dist/index.d.ts +1417 -0
  79. package/dist/index.js +10435 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/index.mjs +10345 -0
  82. package/dist/index.mjs.map +1 -0
  83. package/package.json +126 -0
  84. package/styles/globals.css +65 -0
  85. package/styles/theme.css +430 -0
  86. package/styles/tokens-mapped.css +233 -0
  87. package/styles/tokens.css +807 -0
  88. package/styles/typography.css +430 -0
  89. package/tokens/design-tokens.dtcg.json +3515 -0
@@ -0,0 +1,43 @@
1
+ import type { FC } from "react";
2
+ import * as Selects from "@/components/base/select/select.demo";
3
+
4
+ export default {
5
+ title: "Base components/Select",
6
+ };
7
+
8
+ const DefaultDecorator = (Story: FC) => (
9
+ <div className="flex min-h-screen w-full bg-primary p-4">
10
+ <div className="w-80">
11
+ <Story />
12
+ </div>
13
+ </div>
14
+ );
15
+
16
+ const WiderDecorator = (Story: FC) => (
17
+ <div className="flex min-h-screen w-full bg-primary p-4">
18
+ <div className="w-100">
19
+ <Story />
20
+ </div>
21
+ </div>
22
+ );
23
+
24
+ export const Default = () => <Selects.Default />;
25
+ Default.decorators = [DefaultDecorator];
26
+
27
+ export const IconLeading = () => <Selects.IconLeading />;
28
+ IconLeading.decorators = [DefaultDecorator];
29
+ IconLeading.storyName = "Icon leading";
30
+
31
+ export const AvatarLeading = () => <Selects.AvatarLeading />;
32
+ AvatarLeading.decorators = [DefaultDecorator];
33
+ AvatarLeading.storyName = "Avatar leading";
34
+
35
+ export const DotLeading = () => <Selects.DotLeading />;
36
+ DotLeading.decorators = [DefaultDecorator];
37
+ DotLeading.storyName = "Dot leading";
38
+
39
+ export const Search = () => <Selects.Search />;
40
+ Search.decorators = [DefaultDecorator];
41
+
42
+ export const Tags = () => <Selects.Tags />;
43
+ Tags.decorators = [WiderDecorator];
@@ -0,0 +1,19 @@
1
+ "use client";
2
+
3
+ import { Slider } from "@/components/base/slider/slider";
4
+
5
+ export const Default = () => {
6
+ return <Slider defaultValue={[0, 25]} />;
7
+ };
8
+
9
+ export const BottomLabel = () => {
10
+ return <Slider defaultValue={[0, 25]} labelPosition="bottom" />;
11
+ };
12
+
13
+ export const TopFloating = () => {
14
+ return <Slider defaultValue={[0, 25]} labelPosition="top-floating" />;
15
+ };
16
+
17
+ export const SingleThumb = () => {
18
+ return <Slider defaultValue={50} labelPosition="top-floating" />;
19
+ };
@@ -0,0 +1,26 @@
1
+ import type { FC } from "react";
2
+ import * as Sliders from "@/components/base/slider/slider.demo";
3
+
4
+ export default {
5
+ title: "Base components/Sliders",
6
+ decorators: [
7
+ (Story: FC) => (
8
+ <div className="bg-primary p-16">
9
+ <div className="max-w-xs">
10
+ <Story />
11
+ </div>
12
+ </div>
13
+ ),
14
+ ],
15
+ };
16
+
17
+ export const Default = () => <Sliders.Default />;
18
+
19
+ export const BottomLabel = () => <Sliders.BottomLabel />;
20
+ BottomLabel.storyName = "Bottom label";
21
+
22
+ export const TopFloating = () => <Sliders.TopFloating />;
23
+ TopFloating.storyName = "Top floating";
24
+
25
+ export const SingleThumb = () => <Sliders.SingleThumb />;
26
+ SingleThumb.storyName = "Single thumb";
@@ -0,0 +1,341 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import type { Selection } from "react-aria-components";
5
+ import { Tag, TagGroup, type TagItem, TagList } from "@/components/base/tags/tags";
6
+
7
+ export const DefaultDemo = () => {
8
+ return (
9
+ <TagGroup label="Tags" size="md">
10
+ <TagList className="flex gap-4">
11
+ <Tag>Label</Tag>
12
+ <Tag avatarSrc="https://www.untitledui.com/images/flags/AU.svg">Label</Tag>
13
+ <Tag avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">Label</Tag>
14
+ <Tag dot={true}>Label</Tag>
15
+ </TagList>
16
+ </TagGroup>
17
+ );
18
+ };
19
+
20
+ export const CloseXDemo = () => {
21
+ const [tags, setTags] = useState<TagItem[]>([
22
+ { id: "tag-01", label: "Label" },
23
+ { id: "tag-02", label: "Label", avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
24
+ { id: "tag-03", label: "Label", avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
25
+ { id: "tag-04", label: "Label", dot: true },
26
+ ]);
27
+
28
+ return (
29
+ <TagGroup
30
+ label="Tags"
31
+ size="md"
32
+ onRemove={(keys) => {
33
+ setTags(tags.filter((tag) => !keys.has(tag.id)));
34
+ }}
35
+ >
36
+ <TagList className="flex flex-col items-start gap-4 md:flex-row" items={tags}>
37
+ {(item) => <Tag {...item}>{item.label}</Tag>}
38
+ </TagList>
39
+ </TagGroup>
40
+ );
41
+ };
42
+
43
+ export const CountDemo = () => {
44
+ return (
45
+ <TagGroup label="Tags" size="md">
46
+ <TagList className="flex flex-col items-start gap-4 md:flex-row">
47
+ <Tag count={5}>Label</Tag>
48
+ <Tag avatarSrc="https://www.untitledui.com/images/flags/AU.svg" count={5}>
49
+ Label
50
+ </Tag>
51
+ <Tag avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" count={5}>
52
+ Label
53
+ </Tag>
54
+ <Tag dot={true} count={5}>
55
+ Label
56
+ </Tag>
57
+ </TagList>
58
+ </TagGroup>
59
+ );
60
+ };
61
+
62
+ export const CheckboxDemo = () => {
63
+ const [selectedTags, setSelectedTags] = useState<Selection>(new Set(["tag-01", "tag-02"]));
64
+
65
+ return (
66
+ <TagGroup label="Tags" size="md" selectionMode="multiple" selectedKeys={selectedTags} onSelectionChange={setSelectedTags}>
67
+ <TagList className="flex flex-col items-start gap-4 md:flex-row">
68
+ <Tag id="tag-01">Label</Tag>
69
+ <Tag id="tag-02" avatarSrc="https://www.untitledui.com/images/flags/AU.svg">
70
+ Label
71
+ </Tag>
72
+ <Tag id="tag-03" avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">
73
+ Label
74
+ </Tag>
75
+ <Tag id="tag-04" dot={true}>
76
+ Label
77
+ </Tag>
78
+ </TagList>
79
+ </TagGroup>
80
+ );
81
+ };
82
+
83
+ export const CheckboxCloseXDemo = () => {
84
+ const [selectedTags, setSelectedTags] = useState<Selection>(new Set(["tag-01", "tag-02"]));
85
+ const [tags, setTags] = useState<TagItem[]>([
86
+ { id: "tag-01", label: "Label" },
87
+ { id: "tag-02", label: "Label", avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
88
+ { id: "tag-03", label: "Label", avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
89
+ { id: "tag-04", label: "Label", dot: true },
90
+ ]);
91
+
92
+ return (
93
+ <TagGroup
94
+ label="Tags"
95
+ size="md"
96
+ selectionMode="multiple"
97
+ selectedKeys={selectedTags}
98
+ onSelectionChange={setSelectedTags}
99
+ onRemove={(keys) => {
100
+ setTags(tags.filter((tag) => !keys.has(tag.id)));
101
+ }}
102
+ >
103
+ <TagList className="flex flex-col items-start gap-4 md:flex-row" items={tags}>
104
+ {(item) => <Tag {...item}>{item.label}</Tag>}
105
+ </TagList>
106
+ </TagGroup>
107
+ );
108
+ };
109
+
110
+ export const CheckboxCountDemo = () => {
111
+ const [selectedTags, setSelectedTags] = useState<Selection>(new Set(["tag-01", "tag-02"]));
112
+
113
+ return (
114
+ <TagGroup label="Tags" size="md" selectionMode="multiple" selectedKeys={selectedTags} onSelectionChange={setSelectedTags}>
115
+ <TagList className="flex flex-col items-start gap-4 md:flex-row">
116
+ <Tag id="tag-01" count={5}>
117
+ Label
118
+ </Tag>
119
+ <Tag id="tag-02" avatarSrc="https://www.untitledui.com/images/flags/AU.svg" count={5}>
120
+ Label
121
+ </Tag>
122
+ <Tag id="tag-03" avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" count={5}>
123
+ Label
124
+ </Tag>
125
+ <Tag id="tag-04" dot={true} count={5}>
126
+ Label
127
+ </Tag>
128
+ </TagList>
129
+ </TagGroup>
130
+ );
131
+ };
132
+
133
+ export const SizesDemo = () => {
134
+ return (
135
+ <div className="flex flex-col gap-4">
136
+ {/* Small */}
137
+ <TagGroup label="Tags" size="sm">
138
+ <TagList className="flex gap-4">
139
+ <Tag>Label</Tag>
140
+ <Tag avatarSrc="https://www.untitledui.com/images/flags/AU.svg">Label</Tag>
141
+ <Tag avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">Label</Tag>
142
+ <Tag dot={true}>Label</Tag>
143
+ </TagList>
144
+ </TagGroup>
145
+
146
+ {/* Medium */}
147
+ <TagGroup label="Tags" size="md">
148
+ <TagList className="flex gap-4">
149
+ <Tag>Label</Tag>
150
+ <Tag avatarSrc="https://www.untitledui.com/images/flags/AU.svg">Label</Tag>
151
+ <Tag avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">Label</Tag>
152
+ <Tag dot={true}>Label</Tag>
153
+ </TagList>
154
+ </TagGroup>
155
+
156
+ {/* Large */}
157
+ <TagGroup label="Tags" size="lg">
158
+ <TagList className="flex gap-4">
159
+ <Tag>Label</Tag>
160
+ <Tag avatarSrc="https://www.untitledui.com/images/flags/AU.svg">Label</Tag>
161
+ <Tag avatarSrc="https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80">Label</Tag>
162
+ <Tag dot={true}>Label</Tag>
163
+ </TagList>
164
+ </TagGroup>
165
+ </div>
166
+ );
167
+ };
168
+
169
+ export const Default = () => {
170
+ const tags: TagItem[] = [
171
+ { id: "tag-01", label: "Label" },
172
+ { id: "tag-02", label: "Label", avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
173
+ { id: "tag-03", label: "Label", avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
174
+ { id: "tag-04", label: "Label", dot: true },
175
+ ];
176
+
177
+ return (
178
+ <div className="flex flex-col gap-4">
179
+ <TagGroup label="Tags" size="sm">
180
+ <TagList className="flex gap-4" items={tags}>
181
+ {(item) => <Tag {...item}>{item.label}</Tag>}
182
+ </TagList>
183
+ </TagGroup>
184
+ <TagGroup label="Tags" size="md">
185
+ <TagList className="flex gap-4" items={tags}>
186
+ {(item) => <Tag {...item}>{item.label}</Tag>}
187
+ </TagList>
188
+ </TagGroup>
189
+ <TagGroup label="Tags" size="lg">
190
+ <TagList className="flex gap-4" items={tags}>
191
+ {(item) => <Tag {...item}>{item.label}</Tag>}
192
+ </TagList>
193
+ </TagGroup>
194
+ </div>
195
+ );
196
+ };
197
+
198
+ export const CloseX = () => {
199
+ const tags: TagItem[] = [
200
+ { id: "tag-01", label: "Label", onClose: () => {} },
201
+ { id: "tag-02", label: "Label", onClose: () => {}, avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
202
+ { id: "tag-03", label: "Label", onClose: () => {}, avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
203
+ { id: "tag-04", label: "Label", onClose: () => {}, dot: true },
204
+ ];
205
+
206
+ return (
207
+ <div className="flex flex-col gap-4">
208
+ <TagGroup label="Tags" size="sm">
209
+ <TagList className="flex gap-4" items={tags}>
210
+ {(item) => <Tag {...item}>{item.label}</Tag>}
211
+ </TagList>
212
+ </TagGroup>
213
+ <TagGroup label="Tags" size="md">
214
+ <TagList className="flex gap-4" items={tags}>
215
+ {(item) => <Tag {...item}>{item.label}</Tag>}
216
+ </TagList>
217
+ </TagGroup>
218
+ <TagGroup label="Tags" size="lg">
219
+ <TagList className="flex gap-4" items={tags}>
220
+ {(item) => <Tag {...item}>{item.label}</Tag>}
221
+ </TagList>
222
+ </TagGroup>
223
+ </div>
224
+ );
225
+ };
226
+
227
+ export const Count = () => {
228
+ const tags: TagItem[] = [
229
+ { id: "tag-01", label: "Label", count: 5 },
230
+ { id: "tag-02", label: "Label", count: 5, avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
231
+ { id: "tag-03", label: "Label", count: 5, avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
232
+ { id: "tag-04", label: "Label", count: 5, dot: true },
233
+ ];
234
+
235
+ return (
236
+ <div className="flex flex-col gap-4">
237
+ <TagGroup label="Tags" size="sm">
238
+ <TagList className="flex gap-4" items={tags}>
239
+ {(item) => <Tag {...item}>{item.label}</Tag>}
240
+ </TagList>
241
+ </TagGroup>
242
+ <TagGroup label="Tags" size="md">
243
+ <TagList className="flex gap-4" items={tags}>
244
+ {(item) => <Tag {...item}>{item.label}</Tag>}
245
+ </TagList>
246
+ </TagGroup>
247
+ <TagGroup label="Tags" size="lg">
248
+ <TagList className="flex gap-4" items={tags}>
249
+ {(item) => <Tag {...item}>{item.label}</Tag>}
250
+ </TagList>
251
+ </TagGroup>
252
+ </div>
253
+ );
254
+ };
255
+
256
+ export const CheckboxDefault = () => {
257
+ const tags: TagItem[] = [
258
+ { id: "tag-01", label: "Label" },
259
+ { id: "tag-02", label: "Label", avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
260
+ { id: "tag-03", label: "Label", avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
261
+ { id: "tag-04", label: "Label", dot: true },
262
+ ];
263
+
264
+ return (
265
+ <div className="flex flex-col gap-4">
266
+ <TagGroup label="Tags" selectionMode="multiple" size="sm">
267
+ <TagList className="flex gap-4" items={tags}>
268
+ {(item) => <Tag {...item}>{item.label}</Tag>}
269
+ </TagList>
270
+ </TagGroup>
271
+ <TagGroup label="Tags" selectionMode="multiple" size="md">
272
+ <TagList className="flex gap-4" items={tags}>
273
+ {(item) => <Tag {...item}>{item.label}</Tag>}
274
+ </TagList>
275
+ </TagGroup>
276
+ <TagGroup label="Tags" selectionMode="multiple" size="lg">
277
+ <TagList className="flex gap-4" items={tags}>
278
+ {(item) => <Tag {...item}>{item.label}</Tag>}
279
+ </TagList>
280
+ </TagGroup>
281
+ </div>
282
+ );
283
+ };
284
+
285
+ export const CheckboxCloseX = () => {
286
+ const tags: TagItem[] = [
287
+ { id: "tag-01", label: "Label", onClose: () => {} },
288
+ { id: "tag-02", label: "Label", onClose: () => {}, avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
289
+ { id: "tag-03", label: "Label", onClose: () => {}, avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
290
+ { id: "tag-04", label: "Label", onClose: () => {}, dot: true },
291
+ ];
292
+
293
+ return (
294
+ <div className="flex flex-col gap-4">
295
+ <TagGroup label="Tags" selectionMode="multiple" size="sm">
296
+ <TagList className="flex gap-4" items={tags}>
297
+ {(item) => <Tag {...item}>{item.label}</Tag>}
298
+ </TagList>
299
+ </TagGroup>
300
+ <TagGroup label="Tags" selectionMode="multiple" size="md">
301
+ <TagList className="flex gap-4" items={tags}>
302
+ {(item) => <Tag {...item}>{item.label}</Tag>}
303
+ </TagList>
304
+ </TagGroup>
305
+ <TagGroup label="Tags" selectionMode="multiple" size="lg">
306
+ <TagList className="flex gap-4" items={tags}>
307
+ {(item) => <Tag {...item}>{item.label}</Tag>}
308
+ </TagList>
309
+ </TagGroup>
310
+ </div>
311
+ );
312
+ };
313
+
314
+ export const CheckboxCount = () => {
315
+ const tags: TagItem[] = [
316
+ { id: "tag-01", label: "Label", count: 5 },
317
+ { id: "tag-02", label: "Label", count: 5, avatarSrc: "https://www.untitledui.com/images/flags/AU.svg", avatarContrastBorder: false },
318
+ { id: "tag-03", label: "Label", count: 5, avatarSrc: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
319
+ { id: "tag-04", label: "Label", count: 5, dot: true },
320
+ ];
321
+
322
+ return (
323
+ <div className="flex flex-col gap-4">
324
+ <TagGroup label="Tags" selectionMode="multiple" size="sm">
325
+ <TagList className="flex gap-4" items={tags}>
326
+ {(item) => <Tag {...item}>{item.label}</Tag>}
327
+ </TagList>
328
+ </TagGroup>
329
+ <TagGroup label="Tags" selectionMode="multiple" size="md">
330
+ <TagList className="flex gap-4" items={tags}>
331
+ {(item) => <Tag {...item}>{item.label}</Tag>}
332
+ </TagList>
333
+ </TagGroup>
334
+ <TagGroup label="Tags" selectionMode="multiple" size="lg">
335
+ <TagList className="flex gap-4" items={tags}>
336
+ {(item) => <Tag {...item}>{item.label}</Tag>}
337
+ </TagList>
338
+ </TagGroup>
339
+ </div>
340
+ );
341
+ };
@@ -0,0 +1,28 @@
1
+ import type { FC } from "react";
2
+ import * as Tags from "@/components/base/tags/tags.demo";
3
+
4
+ export default {
5
+ title: "Base components/Tags",
6
+ decorators: [
7
+ (Story: FC) => (
8
+ <div className="flex min-h-screen w-full overflow-auto bg-primary p-4">
9
+ <Story />
10
+ </div>
11
+ ),
12
+ ],
13
+ };
14
+
15
+ export const Default = () => <Tags.Default />;
16
+
17
+ export const CloseX = () => <Tags.CloseX />;
18
+
19
+ export const Count = () => <Tags.Count />;
20
+
21
+ export const CheckboxDefault = () => <Tags.CheckboxDefault />;
22
+ CheckboxDefault.storyName = "Checkbox default";
23
+
24
+ export const CheckboxCloseX = () => <Tags.CheckboxCloseX />;
25
+ CheckboxCloseX.storyName = "Checkbox close X";
26
+
27
+ export const CheckboxCount = () => <Tags.CheckboxCount />;
28
+ CheckboxCount.storyName = "Checkbox count";
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ import { TextArea } from "@/components/base/textarea/textarea";
4
+
5
+ export const DefaultDemo = () => {
6
+ return <TextArea isRequired placeholder="This is a placeholder." label="Description" hint="This is a hint text to help user." rows={5} />;
7
+ };
8
+
9
+ export const DisabledDemo = () => {
10
+ return <TextArea isRequired isDisabled placeholder="This is a placeholder." label="Description" hint="This is a hint text to help user." rows={5} />;
11
+ };
12
+
13
+ export const InvalidDemo = () => {
14
+ return <TextArea isRequired isInvalid placeholder="This is a placeholder." label="Description" hint="This is an error message." rows={5} />;
15
+ };
16
+
17
+ export const Textarea = () => {
18
+ return (
19
+ <div className="flex w-full max-w-md flex-col gap-4">
20
+ <TextArea isRequired placeholder="This is a placeholder." label="Description" hint="This is a hint text to help user." rows={5} />
21
+ <TextArea isRequired isDisabled placeholder="This is a placeholder." label="Description" hint="This is a hint text to help user." rows={5} />
22
+ <TextArea isRequired isInvalid placeholder="This is a placeholder." label="Description" hint="This is an error message." rows={5} />
23
+ </div>
24
+ );
25
+ };
@@ -0,0 +1,15 @@
1
+ import type { FC } from "react";
2
+ import * as TextAreas from "@/components/base/textarea/textarea.demo";
3
+
4
+ export default {
5
+ title: "Base components/Inputs/Textarea",
6
+ decorators: [
7
+ (Story: FC) => (
8
+ <div className="flex min-h-screen w-full bg-primary p-4">
9
+ <Story />
10
+ </div>
11
+ ),
12
+ ],
13
+ };
14
+
15
+ export const Textarea = () => <TextAreas.Textarea />;
@@ -0,0 +1,76 @@
1
+ "use client";
2
+
3
+ import { Toggle } from "@/components/base/toggle/toggle";
4
+
5
+ export const DefaultDemo = () => <Toggle label="Remember me" hint="Save my login details for next time." size="sm" />;
6
+
7
+ export const BaseDemo = () => <Toggle size="sm" />;
8
+
9
+ export const WithLabelDemo = () => <Toggle label="Remember me" size="sm" />;
10
+
11
+ export const WithLabelAndHintDemo = () => <Toggle label="Remember me" hint="Save my login details for next time." size="sm" />;
12
+
13
+ export const DisabledDemo = () => <Toggle isDisabled label="Remember me" hint="Save my login details for next time." size="sm" />;
14
+
15
+ export const SizesDemo = () => (
16
+ <div className="flex flex-col gap-8">
17
+ <Toggle label="Remember me" hint="Save my login details for next time." size="sm" />
18
+ <Toggle label="Remember me" hint="Save my login details for next time." size="md" />
19
+ </div>
20
+ );
21
+
22
+ export const SlimBaseDemo = () => <Toggle slim size="sm" />;
23
+
24
+ export const SlimWithLabelAndHintDemo = () => <Toggle slim label="Remember me" hint="Save my login details for next time." size="sm" />;
25
+
26
+ export const Toggles = () => (
27
+ <div className="grid grid-cols-2 gap-8">
28
+ <div className="flex flex-col gap-4">
29
+ <Toggle label="Remember me" hint="Save my login details for next time." size="sm" />
30
+ <Toggle isDisabled label="Remember me" hint="Save my login details for next time." size="sm" />
31
+ </div>
32
+ <div className="flex flex-col gap-4">
33
+ <Toggle label="Remember me" hint="Save my login details for next time." size="md" />
34
+ <Toggle isDisabled label="Remember me" hint="Save my login details for next time." size="md" />
35
+ </div>
36
+ </div>
37
+ );
38
+
39
+ export const ToggleBase = () => (
40
+ <div className="grid grid-cols-2 gap-8">
41
+ <div className="flex flex-col gap-4">
42
+ <Toggle size="sm" />
43
+ <Toggle isDisabled size="sm" />
44
+ </div>
45
+ <div className="flex flex-col gap-4">
46
+ <Toggle size="md" />
47
+ <Toggle isDisabled size="md" />
48
+ </div>
49
+ </div>
50
+ );
51
+
52
+ export const TogglesSlim = () => (
53
+ <div className="grid grid-cols-2 gap-8">
54
+ <div className="flex flex-col gap-4">
55
+ <Toggle slim label="Remember me" hint="Save my login details for next time." size="sm" />
56
+ <Toggle slim isDisabled label="Remember me" hint="Save my login details for next time." size="sm" />
57
+ </div>
58
+ <div className="flex flex-col gap-4">
59
+ <Toggle slim label="Remember me" hint="Save my login details for next time." size="md" />
60
+ <Toggle slim isDisabled label="Remember me" hint="Save my login details for next time." size="md" />
61
+ </div>
62
+ </div>
63
+ );
64
+
65
+ export const ToggleSlimBase = () => (
66
+ <div className="grid grid-cols-2 gap-8">
67
+ <div className="flex flex-col gap-4">
68
+ <Toggle slim size="sm" />
69
+ <Toggle slim isDisabled size="sm" />
70
+ </div>
71
+ <div className="flex flex-col gap-4">
72
+ <Toggle slim size="md" />
73
+ <Toggle slim isDisabled size="md" />
74
+ </div>
75
+ </div>
76
+ );
@@ -0,0 +1,23 @@
1
+ import type { FC } from "react";
2
+ import * as ToggleComponents from "@/components/base/toggle/toggle.demo";
3
+
4
+ export default {
5
+ title: "Base components/Toggles",
6
+ decorators: [
7
+ (Story: FC) => (
8
+ <div className="flex min-h-screen w-full bg-primary p-4">
9
+ <Story />
10
+ </div>
11
+ ),
12
+ ],
13
+ };
14
+
15
+ export const Toggles = () => <ToggleComponents.Toggles />;
16
+
17
+ export const ToggleBase = () => <ToggleComponents.ToggleBase />;
18
+ ToggleBase.storyName = "Toggle base";
19
+ export const TogglesSlim = () => <ToggleComponents.TogglesSlim />;
20
+ TogglesSlim.storyName = "Toggles slim";
21
+
22
+ export const ToggleSlimBase = () => <ToggleComponents.ToggleSlimBase />;
23
+ ToggleSlimBase.storyName = "Toggle slim base";