aural-ui 2.0.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/LICENSE +21 -0
- package/README.md +456 -0
- package/dist/components/aspect-ratio/AspectRatio.stories.tsx +1327 -0
- package/dist/components/aspect-ratio/index.tsx +10 -0
- package/dist/components/aspect-ratio/meta.ts +8 -0
- package/dist/components/avatar/Avatar.stories.tsx +645 -0
- package/dist/components/avatar/index.tsx +50 -0
- package/dist/components/avatar/meta.ts +8 -0
- package/dist/components/badge/Badge.stories.tsx +169 -0
- package/dist/components/badge/index.tsx +28 -0
- package/dist/components/badge/meta.ts +6 -0
- package/dist/components/banner/Banner.stories.tsx +475 -0
- package/dist/components/banner/index.tsx +256 -0
- package/dist/components/banner/meta.ts +36 -0
- package/dist/components/button/Button.stories.tsx +74 -0
- package/dist/components/button/index.tsx +158 -0
- package/dist/components/button/meta.ts +33 -0
- package/dist/components/card/Card.stories.tsx +377 -0
- package/dist/components/card/index.tsx +85 -0
- package/dist/components/card/meta.ts +14 -0
- package/dist/components/char-count/CharCount.stories.tsx +334 -0
- package/dist/components/char-count/index.tsx +51 -0
- package/dist/components/char-count/meta.ts +13 -0
- package/dist/components/checkbox/Checkbox.stories.tsx +209 -0
- package/dist/components/checkbox/index.tsx +34 -0
- package/dist/components/checkbox/meta.ts +19 -0
- package/dist/components/chip/Chip.stories.tsx +207 -0
- package/dist/components/chip/index.tsx +92 -0
- package/dist/components/chip/meta.ts +17 -0
- package/dist/components/circular-loader/CircularLoader.stories.tsx +741 -0
- package/dist/components/circular-loader/index.tsx +138 -0
- package/dist/components/circular-loader/meta.ts +11 -0
- package/dist/components/collapsible/Collapsible.stories.tsx +319 -0
- package/dist/components/collapsible/index.tsx +158 -0
- package/dist/components/collapsible/meta.ts +22 -0
- package/dist/components/command/Command.stories.tsx +996 -0
- package/dist/components/command/index.tsx +324 -0
- package/dist/components/command/meta.ts +18 -0
- package/dist/components/dialog/Dialog.stories.tsx +963 -0
- package/dist/components/dialog/index.tsx +250 -0
- package/dist/components/dialog/meta.ts +28 -0
- package/dist/components/divider/Divider.stories.tsx +633 -0
- package/dist/components/divider/index.tsx +181 -0
- package/dist/components/divider/meta.ts +12 -0
- package/dist/components/dot-loader/DotLoader.stories.tsx +352 -0
- package/dist/components/dot-loader/index.tsx +78 -0
- package/dist/components/dot-loader/meta.ts +14 -0
- package/dist/components/dropdown/Dropdown.stories.tsx +1210 -0
- package/dist/components/dropdown/index.tsx +479 -0
- package/dist/components/dropdown/meta.ts +21 -0
- package/dist/components/form/Form.stories.tsx +320 -0
- package/dist/components/form/index.tsx +183 -0
- package/dist/components/form/meta.ts +11 -0
- package/dist/components/helper-text/HelperText.stories.tsx +254 -0
- package/dist/components/helper-text/index.tsx +102 -0
- package/dist/components/helper-text/meta.ts +18 -0
- package/dist/components/hover-card/HoverCard.stories.tsx +1328 -0
- package/dist/components/hover-card/index.tsx +42 -0
- package/dist/components/hover-card/meta.ts +12 -0
- package/dist/components/icon-button/IconButton.stories.tsx +252 -0
- package/dist/components/icon-button/index.tsx +130 -0
- package/dist/components/icon-button/meta.ts +20 -0
- package/dist/components/if-else/if-else.stories.tsx +100 -0
- package/dist/components/if-else/index.tsx +56 -0
- package/dist/components/if-else/meta.ts +6 -0
- package/dist/components/index.ts +70 -0
- package/dist/components/input/Input.stories.tsx +431 -0
- package/dist/components/input/index.tsx +487 -0
- package/dist/components/input/meta.ts +28 -0
- package/dist/components/label/Label.stories.tsx +200 -0
- package/dist/components/label/index.tsx +43 -0
- package/dist/components/label/meta.ts +14 -0
- package/dist/components/list/List.stories.tsx +963 -0
- package/dist/components/list/index.tsx +567 -0
- package/dist/components/list/meta.ts +24 -0
- package/dist/components/marquee/Marquee.stories.tsx +819 -0
- package/dist/components/marquee/index.tsx +107 -0
- package/dist/components/marquee/meta.ts +6 -0
- package/dist/components/overlay/Overlay.stories.tsx +954 -0
- package/dist/components/overlay/index.tsx +58 -0
- package/dist/components/overlay/meta.ts +10 -0
- package/dist/components/pagination/Pagination.stories.tsx +354 -0
- package/dist/components/pagination/index.tsx +455 -0
- package/dist/components/pagination/meta.ts +29 -0
- package/dist/components/popover/Popover.stories.tsx +1037 -0
- package/dist/components/popover/index.tsx +67 -0
- package/dist/components/popover/meta.ts +12 -0
- package/dist/components/radio/Radio.stories.tsx +146 -0
- package/dist/components/radio/index.tsx +41 -0
- package/dist/components/radio/meta.ts +19 -0
- package/dist/components/resizable/Resizable.stories.tsx +866 -0
- package/dist/components/resizable/index.tsx +55 -0
- package/dist/components/resizable/meta.ts +12 -0
- package/dist/components/scroll-area/ScrollArea.stories.tsx +1104 -0
- package/dist/components/scroll-area/index.tsx +55 -0
- package/dist/components/scroll-area/meta.ts +8 -0
- package/dist/components/search/Search.stories.tsx +678 -0
- package/dist/components/search/index.tsx +141 -0
- package/dist/components/search/meta.ts +6 -0
- package/dist/components/select/Select.stories.tsx +962 -0
- package/dist/components/select/index.tsx +512 -0
- package/dist/components/select/meta.ts +40 -0
- package/dist/components/sheet/Sheet.stories.tsx +1060 -0
- package/dist/components/sheet/index.tsx +440 -0
- package/dist/components/sheet/meta.ts +38 -0
- package/dist/components/skelton/Skelton.stories.tsx +859 -0
- package/dist/components/skelton/index.tsx +17 -0
- package/dist/components/skelton/meta.ts +6 -0
- package/dist/components/slider/Slider.stories.tsx +876 -0
- package/dist/components/slider/index.tsx +156 -0
- package/dist/components/slider/meta.ts +29 -0
- package/dist/components/stepper/Stepper.stories.tsx +639 -0
- package/dist/components/stepper/index.tsx +650 -0
- package/dist/components/stepper/meta.ts +19 -0
- package/dist/components/switch/Switch.stories.tsx +85 -0
- package/dist/components/switch/index.tsx +37 -0
- package/dist/components/switch/meta.ts +24 -0
- package/dist/components/switch-case/SwitchCase.stories.tsx +209 -0
- package/dist/components/switch-case/index.tsx +89 -0
- package/dist/components/switch-case/meta.ts +6 -0
- package/dist/components/table/Table.stories.tsx +1095 -0
- package/dist/components/table/index.tsx +113 -0
- package/dist/components/table/meta.ts +20 -0
- package/dist/components/tabs/Tabs.stories.tsx +1379 -0
- package/dist/components/tabs/index.tsx +186 -0
- package/dist/components/tabs/meta.ts +25 -0
- package/dist/components/tag/Tag.stories.tsx +625 -0
- package/dist/components/tag/index.tsx +320 -0
- package/dist/components/tag/meta.ts +52 -0
- package/dist/components/textarea/TextArea.stories.tsx +723 -0
- package/dist/components/textarea/index.tsx +480 -0
- package/dist/components/textarea/meta.ts +23 -0
- package/dist/components/toast/Toast.stories.tsx +1427 -0
- package/dist/components/toast/index.tsx +26 -0
- package/dist/components/toast/meta.ts +19 -0
- package/dist/components/toggle/Toggle.stories.tsx +1093 -0
- package/dist/components/toggle/index.tsx +44 -0
- package/dist/components/toggle/meta.ts +19 -0
- package/dist/components/tooltip/Tooltip.stories.tsx +1548 -0
- package/dist/components/tooltip/index.tsx +304 -0
- package/dist/components/tooltip/meta.ts +21 -0
- package/dist/components/typography/Typography.stories.tsx +197 -0
- package/dist/components/typography/index.tsx +184 -0
- package/dist/components/typography/meta.ts +38 -0
- package/dist/fonts/LabGrotesque-Regular.ttf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Bold.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Light.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Medium.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Regular.otf +0 -0
- package/dist/fonts/PPSupplySans-Regular (1).otf +0 -0
- package/dist/fonts/PPSupplySans-Regular.otf +0 -0
- package/dist/fonts/PPSupplySans-Ultralight.otf +0 -0
- package/dist/hooks/index.ts +3 -0
- package/dist/hooks/use-previous/UsePrevious.stories.tsx +997 -0
- package/dist/hooks/use-previous/index.ts +15 -0
- package/dist/hooks/use-previous/meta.ts +6 -0
- package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +983 -0
- package/dist/hooks/use-standalone-pagination/index.ts +146 -0
- package/dist/hooks/use-standalone-pagination/meta.ts +6 -0
- package/dist/icons/Icons.stories.tsx +29 -0
- package/dist/icons/alert-icon/AlertIcon.stories.tsx +991 -0
- package/dist/icons/alert-icon/index.tsx +48 -0
- package/dist/icons/alert-icon/meta.ts +8 -0
- package/dist/icons/all-icons.tsx +738 -0
- package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +1031 -0
- package/dist/icons/angle-down-icon/index.tsx +25 -0
- package/dist/icons/angle-down-icon/meta.ts +8 -0
- package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +1080 -0
- package/dist/icons/arrow-box-left-icon/index.tsx +24 -0
- package/dist/icons/arrow-box-left-icon/meta.ts +8 -0
- package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +1151 -0
- package/dist/icons/arrow-right-icon/index.tsx +26 -0
- package/dist/icons/arrow-right-icon/meta.ts +8 -0
- package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +1273 -0
- package/dist/icons/arrow-right-up-icon/index.tsx +24 -0
- package/dist/icons/arrow-right-up-icon/meta.ts +8 -0
- package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +670 -0
- package/dist/icons/art-board-icon/index.tsx +24 -0
- package/dist/icons/art-board-icon/meta.ts +7 -0
- package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +1244 -0
- package/dist/icons/audio-bar-icon/index.tsx +19 -0
- package/dist/icons/audio-bar-icon/meta.ts +8 -0
- package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +1239 -0
- package/dist/icons/bubble-check-icon/index.tsx +24 -0
- package/dist/icons/bubble-check-icon/meta.ts +8 -0
- package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +1228 -0
- package/dist/icons/bubble-crossed-icon/index.tsx +24 -0
- package/dist/icons/bubble-crossed-icon/meta.ts +8 -0
- package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +912 -0
- package/dist/icons/bubble-sparkle-icon/index.tsx +26 -0
- package/dist/icons/bubble-sparkle-icon/meta.ts +8 -0
- package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +1021 -0
- package/dist/icons/chevron-double-left-icon/index.tsx +34 -0
- package/dist/icons/chevron-double-left-icon/meta.ts +8 -0
- package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +1021 -0
- package/dist/icons/chevron-double-right-icon/index.tsx +34 -0
- package/dist/icons/chevron-double-right-icon/meta.ts +8 -0
- package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +1001 -0
- package/dist/icons/chevron-down-icon/index.tsx +27 -0
- package/dist/icons/chevron-down-icon/meta.ts +8 -0
- package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +1029 -0
- package/dist/icons/chevron-left-icon/index.tsx +27 -0
- package/dist/icons/chevron-left-icon/meta.ts +8 -0
- package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +1021 -0
- package/dist/icons/chevron-right-icon/index.tsx +27 -0
- package/dist/icons/chevron-right-icon/meta.ts +8 -0
- package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +1036 -0
- package/dist/icons/chevron-up-icon/index.tsx +27 -0
- package/dist/icons/chevron-up-icon/meta.ts +8 -0
- package/dist/icons/command-icon/CommandIcon.stories.tsx +1098 -0
- package/dist/icons/command-icon/index.tsx +24 -0
- package/dist/icons/command-icon/meta.ts +8 -0
- package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +1061 -0
- package/dist/icons/cross-circle-icon/index.tsx +23 -0
- package/dist/icons/cross-circle-icon/meta.ts +8 -0
- package/dist/icons/cross-icon/CrossIcon.stories.tsx +1027 -0
- package/dist/icons/cross-icon/index.tsx +24 -0
- package/dist/icons/cross-icon/meta.ts +8 -0
- package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +1092 -0
- package/dist/icons/edit-big-icon/index.tsx +22 -0
- package/dist/icons/edit-big-icon/meta.ts +8 -0
- package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +1090 -0
- package/dist/icons/eye-close-icon/index.tsx +26 -0
- package/dist/icons/eye-close-icon/meta.ts +8 -0
- package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +1098 -0
- package/dist/icons/eye-open-icon/index.tsx +24 -0
- package/dist/icons/eye-open-icon/meta.ts +8 -0
- package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +1071 -0
- package/dist/icons/feature-shine-icon/index.tsx +29 -0
- package/dist/icons/feature-shine-icon/meta.ts +8 -0
- package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +1115 -0
- package/dist/icons/file-chart-icon/index.tsx +24 -0
- package/dist/icons/file-chart-icon/meta.ts +8 -0
- package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +668 -0
- package/dist/icons/file-text-icon/index.tsx +24 -0
- package/dist/icons/file-text-icon/meta.ts +8 -0
- package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +1239 -0
- package/dist/icons/grip-vertical-icon/index.tsx +28 -0
- package/dist/icons/grip-vertical-icon/meta.ts +8 -0
- package/dist/icons/image-icon/ImageIcon.stories.tsx +1181 -0
- package/dist/icons/image-icon/index.tsx +24 -0
- package/dist/icons/image-icon/meta.ts +8 -0
- package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +1248 -0
- package/dist/icons/import-folder-icon/index.tsx +22 -0
- package/dist/icons/import-folder-icon/meta.ts +8 -0
- package/dist/icons/index.ts +46 -0
- package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +1272 -0
- package/dist/icons/light-bulb-simple-icon/index.tsx +24 -0
- package/dist/icons/light-bulb-simple-icon/meta.ts +8 -0
- package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +1245 -0
- package/dist/icons/magic-book-icon/index.tsx +32 -0
- package/dist/icons/magic-book-icon/meta.ts +8 -0
- package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +1251 -0
- package/dist/icons/maintenance-icon/index.tsx +23 -0
- package/dist/icons/maintenance-icon/meta.ts +8 -0
- package/dist/icons/message-icon/MessageIcon.stories.tsx +595 -0
- package/dist/icons/message-icon/index.tsx +30 -0
- package/dist/icons/message-icon/meta.ts +8 -0
- package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +1245 -0
- package/dist/icons/move-horizontal-icon/index.tsx +23 -0
- package/dist/icons/move-horizontal-icon/meta.ts +8 -0
- package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +1196 -0
- package/dist/icons/move-vertical-icon/index.tsx +23 -0
- package/dist/icons/move-vertical-icon/meta.ts +8 -0
- package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +1167 -0
- package/dist/icons/page-search-icon/index.tsx +21 -0
- package/dist/icons/page-search-icon/meta.ts +8 -0
- package/dist/icons/pencil-icon/PencilIcon.stories.tsx +1131 -0
- package/dist/icons/pencil-icon/index.tsx +21 -0
- package/dist/icons/pencil-icon/meta.ts +8 -0
- package/dist/icons/plus-icon/PlusIcon.stories.tsx +1151 -0
- package/dist/icons/plus-icon/index.tsx +24 -0
- package/dist/icons/plus-icon/meta.ts +8 -0
- package/dist/icons/search-icon/SearchIcon.stories.tsx +1181 -0
- package/dist/icons/search-icon/index.tsx +24 -0
- package/dist/icons/search-icon/meta.ts +8 -0
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +1167 -0
- package/dist/icons/site-logo-icon/index.tsx +79 -0
- package/dist/icons/site-logo-icon/meta.ts +8 -0
- package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +637 -0
- package/dist/icons/spinner-gradient-icon/index.tsx +53 -0
- package/dist/icons/spinner-gradient-icon/meta.ts +8 -0
- package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +644 -0
- package/dist/icons/spinner-solid-icon/index.tsx +59 -0
- package/dist/icons/spinner-solid-icon/meta.ts +8 -0
- package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +736 -0
- package/dist/icons/spinner-solid-neutral-icon/index.tsx +53 -0
- package/dist/icons/spinner-solid-neutral-icon/meta.ts +8 -0
- package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +1204 -0
- package/dist/icons/tick-circle-icon/index.tsx +23 -0
- package/dist/icons/tick-circle-icon/meta.ts +8 -0
- package/dist/icons/tick-icon/TickIcon.stories.tsx +1340 -0
- package/dist/icons/tick-icon/index.tsx +24 -0
- package/dist/icons/tick-icon/meta.ts +8 -0
- package/dist/icons/trash-icon/TrashIcon.stories.tsx +996 -0
- package/dist/icons/trash-icon/index.tsx +24 -0
- package/dist/icons/trash-icon/meta.ts +8 -0
- package/dist/icons/upload-icon/UploadIcon.stories.tsx +947 -0
- package/dist/icons/upload-icon/index.tsx +24 -0
- package/dist/icons/upload-icon/meta.ts +8 -0
- package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +1045 -0
- package/dist/icons/vertical-menu-icon/index.tsx +27 -0
- package/dist/icons/vertical-menu-icon/meta.ts +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +206 -0
- package/dist/lib/utils.ts +6 -0
- package/dist/styles/aural-theme.css +1008 -0
- package/package.json +142 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Badge } from "@components/badge"
|
|
3
|
+
import { Button } from "@components/button"
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Card,
|
|
8
|
+
CardAction,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardDescription,
|
|
11
|
+
CardFooter,
|
|
12
|
+
CardHeader,
|
|
13
|
+
CardTitle,
|
|
14
|
+
} from "."
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof Card> = {
|
|
17
|
+
title: "Components/UI/Card",
|
|
18
|
+
component: Card,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
backgrounds: {
|
|
22
|
+
default: "dark",
|
|
23
|
+
values: [
|
|
24
|
+
{ name: "light", value: "#ffffff" },
|
|
25
|
+
{ name: "dark", value: "#0a0a0a" },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
docs: {
|
|
29
|
+
description: {
|
|
30
|
+
component: `
|
|
31
|
+
# Card Component
|
|
32
|
+
|
|
33
|
+
A flexible and interactive card component that serves as a container for related content. Features hover effects and clean styling perfect for displaying information in an organized, visually appealing way.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- **Interactive Design**: Hover gradient effects for better user engagement
|
|
38
|
+
- **Flexible Layout**: Column-based flex layout with customizable gap spacing
|
|
39
|
+
- **Clean Styling**: Neutral color scheme with subtle shadows
|
|
40
|
+
- **Responsive**: Works well across different screen sizes
|
|
41
|
+
- **Accessible**: Proper cursor states and semantic structure
|
|
42
|
+
- **Customizable**: Easy to extend with additional CSS classes
|
|
43
|
+
- **Bordered Design**: Clean borders with rounded corners
|
|
44
|
+
|
|
45
|
+
## Usage Examples
|
|
46
|
+
|
|
47
|
+
### Basic Card
|
|
48
|
+
\`\`\`tsx
|
|
49
|
+
<Card>
|
|
50
|
+
<p>Simple card content</p>
|
|
51
|
+
</Card>
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
### Card with Header and Content
|
|
55
|
+
\`\`\`tsx
|
|
56
|
+
<Card className="w-96">
|
|
57
|
+
<CardHeader>
|
|
58
|
+
<CardTitle>Card Title</CardTitle>
|
|
59
|
+
<CardDescription>Card description</CardDescription>
|
|
60
|
+
</CardHeader>
|
|
61
|
+
<CardContent>Content goes here</CardContent>
|
|
62
|
+
</Card>
|
|
63
|
+
\`\`\`
|
|
64
|
+
|
|
65
|
+
### Card with Custom Width
|
|
66
|
+
\`\`\`tsx
|
|
67
|
+
<Card className="w-80 max-w-sm">
|
|
68
|
+
<div className="space-y-2">
|
|
69
|
+
<h3 className="font-semibold">Custom Card</h3>
|
|
70
|
+
<p className="text-sm text-gray-600">
|
|
71
|
+
This card has custom width styling
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
</Card>
|
|
75
|
+
\`\`\`
|
|
76
|
+
|
|
77
|
+
### Clickable Card
|
|
78
|
+
\`\`\`tsx
|
|
79
|
+
<Card
|
|
80
|
+
className="w-72 transition-transform hover:scale-105"
|
|
81
|
+
onClick={() => console.log('Card clicked')}
|
|
82
|
+
>
|
|
83
|
+
<div className="p-2">
|
|
84
|
+
<h4 className="font-medium">Clickable Card</h4>
|
|
85
|
+
<p className="text-sm mt-1">Click me for interaction</p>
|
|
86
|
+
</div>
|
|
87
|
+
</Card>
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
### Card Grid Layout
|
|
91
|
+
\`\`\`tsx
|
|
92
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
93
|
+
<Card>
|
|
94
|
+
<CardHeader>
|
|
95
|
+
<CardTitle>Feature 1</CardTitle>
|
|
96
|
+
</CardHeader>
|
|
97
|
+
<CardContent>Description of feature 1</CardContent>
|
|
98
|
+
</Card>
|
|
99
|
+
<Card>
|
|
100
|
+
<CardHeader>
|
|
101
|
+
<CardTitle>Feature 2</CardTitle>
|
|
102
|
+
</CardHeader>
|
|
103
|
+
<CardContent>Description of feature 2</CardContent>
|
|
104
|
+
</Card>
|
|
105
|
+
<Card>
|
|
106
|
+
<CardHeader>
|
|
107
|
+
<CardTitle>Feature 3</CardTitle>
|
|
108
|
+
</CardHeader>
|
|
109
|
+
<CardContent>Description of feature 3</CardContent>
|
|
110
|
+
</Card>
|
|
111
|
+
</div>
|
|
112
|
+
\`\`\`
|
|
113
|
+
`,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
tags: ["autodocs"],
|
|
118
|
+
argTypes: {
|
|
119
|
+
className: {
|
|
120
|
+
control: "text",
|
|
121
|
+
description: "Additional CSS classes to apply to the card",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export default meta
|
|
127
|
+
type Story = StoryObj<typeof meta>
|
|
128
|
+
|
|
129
|
+
// Basic card examples
|
|
130
|
+
export const Simple: Story = {
|
|
131
|
+
render: () => (
|
|
132
|
+
<Card>
|
|
133
|
+
<CardHeader>
|
|
134
|
+
<CardTitle>Simple Card</CardTitle>
|
|
135
|
+
<CardDescription>
|
|
136
|
+
This is a basic card with header and content.
|
|
137
|
+
</CardDescription>
|
|
138
|
+
</CardHeader>
|
|
139
|
+
<CardContent>
|
|
140
|
+
<p>
|
|
141
|
+
This is the main content area of the card. You can put any content
|
|
142
|
+
here.
|
|
143
|
+
</p>
|
|
144
|
+
</CardContent>
|
|
145
|
+
</Card>
|
|
146
|
+
),
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export const WithFooter: Story = {
|
|
150
|
+
render: () => (
|
|
151
|
+
<Card>
|
|
152
|
+
<CardHeader>
|
|
153
|
+
<CardTitle>Card with Footer</CardTitle>
|
|
154
|
+
<CardDescription>
|
|
155
|
+
A card that includes a footer section.
|
|
156
|
+
</CardDescription>
|
|
157
|
+
</CardHeader>
|
|
158
|
+
<CardContent>
|
|
159
|
+
<p>Main content goes here. The footer below contains action buttons.</p>
|
|
160
|
+
</CardContent>
|
|
161
|
+
<CardFooter className="gap-2">
|
|
162
|
+
<Button>Cancel</Button>
|
|
163
|
+
<Button>Save</Button>
|
|
164
|
+
</CardFooter>
|
|
165
|
+
</Card>
|
|
166
|
+
),
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const WithAction: Story = {
|
|
170
|
+
render: () => (
|
|
171
|
+
<Card>
|
|
172
|
+
<CardHeader>
|
|
173
|
+
<CardTitle>Project Alpha</CardTitle>
|
|
174
|
+
<CardDescription>A revolutionary new project</CardDescription>
|
|
175
|
+
<CardAction>
|
|
176
|
+
<Badge>Active</Badge>
|
|
177
|
+
</CardAction>
|
|
178
|
+
</CardHeader>
|
|
179
|
+
<CardContent>
|
|
180
|
+
<p>
|
|
181
|
+
This card demonstrates the action slot in the header, which is
|
|
182
|
+
positioned to the right.
|
|
183
|
+
</p>
|
|
184
|
+
</CardContent>
|
|
185
|
+
</Card>
|
|
186
|
+
),
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const WithActionButton: Story = {
|
|
190
|
+
render: () => (
|
|
191
|
+
<Card>
|
|
192
|
+
<CardHeader>
|
|
193
|
+
<CardTitle>Settings</CardTitle>
|
|
194
|
+
<CardDescription>Manage your account preferences</CardDescription>
|
|
195
|
+
<CardAction>
|
|
196
|
+
<Button variant="outline" size="sm">
|
|
197
|
+
Edit
|
|
198
|
+
</Button>
|
|
199
|
+
</CardAction>
|
|
200
|
+
</CardHeader>
|
|
201
|
+
<CardContent>
|
|
202
|
+
<div className="space-y-2">
|
|
203
|
+
<div className="flex justify-between">
|
|
204
|
+
<span>Notifications</span>
|
|
205
|
+
<span className="text-muted-foreground">Enabled</span>
|
|
206
|
+
</div>
|
|
207
|
+
<div className="flex justify-between">
|
|
208
|
+
<span>Theme</span>
|
|
209
|
+
<span className="text-muted-foreground">Dark</span>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</CardContent>
|
|
213
|
+
</Card>
|
|
214
|
+
),
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export const BorderVariants: Story = {
|
|
218
|
+
render: () => (
|
|
219
|
+
<div className="flex gap-4">
|
|
220
|
+
<Card className="w-80">
|
|
221
|
+
<CardHeader className="border-b">
|
|
222
|
+
<CardTitle>Header with Border</CardTitle>
|
|
223
|
+
<CardDescription>The header has a bottom border</CardDescription>
|
|
224
|
+
</CardHeader>
|
|
225
|
+
<CardContent>
|
|
226
|
+
<p>Content section with bordered header above.</p>
|
|
227
|
+
</CardContent>
|
|
228
|
+
</Card>
|
|
229
|
+
|
|
230
|
+
<Card className="w-80">
|
|
231
|
+
<CardHeader>
|
|
232
|
+
<CardTitle>Footer with Border</CardTitle>
|
|
233
|
+
<CardDescription>The footer has a top border</CardDescription>
|
|
234
|
+
</CardHeader>
|
|
235
|
+
<CardContent>
|
|
236
|
+
<p>Content section with bordered footer below.</p>
|
|
237
|
+
</CardContent>
|
|
238
|
+
<CardFooter className="border-t">
|
|
239
|
+
<Button>Action</Button>
|
|
240
|
+
</CardFooter>
|
|
241
|
+
</Card>
|
|
242
|
+
</div>
|
|
243
|
+
),
|
|
244
|
+
parameters: {
|
|
245
|
+
layout: "padded",
|
|
246
|
+
},
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export const ComplexExample: Story = {
|
|
250
|
+
render: () => (
|
|
251
|
+
<Card>
|
|
252
|
+
<CardHeader className="border-b">
|
|
253
|
+
<CardTitle>User Profile</CardTitle>
|
|
254
|
+
<CardDescription>Manage user information and settings</CardDescription>
|
|
255
|
+
<CardAction>
|
|
256
|
+
<div className="flex gap-2">
|
|
257
|
+
<Badge>Pro</Badge>
|
|
258
|
+
<Button variant="outline" size="sm">
|
|
259
|
+
•••
|
|
260
|
+
</Button>
|
|
261
|
+
</div>
|
|
262
|
+
</CardAction>
|
|
263
|
+
</CardHeader>
|
|
264
|
+
<CardContent className="space-y-4">
|
|
265
|
+
<div className="flex items-center space-x-4">
|
|
266
|
+
<div className="bg-muted flex h-12 w-12 items-center justify-center rounded-full">
|
|
267
|
+
<span className="text-lg font-semibold">JD</span>
|
|
268
|
+
</div>
|
|
269
|
+
<div>
|
|
270
|
+
<p className="font-medium">John Doe</p>
|
|
271
|
+
<p className="text-muted-foreground text-sm">
|
|
272
|
+
john.doe@example.com
|
|
273
|
+
</p>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
<div className="space-y-2">
|
|
277
|
+
<div className="flex justify-between text-sm">
|
|
278
|
+
<span>Member since</span>
|
|
279
|
+
<span className="text-muted-foreground">Jan 2024</span>
|
|
280
|
+
</div>
|
|
281
|
+
<div className="flex justify-between text-sm">
|
|
282
|
+
<span>Last login</span>
|
|
283
|
+
<span className="text-muted-foreground">2 hours ago</span>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
</CardContent>
|
|
287
|
+
<CardFooter className="gap-2 border-t">
|
|
288
|
+
<Button variant="outline" className="flex-1">
|
|
289
|
+
Edit Profile
|
|
290
|
+
</Button>
|
|
291
|
+
<Button className="flex-1">View Details</Button>
|
|
292
|
+
</CardFooter>
|
|
293
|
+
</Card>
|
|
294
|
+
),
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export const ContentVariations: Story = {
|
|
298
|
+
render: () => (
|
|
299
|
+
<div className="grid w-full max-w-4xl grid-cols-1 gap-4 md:grid-cols-2">
|
|
300
|
+
<Card>
|
|
301
|
+
<CardHeader>
|
|
302
|
+
<CardTitle>Minimal Card</CardTitle>
|
|
303
|
+
</CardHeader>
|
|
304
|
+
<CardContent>
|
|
305
|
+
<p>Just a title and content.</p>
|
|
306
|
+
</CardContent>
|
|
307
|
+
</Card>
|
|
308
|
+
|
|
309
|
+
<Card>
|
|
310
|
+
<CardContent>
|
|
311
|
+
<p>Content only - no header or footer.</p>
|
|
312
|
+
</CardContent>
|
|
313
|
+
</Card>
|
|
314
|
+
|
|
315
|
+
<Card>
|
|
316
|
+
<CardHeader>
|
|
317
|
+
<CardTitle>Header Only</CardTitle>
|
|
318
|
+
<CardDescription>No content section</CardDescription>
|
|
319
|
+
</CardHeader>
|
|
320
|
+
</Card>
|
|
321
|
+
|
|
322
|
+
<Card>
|
|
323
|
+
<CardHeader>
|
|
324
|
+
<CardTitle>List Content</CardTitle>
|
|
325
|
+
</CardHeader>
|
|
326
|
+
<CardContent>
|
|
327
|
+
<ul className="space-y-2">
|
|
328
|
+
<li className="flex items-center gap-2">
|
|
329
|
+
<div className="h-2 w-2 rounded-full bg-green-500"></div>
|
|
330
|
+
<span>Task completed</span>
|
|
331
|
+
</li>
|
|
332
|
+
<li className="flex items-center gap-2">
|
|
333
|
+
<div className="h-2 w-2 rounded-full bg-yellow-500"></div>
|
|
334
|
+
<span>In progress</span>
|
|
335
|
+
</li>
|
|
336
|
+
<li className="flex items-center gap-2">
|
|
337
|
+
<div className="h-2 w-2 rounded-full bg-red-500"></div>
|
|
338
|
+
<span>Blocked</span>
|
|
339
|
+
</li>
|
|
340
|
+
</ul>
|
|
341
|
+
</CardContent>
|
|
342
|
+
</Card>
|
|
343
|
+
</div>
|
|
344
|
+
),
|
|
345
|
+
parameters: {
|
|
346
|
+
layout: "padded",
|
|
347
|
+
},
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Interactive playground
|
|
351
|
+
export const Playground: Story = {
|
|
352
|
+
args: {
|
|
353
|
+
className: "w-96",
|
|
354
|
+
},
|
|
355
|
+
render: (args: Record<string, unknown>) => (
|
|
356
|
+
<Card {...args}>
|
|
357
|
+
<CardHeader>
|
|
358
|
+
<CardTitle>Playground Card</CardTitle>
|
|
359
|
+
<CardDescription>
|
|
360
|
+
Customize this card using the controls below
|
|
361
|
+
</CardDescription>
|
|
362
|
+
<CardAction>
|
|
363
|
+
<Badge>New</Badge>
|
|
364
|
+
</CardAction>
|
|
365
|
+
</CardHeader>
|
|
366
|
+
<CardContent>
|
|
367
|
+
<p>
|
|
368
|
+
Use the Storybook controls to modify the card's appearance and
|
|
369
|
+
behavior.
|
|
370
|
+
</p>
|
|
371
|
+
</CardContent>
|
|
372
|
+
<CardFooter>
|
|
373
|
+
<Button>Primary Action</Button>
|
|
374
|
+
</CardFooter>
|
|
375
|
+
</Card>
|
|
376
|
+
),
|
|
377
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@lib/utils"
|
|
3
|
+
|
|
4
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
data-slot="card"
|
|
8
|
+
className={cn(
|
|
9
|
+
"bg-fm-surface-primary text-fm-primary border-fm-divider-secondary rounded-fm-s from-fm-tertiary/20 to-fm-surface-primary flex w-xs flex-col gap-4 border p-4 transition-[shadow,background] duration-200 hover:bg-gradient-to-b hover:[box-shadow:var(--bottom-sheet-shadow)_var(--color-fm-neutral-300)]",
|
|
10
|
+
className
|
|
11
|
+
)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
data-slot="card-header"
|
|
21
|
+
className={cn(
|
|
22
|
+
"grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
31
|
+
return (
|
|
32
|
+
<div
|
|
33
|
+
data-slot="card-title"
|
|
34
|
+
className={cn("leading-none font-semibold", className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
data-slot="card-description"
|
|
44
|
+
className={cn("text-sm", className)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot="card-action"
|
|
54
|
+
className={cn(
|
|
55
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
64
|
+
return <div data-slot="card-content" className={cn(className)} {...props} />
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
data-slot="card-footer"
|
|
71
|
+
className={cn("flex items-center [.border-t]:pt-6", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
Card,
|
|
79
|
+
CardHeader,
|
|
80
|
+
CardFooter,
|
|
81
|
+
CardTitle,
|
|
82
|
+
CardAction,
|
|
83
|
+
CardDescription,
|
|
84
|
+
CardContent,
|
|
85
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
dependencies: {},
|
|
3
|
+
devDependencies: {},
|
|
4
|
+
internalDependencies: [],
|
|
5
|
+
tokens: [
|
|
6
|
+
"--color-fm-surface-primary",
|
|
7
|
+
"--color-fm-primary",
|
|
8
|
+
"--color-fm-divider-secondary",
|
|
9
|
+
"--radius-fm-s",
|
|
10
|
+
"--color-fm-tertiary",
|
|
11
|
+
"--color-fm-neutral-300",
|
|
12
|
+
"--bottom-sheet-shadow",
|
|
13
|
+
],
|
|
14
|
+
}
|