ai-design-system 0.1.0
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 +307 -0
- package/components/ai-elements/actions.tsx +65 -0
- package/components/ai-elements/artifact.tsx +147 -0
- package/components/ai-elements/branch.tsx +212 -0
- package/components/ai-elements/canvas.tsx +24 -0
- package/components/ai-elements/chain-of-thought.tsx +228 -0
- package/components/ai-elements/code-block.tsx +179 -0
- package/components/ai-elements/confirmation.tsx +169 -0
- package/components/ai-elements/connection.tsx +28 -0
- package/components/ai-elements/context.tsx +408 -0
- package/components/ai-elements/controls.tsx +18 -0
- package/components/ai-elements/conversation.tsx +97 -0
- package/components/ai-elements/edge.tsx +140 -0
- package/components/ai-elements/image.tsx +24 -0
- package/components/ai-elements/inline-citation.tsx +287 -0
- package/components/ai-elements/loader.tsx +96 -0
- package/components/ai-elements/message.tsx +80 -0
- package/components/ai-elements/node.tsx +71 -0
- package/components/ai-elements/open-in-chat.tsx +363 -0
- package/components/ai-elements/panel.tsx +15 -0
- package/components/ai-elements/plan.tsx +142 -0
- package/components/ai-elements/prompt-input.tsx +1352 -0
- package/components/ai-elements/queue.tsx +274 -0
- package/components/ai-elements/reasoning.tsx +178 -0
- package/components/ai-elements/response.tsx +22 -0
- package/components/ai-elements/shimmer.tsx +64 -0
- package/components/ai-elements/sources.tsx +77 -0
- package/components/ai-elements/suggestion.tsx +56 -0
- package/components/ai-elements/task.tsx +87 -0
- package/components/ai-elements/tool.tsx +179 -0
- package/components/ai-elements/toolbar.tsx +16 -0
- package/components/ai-elements/web-preview.tsx +263 -0
- package/components/blocks/AIConversation/AIConversation.stories.tsx +164 -0
- package/components/blocks/AIConversation/AIConversation.tsx +186 -0
- package/components/blocks/AIConversation/index.ts +8 -0
- package/components/blocks/AppSidebar/AppSidebar.stories.tsx +63 -0
- package/components/blocks/AppSidebar/AppSidebar.tsx +87 -0
- package/components/blocks/AppSidebar/index.ts +2 -0
- package/components/blocks/DocumentEditorWithComments/DocumentEditorWithComments.stories.tsx +341 -0
- package/components/blocks/DocumentEditorWithComments/DocumentEditorWithComments.tsx +255 -0
- package/components/blocks/DocumentEditorWithComments/index.ts +9 -0
- package/components/blocks/FileChangeQueue/FileChangeQueue.stories.tsx +207 -0
- package/components/blocks/FileChangeQueue/FileChangeQueue.tsx +143 -0
- package/components/blocks/FileChangeQueue/index.ts +7 -0
- package/components/blocks/LayoutProvider/LayoutProvider.tsx +34 -0
- package/components/blocks/LayoutProvider/index.ts +1 -0
- package/components/blocks/index.ts +2 -0
- package/components/composites/AgentIndicator/AgentIndicator.stories.tsx +154 -0
- package/components/composites/AgentIndicator/AgentIndicator.tsx +102 -0
- package/components/composites/AgentIndicator/index.ts +8 -0
- package/components/composites/AppHeader/AppHeader.stories.tsx +46 -0
- package/components/composites/AppHeader/AppHeader.tsx +24 -0
- package/components/composites/AppHeader/index.ts +2 -0
- package/components/composites/CommentBox/CommentBox.stories.tsx +192 -0
- package/components/composites/CommentBox/CommentBox.tsx +364 -0
- package/components/composites/CommentBox/index.ts +8 -0
- package/components/composites/Confirmation/Confirmation.stories.tsx +151 -0
- package/components/composites/Confirmation/Confirmation.tsx +93 -0
- package/components/composites/Confirmation/index.ts +7 -0
- package/components/composites/DataTable/DataTable.stories.tsx +35 -0
- package/components/composites/DataTable/DataTable.tsx +95 -0
- package/components/composites/DataTable/index.ts +2 -0
- package/components/composites/DocumentEditor/DocumentEditor.css +106 -0
- package/components/composites/DocumentEditor/DocumentEditor.stories.tsx +927 -0
- package/components/composites/DocumentEditor/DocumentEditor.tsx +279 -0
- package/components/composites/DocumentEditor/index.ts +8 -0
- package/components/composites/FileQueue/FileQueue.stories.tsx +175 -0
- package/components/composites/FileQueue/FileQueue.tsx +161 -0
- package/components/composites/FileQueue/FileStatusBadge.tsx +74 -0
- package/components/composites/FileQueue/index.ts +24 -0
- package/components/composites/InteractiveChart/InteractiveChart.stories.tsx +49 -0
- package/components/composites/InteractiveChart/InteractiveChart.tsx +69 -0
- package/components/composites/InteractiveChart/index.ts +2 -0
- package/components/composites/ModeToggle/ModeToggle.stories.tsx +212 -0
- package/components/composites/ModeToggle/ModeToggle.tsx +100 -0
- package/components/composites/ModeToggle/index.ts +7 -0
- package/components/composites/NavUser/NavUser.stories.tsx +50 -0
- package/components/composites/NavUser/NavUser.tsx +60 -0
- package/components/composites/NavUser/index.ts +2 -0
- package/components/composites/NavigationList/NavigationList.stories.tsx +46 -0
- package/components/composites/NavigationList/NavigationList.tsx +46 -0
- package/components/composites/NavigationList/index.ts +2 -0
- package/components/composites/OrchestratorMessage/OrchestratorMessage.stories.tsx +188 -0
- package/components/composites/OrchestratorMessage/OrchestratorMessage.tsx +72 -0
- package/components/composites/OrchestratorMessage/index.ts +8 -0
- package/components/composites/PageContainer/PageContainer.stories.tsx +41 -0
- package/components/composites/PageContainer/PageContainer.tsx +24 -0
- package/components/composites/PageContainer/index.ts +2 -0
- package/components/composites/PromptInput/PromptInput.stories.tsx +200 -0
- package/components/composites/PromptInput/PromptInput.tsx +129 -0
- package/components/composites/PromptInput/index.ts +8 -0
- package/components/composites/SpecialistMessage/SpecialistMessage.stories.tsx +286 -0
- package/components/composites/SpecialistMessage/SpecialistMessage.tsx +107 -0
- package/components/composites/SpecialistMessage/index.ts +8 -0
- package/components/composites/StatsCard/StatsCard.stories.tsx +76 -0
- package/components/composites/StatsCard/StatsCard.tsx +81 -0
- package/components/composites/StatsCard/index.ts +2 -0
- package/components/composites/TablePagination/TablePagination.stories.tsx +38 -0
- package/components/composites/TablePagination/TablePagination.tsx +119 -0
- package/components/composites/TablePagination/index.ts +2 -0
- package/components/composites/TableToolbar/TableToolbar.stories.tsx +60 -0
- package/components/composites/TableToolbar/TableToolbar.tsx +66 -0
- package/components/composites/TableToolbar/index.ts +2 -0
- package/components/composites/ThemeSelector/ThemeSelector.stories.tsx +48 -0
- package/components/composites/ThemeSelector/ThemeSelector.tsx +79 -0
- package/components/composites/ThemeSelector/index.ts +2 -0
- package/components/composites/ToolCallDisplay/ToolCallDisplay.stories.tsx +49 -0
- package/components/composites/ToolCallDisplay/ToolCallDisplay.tsx +108 -0
- package/components/composites/ToolCallDisplay/index.ts +8 -0
- package/components/composites/UserMessage/UserMessage.stories.tsx +59 -0
- package/components/composites/UserMessage/UserMessage.tsx +52 -0
- package/components/composites/UserMessage/index.ts +8 -0
- package/components/composites/index.ts +90 -0
- package/components/features/AIDocEditor/AIDocEditor.behaviors.stories.tsx +451 -0
- package/components/features/AIDocEditor/AIDocEditor.mocks.ts +96 -0
- package/components/features/AIDocEditor/AIDocEditor.stories.tsx +140 -0
- package/components/features/AIDocEditor/AIDocEditor.tsx +130 -0
- package/components/features/AIDocEditor/index.ts +8 -0
- package/components/features/AIDocEditor/useAIDocEditor.d.ts +97 -0
- package/components/features/AIDocEditor/useAIDocEditor.mock.ts +83 -0
- package/components/features/PageLayout/PageLayout.behaviors.stories.tsx +119 -0
- package/components/features/PageLayout/PageLayout.mocks.ts +27 -0
- package/components/features/PageLayout/PageLayout.stories.tsx +142 -0
- package/components/features/PageLayout/PageLayout.tsx +94 -0
- package/components/features/PageLayout/index.ts +4 -0
- package/components/features/PageLayout/usePageLayout.d.ts +24 -0
- package/components/features/PageLayout/usePageLayout.mock.ts +19 -0
- package/components/features/RefinementPanel/README.md +189 -0
- package/components/features/RefinementPanel/RefinementPanel.behaviors.stories.tsx +475 -0
- package/components/features/RefinementPanel/RefinementPanel.mocks.ts +131 -0
- package/components/features/RefinementPanel/RefinementPanel.stories.tsx +141 -0
- package/components/features/RefinementPanel/RefinementPanel.tsx +160 -0
- package/components/features/RefinementPanel/index.ts +25 -0
- package/components/features/RefinementPanel/useRefinementPanel.d.ts +74 -0
- package/components/features/RefinementPanel/useRefinementPanel.mock.ts +121 -0
- package/components/features/SpecNavigator/SpecNavigator.behaviors.stories.tsx +379 -0
- package/components/features/SpecNavigator/SpecNavigator.mocks.ts +131 -0
- package/components/features/SpecNavigator/SpecNavigator.stories.tsx +122 -0
- package/components/features/SpecNavigator/SpecNavigator.tsx +43 -0
- package/components/features/SpecNavigator/index.ts +2 -0
- package/components/features/SpecNavigator/useSpecNavigator.d.ts +122 -0
- package/components/features/SpecNavigator/useSpecNavigator.mock.ts +93 -0
- package/components/features/index.ts +18 -0
- package/components/index.ts +14 -0
- package/components/primitives/Accordion/Accordion.stories.tsx +87 -0
- package/components/primitives/Accordion/Accordion.tsx +66 -0
- package/components/primitives/Accordion/index.ts +13 -0
- package/components/primitives/Alert/Alert.stories.tsx +422 -0
- package/components/primitives/Alert/Alert.tsx +61 -0
- package/components/primitives/Alert/index.ts +8 -0
- package/components/primitives/AlertDialog/AlertDialog.stories.tsx +367 -0
- package/components/primitives/AlertDialog/AlertDialog.tsx +182 -0
- package/components/primitives/AlertDialog/index.ts +25 -0
- package/components/primitives/Avatar/Avatar.stories.tsx +321 -0
- package/components/primitives/Avatar/Avatar.tsx +63 -0
- package/components/primitives/Avatar/index.ts +8 -0
- package/components/primitives/Badge/Badge.stories.tsx +74 -0
- package/components/primitives/Badge/Badge.tsx +49 -0
- package/components/primitives/Badge/index.ts +2 -0
- package/components/primitives/Button/Button.stories.tsx +445 -0
- package/components/primitives/Button/Button.tsx +89 -0
- package/components/primitives/Button/index.ts +7 -0
- package/components/primitives/Card/Card.stories.tsx +831 -0
- package/components/primitives/Card/Card.tsx +242 -0
- package/components/primitives/Card/index.ts +30 -0
- package/components/primitives/Carousel/Carousel.stories.tsx +32 -0
- package/components/primitives/Carousel/Carousel.tsx +63 -0
- package/components/primitives/Carousel/index.ts +13 -0
- package/components/primitives/Chart/Chart.stories.tsx +346 -0
- package/components/primitives/Chart/Chart.tsx +117 -0
- package/components/primitives/Chart/index.ts +20 -0
- package/components/primitives/Checkbox/Checkbox.stories.tsx +87 -0
- package/components/primitives/Checkbox/Checkbox.tsx +38 -0
- package/components/primitives/Checkbox/index.ts +2 -0
- package/components/primitives/Collapsible/Collapsible.stories.tsx +38 -0
- package/components/primitives/Collapsible/Collapsible.tsx +39 -0
- package/components/primitives/Collapsible/index.ts +8 -0
- package/components/primitives/Command/Command.stories.tsx +150 -0
- package/components/primitives/Command/Command.tsx +147 -0
- package/components/primitives/Command/index.ts +20 -0
- package/components/primitives/Dialog/Dialog.stories.tsx +390 -0
- package/components/primitives/Dialog/Dialog.tsx +140 -0
- package/components/primitives/Dialog/index.ts +22 -0
- package/components/primitives/Drawer/Drawer.stories.tsx +327 -0
- package/components/primitives/Drawer/Drawer.tsx +208 -0
- package/components/primitives/Drawer/index.ts +27 -0
- package/components/primitives/DropdownMenu/DropdownMenu.stories.tsx +150 -0
- package/components/primitives/DropdownMenu/DropdownMenu.tsx +73 -0
- package/components/primitives/DropdownMenu/index.ts +1 -0
- package/components/primitives/HoverCard/HoverCard.stories.tsx +26 -0
- package/components/primitives/HoverCard/HoverCard.tsx +39 -0
- package/components/primitives/HoverCard/index.ts +8 -0
- package/components/primitives/Icon/Icon.stories.tsx +281 -0
- package/components/primitives/Icon/Icon.tsx +87 -0
- package/components/primitives/Icon/index.ts +8 -0
- package/components/primitives/Input/Input.stories.tsx +370 -0
- package/components/primitives/Input/Input.tsx +88 -0
- package/components/primitives/Input/index.ts +7 -0
- package/components/primitives/InputGroup/InputGroup.stories.tsx +40 -0
- package/components/primitives/InputGroup/InputGroup.tsx +72 -0
- package/components/primitives/InputGroup/index.ts +14 -0
- package/components/primitives/Label/Label.stories.tsx +227 -0
- package/components/primitives/Label/Label.tsx +53 -0
- package/components/primitives/Label/index.ts +7 -0
- package/components/primitives/Popover/Popover.stories.tsx +42 -0
- package/components/primitives/Popover/Popover.tsx +107 -0
- package/components/primitives/Popover/index.ts +2 -0
- package/components/primitives/Progress/Progress.stories.tsx +340 -0
- package/components/primitives/Progress/Progress.tsx +31 -0
- package/components/primitives/Progress/index.ts +1 -0
- package/components/primitives/ScrollArea/ScrollArea.stories.tsx +26 -0
- package/components/primitives/ScrollArea/ScrollArea.tsx +28 -0
- package/components/primitives/ScrollArea/index.ts +6 -0
- package/components/primitives/Select/Select.stories.tsx +288 -0
- package/components/primitives/Select/Select.tsx +162 -0
- package/components/primitives/Select/index.ts +22 -0
- package/components/primitives/Separator/Separator.stories.tsx +264 -0
- package/components/primitives/Separator/Separator.tsx +48 -0
- package/components/primitives/Separator/index.ts +7 -0
- package/components/primitives/Sidebar/Sidebar.stories.tsx +358 -0
- package/components/primitives/Sidebar/Sidebar.tsx +317 -0
- package/components/primitives/Sidebar/index.ts +41 -0
- package/components/primitives/Table/Table.stories.tsx +389 -0
- package/components/primitives/Table/Table.tsx +191 -0
- package/components/primitives/Table/index.ts +26 -0
- package/components/primitives/Tabs/Tabs.stories.tsx +129 -0
- package/components/primitives/Tabs/Tabs.tsx +70 -0
- package/components/primitives/Tabs/index.ts +13 -0
- package/components/primitives/Textarea/Textarea.stories.tsx +358 -0
- package/components/primitives/Textarea/Textarea.tsx +91 -0
- package/components/primitives/Textarea/index.ts +7 -0
- package/components/primitives/ToggleGroup/ToggleGroup.stories.tsx +87 -0
- package/components/primitives/ToggleGroup/ToggleGroup.tsx +52 -0
- package/components/primitives/ToggleGroup/index.ts +6 -0
- package/components/primitives/Tooltip/Tooltip.stories.tsx +336 -0
- package/components/primitives/Tooltip/Tooltip.tsx +78 -0
- package/components/primitives/Tooltip/index.ts +10 -0
- package/components/primitives/index.ts +34 -0
- package/components/ui/accordion.tsx +66 -0
- package/components/ui/alert-dialog.tsx +157 -0
- package/components/ui/alert.tsx +66 -0
- package/components/ui/avatar.tsx +53 -0
- package/components/ui/badge.tsx +46 -0
- package/components/ui/button.tsx +60 -0
- package/components/ui/card.tsx +117 -0
- package/components/ui/carousel.tsx +241 -0
- package/components/ui/chart.tsx +334 -0
- package/components/ui/checkbox.tsx +32 -0
- package/components/ui/collapsible.tsx +33 -0
- package/components/ui/command.tsx +184 -0
- package/components/ui/dialog.tsx +143 -0
- package/components/ui/drawer.tsx +118 -0
- package/components/ui/dropdown-menu.tsx +257 -0
- package/components/ui/hover-card.tsx +44 -0
- package/components/ui/input-group.tsx +170 -0
- package/components/ui/input.tsx +48 -0
- package/components/ui/label.tsx +26 -0
- package/components/ui/popover.tsx +33 -0
- package/components/ui/progress.tsx +31 -0
- package/components/ui/scroll-area.tsx +58 -0
- package/components/ui/select.tsx +187 -0
- package/components/ui/separator.tsx +31 -0
- package/components/ui/sidebar.tsx +577 -0
- package/components/ui/table.tsx +120 -0
- package/components/ui/tabs.tsx +66 -0
- package/components/ui/textarea.tsx +46 -0
- package/components/ui/toggle-group.tsx +83 -0
- package/components/ui/toggle.tsx +47 -0
- package/components/ui/tooltip.tsx +61 -0
- package/dist/index.cjs +7389 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +75 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +7160 -0
- package/dist/index.js.map +1 -0
- package/hooks/useAIDocReviewer.d.ts +0 -0
- package/lib/utils.ts +6 -0
- package/package.json +140 -0
- package/tokens/color/base.json +14 -0
- package/tokens/color/dark.json +40 -0
- package/tokens/color/green.json +21 -0
- package/tokens/color/light.json +52 -0
- package/tokens/color/neutral.json +20 -0
- package/tokens/color/violet.json +21 -0
- package/tokens/spacing.json +22 -0
- package/utils/ai-editor/format-date.ts +41 -0
- package/utils/ai-editor/index.ts +22 -0
- package/utils/ai-editor/type-guards.ts +72 -0
- package/utils/ai-editor/validation.ts +130 -0
- package/utils/editor-annotations.ts +122 -0
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardHeader,
|
|
5
|
+
CardTitle,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardFooter,
|
|
9
|
+
CardAction,
|
|
10
|
+
} from './Card'
|
|
11
|
+
import { Button } from '../Button/Button'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Card Primitive Stories
|
|
15
|
+
*
|
|
16
|
+
* The Card component is a foundational primitive for grouping related content and actions.
|
|
17
|
+
* It provides a flexible container with consistent styling, spacing, and visual hierarchy.
|
|
18
|
+
* Cards are essential building blocks for creating organized, scannable interfaces.
|
|
19
|
+
*
|
|
20
|
+
* ## Features
|
|
21
|
+
* - Flexible composition with Header, Title, Description, Content, Footer, and Action sub-components
|
|
22
|
+
* - Consistent spacing and padding throughout
|
|
23
|
+
* - Semantic HTML structure for accessibility
|
|
24
|
+
* - Dark mode support with automatic theming
|
|
25
|
+
* - Responsive design that adapts to container width
|
|
26
|
+
* - Shadow and border styling for visual depth
|
|
27
|
+
*
|
|
28
|
+
* ## Component Structure
|
|
29
|
+
* Cards are composed of several sub-components that work together:
|
|
30
|
+
* - **Card**: Main container with rounded corners, border, and shadow
|
|
31
|
+
* - **CardHeader**: Container for title, description, and optional actions
|
|
32
|
+
* - **CardTitle**: Main heading with semibold typography
|
|
33
|
+
* - **CardDescription**: Supporting text with muted styling
|
|
34
|
+
* - **CardContent**: Main body content area with consistent padding
|
|
35
|
+
* - **CardFooter**: Footer area typically containing actions or supplementary info
|
|
36
|
+
* - **CardAction**: Positioned action buttons or icons in the header
|
|
37
|
+
*
|
|
38
|
+
* ## Accessibility
|
|
39
|
+
* - Semantic HTML structure with proper heading hierarchy
|
|
40
|
+
* - Keyboard navigation support for interactive elements
|
|
41
|
+
* - ARIA attributes for screen readers when needed
|
|
42
|
+
* - Sufficient color contrast in both light and dark modes
|
|
43
|
+
* - Focus management for interactive cards
|
|
44
|
+
*
|
|
45
|
+
* ## Usage Guidelines
|
|
46
|
+
*
|
|
47
|
+
* ### Do's
|
|
48
|
+
* - Use cards to group related content and actions
|
|
49
|
+
* - Maintain consistent card styling across the application
|
|
50
|
+
* - Keep card content focused and concise
|
|
51
|
+
* - Use CardTitle for clear, descriptive headings
|
|
52
|
+
* - Place primary actions in CardFooter
|
|
53
|
+
* - Use CardDescription to provide context
|
|
54
|
+
*
|
|
55
|
+
* ### Don'ts
|
|
56
|
+
* - Don't nest cards too deeply (avoid card-in-card patterns)
|
|
57
|
+
* - Don't overcrowd cards with too much content
|
|
58
|
+
* - Don't use cards for every piece of content (consider alternatives)
|
|
59
|
+
* - Don't forget to provide adequate spacing between cards
|
|
60
|
+
* - Don't use overly long titles or descriptions
|
|
61
|
+
*/
|
|
62
|
+
const meta = {
|
|
63
|
+
title: 'Primitives/Card',
|
|
64
|
+
component: Card,
|
|
65
|
+
tags: ['autodocs'],
|
|
66
|
+
parameters: {
|
|
67
|
+
layout: 'centered',
|
|
68
|
+
docs: {
|
|
69
|
+
description: {
|
|
70
|
+
component:
|
|
71
|
+
'A versatile card component for grouping related content and actions, built on shadcn/ui foundation.',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
argTypes: {
|
|
76
|
+
elevation: {
|
|
77
|
+
control: 'select',
|
|
78
|
+
options: ['flat', 'elevated', 'outlined'],
|
|
79
|
+
description: 'Elevation variant of the card',
|
|
80
|
+
table: {
|
|
81
|
+
defaultValue: { summary: 'flat' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
padding: {
|
|
85
|
+
control: 'select',
|
|
86
|
+
options: ['sm', 'default', 'lg'],
|
|
87
|
+
description: 'Padding variant of the card',
|
|
88
|
+
table: {
|
|
89
|
+
defaultValue: { summary: 'default' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
} satisfies Meta<typeof Card>
|
|
94
|
+
|
|
95
|
+
export default meta
|
|
96
|
+
type Story = StoryObj<typeof meta>
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Default card
|
|
100
|
+
*
|
|
101
|
+
* A simple card with just content. This is the most basic form of a card,
|
|
102
|
+
* useful for displaying standalone content without additional context.
|
|
103
|
+
*/
|
|
104
|
+
export const Default: Story = {
|
|
105
|
+
render: () => (
|
|
106
|
+
<Card style={{ width: '350px' }}>
|
|
107
|
+
<CardContent>
|
|
108
|
+
<p>This is a simple card with just content. It provides a clean container for your information.</p>
|
|
109
|
+
</CardContent>
|
|
110
|
+
</Card>
|
|
111
|
+
),
|
|
112
|
+
parameters: {
|
|
113
|
+
docs: {
|
|
114
|
+
description: {
|
|
115
|
+
story: 'The simplest card structure with only content, useful for basic content containers.',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Card with header
|
|
123
|
+
*
|
|
124
|
+
* A card with a header section containing a title.
|
|
125
|
+
* This is the most common card pattern, providing clear context for the content.
|
|
126
|
+
*/
|
|
127
|
+
export const WithHeader: Story = {
|
|
128
|
+
render: () => (
|
|
129
|
+
<Card style={{ width: '350px' }}>
|
|
130
|
+
<CardHeader>
|
|
131
|
+
<CardTitle>Card Title</CardTitle>
|
|
132
|
+
</CardHeader>
|
|
133
|
+
<CardContent>
|
|
134
|
+
<p>
|
|
135
|
+
This card includes a header with a title, providing clear context for the content below. Headers help
|
|
136
|
+
establish visual hierarchy and improve scanability.
|
|
137
|
+
</p>
|
|
138
|
+
</CardContent>
|
|
139
|
+
</Card>
|
|
140
|
+
),
|
|
141
|
+
parameters: {
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story: 'Card with a header section containing a title, the most common card pattern.',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Card with header and description
|
|
152
|
+
*
|
|
153
|
+
* A card with both title and description in the header.
|
|
154
|
+
* The description provides additional context in a muted style.
|
|
155
|
+
*/
|
|
156
|
+
export const WithHeaderAndDescription: Story = {
|
|
157
|
+
render: () => (
|
|
158
|
+
<Card style={{ width: '350px' }}>
|
|
159
|
+
<CardHeader>
|
|
160
|
+
<CardTitle>Feature Overview</CardTitle>
|
|
161
|
+
<CardDescription>Comprehensive details about this feature and its capabilities.</CardDescription>
|
|
162
|
+
</CardHeader>
|
|
163
|
+
<CardContent>
|
|
164
|
+
<p>
|
|
165
|
+
The card description appears in a muted color below the title, providing supplementary information without
|
|
166
|
+
competing for attention. This creates a clear visual hierarchy.
|
|
167
|
+
</p>
|
|
168
|
+
</CardContent>
|
|
169
|
+
</Card>
|
|
170
|
+
),
|
|
171
|
+
parameters: {
|
|
172
|
+
docs: {
|
|
173
|
+
description: {
|
|
174
|
+
story: 'Card with both title and supporting description text in the header for additional context.',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Card with footer
|
|
182
|
+
*
|
|
183
|
+
* A card with a footer section containing actions.
|
|
184
|
+
* Footers are ideal for call-to-action buttons or supplementary information.
|
|
185
|
+
*/
|
|
186
|
+
export const WithFooter: Story = {
|
|
187
|
+
render: () => (
|
|
188
|
+
<Card style={{ width: '350px' }}>
|
|
189
|
+
<CardHeader>
|
|
190
|
+
<CardTitle>Action Required</CardTitle>
|
|
191
|
+
<CardDescription>Please review and confirm the information below.</CardDescription>
|
|
192
|
+
</CardHeader>
|
|
193
|
+
<CardContent>
|
|
194
|
+
<p>Card content goes here. The footer below provides actions related to this content.</p>
|
|
195
|
+
</CardContent>
|
|
196
|
+
<CardFooter>
|
|
197
|
+
<Button variant="default">Confirm</Button>
|
|
198
|
+
<Button variant="outline">Cancel</Button>
|
|
199
|
+
</CardFooter>
|
|
200
|
+
</Card>
|
|
201
|
+
),
|
|
202
|
+
parameters: {
|
|
203
|
+
docs: {
|
|
204
|
+
description: {
|
|
205
|
+
story: 'Card with a footer section containing action buttons, perfect for forms or confirmations.',
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Complete card structure
|
|
213
|
+
*
|
|
214
|
+
* A fully featured card with all available sub-components:
|
|
215
|
+
* header, title, description, content, and footer.
|
|
216
|
+
*/
|
|
217
|
+
export const Complete: Story = {
|
|
218
|
+
render: () => (
|
|
219
|
+
<Card style={{ width: '400px' }}>
|
|
220
|
+
<CardHeader>
|
|
221
|
+
<CardTitle>Complete Card Example</CardTitle>
|
|
222
|
+
<CardDescription>This card demonstrates all available sub-components working together.</CardDescription>
|
|
223
|
+
</CardHeader>
|
|
224
|
+
<CardContent>
|
|
225
|
+
<div style={{ marginBottom: '16px' }}>
|
|
226
|
+
<p style={{ marginBottom: '12px' }}>
|
|
227
|
+
This is a fully featured card showcasing the complete structure available in the design system.
|
|
228
|
+
</p>
|
|
229
|
+
<ul style={{ listStyle: 'disc', paddingLeft: '20px', marginBottom: '12px' }}>
|
|
230
|
+
<li>CardHeader for grouping title and description</li>
|
|
231
|
+
<li>CardTitle for the main heading</li>
|
|
232
|
+
<li>CardDescription for supporting text</li>
|
|
233
|
+
<li>CardContent for the main body</li>
|
|
234
|
+
<li>CardFooter for actions</li>
|
|
235
|
+
</ul>
|
|
236
|
+
<p>Use this structure when you need to present comprehensive information with clear hierarchy.</p>
|
|
237
|
+
</div>
|
|
238
|
+
</CardContent>
|
|
239
|
+
<CardFooter>
|
|
240
|
+
<Button variant="default" size="sm">
|
|
241
|
+
Primary Action
|
|
242
|
+
</Button>
|
|
243
|
+
<Button variant="outline" size="sm">
|
|
244
|
+
Secondary
|
|
245
|
+
</Button>
|
|
246
|
+
</CardFooter>
|
|
247
|
+
</Card>
|
|
248
|
+
),
|
|
249
|
+
parameters: {
|
|
250
|
+
docs: {
|
|
251
|
+
description: {
|
|
252
|
+
story: 'Complete card structure demonstrating all available sub-components and their composition.',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Card with header action
|
|
260
|
+
*
|
|
261
|
+
* A card with an action button in the header using CardAction.
|
|
262
|
+
* Useful for cards that need quick access to actions like edit, delete, or more options.
|
|
263
|
+
*/
|
|
264
|
+
export const WithHeaderAction: Story = {
|
|
265
|
+
render: () => (
|
|
266
|
+
<Card style={{ width: '350px' }}>
|
|
267
|
+
<CardHeader>
|
|
268
|
+
<CardTitle>Settings Panel</CardTitle>
|
|
269
|
+
<CardDescription>Configure your preferences below.</CardDescription>
|
|
270
|
+
<CardAction>
|
|
271
|
+
<Button variant="ghost" size="icon-sm" aria-label="More options">
|
|
272
|
+
•••
|
|
273
|
+
</Button>
|
|
274
|
+
</CardAction>
|
|
275
|
+
</CardHeader>
|
|
276
|
+
<CardContent>
|
|
277
|
+
<p>The CardAction component positions action buttons in the header, typically for edit or menu actions.</p>
|
|
278
|
+
</CardContent>
|
|
279
|
+
</Card>
|
|
280
|
+
),
|
|
281
|
+
parameters: {
|
|
282
|
+
docs: {
|
|
283
|
+
description: {
|
|
284
|
+
story: 'Card with an action button positioned in the header using CardAction component.',
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Multiple cards in a grid
|
|
292
|
+
*
|
|
293
|
+
* Demonstrates how cards work together in a grid layout.
|
|
294
|
+
* Shows consistent spacing and alignment when using multiple cards.
|
|
295
|
+
*/
|
|
296
|
+
export const MultipleCards: Story = {
|
|
297
|
+
render: () => (
|
|
298
|
+
<div
|
|
299
|
+
style={{
|
|
300
|
+
display: 'grid',
|
|
301
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
|
|
302
|
+
gap: '24px',
|
|
303
|
+
maxWidth: '900px',
|
|
304
|
+
}}
|
|
305
|
+
>
|
|
306
|
+
<Card>
|
|
307
|
+
<CardHeader>
|
|
308
|
+
<CardTitle>Analytics</CardTitle>
|
|
309
|
+
<CardDescription>View your performance metrics</CardDescription>
|
|
310
|
+
</CardHeader>
|
|
311
|
+
<CardContent>
|
|
312
|
+
<div style={{ fontSize: '32px', fontWeight: 'bold', marginBottom: '8px' }}>2,847</div>
|
|
313
|
+
<p style={{ fontSize: '14px', color: 'hsl(var(--muted-foreground))' }}>Total views this month</p>
|
|
314
|
+
</CardContent>
|
|
315
|
+
<CardFooter>
|
|
316
|
+
<Button variant="outline" size="sm">
|
|
317
|
+
View Details
|
|
318
|
+
</Button>
|
|
319
|
+
</CardFooter>
|
|
320
|
+
</Card>
|
|
321
|
+
|
|
322
|
+
<Card>
|
|
323
|
+
<CardHeader>
|
|
324
|
+
<CardTitle>Revenue</CardTitle>
|
|
325
|
+
<CardDescription>Monthly earnings overview</CardDescription>
|
|
326
|
+
</CardHeader>
|
|
327
|
+
<CardContent>
|
|
328
|
+
<div style={{ fontSize: '32px', fontWeight: 'bold', marginBottom: '8px' }}>$12,459</div>
|
|
329
|
+
<p style={{ fontSize: '14px', color: 'hsl(var(--muted-foreground))' }}>+18% from last month</p>
|
|
330
|
+
</CardContent>
|
|
331
|
+
<CardFooter>
|
|
332
|
+
<Button variant="outline" size="sm">
|
|
333
|
+
View Report
|
|
334
|
+
</Button>
|
|
335
|
+
</CardFooter>
|
|
336
|
+
</Card>
|
|
337
|
+
|
|
338
|
+
<Card>
|
|
339
|
+
<CardHeader>
|
|
340
|
+
<CardTitle>Notifications</CardTitle>
|
|
341
|
+
<CardDescription>Recent activity updates</CardDescription>
|
|
342
|
+
</CardHeader>
|
|
343
|
+
<CardContent>
|
|
344
|
+
<div style={{ fontSize: '32px', fontWeight: 'bold', marginBottom: '8px' }}>12</div>
|
|
345
|
+
<p style={{ fontSize: '14px', color: 'hsl(var(--muted-foreground))' }}>Unread notifications</p>
|
|
346
|
+
</CardContent>
|
|
347
|
+
<CardFooter>
|
|
348
|
+
<Button variant="outline" size="sm">
|
|
349
|
+
View All
|
|
350
|
+
</Button>
|
|
351
|
+
</CardFooter>
|
|
352
|
+
</Card>
|
|
353
|
+
</div>
|
|
354
|
+
),
|
|
355
|
+
parameters: {
|
|
356
|
+
docs: {
|
|
357
|
+
description: {
|
|
358
|
+
story: 'Multiple cards arranged in a responsive grid layout, demonstrating consistent spacing and alignment.',
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
layout: 'padded',
|
|
362
|
+
},
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Card with complex content
|
|
367
|
+
*
|
|
368
|
+
* Demonstrates a card with more complex content structure,
|
|
369
|
+
* including multiple paragraphs, lists, and rich formatting.
|
|
370
|
+
*/
|
|
371
|
+
export const WithComplexContent: Story = {
|
|
372
|
+
render: () => (
|
|
373
|
+
<Card style={{ width: '500px' }}>
|
|
374
|
+
<CardHeader>
|
|
375
|
+
<CardTitle>Getting Started Guide</CardTitle>
|
|
376
|
+
<CardDescription>Everything you need to know to begin using the platform.</CardDescription>
|
|
377
|
+
</CardHeader>
|
|
378
|
+
<CardContent>
|
|
379
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
380
|
+
<section>
|
|
381
|
+
<h4 style={{ fontWeight: 600, marginBottom: '8px' }}>Step 1: Setup</h4>
|
|
382
|
+
<p style={{ fontSize: '14px', lineHeight: '1.6' }}>
|
|
383
|
+
Begin by configuring your account settings and preferences. This ensures a personalized experience
|
|
384
|
+
tailored to your needs.
|
|
385
|
+
</p>
|
|
386
|
+
</section>
|
|
387
|
+
|
|
388
|
+
<section>
|
|
389
|
+
<h4 style={{ fontWeight: 600, marginBottom: '8px' }}>Step 2: Integration</h4>
|
|
390
|
+
<p style={{ fontSize: '14px', lineHeight: '1.6' }}>
|
|
391
|
+
Connect your existing tools and services for seamless workflow integration. We support all major
|
|
392
|
+
platforms.
|
|
393
|
+
</p>
|
|
394
|
+
</section>
|
|
395
|
+
|
|
396
|
+
<section>
|
|
397
|
+
<h4 style={{ fontWeight: 600, marginBottom: '8px' }}>Step 3: Launch</h4>
|
|
398
|
+
<p style={{ fontSize: '14px', lineHeight: '1.6' }}>
|
|
399
|
+
You're ready to go! Start exploring features and building your first project.
|
|
400
|
+
</p>
|
|
401
|
+
</section>
|
|
402
|
+
</div>
|
|
403
|
+
</CardContent>
|
|
404
|
+
<CardFooter>
|
|
405
|
+
<Button variant="default">Start Tutorial</Button>
|
|
406
|
+
<Button variant="ghost">Skip for Now</Button>
|
|
407
|
+
</CardFooter>
|
|
408
|
+
</Card>
|
|
409
|
+
),
|
|
410
|
+
parameters: {
|
|
411
|
+
docs: {
|
|
412
|
+
description: {
|
|
413
|
+
story: 'Card containing complex structured content with multiple sections and rich formatting.',
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Compact cards
|
|
421
|
+
*
|
|
422
|
+
* Smaller cards suitable for dashboards or dense layouts.
|
|
423
|
+
* Demonstrates minimal structure with concise content.
|
|
424
|
+
*/
|
|
425
|
+
export const CompactCards: Story = {
|
|
426
|
+
render: () => (
|
|
427
|
+
<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
|
|
428
|
+
<Card style={{ width: '200px' }}>
|
|
429
|
+
<CardContent>
|
|
430
|
+
<div style={{ textAlign: 'center' }}>
|
|
431
|
+
<div style={{ fontSize: '24px', fontWeight: 'bold', marginBottom: '4px' }}>156</div>
|
|
432
|
+
<div style={{ fontSize: '12px', color: 'hsl(var(--muted-foreground))' }}>Active Users</div>
|
|
433
|
+
</div>
|
|
434
|
+
</CardContent>
|
|
435
|
+
</Card>
|
|
436
|
+
|
|
437
|
+
<Card style={{ width: '200px' }}>
|
|
438
|
+
<CardContent>
|
|
439
|
+
<div style={{ textAlign: 'center' }}>
|
|
440
|
+
<div style={{ fontSize: '24px', fontWeight: 'bold', marginBottom: '4px' }}>89%</div>
|
|
441
|
+
<div style={{ fontSize: '12px', color: 'hsl(var(--muted-foreground))' }}>Completion Rate</div>
|
|
442
|
+
</div>
|
|
443
|
+
</CardContent>
|
|
444
|
+
</Card>
|
|
445
|
+
|
|
446
|
+
<Card style={{ width: '200px' }}>
|
|
447
|
+
<CardContent>
|
|
448
|
+
<div style={{ textAlign: 'center' }}>
|
|
449
|
+
<div style={{ fontSize: '24px', fontWeight: 'bold', marginBottom: '4px' }}>24/7</div>
|
|
450
|
+
<div style={{ fontSize: '12px', color: 'hsl(var(--muted-foreground))' }}>Support Available</div>
|
|
451
|
+
</div>
|
|
452
|
+
</CardContent>
|
|
453
|
+
</Card>
|
|
454
|
+
</div>
|
|
455
|
+
),
|
|
456
|
+
parameters: {
|
|
457
|
+
docs: {
|
|
458
|
+
description: {
|
|
459
|
+
story: 'Compact cards with minimal content, ideal for dashboards and metric displays.',
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Dark mode preview
|
|
467
|
+
*
|
|
468
|
+
* All card variants in dark mode to verify theming compatibility.
|
|
469
|
+
* Cards automatically adapt to dark mode with appropriate contrast and styling.
|
|
470
|
+
*/
|
|
471
|
+
export const DarkMode: Story = {
|
|
472
|
+
render: () => (
|
|
473
|
+
<div className="dark" style={{ padding: '32px', background: 'hsl(222.2 84% 4.9%)', borderRadius: '8px' }}>
|
|
474
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '400px' }}>
|
|
475
|
+
<Card>
|
|
476
|
+
<CardHeader>
|
|
477
|
+
<CardTitle>Dark Mode Card</CardTitle>
|
|
478
|
+
<CardDescription>Cards automatically adapt to dark mode with proper contrast.</CardDescription>
|
|
479
|
+
</CardHeader>
|
|
480
|
+
<CardContent>
|
|
481
|
+
<p>The card component seamlessly transitions between light and dark themes, maintaining readability and visual hierarchy.</p>
|
|
482
|
+
</CardContent>
|
|
483
|
+
<CardFooter>
|
|
484
|
+
<Button variant="default" size="sm">
|
|
485
|
+
Action
|
|
486
|
+
</Button>
|
|
487
|
+
<Button variant="outline" size="sm">
|
|
488
|
+
Cancel
|
|
489
|
+
</Button>
|
|
490
|
+
</CardFooter>
|
|
491
|
+
</Card>
|
|
492
|
+
|
|
493
|
+
<Card>
|
|
494
|
+
<CardHeader>
|
|
495
|
+
<CardTitle>Feature Card</CardTitle>
|
|
496
|
+
<CardDescription>All elements maintain appropriate contrast ratios.</CardDescription>
|
|
497
|
+
</CardHeader>
|
|
498
|
+
<CardContent>
|
|
499
|
+
<p>Text, borders, and shadows are optimized for dark mode viewing, ensuring comfortable reading in low-light environments.</p>
|
|
500
|
+
</CardContent>
|
|
501
|
+
</Card>
|
|
502
|
+
</div>
|
|
503
|
+
</div>
|
|
504
|
+
),
|
|
505
|
+
parameters: {
|
|
506
|
+
docs: {
|
|
507
|
+
description: {
|
|
508
|
+
story: 'Cards in dark mode demonstrating automatic theming with proper contrast and styling.',
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
backgrounds: { disable: true },
|
|
512
|
+
},
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Interactive cards
|
|
517
|
+
*
|
|
518
|
+
* Cards with interactive elements and hover states.
|
|
519
|
+
* Demonstrates how cards can be used for clickable content areas.
|
|
520
|
+
*/
|
|
521
|
+
export const InteractiveCards: Story = {
|
|
522
|
+
render: () => (
|
|
523
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '16px', maxWidth: '600px' }}>
|
|
524
|
+
<Card
|
|
525
|
+
style={{ cursor: 'pointer', transition: 'transform 0.2s, box-shadow 0.2s' }}
|
|
526
|
+
onMouseEnter={(e) => {
|
|
527
|
+
e.currentTarget.style.transform = 'translateY(-4px)'
|
|
528
|
+
e.currentTarget.style.boxShadow = '0 10px 20px rgba(0,0,0,0.1)'
|
|
529
|
+
}}
|
|
530
|
+
onMouseLeave={(e) => {
|
|
531
|
+
e.currentTarget.style.transform = 'translateY(0)'
|
|
532
|
+
e.currentTarget.style.boxShadow = ''
|
|
533
|
+
}}
|
|
534
|
+
>
|
|
535
|
+
<CardHeader>
|
|
536
|
+
<CardTitle>Documentation</CardTitle>
|
|
537
|
+
<CardDescription>Browse guides and API references</CardDescription>
|
|
538
|
+
</CardHeader>
|
|
539
|
+
</Card>
|
|
540
|
+
|
|
541
|
+
<Card
|
|
542
|
+
style={{ cursor: 'pointer', transition: 'transform 0.2s, box-shadow 0.2s' }}
|
|
543
|
+
onMouseEnter={(e) => {
|
|
544
|
+
e.currentTarget.style.transform = 'translateY(-4px)'
|
|
545
|
+
e.currentTarget.style.boxShadow = '0 10px 20px rgba(0,0,0,0.1)'
|
|
546
|
+
}}
|
|
547
|
+
onMouseLeave={(e) => {
|
|
548
|
+
e.currentTarget.style.transform = 'translateY(0)'
|
|
549
|
+
e.currentTarget.style.boxShadow = ''
|
|
550
|
+
}}
|
|
551
|
+
>
|
|
552
|
+
<CardHeader>
|
|
553
|
+
<CardTitle>Tutorials</CardTitle>
|
|
554
|
+
<CardDescription>Step-by-step learning paths</CardDescription>
|
|
555
|
+
</CardHeader>
|
|
556
|
+
</Card>
|
|
557
|
+
|
|
558
|
+
<Card
|
|
559
|
+
style={{ cursor: 'pointer', transition: 'transform 0.2s, box-shadow 0.2s' }}
|
|
560
|
+
onMouseEnter={(e) => {
|
|
561
|
+
e.currentTarget.style.transform = 'translateY(-4px)'
|
|
562
|
+
e.currentTarget.style.boxShadow = '0 10px 20px rgba(0,0,0,0.1)'
|
|
563
|
+
}}
|
|
564
|
+
onMouseLeave={(e) => {
|
|
565
|
+
e.currentTarget.style.transform = 'translateY(0)'
|
|
566
|
+
e.currentTarget.style.boxShadow = ''
|
|
567
|
+
}}
|
|
568
|
+
>
|
|
569
|
+
<CardHeader>
|
|
570
|
+
<CardTitle>Community</CardTitle>
|
|
571
|
+
<CardDescription>Connect with other users</CardDescription>
|
|
572
|
+
</CardHeader>
|
|
573
|
+
</Card>
|
|
574
|
+
|
|
575
|
+
<Card
|
|
576
|
+
style={{ cursor: 'pointer', transition: 'transform 0.2s, box-shadow 0.2s' }}
|
|
577
|
+
onMouseEnter={(e) => {
|
|
578
|
+
e.currentTarget.style.transform = 'translateY(-4px)'
|
|
579
|
+
e.currentTarget.style.boxShadow = '0 10px 20px rgba(0,0,0,0.1)'
|
|
580
|
+
}}
|
|
581
|
+
onMouseLeave={(e) => {
|
|
582
|
+
e.currentTarget.style.transform = 'translateY(0)'
|
|
583
|
+
e.currentTarget.style.boxShadow = ''
|
|
584
|
+
}}
|
|
585
|
+
>
|
|
586
|
+
<CardHeader>
|
|
587
|
+
<CardTitle>Support</CardTitle>
|
|
588
|
+
<CardDescription>Get help when you need it</CardDescription>
|
|
589
|
+
</CardHeader>
|
|
590
|
+
</Card>
|
|
591
|
+
</div>
|
|
592
|
+
),
|
|
593
|
+
parameters: {
|
|
594
|
+
docs: {
|
|
595
|
+
description: {
|
|
596
|
+
story: 'Interactive cards with hover effects, useful for navigation or selection interfaces.',
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Flat card (default elevation)
|
|
604
|
+
*
|
|
605
|
+
* Card with no shadow and subtle border
|
|
606
|
+
*/
|
|
607
|
+
export const FlatCard: Story = {
|
|
608
|
+
render: () => (
|
|
609
|
+
<Card elevation="flat" style={{ width: '350px' }}>
|
|
610
|
+
<CardHeader>
|
|
611
|
+
<CardTitle>Flat Card</CardTitle>
|
|
612
|
+
<CardDescription>No shadow, subtle border for minimal visual weight</CardDescription>
|
|
613
|
+
</CardHeader>
|
|
614
|
+
<CardContent>
|
|
615
|
+
<p>This card has a flat elevation with a subtle border, perfect for minimal designs.</p>
|
|
616
|
+
</CardContent>
|
|
617
|
+
</Card>
|
|
618
|
+
),
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Elevated card
|
|
623
|
+
*
|
|
624
|
+
* Card with drop shadow for depth
|
|
625
|
+
*/
|
|
626
|
+
export const ElevatedCard: Story = {
|
|
627
|
+
render: () => (
|
|
628
|
+
<Card elevation="elevated" style={{ width: '350px' }}>
|
|
629
|
+
<CardHeader>
|
|
630
|
+
<CardTitle>Elevated Card</CardTitle>
|
|
631
|
+
<CardDescription>Drop shadow creates depth and emphasis</CardDescription>
|
|
632
|
+
</CardHeader>
|
|
633
|
+
<CardContent>
|
|
634
|
+
<p>This card has an elevated shadow, making it appear to float above the surface.</p>
|
|
635
|
+
</CardContent>
|
|
636
|
+
</Card>
|
|
637
|
+
),
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Outlined card
|
|
642
|
+
*
|
|
643
|
+
* Card with prominent border and no shadow
|
|
644
|
+
*/
|
|
645
|
+
export const OutlinedCard: Story = {
|
|
646
|
+
render: () => (
|
|
647
|
+
<Card elevation="outlined" style={{ width: '350px' }}>
|
|
648
|
+
<CardHeader>
|
|
649
|
+
<CardTitle>Outlined Card</CardTitle>
|
|
650
|
+
<CardDescription>Prominent border without shadow</CardDescription>
|
|
651
|
+
</CardHeader>
|
|
652
|
+
<CardContent>
|
|
653
|
+
<p>This card has a prominent border with no shadow for clear definition.</p>
|
|
654
|
+
</CardContent>
|
|
655
|
+
</Card>
|
|
656
|
+
),
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Small padding card
|
|
661
|
+
*
|
|
662
|
+
* Card with compact padding
|
|
663
|
+
*/
|
|
664
|
+
export const SmallPaddingCard: Story = {
|
|
665
|
+
render: () => (
|
|
666
|
+
<Card padding="sm" style={{ width: '350px' }}>
|
|
667
|
+
<CardHeader>
|
|
668
|
+
<CardTitle>Compact Card</CardTitle>
|
|
669
|
+
<CardDescription>Small padding for dense layouts</CardDescription>
|
|
670
|
+
</CardHeader>
|
|
671
|
+
<CardContent>
|
|
672
|
+
<p>This card has compact padding, suitable for dense layouts or small spaces.</p>
|
|
673
|
+
</CardContent>
|
|
674
|
+
</Card>
|
|
675
|
+
),
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Large padding card
|
|
680
|
+
*
|
|
681
|
+
* Card with spacious padding
|
|
682
|
+
*/
|
|
683
|
+
export const LargePaddingCard: Story = {
|
|
684
|
+
render: () => (
|
|
685
|
+
<Card padding="lg" style={{ width: '350px' }}>
|
|
686
|
+
<CardHeader>
|
|
687
|
+
<CardTitle>Spacious Card</CardTitle>
|
|
688
|
+
<CardDescription>Large padding for breathing room</CardDescription>
|
|
689
|
+
</CardHeader>
|
|
690
|
+
<CardContent>
|
|
691
|
+
<p>This card has generous padding, providing plenty of breathing room for the content.</p>
|
|
692
|
+
</CardContent>
|
|
693
|
+
</Card>
|
|
694
|
+
),
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Elevation variants showcase
|
|
699
|
+
*/
|
|
700
|
+
export const ElevationVariants: Story = {
|
|
701
|
+
render: () => (
|
|
702
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '400px' }}>
|
|
703
|
+
<Card elevation="flat">
|
|
704
|
+
<CardHeader>
|
|
705
|
+
<CardTitle>Flat</CardTitle>
|
|
706
|
+
<CardDescription>Subtle border, no shadow</CardDescription>
|
|
707
|
+
</CardHeader>
|
|
708
|
+
<CardContent>
|
|
709
|
+
<p>Minimal visual weight</p>
|
|
710
|
+
</CardContent>
|
|
711
|
+
</Card>
|
|
712
|
+
|
|
713
|
+
<Card elevation="elevated">
|
|
714
|
+
<CardHeader>
|
|
715
|
+
<CardTitle>Elevated</CardTitle>
|
|
716
|
+
<CardDescription>Drop shadow for depth</CardDescription>
|
|
717
|
+
</CardHeader>
|
|
718
|
+
<CardContent>
|
|
719
|
+
<p>Appears to float above surface</p>
|
|
720
|
+
</CardContent>
|
|
721
|
+
</Card>
|
|
722
|
+
|
|
723
|
+
<Card elevation="outlined">
|
|
724
|
+
<CardHeader>
|
|
725
|
+
<CardTitle>Outlined</CardTitle>
|
|
726
|
+
<CardDescription>Prominent border, no shadow</CardDescription>
|
|
727
|
+
</CardHeader>
|
|
728
|
+
<CardContent>
|
|
729
|
+
<p>Clear definition and separation</p>
|
|
730
|
+
</CardContent>
|
|
731
|
+
</Card>
|
|
732
|
+
</div>
|
|
733
|
+
),
|
|
734
|
+
parameters: {
|
|
735
|
+
docs: {
|
|
736
|
+
description: {
|
|
737
|
+
story: 'All elevation variants side by side for comparison',
|
|
738
|
+
},
|
|
739
|
+
},
|
|
740
|
+
},
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Padding variants showcase
|
|
745
|
+
*/
|
|
746
|
+
export const PaddingVariants: Story = {
|
|
747
|
+
render: () => (
|
|
748
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px', maxWidth: '400px' }}>
|
|
749
|
+
<Card padding="sm">
|
|
750
|
+
<CardHeader>
|
|
751
|
+
<CardTitle>Small Padding</CardTitle>
|
|
752
|
+
<CardDescription>Compact spacing for dense layouts</CardDescription>
|
|
753
|
+
</CardHeader>
|
|
754
|
+
<CardContent>
|
|
755
|
+
<p>Less space, more content density</p>
|
|
756
|
+
</CardContent>
|
|
757
|
+
</Card>
|
|
758
|
+
|
|
759
|
+
<Card padding="default">
|
|
760
|
+
<CardHeader>
|
|
761
|
+
<CardTitle>Default Padding</CardTitle>
|
|
762
|
+
<CardDescription>Standard spacing for most use cases</CardDescription>
|
|
763
|
+
</CardHeader>
|
|
764
|
+
<CardContent>
|
|
765
|
+
<p>Balanced spacing and content</p>
|
|
766
|
+
</CardContent>
|
|
767
|
+
</Card>
|
|
768
|
+
|
|
769
|
+
<Card padding="lg">
|
|
770
|
+
<CardHeader>
|
|
771
|
+
<CardTitle>Large Padding</CardTitle>
|
|
772
|
+
<CardDescription>Spacious layout with breathing room</CardDescription>
|
|
773
|
+
</CardHeader>
|
|
774
|
+
<CardContent>
|
|
775
|
+
<p>More space, improved readability</p>
|
|
776
|
+
</CardContent>
|
|
777
|
+
</Card>
|
|
778
|
+
</div>
|
|
779
|
+
),
|
|
780
|
+
parameters: {
|
|
781
|
+
docs: {
|
|
782
|
+
description: {
|
|
783
|
+
story: 'All padding variants side by side for comparison',
|
|
784
|
+
},
|
|
785
|
+
},
|
|
786
|
+
},
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Combined variants showcase
|
|
791
|
+
*/
|
|
792
|
+
export const CombinedVariants: Story = {
|
|
793
|
+
render: () => (
|
|
794
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))', gap: '24px', maxWidth: '800px' }}>
|
|
795
|
+
<Card elevation="flat" padding="sm">
|
|
796
|
+
<CardHeader>
|
|
797
|
+
<CardTitle>Flat + Small</CardTitle>
|
|
798
|
+
</CardHeader>
|
|
799
|
+
<CardContent>
|
|
800
|
+
<p>Minimal and compact</p>
|
|
801
|
+
</CardContent>
|
|
802
|
+
</Card>
|
|
803
|
+
|
|
804
|
+
<Card elevation="elevated" padding="default">
|
|
805
|
+
<CardHeader>
|
|
806
|
+
<CardTitle>Elevated + Default</CardTitle>
|
|
807
|
+
</CardHeader>
|
|
808
|
+
<CardContent>
|
|
809
|
+
<p>Balanced emphasis</p>
|
|
810
|
+
</CardContent>
|
|
811
|
+
</Card>
|
|
812
|
+
|
|
813
|
+
<Card elevation="outlined" padding="lg">
|
|
814
|
+
<CardHeader>
|
|
815
|
+
<CardTitle>Outlined + Large</CardTitle>
|
|
816
|
+
</CardHeader>
|
|
817
|
+
<CardContent>
|
|
818
|
+
<p>Clear and spacious</p>
|
|
819
|
+
</CardContent>
|
|
820
|
+
</Card>
|
|
821
|
+
</div>
|
|
822
|
+
),
|
|
823
|
+
parameters: {
|
|
824
|
+
docs: {
|
|
825
|
+
description: {
|
|
826
|
+
story: 'Different combinations of elevation and padding variants',
|
|
827
|
+
},
|
|
828
|
+
},
|
|
829
|
+
layout: 'padded',
|
|
830
|
+
},
|
|
831
|
+
}
|