@appdirect/design-system 0.0.22 → 0.0.25
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/README.md +1 -1
- package/dist/Combobox/ADMultiselect.js +91 -0
- package/dist/Combobox/ADMultiselect.tsx +237 -0
- package/dist/Combobox/AutocompleteClearable.js +33 -35
- package/dist/Combobox/AutocompleteClearable.tsx +56 -121
- package/dist/Combobox/SearchableSelect.js +23 -42
- package/dist/Combobox/SearchableSelect.tsx +33 -129
- package/dist/Combobox/Select.js +13 -19
- package/dist/Combobox/Select.tsx +15 -44
- package/dist/Combobox/index.js +1 -1
- package/dist/Combobox/index.ts +2 -2
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/CustomBottomToolbar.module.css +1 -24
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +2 -5
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.tsx +15 -22
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +1 -2
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.module.css +2 -9
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.tsx +4 -5
- package/dist/ComplexComponents/DataTable/DataTableGrid/DataTableGrid.module.css +2 -6
- package/dist/ComplexComponents/DataTable/DataTableGrid/index.js +1 -1
- package/dist/ComplexComponents/DataTable/DataTableGrid/index.tsx +1 -1
- package/dist/ComplexComponents/Utilities/CopyButton.js +15 -27
- package/dist/ComplexComponents/Utilities/CopyButton.tsx +35 -49
- package/dist/DESIGN.md +7 -7
- package/dist/DataDisplay/Avatar.js +26 -81
- package/dist/DataDisplay/Avatar.tsx +35 -93
- package/dist/DataDisplay/Pill.js +21 -79
- package/dist/DataDisplay/Pill.tsx +34 -116
- package/dist/Inputs/ColorInput.js +12 -18
- package/dist/Inputs/ColorInput.tsx +13 -41
- package/dist/Inputs/NumberInput.js +15 -50
- package/dist/Inputs/NumberInput.tsx +18 -117
- package/dist/Inputs/Radio.js +1 -1
- package/dist/Inputs/Radio.tsx +1 -1
- package/dist/Inputs/RadioGroup.js +1 -1
- package/dist/Inputs/RadioGroup.tsx +1 -1
- package/dist/Inputs/TextArea.js +12 -18
- package/dist/Inputs/TextArea.tsx +13 -41
- package/dist/Inputs/TextInput.js +12 -18
- package/dist/Inputs/TextInput.tsx +13 -41
- package/dist/Inputs/inputLabel.js +35 -0
- package/dist/Inputs/inputLabel.tsx +83 -0
- package/dist/Layout/Inline.js +5 -42
- package/dist/Layout/Inline.tsx +6 -79
- package/dist/Overlays/Tooltip.js +2 -2
- package/dist/Overlays/Tooltip.tsx +4 -1
- package/dist/contracts/index.json +1 -1
- package/dist/css/foundations.css +44 -2
- package/dist/css/mantine.css +236 -43
- package/dist/css/tokens.css +58 -26
- package/dist/index.js +3 -3
- package/dist/index.ts +4 -4
- package/dist/stories/Combobox/{Multiselect.stories.tsx → ADMultiselect.stories.tsx} +159 -53
- package/dist/stories/Combobox/SearchableSelect.stories.tsx +3 -3
- package/dist/stories/Combobox/Select.stories.tsx +1 -1
- package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +4 -14
- package/dist/stories/Inputs/ColorInput.stories.tsx +12 -0
- package/dist/stories/Inputs/NumberInput.stories.tsx +12 -0
- package/dist/stories/Inputs/Radio.stories.tsx +10 -5
- package/dist/stories/Inputs/RadioGroup.stories.tsx +122 -80
- package/dist/stories/Inputs/TextArea.stories.tsx +12 -0
- package/dist/stories/Inputs/TextInput.stories.tsx +12 -0
- package/dist/stories/index.json +42 -35
- package/package.json +10 -6
- package/dist/Combobox/Multiselect.js +0 -31
- package/dist/Combobox/Multiselect.tsx +0 -158
package/dist/index.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { TextInput, TextArea, NumberInput, ColorInput, Slider, SliderWithLabel, Switch, SegmentedControl, Checkbox, Radio, RadioGroup, DropZone, FileInput } from './Inputs';
|
|
19
19
|
import { Button, ActionIcon, CloseButton } from './Buttons';
|
|
20
20
|
import { Alert, Avatar, Badge, Card, CardSection, Chip, Pill, Indicator, Progress, ThemeIcon, List, Table } from './DataDisplay';
|
|
21
|
-
import { SearchableSelect, AutocompleteClearable,
|
|
21
|
+
import { SearchableSelect, AutocompleteClearable, ADMultiselect, Select, Combobox } from './Combobox';
|
|
22
22
|
import { Breadcrumb, BackBreadcrumb, NavLink, Stepper, Tabs } from './Navigation';
|
|
23
23
|
import { Drawer, Menu, Modal, ConfirmationModal, Popover, ConfirmationPopover, Tooltip } from './Overlays';
|
|
24
24
|
import { Kbd, Code, Text, Title } from './Typography';
|
|
@@ -44,8 +44,8 @@ export { Button, ActionIcon, CloseButton } from './Buttons';
|
|
|
44
44
|
export type { DSButtonProps, DSActionIconProps, DSCloseButtonProps } from './Buttons';
|
|
45
45
|
|
|
46
46
|
// ========================== COMBOBOX ==========================
|
|
47
|
-
export { SearchableSelect, AutocompleteClearable,
|
|
48
|
-
export type { DSSearchableSelectProps, DSAutocompleteClearableProps,
|
|
47
|
+
export { SearchableSelect, AutocompleteClearable, ADMultiselect, Select, Combobox } from './Combobox';
|
|
48
|
+
export type { DSSearchableSelectProps, DSAutocompleteClearableProps, ADMultiselectProps, DSSelectProps, DSComboboxProps } from './Combobox';
|
|
49
49
|
|
|
50
50
|
// ========================== NAVIGATION ==========================
|
|
51
51
|
export { Breadcrumb, BackBreadcrumb, NavLink, Stepper, Tabs } from './Navigation';
|
|
@@ -147,7 +147,7 @@ export const Buttons = {
|
|
|
147
147
|
export const ComboboxComponents = {
|
|
148
148
|
SearchableSelect,
|
|
149
149
|
AutocompleteClearable,
|
|
150
|
-
|
|
150
|
+
ADMultiselect,
|
|
151
151
|
Select,
|
|
152
152
|
Combobox,
|
|
153
153
|
};
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box, Stack } from '@mantine/core';
|
|
4
|
+
import { ADMultiselect, Title, Text } from '@appdirect/design-system';
|
|
4
5
|
|
|
5
|
-
const meta: Meta<typeof
|
|
6
|
-
title: 'Design System/Combobox/
|
|
7
|
-
component:
|
|
6
|
+
const meta: Meta<typeof ADMultiselect> = {
|
|
7
|
+
title: 'Design System/Combobox/ADMultiselect',
|
|
8
|
+
component: ADMultiselect,
|
|
8
9
|
parameters: {
|
|
9
10
|
layout: 'centered',
|
|
10
11
|
docs: {
|
|
11
12
|
description: {
|
|
12
|
-
component: '
|
|
13
|
+
component: 'Mantine MultiSelect with checkbox options and a "+N more" pill. Hovering "+N more" lists the hidden values. All core MultiSelect props (value, onChange, searchable, clearable, name, ...) are supported.',
|
|
13
14
|
},
|
|
14
15
|
},
|
|
15
16
|
},
|
|
16
|
-
|
|
17
|
+
decorators: [
|
|
18
|
+
(Story) => (
|
|
19
|
+
<Box miw={400}>
|
|
20
|
+
<Story />
|
|
21
|
+
</Box>
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
tags: ['autodocs'],
|
|
17
25
|
argTypes: {
|
|
18
26
|
label: {
|
|
19
27
|
control: 'text',
|
|
@@ -29,7 +37,19 @@ const meta: Meta<typeof Multiselect> = {
|
|
|
29
37
|
},
|
|
30
38
|
error: {
|
|
31
39
|
control: 'text',
|
|
32
|
-
description: 'Error message',
|
|
40
|
+
description: 'Error message, or true for the error state only (then errorCaption supplies the message)',
|
|
41
|
+
},
|
|
42
|
+
errorCaption: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'Message shown below the input when error is true',
|
|
45
|
+
},
|
|
46
|
+
hasHelpIcon: {
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
description: 'Show a (?) help icon with a tooltip to the right of the label',
|
|
49
|
+
},
|
|
50
|
+
helpIconLabel: {
|
|
51
|
+
control: 'text',
|
|
52
|
+
description: 'Tooltip label for the help icon (also its aria-label)',
|
|
33
53
|
},
|
|
34
54
|
required: {
|
|
35
55
|
control: 'boolean',
|
|
@@ -37,7 +57,7 @@ const meta: Meta<typeof Multiselect> = {
|
|
|
37
57
|
},
|
|
38
58
|
showOptional: {
|
|
39
59
|
control: 'boolean',
|
|
40
|
-
description: 'Whether to show "(
|
|
60
|
+
description: 'Whether to show "(Optional)" next to the label',
|
|
41
61
|
},
|
|
42
62
|
disabled: {
|
|
43
63
|
control: 'boolean',
|
|
@@ -45,7 +65,7 @@ const meta: Meta<typeof Multiselect> = {
|
|
|
45
65
|
},
|
|
46
66
|
searchable: {
|
|
47
67
|
control: 'boolean',
|
|
48
|
-
description: 'Whether the
|
|
68
|
+
description: 'Whether the field is typeable and filters options (core default: false)',
|
|
49
69
|
},
|
|
50
70
|
size: {
|
|
51
71
|
control: 'select',
|
|
@@ -103,12 +123,33 @@ export const Default: Story = {
|
|
|
103
123
|
},
|
|
104
124
|
};
|
|
105
125
|
|
|
126
|
+
export const WithHelpIcon: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
label: 'Technologies',
|
|
129
|
+
placeholder: 'Pick one or more technologies',
|
|
130
|
+
data: technologies,
|
|
131
|
+
required: true,
|
|
132
|
+
hasHelpIcon: true,
|
|
133
|
+
helpIconLabel: 'Choose every technology used by the project',
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const WithErrorCaption: Story = {
|
|
138
|
+
args: {
|
|
139
|
+
label: 'Technologies',
|
|
140
|
+
placeholder: 'Pick one or more technologies',
|
|
141
|
+
data: technologies,
|
|
142
|
+
error: true,
|
|
143
|
+
errorCaption: 'Select at least one technology',
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
|
|
106
147
|
export const Sizes: Story = {
|
|
107
148
|
render: () => (
|
|
108
149
|
<Stack gap="lg" w={400}>
|
|
109
150
|
<div>
|
|
110
151
|
<Text size="sm" fw={500} mb="xs">Extra Small (xs):</Text>
|
|
111
|
-
<
|
|
152
|
+
<ADMultiselect
|
|
112
153
|
label="Technologies"
|
|
113
154
|
placeholder="Select technologies"
|
|
114
155
|
data={technologies.slice(0, 6)}
|
|
@@ -118,7 +159,7 @@ export const Sizes: Story = {
|
|
|
118
159
|
|
|
119
160
|
<div>
|
|
120
161
|
<Text size="sm" fw={500} mb="xs">Small (sm):</Text>
|
|
121
|
-
<
|
|
162
|
+
<ADMultiselect
|
|
122
163
|
label="Technologies"
|
|
123
164
|
placeholder="Select technologies"
|
|
124
165
|
data={technologies.slice(0, 6)}
|
|
@@ -128,7 +169,7 @@ export const Sizes: Story = {
|
|
|
128
169
|
|
|
129
170
|
<div>
|
|
130
171
|
<Text size="sm" fw={500} mb="xs">Medium (md):</Text>
|
|
131
|
-
<
|
|
172
|
+
<ADMultiselect
|
|
132
173
|
label="Technologies"
|
|
133
174
|
placeholder="Select technologies"
|
|
134
175
|
data={technologies.slice(0, 6)}
|
|
@@ -138,7 +179,7 @@ export const Sizes: Story = {
|
|
|
138
179
|
|
|
139
180
|
<div>
|
|
140
181
|
<Text size="sm" fw={500} mb="xs">Large (lg):</Text>
|
|
141
|
-
<
|
|
182
|
+
<ADMultiselect
|
|
142
183
|
label="Technologies"
|
|
143
184
|
placeholder="Select technologies"
|
|
144
185
|
data={technologies.slice(0, 6)}
|
|
@@ -148,7 +189,7 @@ export const Sizes: Story = {
|
|
|
148
189
|
|
|
149
190
|
<div>
|
|
150
191
|
<Text size="sm" fw={500} mb="xs">Extra Large (xl):</Text>
|
|
151
|
-
<
|
|
192
|
+
<ADMultiselect
|
|
152
193
|
label="Technologies"
|
|
153
194
|
placeholder="Select technologies"
|
|
154
195
|
data={technologies.slice(0, 6)}
|
|
@@ -160,7 +201,7 @@ export const Sizes: Story = {
|
|
|
160
201
|
parameters: {
|
|
161
202
|
docs: {
|
|
162
203
|
description: {
|
|
163
|
-
story: '
|
|
204
|
+
story: 'ADMultiselect component in different sizes.',
|
|
164
205
|
},
|
|
165
206
|
},
|
|
166
207
|
},
|
|
@@ -169,14 +210,14 @@ export const Sizes: Story = {
|
|
|
169
210
|
export const WithDescription: Story = {
|
|
170
211
|
render: () => (
|
|
171
212
|
<Stack gap="lg" w={400}>
|
|
172
|
-
<
|
|
213
|
+
<ADMultiselect
|
|
173
214
|
label="Programming Languages"
|
|
174
215
|
description="Select all programming languages you're proficient in"
|
|
175
216
|
placeholder="Choose languages"
|
|
176
217
|
data={['JavaScript', 'TypeScript', 'Python', 'Java', 'C#', 'Go', 'Rust', 'Swift']}
|
|
177
218
|
/>
|
|
178
219
|
|
|
179
|
-
<
|
|
220
|
+
<ADMultiselect
|
|
180
221
|
label="Skills"
|
|
181
222
|
description="Pick your areas of expertise (you can select multiple)"
|
|
182
223
|
placeholder="Select skills"
|
|
@@ -187,7 +228,7 @@ export const WithDescription: Story = {
|
|
|
187
228
|
parameters: {
|
|
188
229
|
docs: {
|
|
189
230
|
description: {
|
|
190
|
-
story: '
|
|
231
|
+
story: 'ADMultiselect with helpful description text.',
|
|
191
232
|
},
|
|
192
233
|
},
|
|
193
234
|
},
|
|
@@ -196,7 +237,7 @@ export const WithDescription: Story = {
|
|
|
196
237
|
export const RequiredAndOptional: Story = {
|
|
197
238
|
render: () => (
|
|
198
239
|
<Stack gap="lg" w={400}>
|
|
199
|
-
<
|
|
240
|
+
<ADMultiselect
|
|
200
241
|
label="Required Skills"
|
|
201
242
|
placeholder="Select at least one skill"
|
|
202
243
|
data={skills}
|
|
@@ -204,7 +245,7 @@ export const RequiredAndOptional: Story = {
|
|
|
204
245
|
description="You must select at least one skill"
|
|
205
246
|
/>
|
|
206
247
|
|
|
207
|
-
<
|
|
248
|
+
<ADMultiselect
|
|
208
249
|
label="Additional Technologies"
|
|
209
250
|
placeholder="Optional technology preferences"
|
|
210
251
|
data={technologies}
|
|
@@ -225,7 +266,7 @@ export const RequiredAndOptional: Story = {
|
|
|
225
266
|
export const WithError: Story = {
|
|
226
267
|
render: () => (
|
|
227
268
|
<Stack gap="lg" w={400}>
|
|
228
|
-
<
|
|
269
|
+
<ADMultiselect
|
|
229
270
|
label="Technologies"
|
|
230
271
|
placeholder="Select technologies"
|
|
231
272
|
data={technologies}
|
|
@@ -233,7 +274,7 @@ export const WithError: Story = {
|
|
|
233
274
|
required
|
|
234
275
|
/>
|
|
235
276
|
|
|
236
|
-
<
|
|
277
|
+
<ADMultiselect
|
|
237
278
|
label="Skills"
|
|
238
279
|
placeholder="Choose skills"
|
|
239
280
|
data={skills}
|
|
@@ -244,7 +285,7 @@ export const WithError: Story = {
|
|
|
244
285
|
parameters: {
|
|
245
286
|
docs: {
|
|
246
287
|
description: {
|
|
247
|
-
story: '
|
|
288
|
+
story: 'ADMultiselect with error states and validation messages.',
|
|
248
289
|
},
|
|
249
290
|
},
|
|
250
291
|
},
|
|
@@ -253,7 +294,7 @@ export const WithError: Story = {
|
|
|
253
294
|
export const DisabledState: Story = {
|
|
254
295
|
render: () => (
|
|
255
296
|
<Stack gap="lg" w={400}>
|
|
256
|
-
<
|
|
297
|
+
<ADMultiselect
|
|
257
298
|
label="Technologies"
|
|
258
299
|
placeholder="Not available"
|
|
259
300
|
data={technologies}
|
|
@@ -261,7 +302,7 @@ export const DisabledState: Story = {
|
|
|
261
302
|
description="This field is currently disabled"
|
|
262
303
|
/>
|
|
263
304
|
|
|
264
|
-
<
|
|
305
|
+
<ADMultiselect
|
|
265
306
|
label="Skills"
|
|
266
307
|
placeholder="Select skills"
|
|
267
308
|
data={skills}
|
|
@@ -272,7 +313,7 @@ export const DisabledState: Story = {
|
|
|
272
313
|
parameters: {
|
|
273
314
|
docs: {
|
|
274
315
|
description: {
|
|
275
|
-
story: 'Disabled
|
|
316
|
+
story: 'Disabled ADMultiselect inputs.',
|
|
276
317
|
},
|
|
277
318
|
},
|
|
278
319
|
},
|
|
@@ -283,33 +324,36 @@ export const MaxDisplayedValues: Story = {
|
|
|
283
324
|
<Stack gap="lg" w={400}>
|
|
284
325
|
<div>
|
|
285
326
|
<Text size="sm" fw={500} mb="sm">Max 2 displayed (default):</Text>
|
|
286
|
-
<
|
|
327
|
+
<ADMultiselect
|
|
287
328
|
label="Technologies"
|
|
288
329
|
placeholder="Select multiple technologies"
|
|
289
330
|
data={technologies}
|
|
290
331
|
maxDisplayedValues={2}
|
|
332
|
+
defaultValue={['React', 'Vue', 'Angular', 'Docker']}
|
|
291
333
|
description="Shows max 2 pills, then '+X more'"
|
|
292
334
|
/>
|
|
293
335
|
</div>
|
|
294
336
|
|
|
295
337
|
<div>
|
|
296
338
|
<Text size="sm" fw={500} mb="sm">Max 4 displayed:</Text>
|
|
297
|
-
<
|
|
339
|
+
<ADMultiselect
|
|
298
340
|
label="Skills"
|
|
299
341
|
placeholder="Select multiple skills"
|
|
300
342
|
data={skills}
|
|
301
343
|
maxDisplayedValues={4}
|
|
344
|
+
defaultValue={['frontend', 'backend', 'mobile', 'devops', 'design', 'data']}
|
|
302
345
|
description="Shows max 4 pills before collapsing"
|
|
303
346
|
/>
|
|
304
347
|
</div>
|
|
305
348
|
|
|
306
349
|
<div>
|
|
307
350
|
<Text size="sm" fw={500} mb="sm">Max 1 displayed:</Text>
|
|
308
|
-
<
|
|
351
|
+
<ADMultiselect
|
|
309
352
|
label="Languages"
|
|
310
353
|
placeholder="Select languages"
|
|
311
354
|
data={['English', 'Spanish', 'French', 'German', 'Italian', 'Portuguese', 'Japanese', 'Chinese']}
|
|
312
355
|
maxDisplayedValues={1}
|
|
356
|
+
defaultValue={['English', 'Spanish', 'French']}
|
|
313
357
|
description="Very compact display"
|
|
314
358
|
/>
|
|
315
359
|
</div>
|
|
@@ -329,7 +373,7 @@ export const DifferentDataTypes: Story = {
|
|
|
329
373
|
<Stack gap="lg" w={400}>
|
|
330
374
|
<div>
|
|
331
375
|
<Text size="sm" fw={500} mb="sm">String Array Data:</Text>
|
|
332
|
-
<
|
|
376
|
+
<ADMultiselect
|
|
333
377
|
label="Frameworks"
|
|
334
378
|
placeholder="Select frameworks"
|
|
335
379
|
data={['React', 'Vue.js', 'Angular', 'Svelte', 'Next.js', 'Nuxt.js', 'Gatsby']}
|
|
@@ -338,7 +382,7 @@ export const DifferentDataTypes: Story = {
|
|
|
338
382
|
|
|
339
383
|
<div>
|
|
340
384
|
<Text size="sm" fw={500} mb="sm">Object Array Data (value/label):</Text>
|
|
341
|
-
<
|
|
385
|
+
<ADMultiselect
|
|
342
386
|
label="Job Roles"
|
|
343
387
|
placeholder="Select roles"
|
|
344
388
|
data={[
|
|
@@ -354,7 +398,7 @@ export const DifferentDataTypes: Story = {
|
|
|
354
398
|
|
|
355
399
|
<div>
|
|
356
400
|
<Text size="sm" fw={500} mb="sm">Large Dataset:</Text>
|
|
357
|
-
<
|
|
401
|
+
<ADMultiselect
|
|
358
402
|
label="Technologies"
|
|
359
403
|
placeholder="Select from 15 technologies"
|
|
360
404
|
data={technologies}
|
|
@@ -366,7 +410,7 @@ export const DifferentDataTypes: Story = {
|
|
|
366
410
|
parameters: {
|
|
367
411
|
docs: {
|
|
368
412
|
description: {
|
|
369
|
-
story: '
|
|
413
|
+
story: 'ADMultiselect with different data formats and sizes.',
|
|
370
414
|
},
|
|
371
415
|
},
|
|
372
416
|
},
|
|
@@ -377,7 +421,7 @@ export const FormIntegration: Story = {
|
|
|
377
421
|
<Stack gap="lg" w={450}>
|
|
378
422
|
<Title order={3} size="md" fw={500}>Developer Profile Form</Title>
|
|
379
423
|
|
|
380
|
-
<
|
|
424
|
+
<ADMultiselect
|
|
381
425
|
label="Programming Languages"
|
|
382
426
|
placeholder="Select languages you know"
|
|
383
427
|
data={['JavaScript', 'TypeScript', 'Python', 'Java', 'C#', 'Go', 'Rust', 'Swift', 'Kotlin', 'PHP']}
|
|
@@ -386,7 +430,7 @@ export const FormIntegration: Story = {
|
|
|
386
430
|
maxDisplayedValues={3}
|
|
387
431
|
/>
|
|
388
432
|
|
|
389
|
-
<
|
|
433
|
+
<ADMultiselect
|
|
390
434
|
label="Frameworks & Libraries"
|
|
391
435
|
placeholder="Choose frameworks"
|
|
392
436
|
data={[
|
|
@@ -404,7 +448,7 @@ export const FormIntegration: Story = {
|
|
|
404
448
|
maxDisplayedValues={2}
|
|
405
449
|
/>
|
|
406
450
|
|
|
407
|
-
<
|
|
451
|
+
<ADMultiselect
|
|
408
452
|
label="Areas of Interest"
|
|
409
453
|
placeholder="What interests you?"
|
|
410
454
|
data={[
|
|
@@ -428,7 +472,7 @@ export const FormIntegration: Story = {
|
|
|
428
472
|
parameters: {
|
|
429
473
|
docs: {
|
|
430
474
|
description: {
|
|
431
|
-
story: '
|
|
475
|
+
story: 'ADMultiselect components integrated in a form context.',
|
|
432
476
|
},
|
|
433
477
|
},
|
|
434
478
|
},
|
|
@@ -439,7 +483,7 @@ export const TagSelection: Story = {
|
|
|
439
483
|
<Stack gap="lg" w={450}>
|
|
440
484
|
<div>
|
|
441
485
|
<Text size="sm" fw={500} mb="sm">Article Tags:</Text>
|
|
442
|
-
<
|
|
486
|
+
<ADMultiselect
|
|
443
487
|
label="Tags"
|
|
444
488
|
placeholder="Add tags to your article"
|
|
445
489
|
data={[
|
|
@@ -454,7 +498,7 @@ export const TagSelection: Story = {
|
|
|
454
498
|
|
|
455
499
|
<div>
|
|
456
500
|
<Text size="sm" fw={500} mb="sm">Product Categories:</Text>
|
|
457
|
-
<
|
|
501
|
+
<ADMultiselect
|
|
458
502
|
label="Categories"
|
|
459
503
|
placeholder="Categorize your product"
|
|
460
504
|
data={[
|
|
@@ -475,7 +519,7 @@ export const TagSelection: Story = {
|
|
|
475
519
|
|
|
476
520
|
<div>
|
|
477
521
|
<Text size="sm" fw={500} mb="sm">Project Labels:</Text>
|
|
478
|
-
<
|
|
522
|
+
<ADMultiselect
|
|
479
523
|
label="Labels"
|
|
480
524
|
placeholder="Add project labels"
|
|
481
525
|
data={[
|
|
@@ -493,7 +537,7 @@ export const TagSelection: Story = {
|
|
|
493
537
|
parameters: {
|
|
494
538
|
docs: {
|
|
495
539
|
description: {
|
|
496
|
-
story: '
|
|
540
|
+
story: 'ADMultiselect used for tagging and categorization scenarios.',
|
|
497
541
|
},
|
|
498
542
|
},
|
|
499
543
|
},
|
|
@@ -504,7 +548,7 @@ export const TeamAndPermissions: Story = {
|
|
|
504
548
|
<Stack gap="lg" w={450}>
|
|
505
549
|
<div>
|
|
506
550
|
<Text size="sm" fw={500} mb="sm">Team Members:</Text>
|
|
507
|
-
<
|
|
551
|
+
<ADMultiselect
|
|
508
552
|
label="Assign Team Members"
|
|
509
553
|
placeholder="Select team members"
|
|
510
554
|
data={[
|
|
@@ -522,7 +566,7 @@ export const TeamAndPermissions: Story = {
|
|
|
522
566
|
|
|
523
567
|
<div>
|
|
524
568
|
<Text size="sm" fw={500} mb="sm">User Permissions:</Text>
|
|
525
|
-
<
|
|
569
|
+
<ADMultiselect
|
|
526
570
|
label="Permissions"
|
|
527
571
|
placeholder="Select permissions"
|
|
528
572
|
data={[
|
|
@@ -538,7 +582,7 @@ export const TeamAndPermissions: Story = {
|
|
|
538
582
|
|
|
539
583
|
<div>
|
|
540
584
|
<Text size="sm" fw={500} mb="sm">Notification Preferences:</Text>
|
|
541
|
-
<
|
|
585
|
+
<ADMultiselect
|
|
542
586
|
label="Notifications"
|
|
543
587
|
placeholder="Choose notification types"
|
|
544
588
|
data={[
|
|
@@ -559,7 +603,7 @@ export const TeamAndPermissions: Story = {
|
|
|
559
603
|
parameters: {
|
|
560
604
|
docs: {
|
|
561
605
|
description: {
|
|
562
|
-
story: '
|
|
606
|
+
story: 'ADMultiselect for team management and permission assignment.',
|
|
563
607
|
},
|
|
564
608
|
},
|
|
565
609
|
},
|
|
@@ -572,7 +616,7 @@ export const UseCases: Story = {
|
|
|
572
616
|
|
|
573
617
|
<div>
|
|
574
618
|
<Text size="sm" fw={500} mb="sm">1. Skill Assessment:</Text>
|
|
575
|
-
<
|
|
619
|
+
<ADMultiselect
|
|
576
620
|
label="Technical Skills"
|
|
577
621
|
placeholder="Select your skills"
|
|
578
622
|
data={technologies}
|
|
@@ -583,7 +627,7 @@ export const UseCases: Story = {
|
|
|
583
627
|
|
|
584
628
|
<div>
|
|
585
629
|
<Text size="sm" fw={500} mb="sm">2. Filter Selection:</Text>
|
|
586
|
-
<
|
|
630
|
+
<ADMultiselect
|
|
587
631
|
label="Filters"
|
|
588
632
|
placeholder="Apply filters"
|
|
589
633
|
data={[
|
|
@@ -598,7 +642,7 @@ export const UseCases: Story = {
|
|
|
598
642
|
|
|
599
643
|
<div>
|
|
600
644
|
<Text size="sm" fw={500} mb="sm">3. Multi-language Support:</Text>
|
|
601
|
-
<
|
|
645
|
+
<ADMultiselect
|
|
602
646
|
label="Languages"
|
|
603
647
|
placeholder="Select languages"
|
|
604
648
|
data={[
|
|
@@ -619,7 +663,7 @@ export const UseCases: Story = {
|
|
|
619
663
|
|
|
620
664
|
<div>
|
|
621
665
|
<Text size="sm" fw={500} mb="sm">4. Feature Selection:</Text>
|
|
622
|
-
<
|
|
666
|
+
<ADMultiselect
|
|
623
667
|
label="Features"
|
|
624
668
|
placeholder="Choose features"
|
|
625
669
|
data={[
|
|
@@ -636,7 +680,68 @@ export const UseCases: Story = {
|
|
|
636
680
|
parameters: {
|
|
637
681
|
docs: {
|
|
638
682
|
description: {
|
|
639
|
-
story: 'Real-world examples of
|
|
683
|
+
story: 'Real-world examples of ADMultiselect usage in different application contexts.',
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
export const Controlled: Story = {
|
|
690
|
+
render: () => {
|
|
691
|
+
const [value, setValue] = useState<string[]>(['react', 'vue', 'angular']);
|
|
692
|
+
|
|
693
|
+
return (
|
|
694
|
+
<Stack gap="sm" w={400}>
|
|
695
|
+
<ADMultiselect
|
|
696
|
+
label="Frameworks"
|
|
697
|
+
placeholder="Pick frameworks"
|
|
698
|
+
data={[
|
|
699
|
+
{ value: 'react', label: 'React' },
|
|
700
|
+
{ value: 'vue', label: 'Vue.js' },
|
|
701
|
+
{ value: 'angular', label: 'Angular' },
|
|
702
|
+
{ value: 'svelte', label: 'Svelte' },
|
|
703
|
+
{ value: 'solid', label: 'SolidJS' },
|
|
704
|
+
]}
|
|
705
|
+
value={value}
|
|
706
|
+
onChange={setValue}
|
|
707
|
+
maxDisplayedValues={2}
|
|
708
|
+
clearable
|
|
709
|
+
/>
|
|
710
|
+
<Text size="sm" c="dimmed">Selected values: {value.join(', ') || 'none'}</Text>
|
|
711
|
+
</Stack>
|
|
712
|
+
);
|
|
713
|
+
},
|
|
714
|
+
parameters: {
|
|
715
|
+
docs: {
|
|
716
|
+
description: {
|
|
717
|
+
story: 'Controlled with value/onChange. Pills show option labels while values stay as the option value.',
|
|
718
|
+
},
|
|
719
|
+
},
|
|
720
|
+
},
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
export const GroupedAndSearchable: Story = {
|
|
724
|
+
render: () => (
|
|
725
|
+
<Stack gap="lg" w={400}>
|
|
726
|
+
<ADMultiselect
|
|
727
|
+
label="Regions"
|
|
728
|
+
placeholder="Search regions"
|
|
729
|
+
searchable
|
|
730
|
+
nothingFoundMessage="No regions found"
|
|
731
|
+
data={[
|
|
732
|
+
{ group: 'Americas', items: ['US East', 'US West', 'Canada', 'Brazil'] },
|
|
733
|
+
{ group: 'Europe', items: ['Ireland', 'Germany', 'France'] },
|
|
734
|
+
{ group: 'Asia Pacific', items: ['Japan', 'Singapore', 'Australia'] },
|
|
735
|
+
]}
|
|
736
|
+
defaultValue={['US East', 'Germany', 'Japan', 'Australia']}
|
|
737
|
+
maxDisplayedValues={2}
|
|
738
|
+
/>
|
|
739
|
+
</Stack>
|
|
740
|
+
),
|
|
741
|
+
parameters: {
|
|
742
|
+
docs: {
|
|
743
|
+
description: {
|
|
744
|
+
story: 'Core features still work: grouped data, search with filtering, and hidden values grouped in "+N more".',
|
|
640
745
|
},
|
|
641
746
|
},
|
|
642
747
|
},
|
|
@@ -651,13 +756,14 @@ export const Interactive: Story = {
|
|
|
651
756
|
required: false,
|
|
652
757
|
showOptional: false,
|
|
653
758
|
disabled: false,
|
|
654
|
-
searchable:
|
|
759
|
+
searchable: false,
|
|
655
760
|
maxDisplayedValues: 2,
|
|
761
|
+
defaultValue: ['React', 'Vue', 'Angular'],
|
|
656
762
|
},
|
|
657
763
|
parameters: {
|
|
658
764
|
docs: {
|
|
659
765
|
description: {
|
|
660
|
-
story: 'Use the controls below to interact with the
|
|
766
|
+
story: 'Use the controls below to interact with the ADMultiselect and see different combinations.',
|
|
661
767
|
},
|
|
662
768
|
},
|
|
663
769
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
2
|
import { Stack } from '@mantine/core';
|
|
3
|
-
import {
|
|
3
|
+
import { SearchableSelect, Title, Text } from '@appdirect/design-system';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof SearchableSelect> = {
|
|
6
6
|
title: 'Design System/Combobox/SearchableSelect',
|
|
@@ -9,11 +9,11 @@ const meta: Meta<typeof SearchableSelect> = {
|
|
|
9
9
|
layout: 'centered',
|
|
10
10
|
docs: {
|
|
11
11
|
description: {
|
|
12
|
-
component: '
|
|
12
|
+
component: 'The DS Select with `searchable` on by default. Designers use Combobox in Figma; engineering swaps in SearchableSelect for type-to-filter fields.',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
-
tags: ['autodocs'
|
|
16
|
+
tags: ['autodocs'],
|
|
17
17
|
argTypes: {
|
|
18
18
|
label: {
|
|
19
19
|
control: 'text',
|
|
@@ -16,7 +16,7 @@ A flexible select component built on Mantine's Select with design system default
|
|
|
16
16
|
- **Regular mode**: Standard select with borders, labels, and validation
|
|
17
17
|
- **Borderless mode**: Clean, minimal appearance for dashboard widgets
|
|
18
18
|
- **Searchable / Clearable**: Optional search and clear functionality
|
|
19
|
-
- **Help icon**: Tooltip-based contextual help
|
|
19
|
+
- **Help icon**: Tooltip-based contextual help, a (?) icon to the right of the label
|
|
20
20
|
- **Optional label**: Shows "(Optional)" text next to the label
|
|
21
21
|
- **Error caption**: Separate error message prop for controlled error display
|
|
22
22
|
`,
|