@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
|
@@ -10,7 +10,7 @@ const meta: Meta<typeof CopyButton> = {
|
|
|
10
10
|
layout: 'centered',
|
|
11
11
|
docs: {
|
|
12
12
|
description: {
|
|
13
|
-
component:
|
|
13
|
+
component: `A reusable button component with copy-to-clipboard functionality and interactive tooltips. Built on Mantine's CopyButton: clicking copies the value and the tooltip shows "Copied" briefly.`,
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -43,7 +43,6 @@ export const Default: Story = {
|
|
|
43
43
|
value: 'Hello World',
|
|
44
44
|
label: 'Text',
|
|
45
45
|
onCopy: (value) => {
|
|
46
|
-
navigator.clipboard.writeText(value);
|
|
47
46
|
console.log('Copied:', value);
|
|
48
47
|
},
|
|
49
48
|
},
|
|
@@ -54,7 +53,6 @@ export const BasicUsage: Story = {
|
|
|
54
53
|
const [copyStatus, setCopyStatus] = useState<string>('');
|
|
55
54
|
|
|
56
55
|
const handleCopy = (value: string, context: string) => {
|
|
57
|
-
navigator.clipboard.writeText(value);
|
|
58
56
|
setCopyStatus(`Copied ${context}: ${value}`);
|
|
59
57
|
setTimeout(() => setCopyStatus(''), 3000);
|
|
60
58
|
};
|
|
@@ -122,8 +120,7 @@ export const DifferentSizes: Story = {
|
|
|
122
120
|
value="Small icon"
|
|
123
121
|
label="small text"
|
|
124
122
|
iconSize={16}
|
|
125
|
-
|
|
126
|
-
/>
|
|
123
|
+
/>
|
|
127
124
|
</Stack>
|
|
128
125
|
|
|
129
126
|
<Stack gap="xs" align="center">
|
|
@@ -131,8 +128,7 @@ export const DifferentSizes: Story = {
|
|
|
131
128
|
<CopyButton
|
|
132
129
|
value="Default icon"
|
|
133
130
|
label="default text"
|
|
134
|
-
|
|
135
|
-
/>
|
|
131
|
+
/>
|
|
136
132
|
</Stack>
|
|
137
133
|
|
|
138
134
|
<Stack gap="xs" align="center">
|
|
@@ -141,8 +137,7 @@ export const DifferentSizes: Story = {
|
|
|
141
137
|
value="Large icon"
|
|
142
138
|
label="large text"
|
|
143
139
|
iconSize={32}
|
|
144
|
-
|
|
145
|
-
/>
|
|
140
|
+
/>
|
|
146
141
|
</Stack>
|
|
147
142
|
</Inline>
|
|
148
143
|
</Stack>
|
|
@@ -161,7 +156,6 @@ export const WithCodeSnippets: Story = {
|
|
|
161
156
|
const [copyStatus, setCopyStatus] = useState<string>('');
|
|
162
157
|
|
|
163
158
|
const handleCopy = (value: string, type: string) => {
|
|
164
|
-
navigator.clipboard.writeText(value);
|
|
165
159
|
setCopyStatus(`Copied ${type}`);
|
|
166
160
|
setTimeout(() => setCopyStatus(''), 3000);
|
|
167
161
|
};
|
|
@@ -226,7 +220,6 @@ export const CredentialsExample: Story = {
|
|
|
226
220
|
const [copyStatus, setCopyStatus] = useState<string>('');
|
|
227
221
|
|
|
228
222
|
const handleCopy = (value: string, type: string) => {
|
|
229
|
-
navigator.clipboard.writeText(value);
|
|
230
223
|
setCopyStatus(`Copied ${type}`);
|
|
231
224
|
setTimeout(() => setCopyStatus(''), 2000);
|
|
232
225
|
};
|
|
@@ -300,7 +293,6 @@ export const WithInputFields: Story = {
|
|
|
300
293
|
});
|
|
301
294
|
|
|
302
295
|
const handleCopy = (value: string, field: string) => {
|
|
303
|
-
navigator.clipboard.writeText(value);
|
|
304
296
|
setCopyStatus(`Copied ${field}`);
|
|
305
297
|
setTimeout(() => setCopyStatus(''), 2000);
|
|
306
298
|
};
|
|
@@ -390,7 +382,6 @@ export const SystemInformation: Story = {
|
|
|
390
382
|
const [copyStatus, setCopyStatus] = useState<string>('');
|
|
391
383
|
|
|
392
384
|
const handleCopy = (value: string, type: string) => {
|
|
393
|
-
navigator.clipboard.writeText(value);
|
|
394
385
|
setCopyStatus(`Copied ${type}`);
|
|
395
386
|
setTimeout(() => setCopyStatus(''), 2000);
|
|
396
387
|
};
|
|
@@ -465,7 +456,6 @@ export const Interactive: Story = {
|
|
|
465
456
|
label: 'example text',
|
|
466
457
|
iconSize: 24,
|
|
467
458
|
onCopy: (value) => {
|
|
468
|
-
navigator.clipboard.writeText(value);
|
|
469
459
|
console.log('Copied:', value);
|
|
470
460
|
},
|
|
471
461
|
},
|
|
@@ -33,6 +33,8 @@ const meta: Meta<typeof ColorInput> = {
|
|
|
33
33
|
control: 'boolean',
|
|
34
34
|
description: 'Required field (shows asterisk)',
|
|
35
35
|
},
|
|
36
|
+
hasHelpIcon: { control: 'boolean' },
|
|
37
|
+
helpIconLabel: { control: 'text' },
|
|
36
38
|
showOptional: {
|
|
37
39
|
control: 'boolean',
|
|
38
40
|
description: 'Show "(Optional)" text after label',
|
|
@@ -75,6 +77,16 @@ export const Default: Story = {
|
|
|
75
77
|
},
|
|
76
78
|
};
|
|
77
79
|
|
|
80
|
+
export const WithHelpIcon: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
label: 'Brand color',
|
|
83
|
+
placeholder: '#000000',
|
|
84
|
+
required: true,
|
|
85
|
+
hasHelpIcon: true,
|
|
86
|
+
helpIconLabel: 'More information about this field',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
78
90
|
export const Sizes: Story = {
|
|
79
91
|
render: () => (
|
|
80
92
|
<Stack gap="md" w={300}>
|
|
@@ -33,6 +33,8 @@ const meta: Meta<typeof NumberInput> = {
|
|
|
33
33
|
control: 'boolean',
|
|
34
34
|
description: 'Required field (shows asterisk)',
|
|
35
35
|
},
|
|
36
|
+
hasHelpIcon: { control: 'boolean' },
|
|
37
|
+
helpIconLabel: { control: 'text' },
|
|
36
38
|
showOptional: {
|
|
37
39
|
control: 'boolean',
|
|
38
40
|
description: 'Show "(Optional)" text after label',
|
|
@@ -82,6 +84,16 @@ export const Default: Story = {
|
|
|
82
84
|
},
|
|
83
85
|
};
|
|
84
86
|
|
|
87
|
+
export const WithHelpIcon: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
label: 'Quantity',
|
|
90
|
+
placeholder: 'Enter a number',
|
|
91
|
+
required: true,
|
|
92
|
+
hasHelpIcon: true,
|
|
93
|
+
helpIconLabel: 'More information about this field',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
85
97
|
export const Sizes: Story = {
|
|
86
98
|
render: () => (
|
|
87
99
|
<Stack gap="md" w={300}>
|
|
@@ -52,6 +52,11 @@ export default meta;
|
|
|
52
52
|
type Story = StoryObj<typeof meta>;
|
|
53
53
|
|
|
54
54
|
export const Default: Story = {
|
|
55
|
+
render: args => (
|
|
56
|
+
<Stack gap="xs">
|
|
57
|
+
<Radio {...args} />
|
|
58
|
+
</Stack>
|
|
59
|
+
),
|
|
55
60
|
args: {
|
|
56
61
|
label: 'Select this option',
|
|
57
62
|
value: 'option1',
|
|
@@ -62,8 +67,8 @@ export const Sizes: Story = {
|
|
|
62
67
|
render: () => (
|
|
63
68
|
<Stack gap="md">
|
|
64
69
|
<Radio size="xs" label="Extra Small" value="xs" />
|
|
65
|
-
<Radio size="sm" label="Small" value="sm" />
|
|
66
|
-
<Radio size="md" label="Medium
|
|
70
|
+
<Radio size="sm" label="Small (Default)" value="sm" />
|
|
71
|
+
<Radio size="md" label="Medium" value="md" />
|
|
67
72
|
<Radio size="lg" label="Large" value="lg" />
|
|
68
73
|
<Radio size="xl" label="Extra Large" value="xl" />
|
|
69
74
|
</Stack>
|
|
@@ -127,7 +132,7 @@ export const RadioGroupSizes: Story = {
|
|
|
127
132
|
</RadioGroup>
|
|
128
133
|
|
|
129
134
|
<RadioGroup
|
|
130
|
-
label="Small"
|
|
135
|
+
label="Small (Default)"
|
|
131
136
|
size="sm"
|
|
132
137
|
value={value}
|
|
133
138
|
onChange={(v) => setValue(String(v))}
|
|
@@ -139,7 +144,7 @@ export const RadioGroupSizes: Story = {
|
|
|
139
144
|
</RadioGroup>
|
|
140
145
|
|
|
141
146
|
<RadioGroup
|
|
142
|
-
label="Medium
|
|
147
|
+
label="Medium"
|
|
143
148
|
size="md"
|
|
144
149
|
value={value}
|
|
145
150
|
onChange={(v) => setValue(String(v))}
|
|
@@ -422,7 +427,7 @@ export const Interactive: Story = {
|
|
|
422
427
|
args: {
|
|
423
428
|
label: 'Interactive Radio',
|
|
424
429
|
value: 'interactive',
|
|
425
|
-
size: '
|
|
430
|
+
size: 'sm',
|
|
426
431
|
checked: false,
|
|
427
432
|
disabled: false,
|
|
428
433
|
required: false,
|
|
@@ -49,9 +49,11 @@ export const Default: Story = {
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<RadioGroup label="Choose an option" value={value} onChange={(v) => setValue(String(v))}>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
<Stack gap="xs">
|
|
53
|
+
<Radio value="option1" label="First option" />
|
|
54
|
+
<Radio value="option2" label="Second option" />
|
|
55
|
+
<Radio value="option3" label="Third option" />
|
|
56
|
+
</Stack>
|
|
55
57
|
</RadioGroup>
|
|
56
58
|
);
|
|
57
59
|
},
|
|
@@ -80,9 +82,11 @@ export const Sizes: Story = {
|
|
|
80
82
|
value={values[size]}
|
|
81
83
|
onChange={(val) => setValues(prev => ({ ...prev, [size]: String(val) }))}
|
|
82
84
|
>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
<Stack gap="xs">
|
|
86
|
+
<Radio value="option1" label="First option" />
|
|
87
|
+
<Radio value="option2" label="Second option" />
|
|
88
|
+
<Radio value="option3" label="Third option" />
|
|
89
|
+
</Stack>
|
|
86
90
|
</RadioGroup>
|
|
87
91
|
</div>
|
|
88
92
|
))}
|
|
@@ -109,9 +113,11 @@ export const WithDescription: Story = {
|
|
|
109
113
|
value={value}
|
|
110
114
|
onChange={(v) => setValue(String(v))}
|
|
111
115
|
>
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
<Stack gap="xs">
|
|
117
|
+
<Radio value="basic" label="Basic - $9/month" />
|
|
118
|
+
<Radio value="pro" label="Pro - $29/month" />
|
|
119
|
+
<Radio value="enterprise" label="Enterprise - $99/month" />
|
|
120
|
+
</Stack>
|
|
115
121
|
</RadioGroup>
|
|
116
122
|
);
|
|
117
123
|
},
|
|
@@ -136,10 +142,12 @@ export const Required: Story = {
|
|
|
136
142
|
value={value}
|
|
137
143
|
onChange={(v) => setValue(String(v))}
|
|
138
144
|
>
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
<Stack gap="xs">
|
|
146
|
+
<Radio value="card" label="Credit Card" />
|
|
147
|
+
<Radio value="paypal" label="PayPal" />
|
|
148
|
+
<Radio value="bank" label="Bank Transfer" />
|
|
149
|
+
<Radio value="crypto" label="Cryptocurrency" />
|
|
150
|
+
</Stack>
|
|
143
151
|
</RadioGroup>
|
|
144
152
|
);
|
|
145
153
|
},
|
|
@@ -165,10 +173,12 @@ export const WithError: Story = {
|
|
|
165
173
|
value={value}
|
|
166
174
|
onChange={(v) => setValue(String(v))}
|
|
167
175
|
>
|
|
168
|
-
<
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
<Stack gap="xs">
|
|
177
|
+
<Radio value="standard" label="Standard Delivery (5-7 days)" />
|
|
178
|
+
<Radio value="express" label="Express Delivery (2-3 days)" />
|
|
179
|
+
<Radio value="overnight" label="Overnight Delivery" />
|
|
180
|
+
<Radio value="pickup" label="Store Pickup" />
|
|
181
|
+
</Stack>
|
|
172
182
|
</RadioGroup>
|
|
173
183
|
);
|
|
174
184
|
},
|
|
@@ -195,10 +205,12 @@ export const DisabledStates: Story = {
|
|
|
195
205
|
value={value}
|
|
196
206
|
onChange={(v) => setValue(String(v))}
|
|
197
207
|
>
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
208
|
+
<Stack gap="xs">
|
|
209
|
+
<Radio value="option1" label="Available option" />
|
|
210
|
+
<Radio value="option2" label="Selected option" />
|
|
211
|
+
<Radio value="option3" label="Disabled option" disabled />
|
|
212
|
+
<Radio value="option4" label="Another disabled option" disabled />
|
|
213
|
+
</Stack>
|
|
202
214
|
</RadioGroup>
|
|
203
215
|
</div>
|
|
204
216
|
</Stack>
|
|
@@ -250,10 +262,12 @@ export const FormIntegration: Story = {
|
|
|
250
262
|
value={formData.priority}
|
|
251
263
|
onChange={(val) => setFormData(prev => ({ ...prev, priority: String(val) }))}
|
|
252
264
|
>
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
265
|
+
<Stack gap="xs">
|
|
266
|
+
<Radio value="low" label="🟢 Low Priority" />
|
|
267
|
+
<Radio value="medium" label="🟡 Medium Priority" />
|
|
268
|
+
<Radio value="high" label="🟠 High Priority" />
|
|
269
|
+
<Radio value="urgent" label="🔴 Urgent" />
|
|
270
|
+
</Stack>
|
|
257
271
|
</RadioGroup>
|
|
258
272
|
|
|
259
273
|
<RadioGroup
|
|
@@ -264,10 +278,12 @@ export const FormIntegration: Story = {
|
|
|
264
278
|
value={formData.category}
|
|
265
279
|
onChange={(val) => setFormData(prev => ({ ...prev, category: String(val) }))}
|
|
266
280
|
>
|
|
267
|
-
<
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
281
|
+
<Stack gap="xs">
|
|
282
|
+
<Radio value="development" label="Development" />
|
|
283
|
+
<Radio value="design" label="Design" />
|
|
284
|
+
<Radio value="testing" label="Testing" />
|
|
285
|
+
<Radio value="documentation" label="Documentation" />
|
|
286
|
+
</Stack>
|
|
271
287
|
</RadioGroup>
|
|
272
288
|
|
|
273
289
|
<RadioGroup
|
|
@@ -278,9 +294,11 @@ export const FormIntegration: Story = {
|
|
|
278
294
|
value={formData.visibility}
|
|
279
295
|
onChange={(val) => setFormData(prev => ({ ...prev, visibility: String(val) }))}
|
|
280
296
|
>
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
|
|
297
|
+
<Stack gap="xs">
|
|
298
|
+
<Radio value="private" label="Private (Only me)" />
|
|
299
|
+
<Radio value="team" label="Team members" />
|
|
300
|
+
<Radio value="public" label="Everyone" />
|
|
301
|
+
</Stack>
|
|
284
302
|
</RadioGroup>
|
|
285
303
|
|
|
286
304
|
<Button variant="primary" onClick={handleSubmit}>
|
|
@@ -317,9 +335,11 @@ export const SettingsConfiguration: Story = {
|
|
|
317
335
|
value={settings.theme}
|
|
318
336
|
onChange={(val) => setSettings(prev => ({ ...prev, theme: String(val) }))}
|
|
319
337
|
>
|
|
320
|
-
<
|
|
321
|
-
|
|
322
|
-
|
|
338
|
+
<Stack gap="xs">
|
|
339
|
+
<Radio value="light" label="☀️ Light Theme" />
|
|
340
|
+
<Radio value="dark" label="🌙 Dark Theme" />
|
|
341
|
+
<Radio value="auto" label="🔄 Auto (System)" />
|
|
342
|
+
</Stack>
|
|
323
343
|
</RadioGroup>
|
|
324
344
|
|
|
325
345
|
<RadioGroup
|
|
@@ -328,10 +348,12 @@ export const SettingsConfiguration: Story = {
|
|
|
328
348
|
value={settings.notifications}
|
|
329
349
|
onChange={(val) => setSettings(prev => ({ ...prev, notifications: String(val) }))}
|
|
330
350
|
>
|
|
331
|
-
<
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
351
|
+
<Stack gap="xs">
|
|
352
|
+
<Radio value="all" label="All notifications" />
|
|
353
|
+
<Radio value="important" label="Important only" />
|
|
354
|
+
<Radio value="mentions" label="Mentions and replies" />
|
|
355
|
+
<Radio value="none" label="No notifications" />
|
|
356
|
+
</Stack>
|
|
335
357
|
</RadioGroup>
|
|
336
358
|
|
|
337
359
|
<RadioGroup
|
|
@@ -340,9 +362,11 @@ export const SettingsConfiguration: Story = {
|
|
|
340
362
|
value={settings.privacy}
|
|
341
363
|
onChange={(val) => setSettings(prev => ({ ...prev, privacy: String(val) }))}
|
|
342
364
|
>
|
|
343
|
-
<
|
|
344
|
-
|
|
345
|
-
|
|
365
|
+
<Stack gap="xs">
|
|
366
|
+
<Radio value="public" label="🌍 Public" />
|
|
367
|
+
<Radio value="friends" label="👥 Friends only" />
|
|
368
|
+
<Radio value="private" label="🔒 Private" />
|
|
369
|
+
</Stack>
|
|
346
370
|
</RadioGroup>
|
|
347
371
|
|
|
348
372
|
<RadioGroup
|
|
@@ -351,10 +375,12 @@ export const SettingsConfiguration: Story = {
|
|
|
351
375
|
value={settings.language}
|
|
352
376
|
onChange={(val) => setSettings(prev => ({ ...prev, language: String(val) }))}
|
|
353
377
|
>
|
|
354
|
-
<
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
378
|
+
<Stack gap="xs">
|
|
379
|
+
<Radio value="en" label="🇺🇸 English" />
|
|
380
|
+
<Radio value="es" label="🇪🇸 Spanish" />
|
|
381
|
+
<Radio value="fr" label="🇫🇷 French" />
|
|
382
|
+
<Radio value="de" label="🇩🇪 German" />
|
|
383
|
+
</Stack>
|
|
358
384
|
</RadioGroup>
|
|
359
385
|
</Stack>
|
|
360
386
|
);
|
|
@@ -387,11 +413,13 @@ export const SurveyQuestions: Story = {
|
|
|
387
413
|
value={answers.satisfaction}
|
|
388
414
|
onChange={(val) => setAnswers(prev => ({ ...prev, satisfaction: String(val) }))}
|
|
389
415
|
>
|
|
390
|
-
<
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
416
|
+
<Stack gap="xs">
|
|
417
|
+
<Radio value="very-satisfied" label="😊 Very Satisfied" />
|
|
418
|
+
<Radio value="satisfied" label="🙂 Satisfied" />
|
|
419
|
+
<Radio value="neutral" label="😐 Neutral" />
|
|
420
|
+
<Radio value="dissatisfied" label="🙁 Dissatisfied" />
|
|
421
|
+
<Radio value="very-dissatisfied" label="😞 Very Dissatisfied" />
|
|
422
|
+
</Stack>
|
|
395
423
|
</RadioGroup>
|
|
396
424
|
|
|
397
425
|
<RadioGroup
|
|
@@ -414,11 +442,13 @@ export const SurveyQuestions: Story = {
|
|
|
414
442
|
value={answers.frequency}
|
|
415
443
|
onChange={(val) => setAnswers(prev => ({ ...prev, frequency: String(val) }))}
|
|
416
444
|
>
|
|
417
|
-
<
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
445
|
+
<Stack gap="xs">
|
|
446
|
+
<Radio value="daily" label="Daily" />
|
|
447
|
+
<Radio value="weekly" label="Weekly" />
|
|
448
|
+
<Radio value="monthly" label="Monthly" />
|
|
449
|
+
<Radio value="rarely" label="Rarely" />
|
|
450
|
+
<Radio value="first-time" label="This is my first time" />
|
|
451
|
+
</Stack>
|
|
422
452
|
</RadioGroup>
|
|
423
453
|
|
|
424
454
|
<RadioGroup
|
|
@@ -426,12 +456,14 @@ export const SurveyQuestions: Story = {
|
|
|
426
456
|
value={answers.improvement}
|
|
427
457
|
onChange={(val) => setAnswers(prev => ({ ...prev, improvement: String(val) }))}
|
|
428
458
|
>
|
|
429
|
-
<
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
459
|
+
<Stack gap="xs">
|
|
460
|
+
<Radio value="speed" label="Speed and performance" />
|
|
461
|
+
<Radio value="features" label="Features and functionality" />
|
|
462
|
+
<Radio value="design" label="User interface design" />
|
|
463
|
+
<Radio value="support" label="Customer support" />
|
|
464
|
+
<Radio value="pricing" label="Pricing" />
|
|
465
|
+
<Radio value="other" label="Other" />
|
|
466
|
+
</Stack>
|
|
435
467
|
</RadioGroup>
|
|
436
468
|
</Stack>
|
|
437
469
|
);
|
|
@@ -453,38 +485,46 @@ export const UseCases: Story = {
|
|
|
453
485
|
<div>
|
|
454
486
|
<Text size="sm" fw={500} mb="sm">1. Payment Methods:</Text>
|
|
455
487
|
<RadioGroup label="Payment Method" defaultValue="card">
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
488
|
+
<Stack gap="xs">
|
|
489
|
+
<Radio value="card" label="💳 Credit/Debit Card" />
|
|
490
|
+
<Radio value="paypal" label="🅿️ PayPal" />
|
|
491
|
+
<Radio value="apple" label="🍎 Apple Pay" />
|
|
492
|
+
<Radio value="google" label="🔵 Google Pay" />
|
|
493
|
+
</Stack>
|
|
460
494
|
</RadioGroup>
|
|
461
495
|
</div>
|
|
462
496
|
|
|
463
497
|
<div>
|
|
464
498
|
<Text size="sm" fw={500} mb="sm">2. Shipping Options:</Text>
|
|
465
499
|
<RadioGroup label="Delivery Speed" defaultValue="standard">
|
|
466
|
-
<
|
|
467
|
-
|
|
468
|
-
|
|
500
|
+
<Stack gap="xs">
|
|
501
|
+
<Radio value="standard" label="📦 Standard (5-7 days) - Free" />
|
|
502
|
+
<Radio value="express" label="⚡ Express (2-3 days) - $9.99" />
|
|
503
|
+
<Radio value="overnight" label="🚀 Overnight - $24.99" />
|
|
504
|
+
</Stack>
|
|
469
505
|
</RadioGroup>
|
|
470
506
|
</div>
|
|
471
507
|
|
|
472
508
|
<div>
|
|
473
509
|
<Text size="sm" fw={500} mb="sm">3. Account Types:</Text>
|
|
474
510
|
<RadioGroup label="Account Type" defaultValue="personal">
|
|
475
|
-
<
|
|
476
|
-
|
|
477
|
-
|
|
511
|
+
<Stack gap="xs">
|
|
512
|
+
<Radio value="personal" label="👤 Personal Account" />
|
|
513
|
+
<Radio value="business" label="🏢 Business Account" />
|
|
514
|
+
<Radio value="enterprise" label="🏭 Enterprise Account" />
|
|
515
|
+
</Stack>
|
|
478
516
|
</RadioGroup>
|
|
479
517
|
</div>
|
|
480
518
|
|
|
481
519
|
<div>
|
|
482
520
|
<Text size="sm" fw={500} mb="sm">4. Contact Preferences:</Text>
|
|
483
521
|
<RadioGroup label="Preferred Contact Method" defaultValue="email">
|
|
484
|
-
<
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
522
|
+
<Stack gap="xs">
|
|
523
|
+
<Radio value="email" label="📧 Email" />
|
|
524
|
+
<Radio value="phone" label="📞 Phone" />
|
|
525
|
+
<Radio value="sms" label="💬 SMS" />
|
|
526
|
+
<Radio value="none" label="🚫 Do not contact" />
|
|
527
|
+
</Stack>
|
|
488
528
|
</RadioGroup>
|
|
489
529
|
</div>
|
|
490
530
|
</Stack>
|
|
@@ -503,16 +543,18 @@ export const Interactive: Story = {
|
|
|
503
543
|
label: 'Interactive RadioGroup',
|
|
504
544
|
description: 'Use the controls to modify this RadioGroup',
|
|
505
545
|
required: false,
|
|
506
|
-
size: '
|
|
546
|
+
size: 'sm',
|
|
507
547
|
},
|
|
508
548
|
render: (args) => {
|
|
509
549
|
const [value, setValue] = useState<string>('');
|
|
510
550
|
|
|
511
551
|
return (
|
|
512
552
|
<RadioGroup {...args} value={value} onChange={(v) => setValue(String(v))}>
|
|
513
|
-
<
|
|
514
|
-
|
|
515
|
-
|
|
553
|
+
<Stack gap="xs">
|
|
554
|
+
<Radio value="option1" label="First option" />
|
|
555
|
+
<Radio value="option2" label="Second option" />
|
|
556
|
+
<Radio value="option3" label="Third option" />
|
|
557
|
+
</Stack>
|
|
516
558
|
</RadioGroup>
|
|
517
559
|
);
|
|
518
560
|
},
|
|
@@ -33,6 +33,8 @@ const meta: Meta<typeof TextArea> = {
|
|
|
33
33
|
control: 'boolean',
|
|
34
34
|
description: 'Required field (shows asterisk)',
|
|
35
35
|
},
|
|
36
|
+
hasHelpIcon: { control: 'boolean' },
|
|
37
|
+
helpIconLabel: { control: 'text' },
|
|
36
38
|
showOptional: {
|
|
37
39
|
control: 'boolean',
|
|
38
40
|
description: 'Show "(Optional)" text after label',
|
|
@@ -78,6 +80,16 @@ export const Default: Story = {
|
|
|
78
80
|
},
|
|
79
81
|
};
|
|
80
82
|
|
|
83
|
+
export const WithHelpIcon: Story = {
|
|
84
|
+
args: {
|
|
85
|
+
label: 'Comments',
|
|
86
|
+
placeholder: 'Enter your comments',
|
|
87
|
+
required: true,
|
|
88
|
+
hasHelpIcon: true,
|
|
89
|
+
helpIconLabel: 'More information about this field',
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
81
93
|
export const Sizes: Story = {
|
|
82
94
|
render: () => (
|
|
83
95
|
<Stack gap="md" w={400}>
|
|
@@ -34,6 +34,8 @@ const meta: Meta<typeof TextInput> = {
|
|
|
34
34
|
control: 'boolean',
|
|
35
35
|
description: 'Required field (shows asterisk)',
|
|
36
36
|
},
|
|
37
|
+
hasHelpIcon: { control: 'boolean' },
|
|
38
|
+
helpIconLabel: { control: 'text' },
|
|
37
39
|
showOptional: {
|
|
38
40
|
control: 'boolean',
|
|
39
41
|
description: 'Show "(Optional)" text after label',
|
|
@@ -63,6 +65,16 @@ export const Default: Story = {
|
|
|
63
65
|
},
|
|
64
66
|
};
|
|
65
67
|
|
|
68
|
+
export const WithHelpIcon: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
label: 'Name',
|
|
71
|
+
placeholder: 'Enter your name',
|
|
72
|
+
required: true,
|
|
73
|
+
hasHelpIcon: true,
|
|
74
|
+
helpIconLabel: 'More information about this field',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
66
78
|
export const Sizes: Story = {
|
|
67
79
|
render: () => (
|
|
68
80
|
<Stack gap="md" w={300}>
|