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,1328 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Button } from "@components/button"
|
|
3
|
+
import {
|
|
4
|
+
AlertIcon,
|
|
5
|
+
EditBigIcon,
|
|
6
|
+
FileChartIcon,
|
|
7
|
+
PlusIcon,
|
|
8
|
+
SearchIcon,
|
|
9
|
+
TickCircleIcon,
|
|
10
|
+
} from "@icons/index"
|
|
11
|
+
import type { Meta, StoryObj } from "@storybook/react"
|
|
12
|
+
|
|
13
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from "."
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof HoverCard> = {
|
|
16
|
+
title: "Components/UI/HoverCard",
|
|
17
|
+
component: HoverCard,
|
|
18
|
+
parameters: {
|
|
19
|
+
layout: "centered",
|
|
20
|
+
backgrounds: {
|
|
21
|
+
default: "dark",
|
|
22
|
+
values: [
|
|
23
|
+
{ name: "dark", value: "#0a0a0a" },
|
|
24
|
+
{ name: "light", value: "#ffffff" },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
docs: {
|
|
28
|
+
description: {
|
|
29
|
+
component: `
|
|
30
|
+
# HoverCard Component
|
|
31
|
+
|
|
32
|
+
A rich contextual preview component built on top of Radix UI's HoverCard primitive, providing detailed information that appears on hover with a slight delay.
|
|
33
|
+
|
|
34
|
+
## Components
|
|
35
|
+
|
|
36
|
+
### Core Components
|
|
37
|
+
- **HoverCard**: Root component that manages the hover state and timing
|
|
38
|
+
- **HoverCardTrigger**: The element that triggers the hover card display
|
|
39
|
+
- **HoverCardContent**: The content container with positioning and styling
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- **Smart Positioning**: Automatically positions to stay within viewport
|
|
44
|
+
- **Hover Delay**: Configurable delay before showing content
|
|
45
|
+
- **Rich Content**: Supports complex layouts with images, text, and actions
|
|
46
|
+
- **Keyboard Accessible**: Full keyboard navigation support
|
|
47
|
+
- **Portal Rendering**: Renders in a portal to avoid z-index issues
|
|
48
|
+
- **Responsive**: Adapts to different screen sizes
|
|
49
|
+
- **Design System**: Integrated with design tokens and themes
|
|
50
|
+
- **Animation**: Smooth enter/exit animations
|
|
51
|
+
|
|
52
|
+
## Usage Examples
|
|
53
|
+
|
|
54
|
+
### Basic HoverCard
|
|
55
|
+
\`\`\`tsx
|
|
56
|
+
<HoverCard>
|
|
57
|
+
<HoverCardTrigger>
|
|
58
|
+
<Button variant="link">Hover me</Button>
|
|
59
|
+
</HoverCardTrigger>
|
|
60
|
+
<HoverCardContent>
|
|
61
|
+
<div className="space-y-2">
|
|
62
|
+
<h4 className="text-sm font-semibold">Quick Info</h4>
|
|
63
|
+
<p className="text-sm text-muted-foreground">
|
|
64
|
+
This is a hover card with basic information.
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
</HoverCardContent>
|
|
68
|
+
</HoverCard>
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
### User Profile Card
|
|
72
|
+
\`\`\`tsx
|
|
73
|
+
<HoverCard>
|
|
74
|
+
<HoverCardTrigger>
|
|
75
|
+
<Button variant="link">@username</Button>
|
|
76
|
+
</HoverCardTrigger>
|
|
77
|
+
<HoverCardContent className="w-80">
|
|
78
|
+
<div className="flex justify-between space-x-4">
|
|
79
|
+
<div className="space-y-1">
|
|
80
|
+
<h4 className="text-sm font-semibold">@username</h4>
|
|
81
|
+
<p className="text-sm">
|
|
82
|
+
Full Name - Software Developer
|
|
83
|
+
</p>
|
|
84
|
+
<div className="flex items-center pt-2">
|
|
85
|
+
<CalendarIcon className="mr-2 h-4 w-4" />
|
|
86
|
+
<span className="text-xs text-muted-foreground">
|
|
87
|
+
Joined December 2021
|
|
88
|
+
</span>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</HoverCardContent>
|
|
93
|
+
</HoverCard>
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
### Product Preview
|
|
97
|
+
\`\`\`tsx
|
|
98
|
+
<HoverCard>
|
|
99
|
+
<HoverCardTrigger>
|
|
100
|
+
<img src="product.jpg" alt="Product" />
|
|
101
|
+
</HoverCardTrigger>
|
|
102
|
+
<HoverCardContent>
|
|
103
|
+
<div className="space-y-3">
|
|
104
|
+
<div>
|
|
105
|
+
<h4 className="font-semibold">Product Name</h4>
|
|
106
|
+
<p className="text-sm text-muted-foreground">
|
|
107
|
+
Product description with key features
|
|
108
|
+
</p>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="flex items-center justify-between">
|
|
111
|
+
<span className="text-lg font-bold">$99.99</span>
|
|
112
|
+
<Button size="sm">Add to Cart</Button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</HoverCardContent>
|
|
116
|
+
</HoverCard>
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
## Positioning
|
|
120
|
+
|
|
121
|
+
The hover card automatically positions itself:
|
|
122
|
+
- **side**: "top" | "right" | "bottom" | "left"
|
|
123
|
+
- **align**: "start" | "center" | "end"
|
|
124
|
+
- **sideOffset**: Distance from the trigger (default: 4px)
|
|
125
|
+
- **alignOffset**: Offset along the alignment axis
|
|
126
|
+
|
|
127
|
+
## Accessibility
|
|
128
|
+
|
|
129
|
+
- **ARIA Support**: Proper ARIA attributes for screen readers
|
|
130
|
+
- **Keyboard Navigation**: Accessible via keyboard focus
|
|
131
|
+
- **Focus Management**: Proper focus handling
|
|
132
|
+
- **Delayed Appearance**: Prevents accidental triggers
|
|
133
|
+
- **Screen Reader**: Content is announced when card appears
|
|
134
|
+
|
|
135
|
+
## Design Tokens
|
|
136
|
+
|
|
137
|
+
- \`bg-fm-surface-frosted/20\`: Translucent background
|
|
138
|
+
- \`text-fm-primary\`: Primary text color
|
|
139
|
+
- \`rounded-md\`: Border radius
|
|
140
|
+
- \`border\`: Border styling
|
|
141
|
+
- \`shadow-md\`: Drop shadow
|
|
142
|
+
- \`p-4\`: Default padding
|
|
143
|
+
|
|
144
|
+
## Best Practices
|
|
145
|
+
|
|
146
|
+
- Use for supplementary information, not critical content
|
|
147
|
+
- Keep content concise and scannable
|
|
148
|
+
- Provide clear visual hierarchy
|
|
149
|
+
- Test with keyboard navigation
|
|
150
|
+
- Consider mobile users (hover cards don't work on touch)
|
|
151
|
+
- Don't nest interactive elements unnecessarily
|
|
152
|
+
`,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
tags: ["autodocs"],
|
|
157
|
+
argTypes: {
|
|
158
|
+
openDelay: {
|
|
159
|
+
control: { type: "number", min: 0, max: 2000, step: 100 },
|
|
160
|
+
description: "Delay before hover card opens (ms)",
|
|
161
|
+
},
|
|
162
|
+
closeDelay: {
|
|
163
|
+
control: { type: "number", min: 0, max: 2000, step: 100 },
|
|
164
|
+
description: "Delay before hover card closes (ms)",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export default meta
|
|
170
|
+
type Story = StoryObj<typeof HoverCard>
|
|
171
|
+
|
|
172
|
+
// 1. Basic HoverCard
|
|
173
|
+
export const Basic: Story = {
|
|
174
|
+
render: () => (
|
|
175
|
+
<div className="p-8">
|
|
176
|
+
<HoverCard>
|
|
177
|
+
<HoverCardTrigger asChild>
|
|
178
|
+
<Button variant="text">Hover for more info</Button>
|
|
179
|
+
</HoverCardTrigger>
|
|
180
|
+
<HoverCardContent>
|
|
181
|
+
<div className="space-y-2">
|
|
182
|
+
<h4 className="text-sm font-semibold text-white">
|
|
183
|
+
Quick Information
|
|
184
|
+
</h4>
|
|
185
|
+
<p className="text-sm text-white/70">
|
|
186
|
+
This is a basic hover card that provides additional context when
|
|
187
|
+
you hover over the trigger element.
|
|
188
|
+
</p>
|
|
189
|
+
</div>
|
|
190
|
+
</HoverCardContent>
|
|
191
|
+
</HoverCard>
|
|
192
|
+
</div>
|
|
193
|
+
),
|
|
194
|
+
parameters: {
|
|
195
|
+
docs: {
|
|
196
|
+
description: {
|
|
197
|
+
story:
|
|
198
|
+
"A simple hover card that appears when hovering over a trigger element.",
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// 2. User Profile Cards
|
|
205
|
+
export const UserProfiles: Story = {
|
|
206
|
+
render: () => (
|
|
207
|
+
<div className="space-y-8 p-8">
|
|
208
|
+
<h3 className="text-center text-lg font-medium text-white">
|
|
209
|
+
User Profile Cards
|
|
210
|
+
</h3>
|
|
211
|
+
|
|
212
|
+
<div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
|
213
|
+
{/* Basic Profile */}
|
|
214
|
+
<div className="space-y-4">
|
|
215
|
+
<h4 className="text-sm font-medium text-white/70">Basic Profile</h4>
|
|
216
|
+
<div className="text-center">
|
|
217
|
+
<HoverCard>
|
|
218
|
+
<HoverCardTrigger asChild>
|
|
219
|
+
<Button variant="text" className="text-blue-400">
|
|
220
|
+
@johndoe
|
|
221
|
+
</Button>
|
|
222
|
+
</HoverCardTrigger>
|
|
223
|
+
<HoverCardContent className="w-80">
|
|
224
|
+
<div className="flex space-x-4">
|
|
225
|
+
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-purple-600">
|
|
226
|
+
<span className="font-semibold text-white">JD</span>
|
|
227
|
+
</div>
|
|
228
|
+
<div className="flex-1 space-y-1">
|
|
229
|
+
<h4 className="text-sm font-semibold text-white">
|
|
230
|
+
John Doe
|
|
231
|
+
</h4>
|
|
232
|
+
<p className="text-sm text-white/70">
|
|
233
|
+
Senior Software Engineer
|
|
234
|
+
</p>
|
|
235
|
+
<p className="text-xs text-white/50">
|
|
236
|
+
Building amazing user experiences with React and
|
|
237
|
+
TypeScript
|
|
238
|
+
</p>
|
|
239
|
+
<div className="flex items-center gap-4 pt-2 text-xs text-white/60">
|
|
240
|
+
<span>👥 1.2k followers</span>
|
|
241
|
+
<span>📍 San Francisco</span>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</HoverCardContent>
|
|
246
|
+
</HoverCard>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
{/* Detailed Profile */}
|
|
251
|
+
<div className="space-y-4">
|
|
252
|
+
<h4 className="text-sm font-medium text-white/70">
|
|
253
|
+
Detailed Profile
|
|
254
|
+
</h4>
|
|
255
|
+
<div className="text-center">
|
|
256
|
+
<HoverCard>
|
|
257
|
+
<HoverCardTrigger asChild>
|
|
258
|
+
<Button variant="text" className="text-green-400">
|
|
259
|
+
@sarahsmith
|
|
260
|
+
</Button>
|
|
261
|
+
</HoverCardTrigger>
|
|
262
|
+
<HoverCardContent className="w-96">
|
|
263
|
+
<div className="space-y-3">
|
|
264
|
+
<div className="flex space-x-4">
|
|
265
|
+
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-gradient-to-br from-green-500 to-teal-600">
|
|
266
|
+
<span className="text-lg font-semibold text-white">
|
|
267
|
+
SS
|
|
268
|
+
</span>
|
|
269
|
+
</div>
|
|
270
|
+
<div className="flex-1 space-y-1">
|
|
271
|
+
<h4 className="text-base font-semibold text-white">
|
|
272
|
+
Sarah Smith
|
|
273
|
+
</h4>
|
|
274
|
+
<p className="text-sm text-white/70">
|
|
275
|
+
UX Designer & Product Manager
|
|
276
|
+
</p>
|
|
277
|
+
<div className="flex items-center gap-2 text-xs text-white/60">
|
|
278
|
+
<TickCircleIcon className="h-3 w-3" />
|
|
279
|
+
<span>Verified Account</span>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<p className="text-sm text-white/70">
|
|
285
|
+
Passionate about creating intuitive digital experiences.
|
|
286
|
+
Currently working on design systems and user research.
|
|
287
|
+
</p>
|
|
288
|
+
|
|
289
|
+
<div className="grid grid-cols-3 gap-4 pt-2 text-center">
|
|
290
|
+
<div>
|
|
291
|
+
<div className="text-lg font-semibold text-white">
|
|
292
|
+
248
|
|
293
|
+
</div>
|
|
294
|
+
<div className="text-xs text-white/60">Posts</div>
|
|
295
|
+
</div>
|
|
296
|
+
<div>
|
|
297
|
+
<div className="text-lg font-semibold text-white">
|
|
298
|
+
2.8k
|
|
299
|
+
</div>
|
|
300
|
+
<div className="text-xs text-white/60">Followers</div>
|
|
301
|
+
</div>
|
|
302
|
+
<div>
|
|
303
|
+
<div className="text-lg font-semibold text-white">
|
|
304
|
+
892
|
|
305
|
+
</div>
|
|
306
|
+
<div className="text-xs text-white/60">Following</div>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div className="flex gap-2 pt-2">
|
|
311
|
+
<Button size="sm" className="flex-1">
|
|
312
|
+
Follow
|
|
313
|
+
</Button>
|
|
314
|
+
<Button size="sm" variant="outline">
|
|
315
|
+
Message
|
|
316
|
+
</Button>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</HoverCardContent>
|
|
320
|
+
</HoverCard>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
),
|
|
326
|
+
parameters: {
|
|
327
|
+
docs: {
|
|
328
|
+
description: {
|
|
329
|
+
story:
|
|
330
|
+
"User profile cards showing basic and detailed user information with actions.",
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// 3. Product Previews
|
|
337
|
+
export const ProductPreviews: Story = {
|
|
338
|
+
render: () => (
|
|
339
|
+
<div className="space-y-8 p-8">
|
|
340
|
+
<h3 className="text-center text-lg font-medium text-white">
|
|
341
|
+
Product Previews
|
|
342
|
+
</h3>
|
|
343
|
+
|
|
344
|
+
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
|
|
345
|
+
{/* Simple Product */}
|
|
346
|
+
<div className="space-y-4">
|
|
347
|
+
<h4 className="text-sm font-medium text-white/70">Simple Product</h4>
|
|
348
|
+
<div className="text-center">
|
|
349
|
+
<HoverCard>
|
|
350
|
+
<HoverCardTrigger asChild>
|
|
351
|
+
<div className="cursor-pointer rounded-lg border border-white/10 bg-white/5 p-4 transition-colors hover:bg-white/10">
|
|
352
|
+
<div className="mx-auto mb-2 flex h-20 w-20 items-center justify-center rounded-lg bg-gradient-to-br from-purple-500 to-pink-600">
|
|
353
|
+
<FileChartIcon className="h-8 w-8 text-white" />
|
|
354
|
+
</div>
|
|
355
|
+
<p className="text-sm text-white">Analytics Pro</p>
|
|
356
|
+
</div>
|
|
357
|
+
</HoverCardTrigger>
|
|
358
|
+
<HoverCardContent>
|
|
359
|
+
<div className="space-y-3">
|
|
360
|
+
<div>
|
|
361
|
+
<h4 className="font-semibold text-white">Analytics Pro</h4>
|
|
362
|
+
<p className="text-sm text-white/70">
|
|
363
|
+
Advanced analytics dashboard with real-time insights
|
|
364
|
+
</p>
|
|
365
|
+
</div>
|
|
366
|
+
<div className="flex items-center justify-between">
|
|
367
|
+
<span className="text-lg font-bold text-white">$29/mo</span>
|
|
368
|
+
<Button size="sm">
|
|
369
|
+
<PlusIcon className="mr-1 h-3 w-3" />
|
|
370
|
+
Add
|
|
371
|
+
</Button>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
</HoverCardContent>
|
|
375
|
+
</HoverCard>
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
{/* Detailed Product */}
|
|
380
|
+
<div className="space-y-4">
|
|
381
|
+
<h4 className="text-sm font-medium text-white/70">
|
|
382
|
+
Detailed Product
|
|
383
|
+
</h4>
|
|
384
|
+
<div className="text-center">
|
|
385
|
+
<HoverCard>
|
|
386
|
+
<HoverCardTrigger asChild>
|
|
387
|
+
<div className="cursor-pointer rounded-lg border border-white/10 bg-white/5 p-4 transition-colors hover:bg-white/10">
|
|
388
|
+
<div className="mx-auto mb-2 flex h-20 w-20 items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-cyan-600">
|
|
389
|
+
<SearchIcon className="h-8 w-8 text-white" />
|
|
390
|
+
</div>
|
|
391
|
+
<p className="text-sm text-white">Search Engine</p>
|
|
392
|
+
</div>
|
|
393
|
+
</HoverCardTrigger>
|
|
394
|
+
<HoverCardContent className="w-80">
|
|
395
|
+
<div className="space-y-4">
|
|
396
|
+
<div className="flex space-x-3">
|
|
397
|
+
<div className="flex h-16 w-16 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-cyan-600">
|
|
398
|
+
<SearchIcon className="h-8 w-8 text-white" />
|
|
399
|
+
</div>
|
|
400
|
+
<div className="space-y-1">
|
|
401
|
+
<h4 className="font-semibold text-white">
|
|
402
|
+
Advanced Search Engine
|
|
403
|
+
</h4>
|
|
404
|
+
<p className="text-sm text-white/70">
|
|
405
|
+
AI-powered search with natural language processing
|
|
406
|
+
</p>
|
|
407
|
+
<div className="flex items-center gap-2">
|
|
408
|
+
<div className="flex">
|
|
409
|
+
{[1, 2, 3, 4, 5].map((star) => (
|
|
410
|
+
<span
|
|
411
|
+
key={star}
|
|
412
|
+
className="text-xs text-yellow-400"
|
|
413
|
+
>
|
|
414
|
+
★
|
|
415
|
+
</span>
|
|
416
|
+
))}
|
|
417
|
+
</div>
|
|
418
|
+
<span className="text-xs text-white/60">
|
|
419
|
+
(124 reviews)
|
|
420
|
+
</span>
|
|
421
|
+
</div>
|
|
422
|
+
</div>
|
|
423
|
+
</div>
|
|
424
|
+
|
|
425
|
+
<div className="space-y-2">
|
|
426
|
+
<div className="flex justify-between text-sm">
|
|
427
|
+
<span className="text-white/70">Features:</span>
|
|
428
|
+
</div>
|
|
429
|
+
<ul className="space-y-1 text-xs text-white/60">
|
|
430
|
+
<li>• Real-time search suggestions</li>
|
|
431
|
+
<li>• Advanced filtering options</li>
|
|
432
|
+
<li>• Analytics and insights</li>
|
|
433
|
+
<li>• API access included</li>
|
|
434
|
+
</ul>
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
<div className="flex items-center justify-between border-t border-white/10 pt-2">
|
|
438
|
+
<div>
|
|
439
|
+
<span className="text-xs text-white/60 line-through">
|
|
440
|
+
$99/mo
|
|
441
|
+
</span>
|
|
442
|
+
<span className="ml-2 text-lg font-bold text-white">
|
|
443
|
+
$79/mo
|
|
444
|
+
</span>
|
|
445
|
+
</div>
|
|
446
|
+
<Button size="sm">Start Trial</Button>
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
</HoverCardContent>
|
|
450
|
+
</HoverCard>
|
|
451
|
+
</div>
|
|
452
|
+
</div>
|
|
453
|
+
|
|
454
|
+
{/* Feature Product */}
|
|
455
|
+
<div className="space-y-4">
|
|
456
|
+
<h4 className="text-sm font-medium text-white/70">Feature Product</h4>
|
|
457
|
+
<div className="text-center">
|
|
458
|
+
<HoverCard>
|
|
459
|
+
<HoverCardTrigger asChild>
|
|
460
|
+
<div className="cursor-pointer rounded-lg border border-white/10 bg-white/5 p-4 transition-colors hover:bg-white/10">
|
|
461
|
+
<div className="mx-auto mb-2 flex h-20 w-20 items-center justify-center rounded-lg bg-gradient-to-br from-orange-500 to-red-600">
|
|
462
|
+
<EditBigIcon className="h-8 w-8 text-white" />
|
|
463
|
+
</div>
|
|
464
|
+
<p className="text-sm text-white">Editor Pro</p>
|
|
465
|
+
</div>
|
|
466
|
+
</HoverCardTrigger>
|
|
467
|
+
<HoverCardContent className="w-72">
|
|
468
|
+
<div className="space-y-3">
|
|
469
|
+
<div className="flex items-start space-x-3">
|
|
470
|
+
<div className="flex h-12 w-12 items-center justify-center rounded-lg bg-gradient-to-br from-orange-500 to-red-600">
|
|
471
|
+
<EditBigIcon className="h-6 w-6 text-white" />
|
|
472
|
+
</div>
|
|
473
|
+
<div>
|
|
474
|
+
<h4 className="font-semibold text-white">Editor Pro</h4>
|
|
475
|
+
<p className="text-sm text-white/70">
|
|
476
|
+
Professional code editor
|
|
477
|
+
</p>
|
|
478
|
+
<div className="mt-1 flex items-center gap-1">
|
|
479
|
+
<span className="rounded bg-orange-500/20 px-2 py-0.5 text-xs text-orange-300">
|
|
480
|
+
Popular
|
|
481
|
+
</span>
|
|
482
|
+
<span className="rounded bg-green-500/20 px-2 py-0.5 text-xs text-green-300">
|
|
483
|
+
New
|
|
484
|
+
</span>
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
</div>
|
|
488
|
+
|
|
489
|
+
<div className="grid grid-cols-2 gap-3 text-xs">
|
|
490
|
+
<div className="space-y-1">
|
|
491
|
+
<div className="text-white/70">Languages:</div>
|
|
492
|
+
<div className="text-white/60">20+ supported</div>
|
|
493
|
+
</div>
|
|
494
|
+
<div className="space-y-1">
|
|
495
|
+
<div className="text-white/70">Themes:</div>
|
|
496
|
+
<div className="text-white/60">50+ themes</div>
|
|
497
|
+
</div>
|
|
498
|
+
</div>
|
|
499
|
+
|
|
500
|
+
<div className="flex items-center justify-between">
|
|
501
|
+
<span className="text-lg font-bold text-white">Free</span>
|
|
502
|
+
<Button size="sm" variant="outline">
|
|
503
|
+
Download
|
|
504
|
+
</Button>
|
|
505
|
+
</div>
|
|
506
|
+
</div>
|
|
507
|
+
</HoverCardContent>
|
|
508
|
+
</HoverCard>
|
|
509
|
+
</div>
|
|
510
|
+
</div>
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
),
|
|
514
|
+
parameters: {
|
|
515
|
+
docs: {
|
|
516
|
+
description: {
|
|
517
|
+
story:
|
|
518
|
+
"Product preview cards showing different levels of detail and information architecture.",
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// 4. Documentation Links
|
|
525
|
+
export const DocumentationLinks: Story = {
|
|
526
|
+
render: () => (
|
|
527
|
+
<div className="space-y-8 p-8">
|
|
528
|
+
<h3 className="text-center text-lg font-medium text-white">
|
|
529
|
+
Documentation Links
|
|
530
|
+
</h3>
|
|
531
|
+
|
|
532
|
+
<div className="space-y-6">
|
|
533
|
+
{/* API Documentation */}
|
|
534
|
+
<div className="space-y-4">
|
|
535
|
+
<h4 className="text-sm font-medium text-white/70">
|
|
536
|
+
API Documentation
|
|
537
|
+
</h4>
|
|
538
|
+
<div className="space-y-2">
|
|
539
|
+
<p className="text-sm text-white/70">
|
|
540
|
+
Learn more about our{" "}
|
|
541
|
+
<HoverCard>
|
|
542
|
+
<HoverCardTrigger asChild>
|
|
543
|
+
<Button
|
|
544
|
+
variant="text"
|
|
545
|
+
className="h-auto p-0 font-normal text-blue-400"
|
|
546
|
+
>
|
|
547
|
+
REST API
|
|
548
|
+
</Button>
|
|
549
|
+
</HoverCardTrigger>
|
|
550
|
+
<HoverCardContent>
|
|
551
|
+
<div className="space-y-2">
|
|
552
|
+
<h4 className="text-sm font-semibold text-white">
|
|
553
|
+
REST API
|
|
554
|
+
</h4>
|
|
555
|
+
<p className="text-sm text-white/70">
|
|
556
|
+
Our REST API provides programmatic access to all platform
|
|
557
|
+
features.
|
|
558
|
+
</p>
|
|
559
|
+
<div className="space-y-1 text-xs text-white/60">
|
|
560
|
+
<div>• Rate limit: 1000 requests/hour</div>
|
|
561
|
+
<div>• Authentication: API Key required</div>
|
|
562
|
+
<div>• Response format: JSON</div>
|
|
563
|
+
</div>
|
|
564
|
+
<Button size="sm" className="mt-2 w-full">
|
|
565
|
+
View Documentation
|
|
566
|
+
</Button>
|
|
567
|
+
</div>
|
|
568
|
+
</HoverCardContent>
|
|
569
|
+
</HoverCard>{" "}
|
|
570
|
+
and{" "}
|
|
571
|
+
<HoverCard>
|
|
572
|
+
<HoverCardTrigger asChild>
|
|
573
|
+
<Button
|
|
574
|
+
variant="text"
|
|
575
|
+
className="h-auto p-0 font-normal text-blue-400"
|
|
576
|
+
>
|
|
577
|
+
GraphQL endpoint
|
|
578
|
+
</Button>
|
|
579
|
+
</HoverCardTrigger>
|
|
580
|
+
<HoverCardContent>
|
|
581
|
+
<div className="space-y-2">
|
|
582
|
+
<h4 className="text-sm font-semibold text-white">
|
|
583
|
+
GraphQL API
|
|
584
|
+
</h4>
|
|
585
|
+
<p className="text-sm text-white/70">
|
|
586
|
+
Query exactly the data you need with our GraphQL API.
|
|
587
|
+
</p>
|
|
588
|
+
<div className="space-y-1 text-xs text-white/60">
|
|
589
|
+
<div>• Single endpoint for all queries</div>
|
|
590
|
+
<div>• Type-safe schema</div>
|
|
591
|
+
<div>• Real-time subscriptions</div>
|
|
592
|
+
</div>
|
|
593
|
+
<div className="mt-2 flex gap-2">
|
|
594
|
+
<Button size="sm" className="flex-1">
|
|
595
|
+
Playground
|
|
596
|
+
</Button>
|
|
597
|
+
<Button size="sm" variant="outline" className="flex-1">
|
|
598
|
+
Schema
|
|
599
|
+
</Button>
|
|
600
|
+
</div>
|
|
601
|
+
</div>
|
|
602
|
+
</HoverCardContent>
|
|
603
|
+
</HoverCard>
|
|
604
|
+
.
|
|
605
|
+
</p>
|
|
606
|
+
</div>
|
|
607
|
+
</div>
|
|
608
|
+
|
|
609
|
+
{/* Configuration Options */}
|
|
610
|
+
<div className="space-y-4">
|
|
611
|
+
<h4 className="text-sm font-medium text-white/70">
|
|
612
|
+
Configuration Options
|
|
613
|
+
</h4>
|
|
614
|
+
<div className="rounded-lg border border-white/10 bg-white/5 p-4">
|
|
615
|
+
<div className="space-y-3 text-sm">
|
|
616
|
+
<div className="flex items-center justify-between">
|
|
617
|
+
<span className="text-white">Enable notifications</span>
|
|
618
|
+
<HoverCard>
|
|
619
|
+
<HoverCardTrigger asChild>
|
|
620
|
+
<Button variant="outline" size="sm" className="h-6 w-6 p-0">
|
|
621
|
+
<AlertIcon className="h-4 w-4" />
|
|
622
|
+
</Button>
|
|
623
|
+
</HoverCardTrigger>
|
|
624
|
+
<HoverCardContent className="w-72">
|
|
625
|
+
<div className="space-y-2">
|
|
626
|
+
<h4 className="text-sm font-semibold text-white">
|
|
627
|
+
Notification Settings
|
|
628
|
+
</h4>
|
|
629
|
+
<p className="text-sm text-white/70">
|
|
630
|
+
Control when and how you receive notifications from the
|
|
631
|
+
platform.
|
|
632
|
+
</p>
|
|
633
|
+
<div className="space-y-2">
|
|
634
|
+
<div className="text-xs text-white/60">
|
|
635
|
+
Available notification types:
|
|
636
|
+
</div>
|
|
637
|
+
<ul className="ml-2 space-y-1 text-xs text-white/60">
|
|
638
|
+
<li>• Email notifications</li>
|
|
639
|
+
<li>• Push notifications</li>
|
|
640
|
+
<li>• In-app notifications</li>
|
|
641
|
+
<li>• SMS alerts (premium)</li>
|
|
642
|
+
</ul>
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
</HoverCardContent>
|
|
646
|
+
</HoverCard>
|
|
647
|
+
</div>
|
|
648
|
+
|
|
649
|
+
<div className="flex items-center justify-between">
|
|
650
|
+
<span className="text-white">Auto-save frequency</span>
|
|
651
|
+
<HoverCard>
|
|
652
|
+
<HoverCardTrigger asChild>
|
|
653
|
+
<Button variant="outline" size="sm" className="h-6 w-6 p-0">
|
|
654
|
+
<TickCircleIcon className="h-4 w-4" />
|
|
655
|
+
</Button>
|
|
656
|
+
</HoverCardTrigger>
|
|
657
|
+
<HoverCardContent>
|
|
658
|
+
<div className="space-y-2">
|
|
659
|
+
<h4 className="text-sm font-semibold text-white">
|
|
660
|
+
Auto-save Settings
|
|
661
|
+
</h4>
|
|
662
|
+
<p className="text-sm text-white/70">
|
|
663
|
+
Automatically save your work at regular intervals.
|
|
664
|
+
</p>
|
|
665
|
+
<div className="space-y-1 text-xs text-white/60">
|
|
666
|
+
<div>• Every 30 seconds (recommended)</div>
|
|
667
|
+
<div>• Every 1 minute</div>
|
|
668
|
+
<div>• Every 5 minutes</div>
|
|
669
|
+
<div>• Disabled</div>
|
|
670
|
+
</div>
|
|
671
|
+
</div>
|
|
672
|
+
</HoverCardContent>
|
|
673
|
+
</HoverCard>
|
|
674
|
+
</div>
|
|
675
|
+
</div>
|
|
676
|
+
</div>
|
|
677
|
+
</div>
|
|
678
|
+
</div>
|
|
679
|
+
</div>
|
|
680
|
+
),
|
|
681
|
+
parameters: {
|
|
682
|
+
docs: {
|
|
683
|
+
description: {
|
|
684
|
+
story:
|
|
685
|
+
"Documentation and help text hover cards for providing contextual information about features and settings.",
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
},
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// 5. Interactive Elements
|
|
692
|
+
export const InteractiveElements: Story = {
|
|
693
|
+
render: () => {
|
|
694
|
+
const [selectedUser, setSelectedUser] = React.useState<string | null>(null)
|
|
695
|
+
const [hoveredProduct, setHoveredProduct] = React.useState<string | null>(
|
|
696
|
+
null
|
|
697
|
+
)
|
|
698
|
+
|
|
699
|
+
const users = [
|
|
700
|
+
{ id: "1", name: "Alice Johnson", role: "Designer", status: "online" },
|
|
701
|
+
{ id: "2", name: "Bob Smith", role: "Developer", status: "away" },
|
|
702
|
+
{ id: "3", name: "Carol Davis", role: "Manager", status: "offline" },
|
|
703
|
+
]
|
|
704
|
+
|
|
705
|
+
const products = [
|
|
706
|
+
{ id: "1", name: "Dashboard Pro", price: "$49", sales: 1234 },
|
|
707
|
+
{ id: "2", name: "Analytics Suite", price: "$79", sales: 856 },
|
|
708
|
+
{ id: "3", name: "Report Builder", price: "$29", sales: 2341 },
|
|
709
|
+
]
|
|
710
|
+
|
|
711
|
+
return (
|
|
712
|
+
<div className="space-y-8 p-8">
|
|
713
|
+
<h3 className="text-center text-lg font-medium text-white">
|
|
714
|
+
Interactive Elements
|
|
715
|
+
</h3>
|
|
716
|
+
|
|
717
|
+
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
718
|
+
{/* Team Members */}
|
|
719
|
+
<div className="space-y-4">
|
|
720
|
+
<h4 className="text-sm font-medium text-white/70">Team Members</h4>
|
|
721
|
+
<div className="space-y-2">
|
|
722
|
+
{users.map((user) => (
|
|
723
|
+
<HoverCard key={user.id}>
|
|
724
|
+
<HoverCardTrigger asChild>
|
|
725
|
+
<div
|
|
726
|
+
className={`flex cursor-pointer items-center space-x-3 rounded-lg border p-3 transition-colors ${
|
|
727
|
+
selectedUser === user.id
|
|
728
|
+
? "border-blue-500 bg-blue-500/10"
|
|
729
|
+
: "border-white/10 bg-white/5 hover:bg-white/10"
|
|
730
|
+
}`}
|
|
731
|
+
onClick={() =>
|
|
732
|
+
setSelectedUser(
|
|
733
|
+
selectedUser === user.id ? null : user.id
|
|
734
|
+
)
|
|
735
|
+
}
|
|
736
|
+
>
|
|
737
|
+
<div
|
|
738
|
+
className={`flex h-8 w-8 items-center justify-center rounded-full ${
|
|
739
|
+
user.status === "online"
|
|
740
|
+
? "bg-green-500"
|
|
741
|
+
: user.status === "away"
|
|
742
|
+
? "bg-yellow-500"
|
|
743
|
+
: "bg-gray-500"
|
|
744
|
+
}`}
|
|
745
|
+
>
|
|
746
|
+
<span className="text-xs font-semibold text-white">
|
|
747
|
+
{user.name
|
|
748
|
+
.split(" ")
|
|
749
|
+
.map((n) => n[0])
|
|
750
|
+
.join("")}
|
|
751
|
+
</span>
|
|
752
|
+
</div>
|
|
753
|
+
<div className="flex-1">
|
|
754
|
+
<div className="text-sm font-medium text-white">
|
|
755
|
+
{user.name}
|
|
756
|
+
</div>
|
|
757
|
+
<div className="text-xs text-white/60">{user.role}</div>
|
|
758
|
+
</div>
|
|
759
|
+
<div
|
|
760
|
+
className={`h-2 w-2 rounded-full ${
|
|
761
|
+
user.status === "online"
|
|
762
|
+
? "bg-green-500"
|
|
763
|
+
: user.status === "away"
|
|
764
|
+
? "bg-yellow-500"
|
|
765
|
+
: "bg-gray-500"
|
|
766
|
+
}`}
|
|
767
|
+
/>
|
|
768
|
+
</div>
|
|
769
|
+
</HoverCardTrigger>
|
|
770
|
+
<HoverCardContent className="w-80">
|
|
771
|
+
<div className="space-y-3">
|
|
772
|
+
<div className="flex space-x-4">
|
|
773
|
+
<div
|
|
774
|
+
className={`flex h-16 w-16 items-center justify-center rounded-full ${
|
|
775
|
+
user.status === "online"
|
|
776
|
+
? "bg-green-500"
|
|
777
|
+
: user.status === "away"
|
|
778
|
+
? "bg-yellow-500"
|
|
779
|
+
: "bg-gray-500"
|
|
780
|
+
}`}
|
|
781
|
+
>
|
|
782
|
+
<span className="font-semibold text-white">
|
|
783
|
+
{user.name
|
|
784
|
+
.split(" ")
|
|
785
|
+
.map((n) => n[0])
|
|
786
|
+
.join("")}
|
|
787
|
+
</span>
|
|
788
|
+
</div>
|
|
789
|
+
<div className="space-y-1">
|
|
790
|
+
<h4 className="text-sm font-semibold text-white">
|
|
791
|
+
{user.name}
|
|
792
|
+
</h4>
|
|
793
|
+
<p className="text-sm text-white/70">{user.role}</p>
|
|
794
|
+
<div className="flex items-center gap-2 text-xs">
|
|
795
|
+
<div
|
|
796
|
+
className={`h-2 w-2 rounded-full ${
|
|
797
|
+
user.status === "online"
|
|
798
|
+
? "bg-green-500"
|
|
799
|
+
: user.status === "away"
|
|
800
|
+
? "bg-yellow-500"
|
|
801
|
+
: "bg-gray-500"
|
|
802
|
+
}`}
|
|
803
|
+
/>
|
|
804
|
+
<span className="text-white/60 capitalize">
|
|
805
|
+
{user.status}
|
|
806
|
+
</span>
|
|
807
|
+
</div>
|
|
808
|
+
</div>
|
|
809
|
+
</div>
|
|
810
|
+
|
|
811
|
+
<div className="text-sm text-white/70">
|
|
812
|
+
{user.status === "online"
|
|
813
|
+
? "Available for collaboration"
|
|
814
|
+
: user.status === "away"
|
|
815
|
+
? "Away - will respond later"
|
|
816
|
+
: "Last seen 2 hours ago"}
|
|
817
|
+
</div>
|
|
818
|
+
|
|
819
|
+
<div className="flex gap-2">
|
|
820
|
+
<Button size="sm" className="flex-1">
|
|
821
|
+
Message
|
|
822
|
+
</Button>
|
|
823
|
+
<Button size="sm" variant="outline" className="flex-1">
|
|
824
|
+
Profile
|
|
825
|
+
</Button>
|
|
826
|
+
</div>
|
|
827
|
+
</div>
|
|
828
|
+
</HoverCardContent>
|
|
829
|
+
</HoverCard>
|
|
830
|
+
))}
|
|
831
|
+
</div>
|
|
832
|
+
</div>
|
|
833
|
+
|
|
834
|
+
{/* Product Analytics */}
|
|
835
|
+
<div className="space-y-4">
|
|
836
|
+
<h4 className="text-sm font-medium text-white/70">
|
|
837
|
+
Product Analytics
|
|
838
|
+
</h4>
|
|
839
|
+
<div className="space-y-2">
|
|
840
|
+
{products.map((product) => (
|
|
841
|
+
<HoverCard key={product.id}>
|
|
842
|
+
<HoverCardTrigger asChild>
|
|
843
|
+
<div
|
|
844
|
+
className={`cursor-pointer rounded-lg border p-3 transition-colors ${
|
|
845
|
+
hoveredProduct === product.id
|
|
846
|
+
? "border-purple-500 bg-purple-500/10"
|
|
847
|
+
: "border-white/10 bg-white/5 hover:bg-white/10"
|
|
848
|
+
}`}
|
|
849
|
+
onMouseEnter={() => setHoveredProduct(product.id)}
|
|
850
|
+
onMouseLeave={() => setHoveredProduct(null)}
|
|
851
|
+
>
|
|
852
|
+
<div className="flex items-center justify-between">
|
|
853
|
+
<div>
|
|
854
|
+
<div className="text-sm font-medium text-white">
|
|
855
|
+
{product.name}
|
|
856
|
+
</div>
|
|
857
|
+
<div className="text-xs text-white/60">
|
|
858
|
+
{product.sales} sales
|
|
859
|
+
</div>
|
|
860
|
+
</div>
|
|
861
|
+
<div className="text-right">
|
|
862
|
+
<div className="text-sm font-semibold text-white">
|
|
863
|
+
{product.price}
|
|
864
|
+
</div>
|
|
865
|
+
<div className="text-xs text-green-400">↗ +12%</div>
|
|
866
|
+
</div>
|
|
867
|
+
</div>
|
|
868
|
+
</div>
|
|
869
|
+
</HoverCardTrigger>
|
|
870
|
+
<HoverCardContent className="w-96">
|
|
871
|
+
<div className="space-y-4">
|
|
872
|
+
<div className="flex items-start justify-between">
|
|
873
|
+
<div>
|
|
874
|
+
<h4 className="font-semibold text-white">
|
|
875
|
+
{product.name}
|
|
876
|
+
</h4>
|
|
877
|
+
<p className="text-sm text-white/70">
|
|
878
|
+
Detailed product analytics
|
|
879
|
+
</p>
|
|
880
|
+
</div>
|
|
881
|
+
<span className="text-lg font-bold text-white">
|
|
882
|
+
{product.price}
|
|
883
|
+
</span>
|
|
884
|
+
</div>
|
|
885
|
+
|
|
886
|
+
<div className="grid grid-cols-2 gap-4">
|
|
887
|
+
<div className="space-y-1">
|
|
888
|
+
<div className="text-xs text-white/60">
|
|
889
|
+
Total Sales
|
|
890
|
+
</div>
|
|
891
|
+
<div className="text-lg font-semibold text-white">
|
|
892
|
+
{product.sales}
|
|
893
|
+
</div>
|
|
894
|
+
<div className="text-xs text-green-400">
|
|
895
|
+
+12% vs last month
|
|
896
|
+
</div>
|
|
897
|
+
</div>
|
|
898
|
+
<div className="space-y-1">
|
|
899
|
+
<div className="text-xs text-white/60">Revenue</div>
|
|
900
|
+
<div className="text-lg font-semibold text-white">
|
|
901
|
+
$
|
|
902
|
+
{(
|
|
903
|
+
parseInt(product.price.slice(1)) * product.sales
|
|
904
|
+
).toLocaleString()}
|
|
905
|
+
</div>
|
|
906
|
+
<div className="text-xs text-green-400">
|
|
907
|
+
+8% vs last month
|
|
908
|
+
</div>
|
|
909
|
+
</div>
|
|
910
|
+
</div>
|
|
911
|
+
|
|
912
|
+
<div className="space-y-2">
|
|
913
|
+
<div className="text-xs text-white/60">Top Markets</div>
|
|
914
|
+
<div className="space-y-1">
|
|
915
|
+
<div className="flex justify-between text-xs">
|
|
916
|
+
<span className="text-white/70">North America</span>
|
|
917
|
+
<span className="text-white">45%</span>
|
|
918
|
+
</div>
|
|
919
|
+
<div className="flex justify-between text-xs">
|
|
920
|
+
<span className="text-white/70">Europe</span>
|
|
921
|
+
<span className="text-white">32%</span>
|
|
922
|
+
</div>
|
|
923
|
+
<div className="flex justify-between text-xs">
|
|
924
|
+
<span className="text-white/70">Asia Pacific</span>
|
|
925
|
+
<span className="text-white">23%</span>
|
|
926
|
+
</div>
|
|
927
|
+
</div>
|
|
928
|
+
</div>
|
|
929
|
+
|
|
930
|
+
<Button size="sm" className="w-full">
|
|
931
|
+
<FileChartIcon className="mr-2 h-3 w-3" />
|
|
932
|
+
View Full Report
|
|
933
|
+
</Button>
|
|
934
|
+
</div>
|
|
935
|
+
</HoverCardContent>
|
|
936
|
+
</HoverCard>
|
|
937
|
+
))}
|
|
938
|
+
</div>
|
|
939
|
+
</div>
|
|
940
|
+
</div>
|
|
941
|
+
</div>
|
|
942
|
+
)
|
|
943
|
+
},
|
|
944
|
+
parameters: {
|
|
945
|
+
docs: {
|
|
946
|
+
description: {
|
|
947
|
+
story:
|
|
948
|
+
"Interactive hover cards that respond to user interactions and display dynamic content.",
|
|
949
|
+
},
|
|
950
|
+
},
|
|
951
|
+
},
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// 6. Positioning & Timing
|
|
955
|
+
export const PositioningAndTiming: Story = {
|
|
956
|
+
render: () => (
|
|
957
|
+
<div className="space-y-8 p-8">
|
|
958
|
+
<h3 className="text-center text-lg font-medium text-white">
|
|
959
|
+
Positioning & Timing
|
|
960
|
+
</h3>
|
|
961
|
+
|
|
962
|
+
<div className="space-y-8">
|
|
963
|
+
{/* Positioning */}
|
|
964
|
+
<div className="space-y-4">
|
|
965
|
+
<h4 className="text-center text-sm font-medium text-white/70">
|
|
966
|
+
Different Positions
|
|
967
|
+
</h4>
|
|
968
|
+
<div className="grid grid-cols-2 place-items-center gap-8 lg:grid-cols-4">
|
|
969
|
+
{/* Top */}
|
|
970
|
+
<div className="flex flex-col items-center gap-4">
|
|
971
|
+
<span className="text-sm text-white/70">Top</span>
|
|
972
|
+
<HoverCard>
|
|
973
|
+
<HoverCardTrigger asChild>
|
|
974
|
+
<Button variant="outline" size="sm">
|
|
975
|
+
Top
|
|
976
|
+
</Button>
|
|
977
|
+
</HoverCardTrigger>
|
|
978
|
+
<HoverCardContent side="top">
|
|
979
|
+
<div className="space-y-2">
|
|
980
|
+
<h4 className="text-sm font-semibold text-white">
|
|
981
|
+
Top Position
|
|
982
|
+
</h4>
|
|
983
|
+
<p className="text-sm text-white/70">
|
|
984
|
+
Card positioned above the trigger
|
|
985
|
+
</p>
|
|
986
|
+
</div>
|
|
987
|
+
</HoverCardContent>
|
|
988
|
+
</HoverCard>
|
|
989
|
+
</div>
|
|
990
|
+
|
|
991
|
+
{/* Right */}
|
|
992
|
+
<div className="flex flex-col items-center gap-4">
|
|
993
|
+
<span className="text-sm text-white/70">Right</span>
|
|
994
|
+
<HoverCard>
|
|
995
|
+
<HoverCardTrigger asChild>
|
|
996
|
+
<Button variant="outline" size="sm">
|
|
997
|
+
Right
|
|
998
|
+
</Button>
|
|
999
|
+
</HoverCardTrigger>
|
|
1000
|
+
<HoverCardContent side="right">
|
|
1001
|
+
<div className="space-y-2">
|
|
1002
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1003
|
+
Right Position
|
|
1004
|
+
</h4>
|
|
1005
|
+
<p className="text-sm text-white/70">
|
|
1006
|
+
Card positioned to the right
|
|
1007
|
+
</p>
|
|
1008
|
+
</div>
|
|
1009
|
+
</HoverCardContent>
|
|
1010
|
+
</HoverCard>
|
|
1011
|
+
</div>
|
|
1012
|
+
|
|
1013
|
+
{/* Bottom */}
|
|
1014
|
+
<div className="flex flex-col items-center gap-4">
|
|
1015
|
+
<span className="text-sm text-white/70">Bottom</span>
|
|
1016
|
+
<HoverCard>
|
|
1017
|
+
<HoverCardTrigger asChild>
|
|
1018
|
+
<Button variant="outline" size="sm">
|
|
1019
|
+
Bottom
|
|
1020
|
+
</Button>
|
|
1021
|
+
</HoverCardTrigger>
|
|
1022
|
+
<HoverCardContent side="bottom">
|
|
1023
|
+
<div className="space-y-2">
|
|
1024
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1025
|
+
Bottom Position
|
|
1026
|
+
</h4>
|
|
1027
|
+
<p className="text-sm text-white/70">
|
|
1028
|
+
Card positioned below the trigger
|
|
1029
|
+
</p>
|
|
1030
|
+
</div>
|
|
1031
|
+
</HoverCardContent>
|
|
1032
|
+
</HoverCard>
|
|
1033
|
+
</div>
|
|
1034
|
+
|
|
1035
|
+
{/* Left */}
|
|
1036
|
+
<div className="flex flex-col items-center gap-4">
|
|
1037
|
+
<span className="text-sm text-white/70">Left</span>
|
|
1038
|
+
<HoverCard>
|
|
1039
|
+
<HoverCardTrigger asChild>
|
|
1040
|
+
<Button variant="outline" size="sm">
|
|
1041
|
+
Left
|
|
1042
|
+
</Button>
|
|
1043
|
+
</HoverCardTrigger>
|
|
1044
|
+
<HoverCardContent side="left">
|
|
1045
|
+
<div className="space-y-2">
|
|
1046
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1047
|
+
Left Position
|
|
1048
|
+
</h4>
|
|
1049
|
+
<p className="text-sm text-white/70">
|
|
1050
|
+
Card positioned to the left
|
|
1051
|
+
</p>
|
|
1052
|
+
</div>
|
|
1053
|
+
</HoverCardContent>
|
|
1054
|
+
</HoverCard>
|
|
1055
|
+
</div>
|
|
1056
|
+
</div>
|
|
1057
|
+
</div>
|
|
1058
|
+
|
|
1059
|
+
{/* Timing */}
|
|
1060
|
+
<div className="space-y-4">
|
|
1061
|
+
<h4 className="text-center text-sm font-medium text-white/70">
|
|
1062
|
+
Different Delays
|
|
1063
|
+
</h4>
|
|
1064
|
+
<div className="flex justify-center gap-4">
|
|
1065
|
+
<HoverCard openDelay={0}>
|
|
1066
|
+
<HoverCardTrigger asChild>
|
|
1067
|
+
<Button variant="outline" size="sm">
|
|
1068
|
+
Instant
|
|
1069
|
+
</Button>
|
|
1070
|
+
</HoverCardTrigger>
|
|
1071
|
+
<HoverCardContent>
|
|
1072
|
+
<div className="space-y-2">
|
|
1073
|
+
<h4 className="text-sm font-semibold text-white">No Delay</h4>
|
|
1074
|
+
<p className="text-sm text-white/70">
|
|
1075
|
+
Appears immediately on hover
|
|
1076
|
+
</p>
|
|
1077
|
+
</div>
|
|
1078
|
+
</HoverCardContent>
|
|
1079
|
+
</HoverCard>
|
|
1080
|
+
|
|
1081
|
+
<HoverCard openDelay={500}>
|
|
1082
|
+
<HoverCardTrigger asChild>
|
|
1083
|
+
<Button variant="outline" size="sm">
|
|
1084
|
+
Medium
|
|
1085
|
+
</Button>
|
|
1086
|
+
</HoverCardTrigger>
|
|
1087
|
+
<HoverCardContent>
|
|
1088
|
+
<div className="space-y-2">
|
|
1089
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1090
|
+
Medium Delay
|
|
1091
|
+
</h4>
|
|
1092
|
+
<p className="text-sm text-white/70">
|
|
1093
|
+
500ms delay before appearing
|
|
1094
|
+
</p>
|
|
1095
|
+
</div>
|
|
1096
|
+
</HoverCardContent>
|
|
1097
|
+
</HoverCard>
|
|
1098
|
+
|
|
1099
|
+
<HoverCard openDelay={1000}>
|
|
1100
|
+
<HoverCardTrigger asChild>
|
|
1101
|
+
<Button variant="outline" size="sm">
|
|
1102
|
+
Slow
|
|
1103
|
+
</Button>
|
|
1104
|
+
</HoverCardTrigger>
|
|
1105
|
+
<HoverCardContent>
|
|
1106
|
+
<div className="space-y-2">
|
|
1107
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1108
|
+
Long Delay
|
|
1109
|
+
</h4>
|
|
1110
|
+
<p className="text-sm text-white/70">
|
|
1111
|
+
1000ms delay before appearing
|
|
1112
|
+
</p>
|
|
1113
|
+
</div>
|
|
1114
|
+
</HoverCardContent>
|
|
1115
|
+
</HoverCard>
|
|
1116
|
+
</div>
|
|
1117
|
+
</div>
|
|
1118
|
+
|
|
1119
|
+
{/* Size Variations */}
|
|
1120
|
+
<div className="space-y-4">
|
|
1121
|
+
<h4 className="text-center text-sm font-medium text-white/70">
|
|
1122
|
+
Different Sizes
|
|
1123
|
+
</h4>
|
|
1124
|
+
<div className="flex justify-center gap-4">
|
|
1125
|
+
<HoverCard>
|
|
1126
|
+
<HoverCardTrigger asChild>
|
|
1127
|
+
<Button variant="outline" size="sm">
|
|
1128
|
+
Small
|
|
1129
|
+
</Button>
|
|
1130
|
+
</HoverCardTrigger>
|
|
1131
|
+
<HoverCardContent className="w-48">
|
|
1132
|
+
<div className="space-y-2">
|
|
1133
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1134
|
+
Small Card
|
|
1135
|
+
</h4>
|
|
1136
|
+
<p className="text-sm text-white/70">Compact information</p>
|
|
1137
|
+
</div>
|
|
1138
|
+
</HoverCardContent>
|
|
1139
|
+
</HoverCard>
|
|
1140
|
+
|
|
1141
|
+
<HoverCard>
|
|
1142
|
+
<HoverCardTrigger asChild>
|
|
1143
|
+
<Button variant="outline" size="sm">
|
|
1144
|
+
Medium
|
|
1145
|
+
</Button>
|
|
1146
|
+
</HoverCardTrigger>
|
|
1147
|
+
<HoverCardContent className="w-80">
|
|
1148
|
+
<div className="space-y-2">
|
|
1149
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1150
|
+
Medium Card
|
|
1151
|
+
</h4>
|
|
1152
|
+
<p className="text-sm text-white/70">
|
|
1153
|
+
Medium-sized card with more detailed information and
|
|
1154
|
+
multiple lines of text.
|
|
1155
|
+
</p>
|
|
1156
|
+
</div>
|
|
1157
|
+
</HoverCardContent>
|
|
1158
|
+
</HoverCard>
|
|
1159
|
+
|
|
1160
|
+
<HoverCard>
|
|
1161
|
+
<HoverCardTrigger asChild>
|
|
1162
|
+
<Button variant="outline" size="sm">
|
|
1163
|
+
Large
|
|
1164
|
+
</Button>
|
|
1165
|
+
</HoverCardTrigger>
|
|
1166
|
+
<HoverCardContent className="w-96">
|
|
1167
|
+
<div className="space-y-3">
|
|
1168
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1169
|
+
Large Card
|
|
1170
|
+
</h4>
|
|
1171
|
+
<p className="text-sm text-white/70">
|
|
1172
|
+
Large card with extensive information, multiple sections,
|
|
1173
|
+
and complex layouts. Perfect for detailed previews and
|
|
1174
|
+
comprehensive information displays.
|
|
1175
|
+
</p>
|
|
1176
|
+
<div className="border-t border-white/10 pt-2">
|
|
1177
|
+
<Button size="sm" className="w-full">
|
|
1178
|
+
Learn More
|
|
1179
|
+
</Button>
|
|
1180
|
+
</div>
|
|
1181
|
+
</div>
|
|
1182
|
+
</HoverCardContent>
|
|
1183
|
+
</HoverCard>
|
|
1184
|
+
</div>
|
|
1185
|
+
</div>
|
|
1186
|
+
</div>
|
|
1187
|
+
</div>
|
|
1188
|
+
),
|
|
1189
|
+
parameters: {
|
|
1190
|
+
docs: {
|
|
1191
|
+
description: {
|
|
1192
|
+
story:
|
|
1193
|
+
"Different positioning options, timing delays, and size variations for hover cards.",
|
|
1194
|
+
},
|
|
1195
|
+
},
|
|
1196
|
+
},
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
// 7. Accessibility Demo
|
|
1200
|
+
export const AccessibilityDemo: Story = {
|
|
1201
|
+
render: () => (
|
|
1202
|
+
<div className="space-y-8 p-8">
|
|
1203
|
+
<h3 className="text-center text-lg font-medium text-white">
|
|
1204
|
+
Accessibility Features
|
|
1205
|
+
</h3>
|
|
1206
|
+
|
|
1207
|
+
<div className="space-y-6">
|
|
1208
|
+
<div className="rounded-lg border border-blue-500/30 bg-blue-900/10 p-4">
|
|
1209
|
+
<h4 className="mb-2 text-sm font-medium text-blue-300">
|
|
1210
|
+
Keyboard Navigation
|
|
1211
|
+
</h4>
|
|
1212
|
+
<p className="mb-2 text-xs text-blue-200/70">
|
|
1213
|
+
Try these keyboard interactions:
|
|
1214
|
+
</p>
|
|
1215
|
+
<ul className="space-y-1 text-xs text-blue-200/70">
|
|
1216
|
+
<li>
|
|
1217
|
+
• <kbd className="rounded bg-white/10 px-1">Tab</kbd> to focus
|
|
1218
|
+
hover card triggers
|
|
1219
|
+
</li>
|
|
1220
|
+
<li>• Hover card appears automatically on focus</li>
|
|
1221
|
+
<li>
|
|
1222
|
+
• <kbd className="rounded bg-white/10 px-1">Escape</kbd> to
|
|
1223
|
+
dismiss hover card
|
|
1224
|
+
</li>
|
|
1225
|
+
<li>• Content is announced by screen readers</li>
|
|
1226
|
+
</ul>
|
|
1227
|
+
</div>
|
|
1228
|
+
|
|
1229
|
+
{/* Keyboard Accessible Examples */}
|
|
1230
|
+
<div className="space-y-4">
|
|
1231
|
+
<h4 className="text-sm font-medium text-white/70">
|
|
1232
|
+
Keyboard Accessible Hover Cards
|
|
1233
|
+
</h4>
|
|
1234
|
+
<div className="flex flex-wrap gap-4">
|
|
1235
|
+
<HoverCard>
|
|
1236
|
+
<HoverCardTrigger asChild>
|
|
1237
|
+
<Button>Focusable Button</Button>
|
|
1238
|
+
</HoverCardTrigger>
|
|
1239
|
+
<HoverCardContent>
|
|
1240
|
+
<div className="space-y-2">
|
|
1241
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1242
|
+
Keyboard Accessible
|
|
1243
|
+
</h4>
|
|
1244
|
+
<p className="text-sm text-white/70">
|
|
1245
|
+
This hover card appears on both hover and keyboard focus.
|
|
1246
|
+
</p>
|
|
1247
|
+
</div>
|
|
1248
|
+
</HoverCardContent>
|
|
1249
|
+
</HoverCard>
|
|
1250
|
+
|
|
1251
|
+
<HoverCard>
|
|
1252
|
+
<HoverCardTrigger asChild>
|
|
1253
|
+
<a
|
|
1254
|
+
href="#"
|
|
1255
|
+
className="inline-flex items-center gap-2 rounded px-3 py-2 text-sm text-blue-400 hover:text-blue-300 focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
1256
|
+
onClick={(e) => e.preventDefault()}
|
|
1257
|
+
>
|
|
1258
|
+
<AlertIcon className="h-4 w-4" />
|
|
1259
|
+
Documentation Link
|
|
1260
|
+
</a>
|
|
1261
|
+
</HoverCardTrigger>
|
|
1262
|
+
<HoverCardContent>
|
|
1263
|
+
<div className="space-y-2">
|
|
1264
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1265
|
+
Documentation
|
|
1266
|
+
</h4>
|
|
1267
|
+
<p className="text-sm text-white/70">
|
|
1268
|
+
Comprehensive guides and API reference for developers.
|
|
1269
|
+
</p>
|
|
1270
|
+
<Button size="sm" className="w-full">
|
|
1271
|
+
View Docs
|
|
1272
|
+
</Button>
|
|
1273
|
+
</div>
|
|
1274
|
+
</HoverCardContent>
|
|
1275
|
+
</HoverCard>
|
|
1276
|
+
|
|
1277
|
+
<HoverCard>
|
|
1278
|
+
<HoverCardTrigger asChild>
|
|
1279
|
+
<button className="inline-flex items-center gap-2 rounded border border-white/20 bg-white/5 px-3 py-2 text-sm text-white hover:bg-white/10 focus:ring-2 focus:ring-purple-500 focus:outline-none">
|
|
1280
|
+
<TickCircleIcon className="h-4 w-4" />
|
|
1281
|
+
Status Check
|
|
1282
|
+
</button>
|
|
1283
|
+
</HoverCardTrigger>
|
|
1284
|
+
<HoverCardContent>
|
|
1285
|
+
<div className="space-y-2">
|
|
1286
|
+
<h4 className="text-sm font-semibold text-white">
|
|
1287
|
+
System Status
|
|
1288
|
+
</h4>
|
|
1289
|
+
<div className="space-y-1 text-sm text-white/70">
|
|
1290
|
+
<div className="flex items-center gap-2">
|
|
1291
|
+
<div className="h-2 w-2 rounded-full bg-green-500"></div>
|
|
1292
|
+
<span>All systems operational</span>
|
|
1293
|
+
</div>
|
|
1294
|
+
<div className="text-xs text-white/60">
|
|
1295
|
+
Last updated: 2 minutes ago
|
|
1296
|
+
</div>
|
|
1297
|
+
</div>
|
|
1298
|
+
</div>
|
|
1299
|
+
</HoverCardContent>
|
|
1300
|
+
</HoverCard>
|
|
1301
|
+
</div>
|
|
1302
|
+
</div>
|
|
1303
|
+
|
|
1304
|
+
<div className="rounded-lg border border-amber-500/30 bg-amber-900/10 p-4">
|
|
1305
|
+
<h4 className="mb-2 text-sm font-medium text-amber-300">
|
|
1306
|
+
Best Practices
|
|
1307
|
+
</h4>
|
|
1308
|
+
<ul className="space-y-1 text-xs text-amber-200/70">
|
|
1309
|
+
<li>• Ensure hover cards work with keyboard navigation</li>
|
|
1310
|
+
<li>• Don't put critical information only in hover cards</li>
|
|
1311
|
+
<li>• Keep content concise and scannable</li>
|
|
1312
|
+
<li>• Test with screen readers and keyboard users</li>
|
|
1313
|
+
<li>• Consider mobile users (hover doesn't work on touch)</li>
|
|
1314
|
+
<li>• Provide alternative access methods for important content</li>
|
|
1315
|
+
</ul>
|
|
1316
|
+
</div>
|
|
1317
|
+
</div>
|
|
1318
|
+
</div>
|
|
1319
|
+
),
|
|
1320
|
+
parameters: {
|
|
1321
|
+
docs: {
|
|
1322
|
+
description: {
|
|
1323
|
+
story:
|
|
1324
|
+
"Accessibility features including keyboard navigation, focus management, and best practices for inclusive design.",
|
|
1325
|
+
},
|
|
1326
|
+
},
|
|
1327
|
+
},
|
|
1328
|
+
}
|