@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,52 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Tooltip, Button, Stack } from '@appdirect/design-system';
3
+
4
+ const meta: Meta<typeof Tooltip> = {
5
+ title: 'Design System/Overlays/Tooltip',
6
+ component: Tooltip,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ tags: ['autodocs', 'code-connected'],
11
+ argTypes: {
12
+ position: {
13
+ control: 'select',
14
+ options: ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'right'],
15
+ },
16
+ label: {
17
+ control: 'text',
18
+ },
19
+ },
20
+ };
21
+
22
+ export default meta;
23
+ type Story = StoryObj<typeof meta>;
24
+
25
+ export const Default: Story = {
26
+ args: {
27
+ label: 'Tooltip text',
28
+ children: <Button>Hover me</Button>,
29
+ position: 'top',
30
+ },
31
+ };
32
+
33
+ export const Positions: Story = {
34
+ render: () => (
35
+ <Stack gap="xl" align="center">
36
+ <div style={{ display: 'flex', gap: 16 }}>
37
+ <Tooltip label="Top start" position="top-start"><Button variant="outline" size="sm">Top Start</Button></Tooltip>
38
+ <Tooltip label="Top" position="top"><Button variant="outline" size="sm">Top</Button></Tooltip>
39
+ <Tooltip label="Top end" position="top-end"><Button variant="outline" size="sm">Top End</Button></Tooltip>
40
+ </div>
41
+ <div style={{ display: 'flex', gap: 16 }}>
42
+ <Tooltip label="Left" position="left"><Button variant="outline" size="sm">Left</Button></Tooltip>
43
+ <Tooltip label="Right" position="right"><Button variant="outline" size="sm">Right</Button></Tooltip>
44
+ </div>
45
+ <div style={{ display: 'flex', gap: 16 }}>
46
+ <Tooltip label="Bottom start" position="bottom-start"><Button variant="outline" size="sm">Bottom Start</Button></Tooltip>
47
+ <Tooltip label="Bottom" position="bottom"><Button variant="outline" size="sm">Bottom</Button></Tooltip>
48
+ <Tooltip label="Bottom end" position="bottom-end"><Button variant="outline" size="sm">Bottom End</Button></Tooltip>
49
+ </div>
50
+ </Stack>
51
+ ),
52
+ };
@@ -0,0 +1,368 @@
1
+ import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2
+ import { Stack } from '@mantine/core';
3
+ import { Code, Title, Text } from '@appdirect/design-system';
4
+
5
+ const meta: Meta<typeof Code> = {
6
+ title: 'Design System/Typography/Code',
7
+ component: Code,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component: 'Code component for displaying inline code snippets with consistent styling.',
13
+ },
14
+ },
15
+ },
16
+ tags: ['autodocs', 'code-connected'],
17
+ argTypes: {
18
+ size: {
19
+ control: 'select',
20
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
21
+ description: 'Size of the code text',
22
+ },
23
+ color: {
24
+ control: 'text',
25
+ description: 'Text color',
26
+ },
27
+ bg: {
28
+ control: 'text',
29
+ description: 'Background color',
30
+ },
31
+ children: {
32
+ control: 'text',
33
+ description: 'Code content',
34
+ },
35
+ },
36
+ };
37
+
38
+ export default meta;
39
+ type Story = StoryObj<typeof meta>;
40
+
41
+ export const Default: Story = {
42
+ args: {
43
+ children: 'console.log("Hello World")',
44
+ },
45
+ };
46
+
47
+ export const Sizes: Story = {
48
+ render: () => (
49
+ <Stack gap="md" align="flex-start">
50
+ <div>
51
+ <Text size="sm" fw={500} mb="xs">Extra Small (xs):</Text>
52
+ <Code size="xs">npm install @mantine/core</Code>
53
+ </div>
54
+
55
+ <div>
56
+ <Text size="sm" fw={500} mb="xs">Small (sm) - Default:</Text>
57
+ <Code size="sm">import React from 'react'</Code>
58
+ </div>
59
+
60
+ <div>
61
+ <Text size="sm" fw={500} mb="xs">Medium (md):</Text>
62
+ <Code size="md">const [count, setCount] = useState(0)</Code>
63
+ </div>
64
+
65
+ <div>
66
+ <Text size="sm" fw={500} mb="xs">Large (lg):</Text>
67
+ <Code size="lg">function App() {`{ return <div>Hello</div> }`}</Code>
68
+ </div>
69
+
70
+ <div>
71
+ <Text size="sm" fw={500} mb="xs">Extra Large (xl):</Text>
72
+ <Code size="xl">git commit -m "Initial commit"</Code>
73
+ </div>
74
+ </Stack>
75
+ ),
76
+ parameters: {
77
+ docs: {
78
+ description: {
79
+ story: 'Different sizes for the Code component.',
80
+ },
81
+ },
82
+ },
83
+ };
84
+
85
+ export const InlineUsage: Story = {
86
+ render: () => (
87
+ <Stack gap="md" w={500}>
88
+ <Text>
89
+ To install the package, run <Code>npm install react</Code> in your terminal.
90
+ </Text>
91
+
92
+ <Text>
93
+ The <Code>useState</Code> hook allows you to add state to functional components.
94
+ </Text>
95
+
96
+ <Text>
97
+ Use the <Code>className</Code> prop to apply custom CSS classes to your components.
98
+ </Text>
99
+
100
+ <Text>
101
+ The API endpoint is available at <Code>/api/v1/users</Code> for user management.
102
+ </Text>
103
+
104
+ <Text>
105
+ Set the environment variable <Code>NODE_ENV=production</Code> for production builds.
106
+ </Text>
107
+ </Stack>
108
+ ),
109
+ parameters: {
110
+ docs: {
111
+ description: {
112
+ story: 'Code component used inline within text content.',
113
+ },
114
+ },
115
+ },
116
+ };
117
+
118
+ export const CommandExamples: Story = {
119
+ render: () => (
120
+ <Stack gap="md" align="flex-start">
121
+ <div>
122
+ <Text size="sm" fw={500} mb="xs">Package Management:</Text>
123
+ <Stack gap="xs" align="flex-start">
124
+ <Code>npm install</Code>
125
+ <Code>yarn add @mantine/core</Code>
126
+ <Code>pnpm install --frozen-lockfile</Code>
127
+ </Stack>
128
+ </div>
129
+
130
+ <div>
131
+ <Text size="sm" fw={500} mb="xs">Git Commands:</Text>
132
+ <Stack gap="xs" align="flex-start">
133
+ <Code>git status</Code>
134
+ <Code>git add .</Code>
135
+ <Code>git commit -m "Update components"</Code>
136
+ <Code>git push origin main</Code>
137
+ </Stack>
138
+ </div>
139
+
140
+ <div>
141
+ <Text size="sm" fw={500} mb="xs">Development Scripts:</Text>
142
+ <Stack gap="xs" align="flex-start">
143
+ <Code>npm run dev</Code>
144
+ <Code>npm run build</Code>
145
+ <Code>npm run test</Code>
146
+ <Code>npm run lint</Code>
147
+ </Stack>
148
+ </div>
149
+ </Stack>
150
+ ),
151
+ parameters: {
152
+ docs: {
153
+ description: {
154
+ story: 'Code component displaying various command examples.',
155
+ },
156
+ },
157
+ },
158
+ };
159
+
160
+ export const CodeSnippets: Story = {
161
+ render: () => (
162
+ <Stack gap="md" align="flex-start">
163
+ <div>
164
+ <Text size="sm" fw={500} mb="xs">JavaScript:</Text>
165
+ <Stack gap="xs" align="flex-start">
166
+ <Code>const name = "John Doe"</Code>
167
+ <Code>array.map(item =&gt; item.id)</Code>
168
+ <Code>fetch('/api/data').then(res =&gt; res.json())</Code>
169
+ </Stack>
170
+ </div>
171
+
172
+ <div>
173
+ <Text size="sm" fw={500} mb="xs">React:</Text>
174
+ <Stack gap="xs" align="flex-start">
175
+ <Code>import React from 'react'</Code>
176
+ <Code>const [state, setState] = useState()</Code>
177
+ <Code>useEffect(() =&gt; {`{}`}, [])</Code>
178
+ </Stack>
179
+ </div>
180
+
181
+ <div>
182
+ <Text size="sm" fw={500} mb="xs">CSS:</Text>
183
+ <Stack gap="xs" align="flex-start">
184
+ <Code>display: flex</Code>
185
+ <Code>justify-content: center</Code>
186
+ <Code>margin: 0 auto</Code>
187
+ </Stack>
188
+ </div>
189
+
190
+ <div>
191
+ <Text size="sm" fw={500} mb="xs">HTML:</Text>
192
+ <Stack gap="xs" align="flex-start">
193
+ <Code>&lt;div className="container"&gt;</Code>
194
+ <Code>&lt;button onClick={`{handleClick}`}&gt;</Code>
195
+ <Code>&lt;input type="text" placeholder="Enter name" /&gt;</Code>
196
+ </Stack>
197
+ </div>
198
+ </Stack>
199
+ ),
200
+ parameters: {
201
+ docs: {
202
+ description: {
203
+ story: 'Code component displaying various programming language snippets.',
204
+ },
205
+ },
206
+ },
207
+ };
208
+
209
+ export const FilePathsAndUrls: Story = {
210
+ render: () => (
211
+ <Stack gap="md" align="flex-start">
212
+ <div>
213
+ <Text size="sm" fw={500} mb="xs">File Paths:</Text>
214
+ <Stack gap="xs" align="flex-start">
215
+ <Code>/src/components/Button.tsx</Code>
216
+ <Code>./utils/helpers.js</Code>
217
+ <Code>../assets/images/logo.png</Code>
218
+ <Code>~/Documents/projects/app</Code>
219
+ </Stack>
220
+ </div>
221
+
222
+ <div>
223
+ <Text size="sm" fw={500} mb="xs">URLs and Endpoints:</Text>
224
+ <Stack gap="xs" align="flex-start">
225
+ <Code>https://api.example.com</Code>
226
+ <Code>/api/v1/users</Code>
227
+ <Code>localhost:3000</Code>
228
+ <Code>https://github.com/user/repo</Code>
229
+ </Stack>
230
+ </div>
231
+
232
+ <div>
233
+ <Text size="sm" fw={500} mb="xs">Environment Variables:</Text>
234
+ <Stack gap="xs" align="flex-start">
235
+ <Code>NODE_ENV=production</Code>
236
+ <Code>API_KEY=your_api_key_here</Code>
237
+ <Code>DATABASE_URL=postgresql://...</Code>
238
+ <Code>PORT=3000</Code>
239
+ </Stack>
240
+ </div>
241
+ </Stack>
242
+ ),
243
+ parameters: {
244
+ docs: {
245
+ description: {
246
+ story: 'Code component displaying file paths, URLs, and environment variables.',
247
+ },
248
+ },
249
+ },
250
+ };
251
+
252
+ export const DocumentationExamples: Story = {
253
+ render: () => (
254
+ <Stack gap="lg" w={600}>
255
+ <div>
256
+ <Title order={4} size="sm" fw={500} mb="sm">Installation</Title>
257
+ <Text mb="sm">
258
+ Install the required dependencies using your preferred package manager:
259
+ </Text>
260
+ <Code>npm install @mantine/core @mantine/hooks</Code>
261
+ </div>
262
+
263
+ <div>
264
+ <Title order={4} size="sm" fw={500} mb="sm">Basic Usage</Title>
265
+ <Text mb="sm">
266
+ Import the component and use it in your React application:
267
+ </Text>
268
+ <Code>import {`{ Button }`} from '@mantine/core'</Code>
269
+ </div>
270
+
271
+ <div>
272
+ <Title order={4} size="sm" fw={500} mb="sm">Configuration</Title>
273
+ <Text mb="sm">
274
+ Add the following configuration to your <Code>package.json</Code> file:
275
+ </Text>
276
+ <Code>"scripts": {`{ "dev": "next dev", "build": "next build" }`}</Code>
277
+ </div>
278
+
279
+ <div>
280
+ <Title order={4} size="sm" fw={500} mb="sm">API Reference</Title>
281
+ <Text mb="sm">
282
+ The component accepts the following props: <Code>variant</Code>, <Code>size</Code>, and <Code>disabled</Code>.
283
+ </Text>
284
+ </div>
285
+ </Stack>
286
+ ),
287
+ parameters: {
288
+ docs: {
289
+ description: {
290
+ story: 'Code component used in documentation and instructional content.',
291
+ },
292
+ },
293
+ },
294
+ };
295
+
296
+ export const UseCases: Story = {
297
+ render: () => (
298
+ <Stack gap="xl" w={700}>
299
+ <Title order={3} size="md" fw={500} mb="xs">Common Use Cases</Title>
300
+
301
+ <div>
302
+ <Text size="sm" fw={500} mb="sm">1. Tutorial Steps:</Text>
303
+ <Stack gap="sm">
304
+ <Text>1. Create a new React component: <Code>touch Button.tsx</Code></Text>
305
+ <Text>2. Import React: <Code>import React from 'react'</Code></Text>
306
+ <Text>3. Export your component: <Code>export default Button</Code></Text>
307
+ </Stack>
308
+ </div>
309
+
310
+ <div>
311
+ <Text size="sm" fw={500} mb="sm">2. Error Messages:</Text>
312
+ <Stack gap="sm">
313
+ <Text>
314
+ Module not found: <Code>Cannot resolve './components/Button'</Code>
315
+ </Text>
316
+ <Text>
317
+ Syntax error: <Code>Unexpected token</Code> on line 15
318
+ </Text>
319
+ </Stack>
320
+ </div>
321
+
322
+ <div>
323
+ <Text size="sm" fw={500} mb="sm">3. Configuration Examples:</Text>
324
+ <Stack gap="sm">
325
+ <Text>
326
+ Set your API base URL: <Code>REACT_APP_API_URL=https://api.example.com</Code>
327
+ </Text>
328
+ <Text>
329
+ Configure the build output: <Code>BUILD_PATH=./dist</Code>
330
+ </Text>
331
+ </Stack>
332
+ </div>
333
+
334
+ <div>
335
+ <Text size="sm" fw={500} mb="sm">4. Code References:</Text>
336
+ <Stack gap="sm">
337
+ <Text>
338
+ The <Code>handleSubmit</Code> function is called when the form is submitted.
339
+ </Text>
340
+ <Text>
341
+ Use the <Code>isLoading</Code> state to show loading indicators.
342
+ </Text>
343
+ </Stack>
344
+ </div>
345
+ </Stack>
346
+ ),
347
+ parameters: {
348
+ docs: {
349
+ description: {
350
+ story: 'Real-world examples of Code component usage in different contexts.',
351
+ },
352
+ },
353
+ },
354
+ };
355
+
356
+ export const Interactive: Story = {
357
+ args: {
358
+ children: 'Interactive Code Example',
359
+ size: 'sm',
360
+ },
361
+ parameters: {
362
+ docs: {
363
+ description: {
364
+ story: 'Use the controls below to interact with the Code component and see different combinations.',
365
+ },
366
+ },
367
+ },
368
+ };