@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,176 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
+
import { Stack } from '@mantine/core';
|
|
3
|
+
import { Inline, Badge, Title, Text, Paper } from '@appdirect/design-system';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Badge> = {
|
|
6
|
+
title: 'Design System/Data Display/Badge',
|
|
7
|
+
component: Badge,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: 'Badge component with semantic colors and consistent styling for status indicators and labels.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
tags: ['autodocs', 'code-connected'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
variant: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['filled', 'outline'],
|
|
21
|
+
description: 'Badge style variant',
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
control: 'select',
|
|
25
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
26
|
+
description: 'Badge size',
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['default', 'info', 'success', 'danger', 'pending'],
|
|
31
|
+
description: 'Semantic color variant',
|
|
32
|
+
},
|
|
33
|
+
children: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Badge content',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
42
|
+
|
|
43
|
+
export const Default: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
children: 'Badge',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Colors: Story = {
|
|
50
|
+
render: () => (
|
|
51
|
+
<Inline gap="xs" align="center">
|
|
52
|
+
<Badge color="default">Default</Badge>
|
|
53
|
+
<Badge color="info">Info</Badge>
|
|
54
|
+
<Badge color="success">Success</Badge>
|
|
55
|
+
<Badge color="danger">Danger</Badge>
|
|
56
|
+
<Badge color="pending">Pending</Badge>
|
|
57
|
+
</Inline>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Variants: Story = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<Stack gap="md">
|
|
64
|
+
<Inline gap="xs" align="center">
|
|
65
|
+
<Text size="sm" fw={500} c="dimmed">Filled:</Text>
|
|
66
|
+
<Badge variant="filled" color="default">Default</Badge>
|
|
67
|
+
<Badge variant="filled" color="info">Info</Badge>
|
|
68
|
+
<Badge variant="filled" color="success">Success</Badge>
|
|
69
|
+
<Badge variant="filled" color="danger">Danger</Badge>
|
|
70
|
+
<Badge variant="filled" color="pending">Pending</Badge>
|
|
71
|
+
</Inline>
|
|
72
|
+
<Inline gap="xs" align="center">
|
|
73
|
+
<Text size="sm" fw={500} c="dimmed">Outline:</Text>
|
|
74
|
+
<Badge variant="outline" color="default">Default</Badge>
|
|
75
|
+
<Badge variant="outline" color="info">Info</Badge>
|
|
76
|
+
<Badge variant="outline" color="success">Success</Badge>
|
|
77
|
+
<Badge variant="outline" color="danger">Danger</Badge>
|
|
78
|
+
<Badge variant="outline" color="pending">Pending</Badge>
|
|
79
|
+
</Inline>
|
|
80
|
+
</Stack>
|
|
81
|
+
),
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Sizes: Story = {
|
|
85
|
+
render: () => (
|
|
86
|
+
<Inline gap="sm" align="center">
|
|
87
|
+
<Badge size="xs" color="info">xs</Badge>
|
|
88
|
+
<Badge size="sm" color="info">sm</Badge>
|
|
89
|
+
<Badge size="md" color="info">md</Badge>
|
|
90
|
+
<Badge size="lg" color="info">lg</Badge>
|
|
91
|
+
<Badge size="xl" color="info">xl</Badge>
|
|
92
|
+
</Inline>
|
|
93
|
+
),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const StatusExamples: Story = {
|
|
97
|
+
render: () => (
|
|
98
|
+
<Stack gap="md">
|
|
99
|
+
<Inline gap="xs" align="center">
|
|
100
|
+
<Text size="sm" fw={500} c="dimmed">User Status:</Text>
|
|
101
|
+
<Badge color="success">Active</Badge>
|
|
102
|
+
<Badge color="pending">Pending</Badge>
|
|
103
|
+
<Badge color="danger">Suspended</Badge>
|
|
104
|
+
<Badge color="default">Inactive</Badge>
|
|
105
|
+
</Inline>
|
|
106
|
+
<Inline gap="xs" align="center">
|
|
107
|
+
<Text size="sm" fw={500} c="dimmed">Order Status:</Text>
|
|
108
|
+
<Badge color="info">Processing</Badge>
|
|
109
|
+
<Badge color="pending">Shipped</Badge>
|
|
110
|
+
<Badge color="success">Delivered</Badge>
|
|
111
|
+
<Badge color="danger">Cancelled</Badge>
|
|
112
|
+
</Inline>
|
|
113
|
+
<Inline gap="xs" align="center">
|
|
114
|
+
<Text size="sm" fw={500} c="dimmed">Priority:</Text>
|
|
115
|
+
<Badge color="danger">High</Badge>
|
|
116
|
+
<Badge color="pending">Medium</Badge>
|
|
117
|
+
<Badge color="info">Low</Badge>
|
|
118
|
+
</Inline>
|
|
119
|
+
</Stack>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const InContext: Story = {
|
|
124
|
+
render: () => (
|
|
125
|
+
<Stack gap="md" maw={400}>
|
|
126
|
+
{/* List item with badge */}
|
|
127
|
+
<Paper variant="border">
|
|
128
|
+
<Text fw={500}>John Doe</Text>
|
|
129
|
+
<Text size="sm" c="dimmed">john@example.com</Text>
|
|
130
|
+
<Badge color="success" size="sm">Active</Badge>
|
|
131
|
+
</Paper>
|
|
132
|
+
{/* Card header with badge */}
|
|
133
|
+
<Paper variant="border">
|
|
134
|
+
<Inline justify="space-between" align="center" mb="sm">
|
|
135
|
+
<Title order={4}>Project Alpha</Title>
|
|
136
|
+
<Badge color="pending" variant="outline">In Progress</Badge>
|
|
137
|
+
</Inline>
|
|
138
|
+
<Text size="sm" c="dimmed">
|
|
139
|
+
A comprehensive project management solution for enterprise clients.
|
|
140
|
+
</Text>
|
|
141
|
+
</Paper>
|
|
142
|
+
|
|
143
|
+
{/* Notification with badge */}
|
|
144
|
+
<Paper variant="border">
|
|
145
|
+
<Badge color="info" size="xs">New</Badge>
|
|
146
|
+
<Text fw={500} size="sm">System Update Available</Text>
|
|
147
|
+
<Text size="xs" c="dimmed">
|
|
148
|
+
Version 2.1.0 includes security improvements and bug fixes.
|
|
149
|
+
</Text>
|
|
150
|
+
</Paper>
|
|
151
|
+
</Stack>
|
|
152
|
+
),
|
|
153
|
+
parameters: {
|
|
154
|
+
docs: {
|
|
155
|
+
description: {
|
|
156
|
+
story: 'Examples of Badge components used in real UI contexts.',
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export const Interactive: Story = {
|
|
163
|
+
args: {
|
|
164
|
+
children: 'Interactive Badge',
|
|
165
|
+
color: 'info',
|
|
166
|
+
variant: 'filled',
|
|
167
|
+
size: 'md',
|
|
168
|
+
},
|
|
169
|
+
parameters: {
|
|
170
|
+
docs: {
|
|
171
|
+
description: {
|
|
172
|
+
story: 'Use the controls below to interact with the Badge and see different combinations.',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
};
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
|
|
2
|
+
import { Stack, Image, Box } from '@mantine/core';
|
|
3
|
+
import { Inline, Card, Title, Text, Badge, Button, ThemeIcon, Avatar } from '@appdirect/design-system';
|
|
4
|
+
import { RiHeartLine, RiShareLine, RiBookmarkLine, RiSmartphoneFill, RiUserFill } from '@remixicon/react';
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Card> = {
|
|
7
|
+
title: 'Design System/Data Display/Card',
|
|
8
|
+
component: Card,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: 'Card component with consistent styling: xs shadow, md padding, border enabled, and sm radius.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
tags: ['autodocs', 'code-connected'],
|
|
18
|
+
argTypes: {
|
|
19
|
+
interactive: {
|
|
20
|
+
control: 'boolean',
|
|
21
|
+
description: 'Interactive hover effects',
|
|
22
|
+
},
|
|
23
|
+
children: {
|
|
24
|
+
control: false,
|
|
25
|
+
description: 'Card content',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
export const Default: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
children: (
|
|
36
|
+
<Stack>
|
|
37
|
+
<Title order={3}>Card Title</Title>
|
|
38
|
+
<Text c="dimmed">
|
|
39
|
+
This is a basic card with consistent design system styling.
|
|
40
|
+
</Text>
|
|
41
|
+
</Stack>
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Interactive: Story = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<Inline gap="md" align="center">
|
|
49
|
+
<Card
|
|
50
|
+
interactive
|
|
51
|
+
onClick={() => alert('Card clicked!')}
|
|
52
|
+
>
|
|
53
|
+
<Title order={4} mb="xs">Interactive Card</Title>
|
|
54
|
+
<Text size="sm">
|
|
55
|
+
Hover over this card to see the interactive effects. Click to trigger action.
|
|
56
|
+
</Text>
|
|
57
|
+
</Card>
|
|
58
|
+
<Card>
|
|
59
|
+
<Title order={4} mb="xs">Static Card</Title>
|
|
60
|
+
<Text size="sm">
|
|
61
|
+
This card has no interactive effects for comparison.
|
|
62
|
+
</Text>
|
|
63
|
+
</Card>
|
|
64
|
+
</Inline>
|
|
65
|
+
),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const ProductCard: Story = {
|
|
69
|
+
render: () => (
|
|
70
|
+
<Card style={{ width: '280px' }}>
|
|
71
|
+
<Card.Section>
|
|
72
|
+
<Image
|
|
73
|
+
src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=300&fit=crop&crop=center"
|
|
74
|
+
height={200}
|
|
75
|
+
alt="Wireless Headphones"
|
|
76
|
+
style={{ objectFit: 'cover' }}
|
|
77
|
+
/>
|
|
78
|
+
</Card.Section>
|
|
79
|
+
|
|
80
|
+
<div style={{ marginTop: '12px', marginBottom: '8px' }}>
|
|
81
|
+
<Badge color="success" size="xs">New</Badge>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<Title order={3} mb="xs">Wireless Headphones</Title>
|
|
85
|
+
<Text size="sm" c="dimmed" mb="sm">
|
|
86
|
+
Premium noise-cancelling headphones with 30-hour battery life and crystal clear audio.
|
|
87
|
+
</Text>
|
|
88
|
+
|
|
89
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '16px' }}>
|
|
90
|
+
<Text size="xl" fw={600}>$299</Text>
|
|
91
|
+
<Text size="sm" c="dimmed" td="line-through">$399</Text>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
95
|
+
<Button size="sm" style={{ flex: 1 }}>Add to Cart</Button>
|
|
96
|
+
<Button variant="outline" size="sm">
|
|
97
|
+
<RiHeartLine size={16} />
|
|
98
|
+
</Button>
|
|
99
|
+
</div>
|
|
100
|
+
</Card>
|
|
101
|
+
),
|
|
102
|
+
parameters: {
|
|
103
|
+
docs: {
|
|
104
|
+
description: {
|
|
105
|
+
story: 'Example of a product card with full bleed image using Card.Section, badges, pricing, and actions.',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const UserCard: Story = {
|
|
112
|
+
render: () => (
|
|
113
|
+
<Card style={{ width: '320px' }}>
|
|
114
|
+
<div style={{ display: 'flex', gap: '12px', marginBottom: '16px' }}>
|
|
115
|
+
<div style={{
|
|
116
|
+
width: '48px',
|
|
117
|
+
height: '48px',
|
|
118
|
+
borderRadius: '50%',
|
|
119
|
+
backgroundColor: 'var(--mantine-color-blue-6)',
|
|
120
|
+
display: 'flex',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
color: 'white',
|
|
124
|
+
fontWeight: 600
|
|
125
|
+
}}>
|
|
126
|
+
JD
|
|
127
|
+
</div>
|
|
128
|
+
<div style={{ flex: 1 }}>
|
|
129
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
130
|
+
<Title order={4}>John Doe</Title>
|
|
131
|
+
<Badge color="success" size="xs">Online</Badge>
|
|
132
|
+
</div>
|
|
133
|
+
<Text size="sm" c="dimmed" mt={4}>
|
|
134
|
+
Senior Developer
|
|
135
|
+
</Text>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<Text size="sm" mb="md">
|
|
140
|
+
Passionate about creating beautiful and functional user interfaces.
|
|
141
|
+
5+ years of experience in React and TypeScript.
|
|
142
|
+
</Text>
|
|
143
|
+
|
|
144
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
145
|
+
<Button size="sm" variant="outline" style={{ flex: 1 }}>Message</Button>
|
|
146
|
+
<Button size="sm" style={{ flex: 1 }}>Connect</Button>
|
|
147
|
+
</div>
|
|
148
|
+
</Card>
|
|
149
|
+
),
|
|
150
|
+
parameters: {
|
|
151
|
+
docs: {
|
|
152
|
+
description: {
|
|
153
|
+
story: 'Example of a user profile card with avatar, status, and actions.',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const ArticleCard: Story = {
|
|
160
|
+
render: () => (
|
|
161
|
+
<Card
|
|
162
|
+
interactive
|
|
163
|
+
style={{ width: '400px' }}
|
|
164
|
+
onClick={() => console.log('Article clicked')}
|
|
165
|
+
>
|
|
166
|
+
<div style={{ marginBottom: '12px' }}>
|
|
167
|
+
<Badge color="info" size="xs">Technology</Badge>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<Title order={3} mb="xs">
|
|
171
|
+
The Future of Web Development
|
|
172
|
+
</Title>
|
|
173
|
+
|
|
174
|
+
<Text size="sm" c="dimmed" mb="md">
|
|
175
|
+
Exploring the latest trends and technologies that are shaping the future of web development,
|
|
176
|
+
from AI-powered tools to new frameworks.
|
|
177
|
+
</Text>
|
|
178
|
+
|
|
179
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
|
180
|
+
<Text size="xs" c="dimmed">By Sarah Johnson</Text>
|
|
181
|
+
<Text size="xs" c="dimmed">5 min read</Text>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: '16px', paddingTop: '16px', borderTop: '1px solid var(--mantine-color-gray-2)' }}>
|
|
185
|
+
<Text size="xs" c="dimmed">March 15, 2024</Text>
|
|
186
|
+
<div style={{ display: 'flex', gap: '8px' }}>
|
|
187
|
+
<RiHeartLine size={16} style={{ color: 'var(--mantine-color-gray-5)' }} />
|
|
188
|
+
<RiShareLine size={16} style={{ color: 'var(--mantine-color-gray-5)' }} />
|
|
189
|
+
<RiBookmarkLine size={16} style={{ color: 'var(--mantine-color-gray-5)' }} />
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</Card>
|
|
193
|
+
),
|
|
194
|
+
parameters: {
|
|
195
|
+
docs: {
|
|
196
|
+
description: {
|
|
197
|
+
story: 'Example of an interactive article card with metadata and actions.',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const CardGrid: Story = {
|
|
204
|
+
render: () => (
|
|
205
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '16px', width: '800px' }}>
|
|
206
|
+
<Card>
|
|
207
|
+
<Title order={4} mb="xs">Feature 1</Title>
|
|
208
|
+
<Text size="sm">Consistent styling across all cards</Text>
|
|
209
|
+
</Card>
|
|
210
|
+
<Card>
|
|
211
|
+
<Title order={4} mb="xs">Feature 2</Title>
|
|
212
|
+
<Text size="sm">Fixed padding and shadow</Text>
|
|
213
|
+
</Card>
|
|
214
|
+
<Card>
|
|
215
|
+
<Title order={4} mb="xs">Feature 3</Title>
|
|
216
|
+
<Text size="sm">Always has border and rounded corners</Text>
|
|
217
|
+
</Card>
|
|
218
|
+
</div>
|
|
219
|
+
),
|
|
220
|
+
parameters: {
|
|
221
|
+
docs: {
|
|
222
|
+
description: {
|
|
223
|
+
story: 'Example of cards in a grid layout showing consistent styling.',
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const WithCustomStyling: Story = {
|
|
230
|
+
render: () => (
|
|
231
|
+
<div style={{ display: 'flex', gap: '16px', width: '600px' }}>
|
|
232
|
+
<Card style={{ minHeight: '120px' }}>
|
|
233
|
+
<Title order={4} mb="xs">Custom Height</Title>
|
|
234
|
+
<Text size="sm">Card with custom minimum height applied via style prop</Text>
|
|
235
|
+
</Card>
|
|
236
|
+
<Card style={{ width: '200px' }}>
|
|
237
|
+
<Title order={4} mb="xs">Custom Width</Title>
|
|
238
|
+
<Text size="sm">Narrower card with custom width</Text>
|
|
239
|
+
</Card>
|
|
240
|
+
</div>
|
|
241
|
+
),
|
|
242
|
+
parameters: {
|
|
243
|
+
docs: {
|
|
244
|
+
description: {
|
|
245
|
+
story: 'Cards can still be customized with layout properties like width and height while maintaining consistent styling.',
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export const Interactive_Control: Story = {
|
|
252
|
+
args: {
|
|
253
|
+
children: (
|
|
254
|
+
<div>
|
|
255
|
+
<Title order={3} mb="xs">Interactive Card</Title>
|
|
256
|
+
<Text c="dimmed">
|
|
257
|
+
Use the controls below to toggle interactive behavior.
|
|
258
|
+
</Text>
|
|
259
|
+
</div>
|
|
260
|
+
),
|
|
261
|
+
interactive: false,
|
|
262
|
+
},
|
|
263
|
+
parameters: {
|
|
264
|
+
docs: {
|
|
265
|
+
description: {
|
|
266
|
+
story: 'Use the controls below to interact with the Card and see the interactive behavior.',
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export const HoverEffects: Story = {
|
|
273
|
+
render: () => (
|
|
274
|
+
<Stack gap="md">
|
|
275
|
+
<Card style={{ width: '400px' }}>
|
|
276
|
+
<Title order={4} mb="xs">Static Card</Title>
|
|
277
|
+
<Text size="sm" c="dimmed" mb="md">
|
|
278
|
+
This card has no hover effects. It maintains the default appearance.
|
|
279
|
+
</Text>
|
|
280
|
+
<Badge color="default" size="xs">No Interaction</Badge>
|
|
281
|
+
</Card>
|
|
282
|
+
|
|
283
|
+
<Card
|
|
284
|
+
interactive
|
|
285
|
+
onClick={() => alert('Card clicked!')}
|
|
286
|
+
style={{ width: '400px' }}
|
|
287
|
+
>
|
|
288
|
+
<Title order={4} mb="xs">Interactive Card</Title>
|
|
289
|
+
<Text size="sm" c="dimmed" mb="md">
|
|
290
|
+
This card has hover effects: lift animation, enhanced shadow, and border highlight.
|
|
291
|
+
</Text>
|
|
292
|
+
<Badge color="info" size="xs">Hover & Click Me!</Badge>
|
|
293
|
+
</Card>
|
|
294
|
+
|
|
295
|
+
<Card
|
|
296
|
+
interactive
|
|
297
|
+
onClick={() => console.log('Product card clicked')}
|
|
298
|
+
style={{ width: '400px' }}
|
|
299
|
+
>
|
|
300
|
+
<Inline gap="xs" mb="xs">
|
|
301
|
+
<ThemeIcon size="xxl">
|
|
302
|
+
<RiSmartphoneFill size={40} />
|
|
303
|
+
</ThemeIcon>
|
|
304
|
+
<Box>
|
|
305
|
+
<Title order={5}>iPhone 15 Pro</Title>
|
|
306
|
+
<Text size="sm" c="dimmed">Latest model</Text>
|
|
307
|
+
</Box>
|
|
308
|
+
</Inline>
|
|
309
|
+
|
|
310
|
+
<Box>
|
|
311
|
+
<Text size="lg" fw={600} mb="xs">$999</Text>
|
|
312
|
+
<Text size="sm" c="dimmed">Click to view details</Text>
|
|
313
|
+
</Box>
|
|
314
|
+
</Card>
|
|
315
|
+
|
|
316
|
+
<Card
|
|
317
|
+
interactive
|
|
318
|
+
onClick={() => console.log('Profile card clicked')}
|
|
319
|
+
style={{ width: '400px' }}
|
|
320
|
+
>
|
|
321
|
+
<Stack align="center" gap="xs">
|
|
322
|
+
<Avatar size="lg" variant="icon" icon={<RiUserFill size={40} />} />
|
|
323
|
+
<Box style={{ textAlign: 'center' }}>
|
|
324
|
+
<Title order={5}>Alex Smith</Title>
|
|
325
|
+
<Text size="sm" c="dimmed">
|
|
326
|
+
Product Designer
|
|
327
|
+
</Text>
|
|
328
|
+
</Box>
|
|
329
|
+
<Badge color="success" size="sm">Available</Badge>
|
|
330
|
+
</Stack>
|
|
331
|
+
</Card>
|
|
332
|
+
</Stack>
|
|
333
|
+
),
|
|
334
|
+
parameters: {
|
|
335
|
+
docs: {
|
|
336
|
+
description: {
|
|
337
|
+
story: 'Comparison of static cards vs interactive cards with hover effects. Interactive cards have: lift animation (translateY), enhanced shadow, border color change, and focus styles for accessibility.',
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export const WithSections: Story = {
|
|
344
|
+
render: () => (
|
|
345
|
+
<Stack gap="md">
|
|
346
|
+
{/* Card with header section */}
|
|
347
|
+
<Card style={{ width: '400px' }}>
|
|
348
|
+
<Card.Section withBorder inheritPadding py="xs">
|
|
349
|
+
<Inline justify="space-between" align="center">
|
|
350
|
+
<Title order={4} size="sm">Header Section</Title>
|
|
351
|
+
<Badge color="info" size="xs">New</Badge>
|
|
352
|
+
</Inline>
|
|
353
|
+
</Card.Section>
|
|
354
|
+
|
|
355
|
+
<Text size="sm" mb="md">
|
|
356
|
+
This card has a header section with border and inherited padding.
|
|
357
|
+
Perfect for card titles with actions.
|
|
358
|
+
</Text>
|
|
359
|
+
|
|
360
|
+
<Button size="sm" fullWidth>Action</Button>
|
|
361
|
+
</Card>
|
|
362
|
+
|
|
363
|
+
{/* Card with landscape image section */}
|
|
364
|
+
<Card style={{ width: '400px' }}>
|
|
365
|
+
<Card.Section>
|
|
366
|
+
<Image
|
|
367
|
+
src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400&h=200&fit=crop&crop=center"
|
|
368
|
+
height={160}
|
|
369
|
+
alt="Beautiful landscape"
|
|
370
|
+
style={{ objectFit: 'cover' }}
|
|
371
|
+
/>
|
|
372
|
+
</Card.Section>
|
|
373
|
+
|
|
374
|
+
<Title order={4} mt="md" mb="xs">Beautiful Landscape</Title>
|
|
375
|
+
<Text size="sm" c="dimmed">
|
|
376
|
+
Full bleed sections extend to the card edges, perfect for images or hero content.
|
|
377
|
+
</Text>
|
|
378
|
+
</Card>
|
|
379
|
+
|
|
380
|
+
{/* Card with footer section */}
|
|
381
|
+
<Card style={{ width: '400px' }}>
|
|
382
|
+
<Title order={4} mb="xs">Article Title</Title>
|
|
383
|
+
<Text size="sm" c="dimmed" mb="md">
|
|
384
|
+
This card demonstrates a footer section with inherited padding and border.
|
|
385
|
+
</Text>
|
|
386
|
+
|
|
387
|
+
<Card.Section withBorder inheritPadding py="xs">
|
|
388
|
+
<Inline justify="space-between" align="center">
|
|
389
|
+
<Text size="xs" c="dimmed">March 15, 2024</Text>
|
|
390
|
+
<Inline gap="xs">
|
|
391
|
+
<RiHeartLine size={14} />
|
|
392
|
+
<RiShareLine size={14} />
|
|
393
|
+
</Inline>
|
|
394
|
+
</Inline>
|
|
395
|
+
</Card.Section>
|
|
396
|
+
</Card>
|
|
397
|
+
</Stack>
|
|
398
|
+
),
|
|
399
|
+
parameters: {
|
|
400
|
+
docs: {
|
|
401
|
+
description: {
|
|
402
|
+
story: 'Showcase of Card.Section functionality: full bleed content, headers with borders, and footers. Use withBorder and inheritPadding props to control section styling.',
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
};
|