@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,936 @@
1
+ "use client";
2
+
3
+ import { User01 } from "@untitledui/icons";
4
+ import { useListData } from "react-stately";
5
+ import { MultiSelect } from "@/components/base/select/multi-select";
6
+ import { Select, type SelectItemType } from "@/components/base/select/select";
7
+ import { NativeSelect } from "@/components/base/select/select-native";
8
+ import { Dot } from "@/components/foundations/dot-icon";
9
+
10
+ const items = [
11
+ {
12
+ label: "Phoenix Baker",
13
+ id: "@phoenix",
14
+ supportingText: "@phoenix",
15
+ avatarUrl: "https://www.untitledui.com/images/avatars/phoenix-baker?fm=webp&q=80",
16
+ },
17
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia", avatarUrl: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
18
+ {
19
+ label: "Lana Steiner",
20
+ id: "@lana",
21
+ supportingText: "@lana",
22
+
23
+ avatarUrl: "https://www.untitledui.com/images/avatars/lana-steiner?fm=webp&q=80",
24
+ },
25
+ {
26
+ label: "Demi Wilkinson",
27
+ id: "@demi",
28
+ supportingText: "@demi",
29
+ avatarUrl: "https://www.untitledui.com/images/avatars/demi-wilkinson?fm=webp&q=80",
30
+ },
31
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice", avatarUrl: "https://www.untitledui.com/images/avatars/candice-wu?fm=webp&q=80" },
32
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali", avatarUrl: "https://www.untitledui.com/images/avatars/natali-craig?fm=webp&q=80" },
33
+ { label: "Abraham Baker", id: "@abraham", supportingText: "@abraham", avatarUrl: "https://www.untitledui.com/images/avatars/abraham-baker?fm=webp&q=80" },
34
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem", avatarUrl: "https://www.untitledui.com/images/avatars/adem-lane?fm=webp&q=80" },
35
+ {
36
+ label: "Jackson Reed",
37
+ id: "@jackson",
38
+ supportingText: "@jackson",
39
+ avatarUrl: "https://www.untitledui.com/images/avatars/jackson-reed?fm=webp&q=80",
40
+ },
41
+ {
42
+ label: "Jessie Meyton",
43
+ id: "@jessie",
44
+ supportingText: "@jessie",
45
+ avatarUrl: "https://www.untitledui.com/images/avatars/jessie-meyton?fm=webp&q=80",
46
+ },
47
+ ];
48
+
49
+ export const DefaultDemo = () => {
50
+ const items = [
51
+ { label: "Phoenix Baker", id: "@phoenix", supportingText: "@phoenix" },
52
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia" },
53
+ { label: "Lana Steiner", id: "@lana", supportingText: "@lana", disabled: true },
54
+ { label: "Demi Wilkinson", id: "@demi", supportingText: "@demi" },
55
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice" },
56
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali" },
57
+ { label: "Abraham Baker", id: "@abraham", supportingText: "@abraham" },
58
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem" },
59
+ { label: "Jackson Reed", id: "@jackson", supportingText: "@jackson" },
60
+ { label: "Jessie Meyton", id: "@jessie", supportingText: "@jessie" },
61
+ ];
62
+
63
+ return (
64
+ <Select
65
+ isRequired
66
+ label="Team member"
67
+ tooltip="This is a tooltip"
68
+ hint="This is a hint text to help user."
69
+ placeholder="Select team member"
70
+ items={items}
71
+ >
72
+ {(item) => (
73
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
74
+ {item.label}
75
+ </Select.Item>
76
+ )}
77
+ </Select>
78
+ );
79
+ };
80
+
81
+ export const DisabledDemo = () => {
82
+ const items = [
83
+ { label: "Phoenix Baker", id: "@phoenix", supportingText: "@phoenix" },
84
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia" },
85
+ { label: "Lana Steiner", id: "@lana", supportingText: "@lana", disabled: true },
86
+ { label: "Demi Wilkinson", id: "@demi", supportingText: "@demi" },
87
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice" },
88
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali" },
89
+ { label: "Abraham Baker", id: "@abraham", supportingText: "@abraham" },
90
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem" },
91
+ { label: "Jackson Reed", id: "@jackson", supportingText: "@jackson" },
92
+ { label: "Jessie Meyton", id: "@jessie", supportingText: "@jessie" },
93
+ ];
94
+
95
+ return (
96
+ <Select
97
+ isRequired
98
+ isDisabled
99
+ label="Team member"
100
+ tooltip="This is a tooltip"
101
+ hint="This is a hint text to help user."
102
+ placeholder="Select team member"
103
+ items={items}
104
+ >
105
+ {(item) => (
106
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
107
+ {item.label}
108
+ </Select.Item>
109
+ )}
110
+ </Select>
111
+ );
112
+ };
113
+
114
+ export const SizesDemo = () => {
115
+ const items = [
116
+ { label: "Phoenix Baker", id: "@phoenix", supportingText: "@phoenix" },
117
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia" },
118
+ { label: "Lana Steiner", id: "@lana", supportingText: "@lana", disabled: true },
119
+ { label: "Demi Wilkinson", id: "@demi", supportingText: "@demi" },
120
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice" },
121
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali" },
122
+ { label: "Abraham Baker", id: "@abraham", supportingText: "@abraham" },
123
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem" },
124
+ { label: "Jackson Reed", id: "@jackson", supportingText: "@jackson" },
125
+ { label: "Jessie Meyton", id: "@jessie", supportingText: "@jessie" },
126
+ ];
127
+
128
+ return (
129
+ <div className="flex flex-col gap-8">
130
+ {/* Small */}
131
+ <Select
132
+ isRequired
133
+ size="sm"
134
+ label="Team member"
135
+ tooltip="This is a tooltip"
136
+ hint="This is a hint text to help user."
137
+ placeholder="Select team member"
138
+ items={items}
139
+ >
140
+ {(item) => (
141
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
142
+ {item.label}
143
+ </Select.Item>
144
+ )}
145
+ </Select>
146
+
147
+ {/* Medium */}
148
+ <Select
149
+ isRequired
150
+ size="md"
151
+ label="Team member"
152
+ tooltip="This is a tooltip"
153
+ hint="This is a hint text to help user."
154
+ placeholder="Select team member"
155
+ items={items}
156
+ >
157
+ {(item) => (
158
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
159
+ {item.label}
160
+ </Select.Item>
161
+ )}
162
+ </Select>
163
+ </div>
164
+ );
165
+ };
166
+
167
+ export const IconLeadingDemo = () => {
168
+ const items = [
169
+ { label: "Phoenix Baker", id: "@phoenix", supportingText: "@phoenix", icon: User01 },
170
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia", icon: User01 },
171
+ { label: "Lana Steiner", id: "@lana", supportingText: "@lana", icon: User01, disabled: true },
172
+ { label: "Demi Wilkinson", id: "@demi", supportingText: "@demi", icon: User01 },
173
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice", icon: User01 },
174
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali", icon: User01 },
175
+ { label: "Abraham Baker", id: "@abraham", supportingText: "@abraham", icon: User01 },
176
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem", icon: User01 },
177
+ { label: "Jackson Reed", id: "@jackson", supportingText: "@jackson", icon: User01 },
178
+ { label: "Jessie Meyton", id: "@jessie", supportingText: "@jessie", icon: User01 },
179
+ ];
180
+
181
+ return (
182
+ <Select
183
+ isRequired
184
+ label="Team member"
185
+ tooltip="This is a tooltip"
186
+ hint="This is a hint text to help user."
187
+ placeholder="Select team member"
188
+ placeholderIcon={User01}
189
+ items={items}
190
+ >
191
+ {(item) => (
192
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
193
+ {item.label}
194
+ </Select.Item>
195
+ )}
196
+ </Select>
197
+ );
198
+ };
199
+
200
+ export const AvatarLeadingDemo = () => {
201
+ const items = [
202
+ {
203
+ label: "Phoenix Baker",
204
+ id: "@phoenix",
205
+ supportingText: "@phoenix",
206
+ avatarUrl: "https://www.untitledui.com/images/avatars/phoenix-baker?fm=webp&q=80",
207
+ },
208
+ {
209
+ label: "Olivia Rhye",
210
+ id: "@olivia",
211
+ supportingText: "@olivia",
212
+ avatarUrl: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80",
213
+ },
214
+ {
215
+ label: "Lana Steiner",
216
+ id: "@lana",
217
+ supportingText: "@lana",
218
+
219
+ avatarUrl: "https://www.untitledui.com/images/avatars/lana-steiner?fm=webp&q=80",
220
+ },
221
+ {
222
+ label: "Demi Wilkinson",
223
+ id: "@demi",
224
+ supportingText: "@demi",
225
+ avatarUrl: "https://www.untitledui.com/images/avatars/demi-wilkinson?fm=webp&q=80",
226
+ },
227
+ {
228
+ label: "Candice Wu",
229
+ id: "@candice",
230
+ supportingText: "@candice",
231
+ avatarUrl: "https://www.untitledui.com/images/avatars/candice-wu?fm=webp&q=80",
232
+ },
233
+ {
234
+ label: "Natali Craig",
235
+ id: "@natali",
236
+ supportingText: "@natali",
237
+ avatarUrl: "https://www.untitledui.com/images/avatars/natali-craig?fm=webp&q=80",
238
+ },
239
+ {
240
+ label: "Abraham Baker",
241
+ id: "@abraham",
242
+ supportingText: "@abraham",
243
+ avatarUrl: "https://www.untitledui.com/images/avatars/abraham-baker?fm=webp&q=80",
244
+ },
245
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem", avatarUrl: "https://www.untitledui.com/images/avatars/adem-lane?fm=webp&q=80" },
246
+ {
247
+ label: "Jackson Reed",
248
+ id: "@jackson",
249
+ supportingText: "@jackson",
250
+ avatarUrl: "https://www.untitledui.com/images/avatars/jackson-reed?fm=webp&q=80",
251
+ },
252
+ {
253
+ label: "Jessie Meyton",
254
+ id: "@jessie",
255
+ supportingText: "@jessie",
256
+ avatarUrl: "https://www.untitledui.com/images/avatars/jessie-meyton?fm=webp&q=80",
257
+ },
258
+ ];
259
+
260
+ return (
261
+ <Select
262
+ isRequired
263
+ label="Team member"
264
+ tooltip="This is a tooltip"
265
+ hint="This is a hint text to help user."
266
+ placeholder="Select team member"
267
+ placeholderIcon={User01}
268
+ items={items}
269
+ >
270
+ {(item) => (
271
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
272
+ {item.label}
273
+ </Select.Item>
274
+ )}
275
+ </Select>
276
+ );
277
+ };
278
+
279
+ export const DotLeadingDemo = () => {
280
+ const items: SelectItemType[] = [
281
+ {
282
+ label: "Phoenix Baker",
283
+ id: "@phoenix",
284
+ supportingText: "@phoenix",
285
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
286
+ },
287
+ {
288
+ label: "Olivia Rhye",
289
+ id: "@olivia",
290
+ supportingText: "@olivia",
291
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
292
+ },
293
+ {
294
+ label: "Lana Steiner",
295
+ id: "@lana",
296
+ supportingText: "@lana",
297
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
298
+ },
299
+ {
300
+ label: "Demi Wilkinson",
301
+ id: "@demi",
302
+ supportingText: "@demi",
303
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
304
+ },
305
+ {
306
+ label: "Candice Wu",
307
+ id: "@candice",
308
+ supportingText: "@candice",
309
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
310
+ },
311
+ {
312
+ label: "Natali Craig",
313
+ id: "@natali",
314
+ supportingText: "@natali",
315
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
316
+ },
317
+ {
318
+ label: "Abraham Baker",
319
+ id: "@abraham",
320
+ supportingText: "@abraham",
321
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
322
+ },
323
+ {
324
+ label: "Adem Lane",
325
+ id: "@adem",
326
+ supportingText: "@adem",
327
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
328
+ },
329
+ {
330
+ label: "Jackson Reed",
331
+ id: "@jackson",
332
+ supportingText: "@jackson",
333
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
334
+ },
335
+ {
336
+ label: "Jessie Meyton",
337
+ id: "@jessie",
338
+ supportingText: "@jessie",
339
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
340
+ },
341
+ ];
342
+
343
+ return (
344
+ <Select
345
+ isRequired
346
+ label="Team member"
347
+ tooltip="This is a tooltip"
348
+ hint="This is a hint text to help user."
349
+ placeholder="Select team member"
350
+ placeholderIcon={<Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />}
351
+ items={items}
352
+ >
353
+ {(item) => (
354
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
355
+ {item.label}
356
+ </Select.Item>
357
+ )}
358
+ </Select>
359
+ );
360
+ };
361
+
362
+ export const SearchDemo = () => {
363
+ const items = [
364
+ { label: "Phoenix Baker", id: "@phoenix", supportingText: "@phoenix" },
365
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia" },
366
+ { label: "Lana Steiner", id: "@lana", supportingText: "@lana", disabled: true },
367
+ { label: "Demi Wilkinson", id: "@demi", supportingText: "@demi" },
368
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice" },
369
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali" },
370
+ { label: "Abraham Baker", id: "@abraham", supportingText: "@abraham" },
371
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem" },
372
+ { label: "Jackson Reed", id: "@jackson", supportingText: "@jackson" },
373
+ { label: "Jessie Meyton", id: "@jessie", supportingText: "@jessie" },
374
+ ];
375
+
376
+ return (
377
+ <Select.ComboBox isRequired label="Search" tooltip="This is a tooltip" hint="This is a hint text to help user." placeholder="Search" items={items}>
378
+ {(item) => (
379
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
380
+ {item.label}
381
+ </Select.Item>
382
+ )}
383
+ </Select.ComboBox>
384
+ );
385
+ };
386
+
387
+ export const TagsDemo = () => {
388
+ const selectedItems = useListData({
389
+ initialItems: [],
390
+ });
391
+
392
+ const items = [
393
+ {
394
+ label: "Phoenix Baker",
395
+ id: "@phoenix",
396
+ supportingText: "@phoenix",
397
+ avatarUrl: "https://www.untitledui.com/images/avatars/phoenix-baker?fm=webp&q=80",
398
+ },
399
+ { label: "Olivia Rhye", id: "@olivia", supportingText: "@olivia", avatarUrl: "https://www.untitledui.com/images/avatars/olivia-rhye?fm=webp&q=80" },
400
+ {
401
+ label: "Lana Steiner",
402
+ id: "@lana",
403
+ supportingText: "@lana",
404
+ disabled: true,
405
+ avatarUrl: "https://www.untitledui.com/images/avatars/lana-steiner?fm=webp&q=80",
406
+ },
407
+ { label: "Demi Wilkinson", id: "@demi", supportingText: "@demi", avatarUrl: "https://www.untitledui.com/images/avatars/demi-wilkinson?fm=webp&q=80" },
408
+ { label: "Candice Wu", id: "@candice", supportingText: "@candice", avatarUrl: "https://www.untitledui.com/images/avatars/candice-wu?fm=webp&q=80" },
409
+ { label: "Natali Craig", id: "@natali", supportingText: "@natali", avatarUrl: "https://www.untitledui.com/images/avatars/natali-craig?fm=webp&q=80" },
410
+ {
411
+ label: "Abraham Baker",
412
+ id: "@abraham",
413
+ supportingText: "@abraham",
414
+ avatarUrl: "https://www.untitledui.com/images/avatars/abraham-baker?fm=webp&q=80",
415
+ },
416
+ { label: "Adem Lane", id: "@adem", supportingText: "@adem", avatarUrl: "https://www.untitledui.com/images/avatars/adem-lane?fm=webp&q=80" },
417
+ { label: "Jackson Reed", id: "@jackson", supportingText: "@jackson", avatarUrl: "https://www.untitledui.com/images/avatars/jackson-reed?fm=webp&q=80" },
418
+ { label: "Jessie Meyton", id: "@jessie", supportingText: "@jessie", avatarUrl: "https://www.untitledui.com/images/avatars/jessie-meyton?fm=webp&q=80" },
419
+ ];
420
+
421
+ return (
422
+ <MultiSelect
423
+ isRequired
424
+ selectedItems={selectedItems}
425
+ label="Search"
426
+ tooltip="This is a tooltip"
427
+ hint="This is a hint text to help user."
428
+ placeholder="Search"
429
+ items={items}
430
+ >
431
+ {(item) => (
432
+ <MultiSelect.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
433
+ {item.label}
434
+ </MultiSelect.Item>
435
+ )}
436
+ </MultiSelect>
437
+ );
438
+ };
439
+
440
+ export const Native = () => (
441
+ <NativeSelect
442
+ label="Team members"
443
+ options={[
444
+ { label: "Wade Cooper", value: "@wadecooper" },
445
+ { label: "Arlene Mccoy", value: "@arlenemccoy" },
446
+ { label: "Devon Webb", value: "@devonwebb", disabled: true },
447
+ { label: "Tom Cook", value: "@tomcook" },
448
+ { label: "Tanya Fox", value: "@tanyafox" },
449
+ { label: "Hellen Schmidt", value: "@hellenschmidt" },
450
+ { label: "Caroline Schultz", value: "@carolineschultz" },
451
+ { label: "Mason Heaney", value: "@masonheaney" },
452
+ { label: "Claudie Smitham", value: "@claudiesmitham" },
453
+ { label: "Emil Schaefer", value: "@emilschaefer" },
454
+ ]}
455
+ hint="This is a hint text to help user."
456
+ />
457
+ );
458
+
459
+ export const Default = () => {
460
+ return (
461
+ <div className="flex flex-col gap-16">
462
+ <div className="flex flex-col gap-4">
463
+ <Select
464
+ isRequired
465
+ label="Team member"
466
+ tooltip="This is a tooltip"
467
+ hint="This is a hint text to help user."
468
+ placeholder="Select team member"
469
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
470
+ >
471
+ {(item) => (
472
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
473
+ {item.label}
474
+ </Select.Item>
475
+ )}
476
+ </Select>
477
+ <Select
478
+ isDisabled
479
+ isRequired
480
+ label="Team member"
481
+ tooltip="This is a tooltip"
482
+ hint="This is a hint text to help user."
483
+ placeholder="Select team member"
484
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
485
+ >
486
+ {(item) => (
487
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
488
+ {item.label}
489
+ </Select.Item>
490
+ )}
491
+ </Select>
492
+ </div>
493
+ <div className="flex flex-col gap-4">
494
+ <Select
495
+ isRequired
496
+ size="md"
497
+ label="Team member"
498
+ tooltip="This is a tooltip"
499
+ hint="This is a hint text to help user."
500
+ placeholder="Select team member"
501
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
502
+ >
503
+ {(item) => (
504
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
505
+ {item.label}
506
+ </Select.Item>
507
+ )}
508
+ </Select>
509
+ <Select
510
+ isDisabled
511
+ isRequired
512
+ size="md"
513
+ label="Team member"
514
+ tooltip="This is a tooltip"
515
+ hint="This is a hint text to help user."
516
+ placeholder="Select team member"
517
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
518
+ >
519
+ {(item) => (
520
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
521
+ {item.label}
522
+ </Select.Item>
523
+ )}
524
+ </Select>
525
+ </div>
526
+ </div>
527
+ );
528
+ };
529
+
530
+ export const IconLeading = () => (
531
+ <div className="flex flex-col gap-16">
532
+ <div className="flex flex-col gap-4">
533
+ <Select
534
+ isRequired
535
+ label="Team member"
536
+ tooltip="This is a tooltip"
537
+ hint="This is a hint text to help user."
538
+ placeholder="Select team member"
539
+ placeholderIcon={User01}
540
+ items={items.map(({ avatarUrl: _, ...item }) => ({ ...item, icon: User01 }))}
541
+ >
542
+ {(item) => (
543
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
544
+ {item.label}
545
+ </Select.Item>
546
+ )}
547
+ </Select>
548
+ <Select
549
+ isRequired
550
+ label="Team member"
551
+ tooltip="This is a tooltip"
552
+ hint="This is a hint text to help user."
553
+ placeholder="Select team member"
554
+ placeholderIcon={User01}
555
+ isDisabled
556
+ items={items.map(({ avatarUrl: _, ...item }) => ({ ...item, icon: User01 }))}
557
+ >
558
+ {(item) => (
559
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
560
+ {item.label}
561
+ </Select.Item>
562
+ )}
563
+ </Select>
564
+ </div>
565
+ <div className="flex flex-col gap-4">
566
+ <Select
567
+ size="md"
568
+ isRequired
569
+ label="Team member"
570
+ tooltip="This is a tooltip"
571
+ hint="This is a hint text to help user."
572
+ placeholder="Select team member"
573
+ placeholderIcon={User01}
574
+ items={items.map(({ avatarUrl: _, ...item }) => ({ ...item, icon: User01 }))}
575
+ >
576
+ {(item) => (
577
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
578
+ {item.label}
579
+ </Select.Item>
580
+ )}
581
+ </Select>
582
+ <Select
583
+ size="md"
584
+ isRequired
585
+ label="Team member"
586
+ tooltip="This is a tooltip"
587
+ hint="This is a hint text to help user."
588
+ placeholder="Select team member"
589
+ placeholderIcon={User01}
590
+ isDisabled
591
+ items={items.map(({ avatarUrl: _, ...item }) => ({ ...item, icon: User01 }))}
592
+ >
593
+ {(item) => (
594
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
595
+ {item.label}
596
+ </Select.Item>
597
+ )}
598
+ </Select>
599
+ </div>
600
+ </div>
601
+ );
602
+
603
+ export const AvatarLeading = () => (
604
+ <div className="flex flex-col gap-16">
605
+ <div className="flex flex-col gap-4">
606
+ <Select
607
+ isRequired
608
+ label="Team member"
609
+ tooltip="This is a tooltip"
610
+ hint="This is a hint text to help user."
611
+ placeholder="Select team member"
612
+ placeholderIcon={User01}
613
+ items={items}
614
+ >
615
+ {(item) => (
616
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
617
+ {item.label}
618
+ </Select.Item>
619
+ )}
620
+ </Select>
621
+ <Select
622
+ isRequired
623
+ label="Team member"
624
+ tooltip="This is a tooltip"
625
+ hint="This is a hint text to help user."
626
+ placeholder="Select team member"
627
+ placeholderIcon={User01}
628
+ isDisabled
629
+ items={items}
630
+ >
631
+ {(item) => (
632
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
633
+ {item.label}
634
+ </Select.Item>
635
+ )}
636
+ </Select>
637
+ </div>
638
+ <div className="flex flex-col gap-4">
639
+ <Select
640
+ size="md"
641
+ isRequired
642
+ label="Team member"
643
+ tooltip="This is a tooltip"
644
+ hint="This is a hint text to help user."
645
+ placeholder="Select team member"
646
+ placeholderIcon={User01}
647
+ items={items}
648
+ >
649
+ {(item) => (
650
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
651
+ {item.label}
652
+ </Select.Item>
653
+ )}
654
+ </Select>
655
+ <Select
656
+ size="md"
657
+ isRequired
658
+ label="Team member"
659
+ tooltip="This is a tooltip"
660
+ hint="This is a hint text to help user."
661
+ placeholder="Select team member"
662
+ placeholderIcon={User01}
663
+ isDisabled
664
+ items={items}
665
+ >
666
+ {(item) => (
667
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
668
+ {item.label}
669
+ </Select.Item>
670
+ )}
671
+ </Select>
672
+ </div>
673
+ </div>
674
+ );
675
+
676
+ export const DotLeading = () => (
677
+ <div className="flex flex-col gap-16">
678
+ <div className="flex flex-col gap-4">
679
+ <Select
680
+ isRequired
681
+ label="Team member"
682
+ tooltip="This is a tooltip"
683
+ hint="This is a hint text to help user."
684
+ placeholder="Select team member"
685
+ placeholderIcon={<Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />}
686
+ items={items.map(({ avatarUrl: _, ...item }) => ({
687
+ ...item,
688
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
689
+ }))}
690
+ >
691
+ {(item) => (
692
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
693
+ {item.label}
694
+ </Select.Item>
695
+ )}
696
+ </Select>
697
+ <Select
698
+ isDisabled
699
+ isRequired
700
+ label="Team member"
701
+ tooltip="This is a tooltip"
702
+ hint="This is a hint text to help user."
703
+ placeholder="Select team member"
704
+ placeholderIcon={<Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />}
705
+ items={items.map(({ avatarUrl: _, ...item }) => ({
706
+ ...item,
707
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
708
+ }))}
709
+ >
710
+ {(item) => (
711
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
712
+ {item.label}
713
+ </Select.Item>
714
+ )}
715
+ </Select>
716
+ </div>
717
+ <div className="flex flex-col gap-4">
718
+ <Select
719
+ size="md"
720
+ isRequired
721
+ label="Team member"
722
+ tooltip="This is a tooltip"
723
+ hint="This is a hint text to help user."
724
+ placeholder="Select team member"
725
+ placeholderIcon={<Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />}
726
+ items={items.map(({ avatarUrl: _, ...item }) => ({
727
+ ...item,
728
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
729
+ }))}
730
+ >
731
+ {(item) => (
732
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
733
+ {item.label}
734
+ </Select.Item>
735
+ )}
736
+ </Select>
737
+ <Select
738
+ isDisabled
739
+ isRequired
740
+ size="md"
741
+ label="Team member"
742
+ tooltip="This is a tooltip"
743
+ hint="This is a hint text to help user."
744
+ placeholder="Select team member"
745
+ placeholderIcon={<Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />}
746
+ items={items.map(({ avatarUrl: _, ...item }) => ({
747
+ ...item,
748
+ icon: <Dot className="size-2.5 text-fg-success-secondary in-disabled:text-fg-disabled_subtle" />,
749
+ }))}
750
+ >
751
+ {(item) => (
752
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
753
+ {item.label}
754
+ </Select.Item>
755
+ )}
756
+ </Select>
757
+ </div>
758
+ </div>
759
+ );
760
+
761
+ export const Search = () => (
762
+ <div className="flex flex-col gap-16">
763
+ <div className="flex flex-col gap-4">
764
+ <Select.ComboBox
765
+ isRequired
766
+ label="Search"
767
+ tooltip="This is a tooltip"
768
+ hint="This is a hint text to help user."
769
+ placeholder="Search"
770
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
771
+ >
772
+ {(item) => (
773
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
774
+ {item.label}
775
+ </Select.Item>
776
+ )}
777
+ </Select.ComboBox>
778
+ <Select.ComboBox
779
+ isRequired
780
+ label="Search"
781
+ tooltip="This is a tooltip"
782
+ hint="This is a hint text to help user."
783
+ placeholder="Search"
784
+ isDisabled
785
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
786
+ >
787
+ {(item) => (
788
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
789
+ {item.label}
790
+ </Select.Item>
791
+ )}
792
+ </Select.ComboBox>
793
+ </div>
794
+ <div className="flex flex-col gap-4">
795
+ <Select.ComboBox
796
+ size="md"
797
+ isRequired
798
+ label="Search"
799
+ tooltip="This is a tooltip"
800
+ hint="This is a hint text to help user."
801
+ placeholder="Search"
802
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
803
+ >
804
+ {(item) => (
805
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
806
+ {item.label}
807
+ </Select.Item>
808
+ )}
809
+ </Select.ComboBox>
810
+ <Select.ComboBox
811
+ size="md"
812
+ isRequired
813
+ label="Search"
814
+ tooltip="This is a tooltip"
815
+ hint="This is a hint text to help user."
816
+ placeholder="Search"
817
+ isDisabled
818
+ items={items.map(({ avatarUrl: _, ...item }) => item)}
819
+ >
820
+ {(item) => (
821
+ <Select.Item id={item.id} supportingText={item.supportingText} isDisabled={item.isDisabled} icon={item.icon} avatarUrl={item.avatarUrl}>
822
+ {item.label}
823
+ </Select.Item>
824
+ )}
825
+ </Select.ComboBox>
826
+ </div>
827
+ </div>
828
+ );
829
+
830
+ export const Tags = () => {
831
+ const selectedItems = useListData({
832
+ initialItems: [],
833
+ });
834
+
835
+ return (
836
+ <div className="flex flex-col gap-16">
837
+ <div className="flex flex-col gap-4">
838
+ <MultiSelect
839
+ shortcut
840
+ selectedItems={selectedItems}
841
+ isRequired
842
+ label="Search"
843
+ tooltip="This is a tooltip"
844
+ hint="This is a hint text to help user."
845
+ placeholder="Search"
846
+ items={items}
847
+ >
848
+ {(item) => (
849
+ <MultiSelect.Item
850
+ id={item.id}
851
+ supportingText={item.supportingText}
852
+ isDisabled={item.isDisabled}
853
+ icon={item.icon}
854
+ avatarUrl={item.avatarUrl}
855
+ >
856
+ {item.label}
857
+ </MultiSelect.Item>
858
+ )}
859
+ </MultiSelect>
860
+
861
+ <MultiSelect
862
+ shortcut
863
+ selectedItems={selectedItems}
864
+ isRequired
865
+ label="Search"
866
+ tooltip="This is a tooltip"
867
+ hint="This is a hint text to help user."
868
+ placeholder="Search"
869
+ items={items}
870
+ isDisabled
871
+ >
872
+ {(item) => (
873
+ <MultiSelect.Item
874
+ id={item.id}
875
+ supportingText={item.supportingText}
876
+ isDisabled={item.isDisabled}
877
+ icon={item.icon}
878
+ avatarUrl={item.avatarUrl}
879
+ >
880
+ {item.label}
881
+ </MultiSelect.Item>
882
+ )}
883
+ </MultiSelect>
884
+ </div>
885
+ <div className="flex flex-col gap-4">
886
+ <MultiSelect
887
+ shortcut
888
+ selectedItems={selectedItems}
889
+ size="md"
890
+ isRequired
891
+ label="Search"
892
+ tooltip="This is a tooltip"
893
+ hint="This is a hint text to help user."
894
+ items={items}
895
+ placeholder="Search"
896
+ >
897
+ {(item) => (
898
+ <MultiSelect.Item
899
+ id={item.id}
900
+ supportingText={item.supportingText}
901
+ isDisabled={item.isDisabled}
902
+ icon={item.icon}
903
+ avatarUrl={item.avatarUrl}
904
+ >
905
+ {item.label}
906
+ </MultiSelect.Item>
907
+ )}
908
+ </MultiSelect>
909
+ <MultiSelect
910
+ shortcut
911
+ selectedItems={selectedItems}
912
+ size="md"
913
+ isRequired
914
+ label="Search"
915
+ tooltip="This is a tooltip"
916
+ hint="This is a hint text to help user."
917
+ placeholder="Search"
918
+ items={items}
919
+ isDisabled
920
+ >
921
+ {(item) => (
922
+ <MultiSelect.Item
923
+ id={item.id}
924
+ supportingText={item.supportingText}
925
+ isDisabled={item.isDisabled}
926
+ icon={item.icon}
927
+ avatarUrl={item.avatarUrl}
928
+ >
929
+ {item.label}
930
+ </MultiSelect.Item>
931
+ )}
932
+ </MultiSelect>
933
+ </div>
934
+ </div>
935
+ );
936
+ };