@appdirect/design-system 0.0.9 → 0.0.11

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 (64) hide show
  1. package/README.md +2 -0
  2. package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +24 -34
  3. package/dist/ComplexComponents/PageContentHeader/index.ts +0 -2
  4. package/dist/contracts/PageContentHeader.json +10 -5
  5. package/dist/contracts/index.json +1 -1
  6. package/dist/index.ts +3 -4
  7. package/dist/stories/Buttons/ActionIcon.stories.tsx +159 -0
  8. package/dist/stories/Buttons/Button.stories.tsx +145 -0
  9. package/dist/stories/Buttons/CloseButton.stories.tsx +121 -0
  10. package/dist/stories/Combobox/AutocompleteClearable.stories.tsx +554 -0
  11. package/dist/stories/Combobox/Combobox.stories.tsx +106 -0
  12. package/dist/stories/Combobox/Multiselect.stories.tsx +664 -0
  13. package/dist/stories/Combobox/SearchableSelect.stories.tsx +640 -0
  14. package/dist/stories/Combobox/Select.stories.tsx +311 -0
  15. package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +822 -0
  16. package/dist/stories/ComplexComponents/DataTable/DataTable.stories.tsx +502 -0
  17. package/dist/stories/ComplexComponents/KeyInsight/KeyInsights.stories.tsx +386 -0
  18. package/dist/stories/ComplexComponents/NameValue/NameValue.stories.tsx +405 -0
  19. package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +527 -0
  20. package/dist/stories/ComplexComponents/Placeholder/Placeholder.stories.tsx +76 -0
  21. package/dist/stories/ComplexComponents/Slat/Slat.stories.tsx +79 -0
  22. package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +479 -0
  23. package/dist/stories/DataDisplay/Alert.stories.tsx +296 -0
  24. package/dist/stories/DataDisplay/Avatar.stories.tsx +251 -0
  25. package/dist/stories/DataDisplay/Badge.stories.tsx +176 -0
  26. package/dist/stories/DataDisplay/Card.stories.tsx +406 -0
  27. package/dist/stories/DataDisplay/Chip.stories.tsx +495 -0
  28. package/dist/stories/DataDisplay/Indicator.stories.tsx +571 -0
  29. package/dist/stories/DataDisplay/List.stories.tsx +376 -0
  30. package/dist/stories/DataDisplay/Pill.stories.tsx +506 -0
  31. package/dist/stories/DataDisplay/Progress.stories.tsx +352 -0
  32. package/dist/stories/DataDisplay/Table.stories.tsx +346 -0
  33. package/dist/stories/DataDisplay/ThemeIcon.stories.tsx +125 -0
  34. package/dist/stories/Inputs/Checkbox.stories.tsx +263 -0
  35. package/dist/stories/Inputs/ColorInput.stories.tsx +434 -0
  36. package/dist/stories/Inputs/DropZone.stories.tsx +401 -0
  37. package/dist/stories/Inputs/FileInput.stories.tsx +383 -0
  38. package/dist/stories/Inputs/NumberInput.stories.tsx +342 -0
  39. package/dist/stories/Inputs/Radio.stories.tsx +437 -0
  40. package/dist/stories/Inputs/RadioGroup.stories.tsx +526 -0
  41. package/dist/stories/Inputs/SegmentedControl.stories.tsx +60 -0
  42. package/dist/stories/Inputs/Slider.stories.tsx +22 -0
  43. package/dist/stories/Inputs/SliderWithLabel.stories.tsx +37 -0
  44. package/dist/stories/Inputs/Switch.stories.tsx +361 -0
  45. package/dist/stories/Inputs/TextArea.stories.tsx +355 -0
  46. package/dist/stories/Inputs/TextInput.stories.tsx +266 -0
  47. package/dist/stories/Misc/Divider.stories.tsx +581 -0
  48. package/dist/stories/Misc/Paper.stories.tsx +557 -0
  49. package/dist/stories/Navigation/Breadcrumb.stories.tsx +489 -0
  50. package/dist/stories/Navigation/NavLink.stories.tsx +601 -0
  51. package/dist/stories/Navigation/Stepper.stories.tsx +413 -0
  52. package/dist/stories/Navigation/Tabs.stories.tsx +528 -0
  53. package/dist/stories/Overlays/Drawer.stories.tsx +802 -0
  54. package/dist/stories/Overlays/Menu.stories.tsx +941 -0
  55. package/dist/stories/Overlays/Modal.stories.tsx +249 -0
  56. package/dist/stories/Overlays/Popover.stories.tsx +780 -0
  57. package/dist/stories/Overlays/Tooltip.stories.tsx +52 -0
  58. package/dist/stories/Typography/Code.stories.tsx +368 -0
  59. package/dist/stories/Typography/Kbd.stories.tsx +514 -0
  60. package/dist/stories/Typography/Text.stories.tsx +117 -0
  61. package/dist/stories/Typography/Title.stories.tsx +112 -0
  62. package/dist/stories/index.json +1435 -0
  63. package/package.json +5 -3
  64. package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +0 -65
@@ -0,0 +1,266 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack } from '@mantine/core';
3
+ import { TextInput } from '@appdirect/design-system';
4
+ import { RiUserLine, RiMailLine, RiSearchLine, RiEyeLine, RiEyeOffLine } from '@remixicon/react';
5
+ import { useState } from 'react';
6
+
7
+ const meta: Meta<typeof TextInput> = {
8
+ title: 'Design System/Inputs/TextInput',
9
+ component: TextInput,
10
+ parameters: {
11
+ layout: 'centered',
12
+ docs: {
13
+ description: {
14
+ component: 'TextInput component with design system sizing, consistent styling, and enhanced label options.',
15
+ },
16
+ },
17
+ },
18
+ tags: ['autodocs', 'code-connected'],
19
+ argTypes: {
20
+ size: {
21
+ control: 'select',
22
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
23
+ description: 'Input size',
24
+ },
25
+ label: {
26
+ control: 'text',
27
+ description: 'Input label',
28
+ },
29
+ placeholder: {
30
+ control: 'text',
31
+ description: 'Placeholder text',
32
+ },
33
+ required: {
34
+ control: 'boolean',
35
+ description: 'Required field (shows asterisk)',
36
+ },
37
+ showOptional: {
38
+ control: 'boolean',
39
+ description: 'Show "(Optional)" text after label',
40
+ },
41
+ disabled: {
42
+ control: 'boolean',
43
+ description: 'Disabled state',
44
+ },
45
+ error: {
46
+ control: 'text',
47
+ description: 'Error message',
48
+ },
49
+ description: {
50
+ control: 'text',
51
+ description: 'Help text below input',
52
+ },
53
+ },
54
+ };
55
+
56
+ export default meta;
57
+ type Story = StoryObj<typeof meta>;
58
+
59
+ export const Default: Story = {
60
+ args: {
61
+ label: 'Name',
62
+ placeholder: 'Enter your name',
63
+ },
64
+ };
65
+
66
+ export const Sizes: Story = {
67
+ render: () => (
68
+ <Stack gap="md" w={300}>
69
+ <TextInput size="xs" label="Extra Small" placeholder="xs size" />
70
+ <TextInput size="sm" label="Small" placeholder="sm size" />
71
+ <TextInput size="md" label="Medium" placeholder="md size (default)" />
72
+ <TextInput size="lg" label="Large" placeholder="lg size" />
73
+ <TextInput size="xl" label="Extra Large" placeholder="xl size" />
74
+ </Stack>
75
+ ),
76
+ };
77
+
78
+ export const LabelVariants: Story = {
79
+ render: () => (
80
+ <Stack gap="md" w={300}>
81
+ <TextInput label="Required Field" placeholder="This field is required" required />
82
+ <TextInput label="Optional Field" placeholder="This field is optional" showOptional />
83
+ <TextInput placeholder="No label" />
84
+ </Stack>
85
+ ),
86
+ };
87
+
88
+ export const WithIcons: Story = {
89
+ render: () => (
90
+ <Stack gap="md" w={300}>
91
+ <TextInput
92
+ label="Search"
93
+ placeholder="Search..."
94
+ leftSection={<RiSearchLine size={16} />}
95
+ />
96
+ <TextInput
97
+ label="Email"
98
+ placeholder="your@email.com"
99
+ rightSection={<span>@</span>}
100
+ />
101
+ </Stack>
102
+ ),
103
+ };
104
+
105
+ export const States: Story = {
106
+ render: () => (
107
+ <Stack gap="md" w={300}>
108
+ <TextInput label="Default" placeholder="Enter text" />
109
+ <TextInput label="Disabled" placeholder="Disabled input" disabled />
110
+ <TextInput label="With Error" placeholder="Enter text" error="This field is required" />
111
+ </Stack>
112
+ ),
113
+ };
114
+
115
+ export const WithDescriptions: Story = {
116
+ render: () => (
117
+ <Stack gap="md" w={350}>
118
+ <TextInput
119
+ label="Username"
120
+ placeholder="Enter username"
121
+ description="Must be 3-20 characters long and contain only letters, numbers, and underscores"
122
+ required
123
+ />
124
+ <TextInput
125
+ label="Email Address"
126
+ placeholder="your@email.com"
127
+ type="email"
128
+ description="We'll never share your email with anyone else"
129
+ required
130
+ />
131
+ <TextInput
132
+ label="Website URL"
133
+ placeholder="https://example.com"
134
+ type="url"
135
+ description="Optional: Add your personal or company website"
136
+ showOptional
137
+ />
138
+ <TextInput
139
+ label="Phone Number"
140
+ placeholder="+1 (555) 123-4567"
141
+ type="tel"
142
+ description="Include country code for international numbers"
143
+ showOptional
144
+ />
145
+ <TextInput
146
+ label="API Key"
147
+ placeholder="sk-..."
148
+ description="Keep this secret! Never share your API key publicly"
149
+ error="Invalid API key format"
150
+ />
151
+ </Stack>
152
+ ),
153
+ parameters: {
154
+ docs: {
155
+ description: {
156
+ story: 'Examples of TextInput with description/help text to guide users on proper input format and requirements.',
157
+ },
158
+ },
159
+ },
160
+ };
161
+
162
+ export const PasswordExample: Story = {
163
+ render: () => {
164
+ const [showPassword, setShowPassword] = useState(false);
165
+
166
+ return (
167
+ <div style={{ width: '300px' }}>
168
+ <TextInput
169
+ label="Password"
170
+ placeholder="Enter password"
171
+ type={showPassword ? 'text' : 'password'}
172
+ required
173
+ rightSection={
174
+ <button
175
+ type="button"
176
+ onClick={() => setShowPassword(!showPassword)}
177
+ style={{
178
+ background: 'none',
179
+ border: 'none',
180
+ cursor: 'pointer',
181
+ display: 'flex',
182
+ alignItems: 'center',
183
+ color: 'var(--mantine-color-gray-6)',
184
+ }}
185
+ >
186
+ {showPassword ? <RiEyeOffLine size={16} /> : <RiEyeLine size={16} />}
187
+ </button>
188
+ }
189
+ />
190
+ </div>
191
+ );
192
+ },
193
+ parameters: {
194
+ docs: {
195
+ description: {
196
+ story: 'Example of a password input with toggle visibility functionality.',
197
+ },
198
+ },
199
+ },
200
+ };
201
+
202
+ export const Required: Story = {
203
+ render: () => (
204
+ <Stack gap="md" w={300}>
205
+ <TextInput
206
+ label="Required Field"
207
+ placeholder="This field is required"
208
+ required
209
+ />
210
+ <TextInput
211
+ label="Optional Field"
212
+ placeholder="This field is optional"
213
+ />
214
+ </Stack>
215
+ ),
216
+ };
217
+
218
+ export const FormExample: Story = {
219
+ render: () => (
220
+ <Stack gap="md" w={400}>
221
+ <TextInput
222
+ label="First Name"
223
+ placeholder="Enter your first name"
224
+ required
225
+ />
226
+ <TextInput
227
+ label="Last Name"
228
+ placeholder="Enter your last name"
229
+ required
230
+ />
231
+ <TextInput
232
+ label="Email"
233
+ placeholder="your@email.com"
234
+ type="email"
235
+ required
236
+ />
237
+ <TextInput
238
+ label="Phone"
239
+ placeholder="+1 (555) 123-4567"
240
+ type="tel"
241
+ />
242
+ </Stack>
243
+ ),
244
+ parameters: {
245
+ docs: {
246
+ description: {
247
+ story: 'Example of TextInput components used in a typical form layout.',
248
+ },
249
+ },
250
+ },
251
+ };
252
+
253
+ export const Interactive: Story = {
254
+ args: {
255
+ label: 'Interactive Input',
256
+ placeholder: 'Type something...',
257
+ size: 'md',
258
+ },
259
+ parameters: {
260
+ docs: {
261
+ description: {
262
+ story: 'Use the controls below to interact with the TextInput and see different combinations.',
263
+ },
264
+ },
265
+ },
266
+ };