@appdirect/design-system 0.0.10 → 0.0.12
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 +85 -5
- package/dist/Buttons/ActionIcon.js +14 -0
- package/dist/Buttons/Button.js +66 -0
- package/dist/Buttons/CloseButton.js +48 -0
- package/dist/Buttons/index.js +13 -0
- package/dist/Combobox/AutocompleteClearable.js +36 -0
- package/dist/Combobox/Combobox.js +28 -0
- package/dist/Combobox/Multiselect.js +31 -0
- package/dist/Combobox/SearchableSelect.js +43 -0
- package/dist/Combobox/Select.js +72 -0
- package/dist/Combobox/index.js +10 -0
- package/dist/ComplexComponents/DashboardWidget/DashboardWidget.js +96 -0
- package/dist/ComplexComponents/DashboardWidget/index.js +1 -0
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +82 -0
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/utils.js +23 -0
- package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/index.js +23 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +230 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterChip.js +30 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/DateRangeFilter.js +12 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterRenderer.js +32 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/FilterSystem.js +90 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/MultiSelectFilter.js +43 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/SingleSelectFilter.js +30 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/index.js +39 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/FilterSystem/types.js +9 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/ResultCount/index.js +31 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +42 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SelectFilter.js +21 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.js +410 -0
- package/dist/ComplexComponents/DataTable/DataTable.js +405 -0
- package/dist/ComplexComponents/DataTable/ErrorOverlay/index.js +9 -0
- package/dist/ComplexComponents/DataTable/SortableHeaderCell/index.js +27 -0
- package/dist/ComplexComponents/DataTable/index.js +1 -0
- package/dist/ComplexComponents/DataTable/translations/en.js +99 -0
- package/dist/ComplexComponents/DataTable/translations/index.js +17 -0
- package/dist/ComplexComponents/KeyInsight/KeyInsights.js +176 -0
- package/dist/ComplexComponents/KeyInsight/index.js +1 -0
- package/dist/ComplexComponents/NameValue/NameValue.js +94 -0
- package/dist/ComplexComponents/NameValue/NameValueItem.js +59 -0
- package/dist/ComplexComponents/NameValue/index.js +2 -0
- package/dist/ComplexComponents/PageContentHeader/PageContentHeader.js +92 -0
- package/dist/ComplexComponents/PageContentHeader/PageContentHeader.tsx +24 -34
- package/dist/ComplexComponents/PageContentHeader/index.js +1 -0
- package/dist/ComplexComponents/PageContentHeader/index.ts +0 -2
- package/dist/ComplexComponents/Placeholder/Placeholder.js +51 -0
- package/dist/ComplexComponents/Placeholder/index.js +1 -0
- package/dist/ComplexComponents/Slat/Slat.js +53 -0
- package/dist/ComplexComponents/Slat/index.js +1 -0
- package/dist/ComplexComponents/Utilities/CopyButton.js +45 -0
- package/dist/ComplexComponents/Utilities/index.js +1 -0
- package/dist/DataDisplay/Alert.js +77 -0
- package/dist/DataDisplay/Avatar.js +157 -0
- package/dist/DataDisplay/Badge.js +78 -0
- package/dist/DataDisplay/Card.js +100 -0
- package/dist/DataDisplay/Chip.js +36 -0
- package/dist/DataDisplay/Indicator.js +59 -0
- package/dist/DataDisplay/List.js +60 -0
- package/dist/DataDisplay/Pill.js +81 -0
- package/dist/DataDisplay/Progress.js +42 -0
- package/dist/DataDisplay/Table.js +38 -0
- package/dist/DataDisplay/ThemeIcon.js +31 -0
- package/dist/DataDisplay/index.js +18 -0
- package/dist/Inputs/Checkbox.js +62 -0
- package/dist/Inputs/ColorInput.js +48 -0
- package/dist/Inputs/DropZone.js +12 -0
- package/dist/Inputs/FileInput.js +77 -0
- package/dist/Inputs/NumberInput.js +49 -0
- package/dist/Inputs/Radio.js +55 -0
- package/dist/Inputs/RadioGroup.js +59 -0
- package/dist/Inputs/SegmentedControl.js +50 -0
- package/dist/Inputs/Slider.js +50 -0
- package/dist/Inputs/SliderWithLabel.js +32 -0
- package/dist/Inputs/Switch.js +47 -0
- package/dist/Inputs/TextArea.js +50 -0
- package/dist/Inputs/TextInput.js +87 -0
- package/dist/Inputs/index.js +27 -0
- package/dist/Layout/Box.js +39 -0
- package/dist/Layout/Center.js +11 -0
- package/dist/Layout/Container.js +11 -0
- package/dist/Layout/Flex.js +12 -0
- package/dist/Layout/Grid.js +13 -0
- package/dist/Layout/Group.js +14 -0
- package/dist/Layout/Inline.js +46 -0
- package/dist/Layout/SimpleGrid.js +14 -0
- package/dist/Layout/Stack.js +45 -0
- package/dist/Layout/index.js +10 -0
- package/dist/Misc/Divider.js +8 -0
- package/dist/Misc/Paper.js +24 -0
- package/dist/Misc/index.js +10 -0
- package/dist/Navigation/Breadcrumb.js +60 -0
- package/dist/Navigation/NavLink.js +28 -0
- package/dist/Navigation/Stepper.js +8 -0
- package/dist/Navigation/Tabs.js +22 -0
- package/dist/Navigation/index.js +9 -0
- package/dist/Overlays/Drawer.js +63 -0
- package/dist/Overlays/Menu.js +85 -0
- package/dist/Overlays/Modal.js +61 -0
- package/dist/Overlays/Popover.js +118 -0
- package/dist/Overlays/Tooltip.js +71 -0
- package/dist/Overlays/index.js +12 -0
- package/dist/Shell/AppShellLayout.js +13 -0
- package/dist/Shell/HeaderBar.js +8 -0
- package/dist/Shell/SidebarNav.js +9 -0
- package/dist/Shell/SidebarNavLink.js +17 -0
- package/dist/Shell/SingleColumnLayout.js +11 -0
- package/dist/Shell/TertiaryColumnLayout.js +12 -0
- package/dist/Shell/index.js +6 -0
- package/dist/Typography/Code.js +8 -0
- package/dist/Typography/Kbd.js +58 -0
- package/dist/Typography/Text.js +8 -0
- package/dist/Typography/Title.js +11 -0
- package/dist/Typography/index.js +12 -0
- package/dist/config.js +202 -0
- package/dist/contracts/PageContentHeader.json +10 -5
- package/dist/contracts/index.json +1 -1
- package/dist/hooks/useTableHandlers.js +136 -0
- package/dist/hooks/useTableRenderFunctions.js +164 -0
- package/dist/hooks/useTableState.js +70 -0
- package/dist/index.js +162 -0
- package/dist/index.ts +3 -4
- package/dist/stories/Buttons/ActionIcon.stories.tsx +159 -0
- package/dist/stories/Buttons/Button.stories.tsx +145 -0
- package/dist/stories/Buttons/CloseButton.stories.tsx +121 -0
- package/dist/stories/Combobox/AutocompleteClearable.stories.tsx +554 -0
- package/dist/stories/Combobox/Combobox.stories.tsx +106 -0
- package/dist/stories/Combobox/Multiselect.stories.tsx +664 -0
- package/dist/stories/Combobox/SearchableSelect.stories.tsx +640 -0
- package/dist/stories/Combobox/Select.stories.tsx +311 -0
- package/dist/stories/ComplexComponents/DashboardWidget/DashboardWidget.stories.tsx +822 -0
- package/dist/stories/ComplexComponents/DataTable/DataTable.stories.tsx +502 -0
- package/dist/stories/ComplexComponents/KeyInsight/KeyInsights.stories.tsx +386 -0
- package/dist/stories/ComplexComponents/NameValue/NameValue.stories.tsx +405 -0
- package/dist/stories/ComplexComponents/PageContentHeader/PageContentHeader.stories.tsx +527 -0
- package/dist/stories/ComplexComponents/Placeholder/Placeholder.stories.tsx +76 -0
- package/dist/stories/ComplexComponents/Slat/Slat.stories.tsx +79 -0
- package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +479 -0
- package/dist/stories/DataDisplay/Alert.stories.tsx +296 -0
- package/dist/stories/DataDisplay/Avatar.stories.tsx +251 -0
- package/dist/stories/DataDisplay/Badge.stories.tsx +176 -0
- package/dist/stories/DataDisplay/Card.stories.tsx +406 -0
- package/dist/stories/DataDisplay/Chip.stories.tsx +495 -0
- package/dist/stories/DataDisplay/Indicator.stories.tsx +571 -0
- package/dist/stories/DataDisplay/List.stories.tsx +376 -0
- package/dist/stories/DataDisplay/Pill.stories.tsx +506 -0
- package/dist/stories/DataDisplay/Progress.stories.tsx +352 -0
- package/dist/stories/DataDisplay/Table.stories.tsx +346 -0
- package/dist/stories/DataDisplay/ThemeIcon.stories.tsx +125 -0
- package/dist/stories/Inputs/Checkbox.stories.tsx +263 -0
- package/dist/stories/Inputs/ColorInput.stories.tsx +434 -0
- package/dist/stories/Inputs/DropZone.stories.tsx +401 -0
- package/dist/stories/Inputs/FileInput.stories.tsx +383 -0
- package/dist/stories/Inputs/NumberInput.stories.tsx +342 -0
- package/dist/stories/Inputs/Radio.stories.tsx +437 -0
- package/dist/stories/Inputs/RadioGroup.stories.tsx +526 -0
- package/dist/stories/Inputs/SegmentedControl.stories.tsx +60 -0
- package/dist/stories/Inputs/Slider.stories.tsx +22 -0
- package/dist/stories/Inputs/SliderWithLabel.stories.tsx +37 -0
- package/dist/stories/Inputs/Switch.stories.tsx +361 -0
- package/dist/stories/Inputs/TextArea.stories.tsx +355 -0
- package/dist/stories/Inputs/TextInput.stories.tsx +266 -0
- package/dist/stories/Misc/Divider.stories.tsx +581 -0
- package/dist/stories/Misc/Paper.stories.tsx +557 -0
- package/dist/stories/Navigation/Breadcrumb.stories.tsx +489 -0
- package/dist/stories/Navigation/NavLink.stories.tsx +601 -0
- package/dist/stories/Navigation/Stepper.stories.tsx +413 -0
- package/dist/stories/Navigation/Tabs.stories.tsx +528 -0
- package/dist/stories/Overlays/Drawer.stories.tsx +802 -0
- package/dist/stories/Overlays/Menu.stories.tsx +941 -0
- package/dist/stories/Overlays/Modal.stories.tsx +249 -0
- package/dist/stories/Overlays/Popover.stories.tsx +780 -0
- package/dist/stories/Overlays/Tooltip.stories.tsx +52 -0
- package/dist/stories/Typography/Code.stories.tsx +368 -0
- package/dist/stories/Typography/Kbd.stories.tsx +514 -0
- package/dist/stories/Typography/Text.stories.tsx +117 -0
- package/dist/stories/Typography/Title.stories.tsx +112 -0
- package/dist/stories/index.json +1435 -0
- package/dist/types.js +127 -0
- package/package.json +12 -7
- package/dist/ComplexComponents/PageContentHeader/DescriptionBlock.tsx +0 -65
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
+
import { Stack, Inline, PageContentHeader, Title, Text, Card, NameValue } from '@appdirect/design-system';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
RiUserLine,
|
|
6
|
+
RiSettingsLine,
|
|
7
|
+
RiDatabaseLine,
|
|
8
|
+
RiShieldLine,
|
|
9
|
+
RiTeamLine,
|
|
10
|
+
RiBarChartLine,
|
|
11
|
+
RiFileTextLine,
|
|
12
|
+
RiGlobalLine,
|
|
13
|
+
RiCloudLine,
|
|
14
|
+
RiCodeLine
|
|
15
|
+
} from '@remixicon/react';
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof PageContentHeader> = {
|
|
18
|
+
title: 'Design System/Complex Components/PageContentHeader',
|
|
19
|
+
component: PageContentHeader,
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: 'padded',
|
|
22
|
+
docs: {
|
|
23
|
+
description: {
|
|
24
|
+
component: 'A comprehensive page header component that supports multiple content sections including key insights, descriptions, name-value pairs, and expandable drawers. Perfect for dashboard headers, profile pages, and detailed information displays.',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
tags: ['autodocs', 'needs-connect'],
|
|
29
|
+
argTypes: {
|
|
30
|
+
title: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Main title/heading',
|
|
33
|
+
},
|
|
34
|
+
subhead: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'Subhead text above the title',
|
|
37
|
+
},
|
|
38
|
+
badge: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Optional badge text',
|
|
41
|
+
},
|
|
42
|
+
editable: {
|
|
43
|
+
control: 'boolean',
|
|
44
|
+
description: 'Whether the title is editable',
|
|
45
|
+
},
|
|
46
|
+
contentSection: {
|
|
47
|
+
control: 'select',
|
|
48
|
+
options: [undefined, 'insights', 'description', 'nameValuePairs', 'drawer'],
|
|
49
|
+
description: 'Which content section to display, if any',
|
|
50
|
+
},
|
|
51
|
+
panelNotification: {
|
|
52
|
+
control: 'boolean',
|
|
53
|
+
description: 'Whether to show a panel notification banner below the header',
|
|
54
|
+
},
|
|
55
|
+
spacing: {
|
|
56
|
+
control: 'select',
|
|
57
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
58
|
+
description: 'Custom spacing',
|
|
59
|
+
},
|
|
60
|
+
drawerLabel: {
|
|
61
|
+
control: 'text',
|
|
62
|
+
description: 'Text for the button when drawer is closed',
|
|
63
|
+
},
|
|
64
|
+
drawerLabelOpen: {
|
|
65
|
+
control: 'text',
|
|
66
|
+
description: 'Text for the button when drawer is open',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default meta;
|
|
72
|
+
type Story = StoryObj<typeof meta>;
|
|
73
|
+
|
|
74
|
+
export const Default: Story = {
|
|
75
|
+
args: {
|
|
76
|
+
title: 'User Dashboard',
|
|
77
|
+
subhead: 'Overview',
|
|
78
|
+
badge: 'Active',
|
|
79
|
+
contentSection: 'description',
|
|
80
|
+
description: 'Welcome to your personalized dashboard. Here you can view your account information, recent activity, and manage your settings.',
|
|
81
|
+
editable: false,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const WithKeyInsights: Story = {
|
|
86
|
+
render: () => (
|
|
87
|
+
<Stack gap="lg">
|
|
88
|
+
<PageContentHeader
|
|
89
|
+
title="Analytics Dashboard"
|
|
90
|
+
subhead="Performance Metrics"
|
|
91
|
+
badge="Live"
|
|
92
|
+
icon={<RiBarChartLine />}
|
|
93
|
+
contentSection="insights"
|
|
94
|
+
insights={[
|
|
95
|
+
{
|
|
96
|
+
value: "1,247",
|
|
97
|
+
title: "Total Users",
|
|
98
|
+
subtitle: "+12% from last month"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
value: "89.2%",
|
|
102
|
+
title: "Success Rate",
|
|
103
|
+
subtitle: "+2.1% improvement"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
value: "245ms",
|
|
107
|
+
title: "Avg Response",
|
|
108
|
+
subtitle: "-15ms faster"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
value: "$12,450",
|
|
112
|
+
title: "Revenue",
|
|
113
|
+
subtitle: "+8.5% growth"
|
|
114
|
+
}
|
|
115
|
+
]}
|
|
116
|
+
actions={[
|
|
117
|
+
{ label: 'Export Data', onClick: () => console.log('Export'), variant: 'outline' },
|
|
118
|
+
{ label: 'Refresh', onClick: () => console.log('Refresh'), variant: 'primary' }
|
|
119
|
+
]}
|
|
120
|
+
/>
|
|
121
|
+
</Stack>
|
|
122
|
+
),
|
|
123
|
+
parameters: {
|
|
124
|
+
docs: {
|
|
125
|
+
description: {
|
|
126
|
+
story: 'Page header with key insights displaying important metrics and KPIs.',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const UserProfile: Story = {
|
|
133
|
+
render: () => (
|
|
134
|
+
<Stack gap="lg">
|
|
135
|
+
<PageContentHeader
|
|
136
|
+
title="John Doe"
|
|
137
|
+
subhead="Senior Developer"
|
|
138
|
+
badge="Online"
|
|
139
|
+
icon={<RiUserLine />}
|
|
140
|
+
editable={true}
|
|
141
|
+
onEdit={() => console.log('Edit profile')}
|
|
142
|
+
contentSection="nameValuePairs"
|
|
143
|
+
nameValuePairs={[
|
|
144
|
+
{ name: "Email", value: "john.doe@company.com" },
|
|
145
|
+
{ name: "Department", value: "Engineering" },
|
|
146
|
+
{ name: "Location", value: "San Francisco, CA" },
|
|
147
|
+
{ name: "Employee ID", value: "EMP-2024-001" },
|
|
148
|
+
{ name: "Start Date", value: "January 15, 2022" },
|
|
149
|
+
{ name: "Manager", value: "Sarah Johnson" },
|
|
150
|
+
{ name: "Team", value: "Frontend Platform" },
|
|
151
|
+
{ name: "Level", value: "Senior (L5)" }
|
|
152
|
+
]}
|
|
153
|
+
nameValueColumns={2}
|
|
154
|
+
actions={[
|
|
155
|
+
{ label: 'Edit Profile', onClick: () => console.log('Edit'), variant: 'outline' },
|
|
156
|
+
{ label: 'View Calendar', onClick: () => console.log('Calendar'), variant: 'default' },
|
|
157
|
+
{ label: 'Send Message', onClick: () => console.log('Message'), variant: 'primary' }
|
|
158
|
+
]}
|
|
159
|
+
/>
|
|
160
|
+
</Stack>
|
|
161
|
+
),
|
|
162
|
+
parameters: {
|
|
163
|
+
docs: {
|
|
164
|
+
description: {
|
|
165
|
+
story: 'User profile header with name-value pairs showing employee information.',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const ProjectOverview: Story = {
|
|
172
|
+
render: () => (
|
|
173
|
+
<Stack gap="lg">
|
|
174
|
+
<PageContentHeader
|
|
175
|
+
title="E-commerce Platform"
|
|
176
|
+
subhead="Project Overview"
|
|
177
|
+
badge="In Progress"
|
|
178
|
+
icon={<RiCodeLine />}
|
|
179
|
+
contentSection="description"
|
|
180
|
+
descriptionTitle="About this project"
|
|
181
|
+
description="A modern e-commerce platform built with React, Node.js, and PostgreSQL. This project includes user authentication, product catalog, shopping cart, payment processing, and admin dashboard. <a href='/docs/project'>View documentation</a> for more details."
|
|
182
|
+
allowLinks={true}
|
|
183
|
+
actions={[
|
|
184
|
+
{ label: 'View Repository', onClick: () => console.log('Repo'), variant: 'outline' },
|
|
185
|
+
{ label: 'Deploy', onClick: () => console.log('Deploy'), variant: 'primary' }
|
|
186
|
+
]}
|
|
187
|
+
/>
|
|
188
|
+
</Stack>
|
|
189
|
+
),
|
|
190
|
+
parameters: {
|
|
191
|
+
docs: {
|
|
192
|
+
description: {
|
|
193
|
+
story: 'Project overview with a description supporting HTML content.',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export const SystemStatus: Story = {
|
|
200
|
+
render: () => {
|
|
201
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<Stack gap="lg">
|
|
205
|
+
<PageContentHeader
|
|
206
|
+
title="System Health"
|
|
207
|
+
subhead="Infrastructure Status"
|
|
208
|
+
badge="Operational"
|
|
209
|
+
icon={<RiShieldLine />}
|
|
210
|
+
contentSection="drawer"
|
|
211
|
+
drawerLabel="Show Detailed Metrics"
|
|
212
|
+
drawerLabelOpen="Hide Detailed Metrics"
|
|
213
|
+
defaultDrawerOpen={drawerOpen}
|
|
214
|
+
drawerContent={
|
|
215
|
+
<NameValue
|
|
216
|
+
pairs={[
|
|
217
|
+
{ name: "CPU Usage", value: "45.2%" },
|
|
218
|
+
{ name: "Memory Usage", value: "78.5%" },
|
|
219
|
+
{ name: "Disk I/O", value: "23.1%" },
|
|
220
|
+
{ name: "Network Traffic", value: "156 MB/s" },
|
|
221
|
+
{ name: "Active Connections", value: "1,247" },
|
|
222
|
+
{ name: "Uptime", value: "15 days, 4 hours" },
|
|
223
|
+
{ name: "Last Restart", value: "March 15, 2024" },
|
|
224
|
+
{ name: "Status", value: "Operational" }
|
|
225
|
+
]}
|
|
226
|
+
columns={2}
|
|
227
|
+
spacing="sm"
|
|
228
|
+
labelSize="xs"
|
|
229
|
+
valueSize="sm"
|
|
230
|
+
/>
|
|
231
|
+
}
|
|
232
|
+
actions={[
|
|
233
|
+
{ label: 'View Logs', onClick: () => console.log('Logs'), variant: 'outline' },
|
|
234
|
+
{ label: 'Restart Services', onClick: () => console.log('Restart'), variant: 'danger' }
|
|
235
|
+
]}
|
|
236
|
+
/>
|
|
237
|
+
</Stack>
|
|
238
|
+
);
|
|
239
|
+
},
|
|
240
|
+
parameters: {
|
|
241
|
+
docs: {
|
|
242
|
+
description: {
|
|
243
|
+
story: 'System status header with expandable drawer containing detailed metrics.',
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export const TeamDashboard: Story = {
|
|
250
|
+
render: () => (
|
|
251
|
+
<Stack gap="lg">
|
|
252
|
+
<PageContentHeader
|
|
253
|
+
title="Engineering Team"
|
|
254
|
+
subhead="Team Dashboard"
|
|
255
|
+
badge="15 Members"
|
|
256
|
+
icon={<RiTeamLine />}
|
|
257
|
+
contentSection="insights"
|
|
258
|
+
insights={[
|
|
259
|
+
{
|
|
260
|
+
value: "23",
|
|
261
|
+
title: "Active Tasks",
|
|
262
|
+
subtitle: "Across 5 projects",
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
value: "87%",
|
|
266
|
+
title: "Sprint Progress",
|
|
267
|
+
subtitle: "3 days remaining",
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
value: "4.2",
|
|
271
|
+
title: "Avg Story Points",
|
|
272
|
+
subtitle: "Per developer",
|
|
273
|
+
}
|
|
274
|
+
]}
|
|
275
|
+
actions={[
|
|
276
|
+
{ label: 'Add Member', onClick: () => console.log('Add'), variant: 'outline' },
|
|
277
|
+
{ label: 'Sprint Planning', onClick: () => console.log('Sprint'), variant: 'default' },
|
|
278
|
+
{ label: 'Start Standup', onClick: () => console.log('Standup'), variant: 'primary' }
|
|
279
|
+
]}
|
|
280
|
+
/>
|
|
281
|
+
</Stack>
|
|
282
|
+
),
|
|
283
|
+
parameters: {
|
|
284
|
+
docs: {
|
|
285
|
+
description: {
|
|
286
|
+
story: 'Team dashboard with insights showing team performance metrics.',
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export const DatabaseManagement: Story = {
|
|
293
|
+
render: () => (
|
|
294
|
+
<Stack gap="lg">
|
|
295
|
+
<PageContentHeader
|
|
296
|
+
title="Production Database"
|
|
297
|
+
subhead="PostgreSQL Cluster"
|
|
298
|
+
badge="Healthy"
|
|
299
|
+
icon={<RiDatabaseLine />}
|
|
300
|
+
contentSection="nameValuePairs"
|
|
301
|
+
nameValuePairs={[
|
|
302
|
+
{ name: "Host", value: "prod-db-01.company.com", showCopy: true, onCopy: (v) => navigator.clipboard.writeText(v) },
|
|
303
|
+
{ name: "Port", value: "5432" },
|
|
304
|
+
{ name: "Database", value: "ecommerce_prod" },
|
|
305
|
+
{ name: "Version", value: "PostgreSQL 15.3" },
|
|
306
|
+
{ name: "Size", value: "2.4 TB" },
|
|
307
|
+
{ name: "Connections", value: "45/100" },
|
|
308
|
+
{ name: "Uptime", value: "127 days" },
|
|
309
|
+
{ name: "Last Backup", value: "2 hours ago" }
|
|
310
|
+
]}
|
|
311
|
+
nameValueColumns={2}
|
|
312
|
+
actions={[
|
|
313
|
+
{ label: 'Create Backup', onClick: () => console.log('Backup'), variant: 'outline' },
|
|
314
|
+
{ label: 'View Logs', onClick: () => console.log('Logs'), variant: 'default' },
|
|
315
|
+
{ label: 'Monitor', onClick: () => console.log('Monitor'), variant: 'primary' }
|
|
316
|
+
]}
|
|
317
|
+
/>
|
|
318
|
+
</Stack>
|
|
319
|
+
),
|
|
320
|
+
parameters: {
|
|
321
|
+
docs: {
|
|
322
|
+
description: {
|
|
323
|
+
story: 'Database management header with copyable connection details.',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export const ApplicationSettings: Story = {
|
|
330
|
+
render: () => (
|
|
331
|
+
<Stack gap="lg">
|
|
332
|
+
<PageContentHeader
|
|
333
|
+
title="Application Settings"
|
|
334
|
+
subhead="Configuration"
|
|
335
|
+
icon={<RiSettingsLine />}
|
|
336
|
+
contentSection="description"
|
|
337
|
+
descriptionTitle="Environment Configuration"
|
|
338
|
+
description="Manage your application settings, environment variables, and feature flags. Changes made here will affect the production environment and require careful review."
|
|
339
|
+
allowLinks={false}
|
|
340
|
+
actions={[
|
|
341
|
+
{ label: 'Reset to Default', onClick: () => console.log('Reset'), variant: 'outline' },
|
|
342
|
+
{ label: 'Export Config', onClick: () => console.log('Export'), variant: 'default' },
|
|
343
|
+
{ label: 'Save Changes', onClick: () => console.log('Save'), variant: 'primary' }
|
|
344
|
+
]}
|
|
345
|
+
/>
|
|
346
|
+
</Stack>
|
|
347
|
+
),
|
|
348
|
+
parameters: {
|
|
349
|
+
docs: {
|
|
350
|
+
description: {
|
|
351
|
+
story: 'Settings page header with description section and action buttons.',
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export const APIDocumentation: Story = {
|
|
358
|
+
render: () => (
|
|
359
|
+
<Stack gap="lg">
|
|
360
|
+
<PageContentHeader
|
|
361
|
+
title="REST API v2.1"
|
|
362
|
+
subhead="API Documentation"
|
|
363
|
+
badge="Stable"
|
|
364
|
+
icon={<RiGlobalLine />}
|
|
365
|
+
contentSection="description"
|
|
366
|
+
descriptionTitle="Getting Started"
|
|
367
|
+
description="Welcome to our REST API documentation. This API provides access to user data, product information, and order management. <a href='/api/auth'>Authentication</a> is required for most endpoints. Check out our <a href='/api/examples'>code examples</a> to get started quickly."
|
|
368
|
+
allowLinks={true}
|
|
369
|
+
actions={[
|
|
370
|
+
{ label: 'View Examples', onClick: () => console.log('Examples'), variant: 'outline' },
|
|
371
|
+
{ label: 'Test API', onClick: () => console.log('Test'), variant: 'default' },
|
|
372
|
+
{ label: 'Get API Key', onClick: () => console.log('API Key'), variant: 'primary' }
|
|
373
|
+
]}
|
|
374
|
+
/>
|
|
375
|
+
</Stack>
|
|
376
|
+
),
|
|
377
|
+
parameters: {
|
|
378
|
+
docs: {
|
|
379
|
+
description: {
|
|
380
|
+
story: 'API documentation header with an HTML-enabled description.',
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
export const CloudInfrastructure: Story = {
|
|
387
|
+
render: () => (
|
|
388
|
+
<Stack gap="lg">
|
|
389
|
+
<PageContentHeader
|
|
390
|
+
title="AWS Infrastructure"
|
|
391
|
+
subhead="Cloud Resources"
|
|
392
|
+
badge="Multi-Region"
|
|
393
|
+
icon={<RiCloudLine />}
|
|
394
|
+
contentSection="insights"
|
|
395
|
+
insights={[
|
|
396
|
+
{
|
|
397
|
+
value: "12",
|
|
398
|
+
title: "EC2 Instances",
|
|
399
|
+
subtitle: "Running",
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
value: "$1,247",
|
|
403
|
+
title: "Monthly Cost",
|
|
404
|
+
subtitle: "Current billing",
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
value: "99.9%",
|
|
408
|
+
title: "Uptime",
|
|
409
|
+
subtitle: "Last 30 days",
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
value: "3",
|
|
413
|
+
title: "Regions",
|
|
414
|
+
subtitle: "Active deployments",
|
|
415
|
+
}
|
|
416
|
+
]}
|
|
417
|
+
actions={[
|
|
418
|
+
{ label: 'View Costs', onClick: () => console.log('Costs'), variant: 'outline' },
|
|
419
|
+
{ label: 'Scale Resources', onClick: () => console.log('Scale'), variant: 'default' },
|
|
420
|
+
{ label: 'Deploy', onClick: () => console.log('Deploy'), variant: 'primary' }
|
|
421
|
+
]}
|
|
422
|
+
/>
|
|
423
|
+
</Stack>
|
|
424
|
+
),
|
|
425
|
+
parameters: {
|
|
426
|
+
docs: {
|
|
427
|
+
description: {
|
|
428
|
+
story: 'Cloud infrastructure overview with cost and performance insights.',
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
export const DocumentationPage: Story = {
|
|
435
|
+
render: () => (
|
|
436
|
+
<Stack gap="lg">
|
|
437
|
+
<PageContentHeader
|
|
438
|
+
title="Component Library"
|
|
439
|
+
subhead="Design System Documentation"
|
|
440
|
+
badge="v2.1.0"
|
|
441
|
+
icon={<RiFileTextLine />}
|
|
442
|
+
editable={true}
|
|
443
|
+
onEdit={() => console.log('Edit documentation')}
|
|
444
|
+
contentSection="description"
|
|
445
|
+
descriptionTitle="About this library"
|
|
446
|
+
description="A comprehensive React component library built with TypeScript and Mantine. Includes over 50 components with full TypeScript support, Storybook documentation, and automated testing. Perfect for building consistent user interfaces across your applications."
|
|
447
|
+
allowLinks={false}
|
|
448
|
+
actions={[
|
|
449
|
+
{ label: 'View Components', onClick: () => console.log('Components'), variant: 'outline' },
|
|
450
|
+
{ label: 'Download', onClick: () => console.log('Download'), variant: 'default' },
|
|
451
|
+
{ label: 'Get Started', onClick: () => console.log('Start'), variant: 'primary' }
|
|
452
|
+
]}
|
|
453
|
+
/>
|
|
454
|
+
</Stack>
|
|
455
|
+
),
|
|
456
|
+
parameters: {
|
|
457
|
+
docs: {
|
|
458
|
+
description: {
|
|
459
|
+
story: 'Documentation page header with editable title and description.',
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export const WithPanelNotification: Story = {
|
|
466
|
+
render: () => (
|
|
467
|
+
<Stack gap="lg">
|
|
468
|
+
<PageContentHeader
|
|
469
|
+
title="User Dashboard"
|
|
470
|
+
subhead="Overview"
|
|
471
|
+
badge="Active"
|
|
472
|
+
contentSection="description"
|
|
473
|
+
description="Welcome to your personalized dashboard. Here you can view your account information, recent activity, and manage your settings."
|
|
474
|
+
panelNotification
|
|
475
|
+
panelNotificationMessage="This account is pending verification. Some features are limited until verification is complete."
|
|
476
|
+
/>
|
|
477
|
+
</Stack>
|
|
478
|
+
),
|
|
479
|
+
parameters: {
|
|
480
|
+
docs: {
|
|
481
|
+
description: {
|
|
482
|
+
story: 'Panel notification is independent of contentSection - it can appear alongside any content section, or with none at all.',
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
export const HeaderOnly: Story = {
|
|
489
|
+
render: () => (
|
|
490
|
+
<Stack gap="lg">
|
|
491
|
+
<PageContentHeader
|
|
492
|
+
title="Minimal Header"
|
|
493
|
+
subhead="No content section"
|
|
494
|
+
icon={<RiSettingsLine />}
|
|
495
|
+
actions={[
|
|
496
|
+
{ label: 'Primary Action', onClick: () => console.log('Action'), variant: 'primary' },
|
|
497
|
+
]}
|
|
498
|
+
/>
|
|
499
|
+
</Stack>
|
|
500
|
+
),
|
|
501
|
+
parameters: {
|
|
502
|
+
docs: {
|
|
503
|
+
description: {
|
|
504
|
+
story: 'contentSection is optional - omit it entirely for a header-only layout with no content below.',
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
export const Interactive: Story = {
|
|
511
|
+
args: {
|
|
512
|
+
title: 'Interactive Example',
|
|
513
|
+
subhead: 'Customize me',
|
|
514
|
+
badge: 'Demo',
|
|
515
|
+
contentSection: 'description',
|
|
516
|
+
description: 'Use the controls below to customize this PageContentHeader component and see how different props affect the appearance and behavior.',
|
|
517
|
+
editable: false,
|
|
518
|
+
spacing: 'sm',
|
|
519
|
+
},
|
|
520
|
+
parameters: {
|
|
521
|
+
docs: {
|
|
522
|
+
description: {
|
|
523
|
+
story: 'Use the controls below to interact with the PageContentHeader and see different combinations.',
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
+
import { Placeholder } from '@appdirect/design-system';
|
|
3
|
+
import { RiErrorWarningLine } from '@remixicon/react';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Placeholder> = {
|
|
6
|
+
title: 'Design System/Complex Components/Placeholder',
|
|
7
|
+
component: Placeholder,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs', 'code-connected'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<div style={{ width: 587 }}>
|
|
20
|
+
<Placeholder
|
|
21
|
+
icon={<RiErrorWarningLine size={24} />}
|
|
22
|
+
title="This is the Title"
|
|
23
|
+
description="This is the optional description of the placeholder"
|
|
24
|
+
actions={[
|
|
25
|
+
{ label: 'Button One', onClick: () => {} },
|
|
26
|
+
{ label: 'Button Two', onClick: () => {} },
|
|
27
|
+
]}
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Sizes: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<div style={{ width: 587, display: 'flex', flexDirection: 'column', gap: 32 }}>
|
|
36
|
+
<Placeholder
|
|
37
|
+
icon={<RiErrorWarningLine size={24} />}
|
|
38
|
+
title="This is the Title"
|
|
39
|
+
description="This is the optional description of the placeholder"
|
|
40
|
+
actions={[
|
|
41
|
+
{ label: 'Button One', onClick: () => {} },
|
|
42
|
+
{ label: 'Button Two', onClick: () => {} },
|
|
43
|
+
]}
|
|
44
|
+
size="sm"
|
|
45
|
+
/>
|
|
46
|
+
<Placeholder
|
|
47
|
+
icon={<RiErrorWarningLine size={24} />}
|
|
48
|
+
title="This is the Title"
|
|
49
|
+
description="This is the optional description of the placeholder"
|
|
50
|
+
actions={[
|
|
51
|
+
{ label: 'Button One', onClick: () => {} },
|
|
52
|
+
{ label: 'Button Two', onClick: () => {} },
|
|
53
|
+
]}
|
|
54
|
+
size="md"
|
|
55
|
+
/>
|
|
56
|
+
<Placeholder
|
|
57
|
+
icon={<RiErrorWarningLine size={24} />}
|
|
58
|
+
title="This is the Title"
|
|
59
|
+
description="This is the optional description of the placeholder"
|
|
60
|
+
actions={[
|
|
61
|
+
{ label: 'Button One', onClick: () => {} },
|
|
62
|
+
{ label: 'Button Two', onClick: () => {} },
|
|
63
|
+
]}
|
|
64
|
+
size="lg"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const NoDescriptionOrActions: Story = {
|
|
71
|
+
render: () => (
|
|
72
|
+
<div style={{ width: 587 }}>
|
|
73
|
+
<Placeholder icon={<RiErrorWarningLine size={24} />} title="No results found" />
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
+
import { Stack, Slat } from '@appdirect/design-system';
|
|
3
|
+
import { RiStarLine } from '@remixicon/react';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Slat> = {
|
|
6
|
+
title: 'Design System/Complex Components/Slat',
|
|
7
|
+
component: Slat,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'padded',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'A compact row for listing items (e.g. in a feed or list), with a leading icon, title/subtitle, optional status indicator or badge, a trailing action, and an optional notification banner below.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
tags: ['autodocs', 'needs-connect'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
size: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
title: 'This is the title',
|
|
31
|
+
subtitle: 'and this is the subhead',
|
|
32
|
+
icon: <RiStarLine size={16} />,
|
|
33
|
+
size: 'xs',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const WithIndicatorAndBadge: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
title: 'Invoice #1024',
|
|
40
|
+
subtitle: 'Due in 3 days',
|
|
41
|
+
icon: <RiStarLine size={16} />,
|
|
42
|
+
indicator: { variant: 'pending' },
|
|
43
|
+
badge: { label: 'Draft', color: 'default' },
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const WithAction: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
title: 'This is the title',
|
|
50
|
+
subtitle: 'and this is the subhead',
|
|
51
|
+
icon: <RiStarLine size={16} />,
|
|
52
|
+
action: { label: 'Review', onClick: () => {} },
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const WithNotification: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
title: 'This is the title',
|
|
59
|
+
subtitle: 'and this is the subhead',
|
|
60
|
+
icon: <RiStarLine size={16} />,
|
|
61
|
+
notification: 'Something needs your attention.',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const AllSizes: Story = {
|
|
66
|
+
render: () => (
|
|
67
|
+
<Stack gap="md">
|
|
68
|
+
{(['xs', 'sm', 'md', 'lg', 'xl'] as const).map((size) => (
|
|
69
|
+
<Slat
|
|
70
|
+
key={size}
|
|
71
|
+
size={size}
|
|
72
|
+
title="This is the title"
|
|
73
|
+
subtitle="and this is the subhead"
|
|
74
|
+
icon={<RiStarLine size={16} />}
|
|
75
|
+
/>
|
|
76
|
+
))}
|
|
77
|
+
</Stack>
|
|
78
|
+
),
|
|
79
|
+
};
|