aural-ui 3.0.7 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/aspect-ratio/AspectRatio.stories.tsx +290 -1199
- package/dist/components/avatar/Avatar.stories.tsx +235 -237
- package/dist/components/badge/Badge.stories.tsx +379 -116
- package/dist/components/banner/Banner.stories.tsx +445 -391
- package/dist/components/breadcrumb/Breadcrumb.stories.tsx +453 -199
- package/dist/components/button/Button.stories.tsx +585 -230
- package/dist/components/button/index.tsx +7 -7
- package/dist/components/card/Card.stories.tsx +619 -301
- package/dist/components/char-count/CharCount.stories.tsx +350 -248
- package/dist/components/checkbox/Checkbox.stories.tsx +309 -167
- package/dist/components/chip/Chip.stories.tsx +362 -168
- package/dist/components/circular-loader/CircularLoader.stories.tsx +221 -620
- package/dist/components/clamp-lines/ClampLines.stories.tsx +246 -117
- package/dist/components/collapsible/Collapsible.stories.tsx +391 -252
- package/dist/components/command/Command.stories.tsx +533 -856
- package/dist/components/dialog/Dialog.stories.tsx +505 -949
- package/dist/components/divider/Divider.stories.tsx +265 -502
- package/dist/components/dot-loader/DotLoader.stories.tsx +256 -257
- package/dist/components/drawer/Drawer.stories.tsx +659 -993
- package/dist/components/drawer/index.tsx +3 -3
- package/dist/components/dropdown/Dropdown.stories.tsx +643 -1018
- package/dist/components/form/Form.stories.tsx +560 -274
- package/dist/components/helper-text/HelperText.stories.tsx +199 -200
- package/dist/components/hover-card/HoverCard.stories.tsx +318 -1221
- package/dist/components/icon-button/IconButton.stories.tsx +837 -194
- package/dist/components/if-else/if-else.stories.tsx +370 -83
- package/dist/components/input/Input.stories.tsx +436 -368
- package/dist/components/label/Label.stories.tsx +156 -154
- package/dist/components/list/List.stories.tsx +485 -822
- package/dist/components/marquee/Marquee.stories.tsx +356 -694
- package/dist/components/otp-inputs/OtpInputs.stories.tsx +352 -410
- package/dist/components/overlay/Overlay.stories.tsx +452 -818
- package/dist/components/overlay/index.tsx +4 -4
- package/dist/components/pagination/Pagination.stories.tsx +721 -210
- package/dist/components/popover/Popover.stories.tsx +484 -873
- package/dist/components/radio/Radio.stories.tsx +432 -124
- package/dist/components/resizable/Resizable.stories.tsx +496 -752
- package/dist/components/scroll-area/ScrollArea.stories.tsx +384 -1006
- package/dist/components/search/Search.stories.tsx +314 -575
- package/dist/components/select/Select.stories.tsx +684 -787
- package/dist/components/sheet/Sheet.stories.tsx +671 -936
- package/dist/components/skelton/Skelton.stories.tsx +230 -764
- package/dist/components/slider/Slider.stories.tsx +384 -737
- package/dist/components/stepper/Stepper.stories.tsx +371 -514
- package/dist/components/switch/Switch.stories.tsx +461 -208
- package/dist/components/switch-case/SwitchCase.stories.tsx +367 -188
- package/dist/components/table/Table.stories.tsx +770 -914
- package/dist/components/tabs/Tabs.stories.tsx +459 -1400
- package/dist/components/tag/Tag.stories.tsx +714 -542
- package/dist/components/textarea/TextArea.stories.tsx +621 -562
- package/dist/components/thumbnail-tags/ThumbnailTags.stories.tsx +228 -148
- package/dist/components/toast/Toast.stories.tsx +452 -1333
- package/dist/components/toggle/Toggle.stories.tsx +488 -909
- package/dist/components/tooltip/Tooltip.stories.tsx +344 -1372
- package/dist/components/typography/Typography.stories.tsx +406 -89
- package/dist/hooks/use-change-state/UseChangeState.stories.tsx +309 -606
- package/dist/hooks/use-previous/UsePrevious.stories.tsx +367 -917
- package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +639 -867
- package/dist/icons/Icons.stories.tsx +0 -12
- package/dist/icons/ai-avatar-icon/AiAvatarIcon.stories.tsx +226 -1013
- package/dist/icons/alert-icon/AlertIcon.stories.tsx +109 -929
- package/dist/icons/all-icons.tsx +124 -87
- package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +140 -971
- package/dist/icons/apple-logo-icon/AppleLogoIcon.stories.tsx +148 -888
- package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +135 -1019
- package/dist/icons/arrow-corner-up-left-icon/ArrowCornerUpLeftIcon.stories.tsx +137 -953
- package/dist/icons/arrow-corner-up-right-icon/ArrowCornerUpRightIcon.stories.tsx +138 -997
- package/dist/icons/arrow-left-icon/ArrowLeftIcon.stories.tsx +136 -942
- package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +148 -1092
- package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +146 -1211
- package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +126 -615
- package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +144 -1164
- package/dist/icons/backward-ten-seconds-icon/BackwardTenSecondsIcon.stories.tsx +167 -985
- package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +122 -1179
- package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +124 -1168
- package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +119 -850
- package/dist/icons/camera-icon/CameraIcon.stories.tsx +112 -1213
- package/dist/icons/capital-a-letter-icon/CapitalALetterIcon.stories.tsx +117 -934
- package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +160 -961
- package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +163 -961
- package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +144 -942
- package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +129 -966
- package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +147 -964
- package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +145 -975
- package/dist/icons/circle-tick-icon/CircleTickIcon.stories.tsx +150 -1142
- package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +114 -461
- package/dist/icons/coin-icon/CoinIcon.stories.tsx +124 -1322
- package/dist/icons/coin-toons-icon/CoinToonsIcon.stories.tsx +117 -1318
- package/dist/icons/column-wide-add-icon/ColumnWideAddIcon.stories.tsx +114 -903
- package/dist/icons/command-icon/CommandIcon.stories.tsx +127 -1042
- package/dist/icons/copy-icon/CopyIcon.stories.tsx +123 -962
- package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +147 -999
- package/dist/icons/cross-icon/CrossIcon.stories.tsx +139 -960
- package/dist/icons/download-icon/DownloadIcon.stories.tsx +126 -820
- package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +124 -1031
- package/dist/icons/email-icon/EmailIcon.stories.tsx +115 -936
- package/dist/icons/expand-icon/ExpandIcon.stories.tsx +112 -1111
- package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +144 -1025
- package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +143 -1036
- package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +127 -1011
- package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +126 -1056
- package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +125 -614
- package/dist/icons/filter-bar-row-icon/FilterBarRowIcon.stories.tsx +119 -1050
- package/dist/icons/forward-ten-seconds-icon/ForwardTenSecondsIcon.stories.tsx +169 -989
- package/dist/icons/git-branch-icon/GitBranchIcon.stories.tsx +115 -1145
- package/dist/icons/git-fork-icon/GitForkIcon.stories.tsx +115 -1122
- package/dist/icons/globe-icon/GlobeIcon.stories.tsx +130 -313
- package/dist/icons/google-logo-icon/GoogleLogoIcon.stories.tsx +145 -940
- package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +119 -1174
- package/dist/icons/head-icon/HeadIcon.stories.tsx +111 -916
- package/dist/icons/heart-icon/HeartIcon.stories.tsx +120 -1019
- package/dist/icons/image-avatar-sparkle-icon/ImageAvatarSparkleIcon.stories.tsx +119 -683
- package/dist/icons/image-icon/ImageIcon.stories.tsx +105 -1121
- package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +111 -1192
- package/dist/icons/import-left-arrow-folder-icon/ImportLeftArrowFolderIcon.stories.tsx +136 -1256
- package/dist/icons/indian-flag-icon/IndianFlagIcon.stories.tsx +159 -962
- package/dist/icons/instagram-icon/InstagramIcon.stories.tsx +161 -1385
- package/dist/icons/layout-column-icon/LayoutColumnIcon.stories.tsx +124 -972
- package/dist/icons/layout-left-icon/LayoutLeftIcon.stories.tsx +119 -948
- package/dist/icons/layout-right-icon/LayoutRightIcon.stories.tsx +119 -942
- package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +108 -1215
- package/dist/icons/linked-in-icon/LinkedInIcon.stories.tsx +154 -1517
- package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +110 -1188
- package/dist/icons/magic-edit-icon/MagicEditIcon.stories.tsx +119 -678
- package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +123 -1184
- package/dist/icons/message-icon/MessageIcon.stories.tsx +114 -538
- package/dist/icons/minimize-icon/MinimizeIcon.stories.tsx +116 -1158
- package/dist/icons/moon-icon/MoonIcon.stories.tsx +120 -536
- package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +109 -1184
- package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +115 -1134
- package/dist/icons/musical-note-icon/MusicalNoteIcon.stories.tsx +119 -971
- package/dist/icons/notepad-icon/NotepadIcon.stories.tsx +111 -1100
- package/dist/icons/notes-icon/NotesIcon.stories.tsx +119 -1101
- package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +109 -1111
- package/dist/icons/page-text-icon/PageTextIcon.stories.tsx +122 -684
- package/dist/icons/paint-roll-icon/PaintRollIcon.stories.tsx +113 -954
- package/dist/icons/paper-plane-icon/PaperPlaneIcon.stories.tsx +112 -877
- package/dist/icons/pause-icon/PauseIcon.stories.tsx +113 -1000
- package/dist/icons/pencil-icon/PencilIcon.stories.tsx +115 -1070
- package/dist/icons/phone-icon/PhoneIcon.stories.tsx +115 -978
- package/dist/icons/plus-icon/PlusIcon.stories.tsx +106 -1093
- package/dist/icons/pocket-studio-icon/PocketStudioIcon.stories.tsx +107 -829
- package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +102 -469
- package/dist/icons/search-icon/SearchIcon.stories.tsx +111 -1124
- package/dist/icons/setting-icon/SettingIcon.stories.tsx +107 -970
- package/dist/icons/share-icon/ShareIcon.stories.tsx +120 -1025
- package/dist/icons/shield-icon/ShieldIcon.stories.tsx +117 -931
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +137 -1104
- package/dist/icons/skip-backward-icon/SkipBackwardIcon.stories.tsx +172 -982
- package/dist/icons/skip-forward-icon/SkipForwardIcon.stories.tsx +164 -983
- package/dist/icons/sparkles-soft-icon/SparklesSoftIcon.stories.tsx +105 -958
- package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +158 -580
- package/dist/icons/spinner-gradient-icon/index.tsx +6 -1
- package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +158 -587
- package/dist/icons/spinner-solid-icon/index.tsx +6 -1
- package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +146 -682
- package/dist/icons/spinner-solid-neutral-icon/index.tsx +1 -1
- package/dist/icons/star-icon/StarIcon.stories.tsx +124 -904
- package/dist/icons/store-coin-icon/StoreCoinIcon.stories.tsx +112 -964
- package/dist/icons/suggestion-icon/SuggestionIcon.stories.tsx +116 -852
- package/dist/icons/sun-icon/SunIcon.stories.tsx +120 -831
- package/dist/icons/text-color-icon/TextColorIcon.stories.tsx +116 -950
- package/dist/icons/text-indicator-icon/TextIndicatorIcon.stories.tsx +123 -980
- package/dist/icons/threads-icon/ThreadsIcon.stories.tsx +156 -1427
- package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +146 -1142
- package/dist/icons/tick-icon/TickIcon.stories.tsx +145 -1276
- package/dist/icons/trash-icon/TrashIcon.stories.tsx +108 -933
- package/dist/icons/twitter-x-icon/TwitterXIcon.stories.tsx +157 -1402
- package/dist/icons/upload-icon/UploadIcon.stories.tsx +115 -889
- package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +118 -984
- package/dist/icons/video-play-list-icon/VideoPlaylistIcon.stories.tsx +125 -1049
- package/dist/icons/voice-playing-icon/VoicePlayingIcon.stories.tsx +123 -1356
- package/dist/icons/volume-full-icon/VolumeFullIcon.stories.tsx +110 -1171
- package/dist/icons/volume-half-icon/VolumeHalfIcon.stories.tsx +112 -1093
- package/dist/icons/volume-off-icon/VolumeOffIcon.stories.tsx +115 -1087
- package/dist/icons/warning-icon/WarningIcon.stories.tsx +122 -1046
- package/dist/icons/youtube-icon/YoutubeIcon.stories.tsx +161 -936
- package/dist/index.cjs +84 -84
- package/dist/index.js +84 -84
- package/dist/styles/aural-all-theme.css +1222 -0
- package/dist/styles/{aural-theme.css → aural-dark-theme.css} +15 -3
- package/dist/styles/aural-light-theme.css +1047 -0
- package/package.json +1 -1
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Button } from "@components/button"
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
EyeOpenIcon,
|
|
8
|
-
FileChartIcon,
|
|
9
|
-
PlusIcon,
|
|
4
|
+
HeartIcon,
|
|
5
|
+
MusicalNoteIcon,
|
|
6
|
+
PauseIcon,
|
|
10
7
|
SearchIcon,
|
|
11
|
-
|
|
8
|
+
SettingIcon,
|
|
9
|
+
ShareIcon,
|
|
10
|
+
SkipBackwardIcon,
|
|
11
|
+
SkipForwardIcon,
|
|
12
|
+
StarIcon,
|
|
12
13
|
TrashIcon,
|
|
14
|
+
UploadIcon,
|
|
15
|
+
VolumeFullIcon,
|
|
13
16
|
} from "@icons/index"
|
|
14
17
|
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
15
18
|
|
|
16
|
-
import {
|
|
19
|
+
import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
|
|
20
|
+
|
|
21
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "."
|
|
17
22
|
|
|
18
23
|
const meta: Meta<typeof Tooltip> = {
|
|
19
24
|
title: "Components/UI/Tooltip",
|
|
@@ -29,161 +34,27 @@ const meta: Meta<typeof Tooltip> = {
|
|
|
29
34
|
},
|
|
30
35
|
docs: {
|
|
31
36
|
description: {
|
|
32
|
-
component:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
A sophisticated tooltip component built on top of Radix UI's Tooltip primitive with context-based variant management, gradient backgrounds, and comprehensive positioning support.
|
|
36
|
-
|
|
37
|
-
## Complete Props Reference
|
|
38
|
-
|
|
39
|
-
### Tooltip (Root Component)
|
|
40
|
-
The main wrapper component that provides context for all child components.
|
|
41
|
-
|
|
42
|
-
| Prop | Type | Default | Description |
|
|
43
|
-
|------|------|---------|-------------|
|
|
44
|
-
| \`variant\` | \`"dark" | "light"\` | \`"dark"\` | Visual variant that controls styling for content and arrow |
|
|
45
|
-
| \`children\` | \`ReactNode\` | - | Must contain TooltipTrigger and TooltipContent |
|
|
46
|
-
| \`...props\` | \`TooltipRootProps\` | - | All Radix Tooltip.Root props (open, onOpenChange, etc.) |
|
|
47
|
-
|
|
48
|
-
### TooltipTrigger
|
|
49
|
-
The element that triggers the tooltip on hover/focus.
|
|
50
|
-
|
|
51
|
-
| Prop | Type | Default | Description |
|
|
52
|
-
|------|------|---------|-------------|
|
|
53
|
-
| \`asChild\` | \`boolean\` | \`false\` | Merge props with child element instead of rendering button |
|
|
54
|
-
| \`children\` | \`ReactNode\` | - | Trigger element content |
|
|
55
|
-
| \`...props\` | \`TooltipTriggerProps\` | - | All Radix Tooltip.Trigger props |
|
|
56
|
-
|
|
57
|
-
### TooltipContent
|
|
58
|
-
The tooltip content with positioning, styling, and arrow.
|
|
59
|
-
|
|
60
|
-
| Prop | Type | Default | Description |
|
|
61
|
-
|------|------|---------|-------------|
|
|
62
|
-
| \`side\` | \`"top" | "right" | "bottom" | "left"\` | \`"top"\` | Which side of trigger to position tooltip |
|
|
63
|
-
| \`align\` | \`"start" | "center" | "end"\` | \`"center"\` | Alignment relative to trigger (for top/bottom sides) |
|
|
64
|
-
| \`sideOffset\` | \`number\` | \`0\` | Distance in pixels between tooltip and trigger |
|
|
65
|
-
| \`className\` | \`string\` | - | Additional CSS classes |
|
|
66
|
-
| \`children\` | \`ReactNode\` | - | Tooltip content |
|
|
67
|
-
| \`...props\` | \`TooltipContentProps\` | - | All Radix Tooltip.Content props |
|
|
68
|
-
|
|
69
|
-
### TooltipProvider (Optional)
|
|
70
|
-
Global provider for controlling tooltip behavior across multiple tooltips.
|
|
71
|
-
|
|
72
|
-
| Prop | Type | Default | Description |
|
|
73
|
-
|------|------|---------|-------------|
|
|
74
|
-
| \`delayDuration\` | \`number\` | \`0\` | Delay in milliseconds before tooltip appears |
|
|
75
|
-
| \`skipDelayDuration\` | \`number\` | \`300\` | Time to skip delay when moving between tooltips |
|
|
76
|
-
| \`disableHoverableContent\` | \`boolean\` | \`false\` | Disable hovering over tooltip content |
|
|
77
|
-
| \`children\` | \`ReactNode\` | - | App content with tooltips |
|
|
78
|
-
|
|
79
|
-
## Positioning Matrix
|
|
80
|
-
|
|
81
|
-
### Available Combinations
|
|
82
|
-
- **Top Side**: start, center, end alignments (3 combinations)
|
|
83
|
-
- **Right Side**: center alignment only (1 combination)
|
|
84
|
-
- **Bottom Side**: start, center, end alignments (3 combinations)
|
|
85
|
-
- **Left Side**: center alignment only (1 combination)
|
|
86
|
-
|
|
87
|
-
**Total: 8 positioning combinations × 2 variants = 16 total variations**
|
|
88
|
-
|
|
89
|
-
### Gradient System
|
|
90
|
-
Each positioning combination has a unique gradient optimized for that specific placement:
|
|
91
|
-
|
|
92
|
-
#### Dark Variant Gradients
|
|
93
|
-
- **Colors**: Purple (\`--fmSecondary-200\`) to dark transparent
|
|
94
|
-
- **Purpose**: Create visual connection from arrow to trigger
|
|
95
|
-
- **Style**: Single radial gradients
|
|
96
|
-
|
|
97
|
-
#### Light Variant Gradients
|
|
98
|
-
- **Colors**: Light purple (\`--fmSecondary-800\`) to white transparent
|
|
99
|
-
- **Purpose**: Sophisticated light theme integration
|
|
100
|
-
- **Style**: Complex multi-layer linear + radial gradients
|
|
101
|
-
|
|
102
|
-
## Usage Patterns
|
|
103
|
-
|
|
104
|
-
### Basic Usage
|
|
105
|
-
\`\`\`tsx
|
|
106
|
-
<Tooltip variant="dark">
|
|
107
|
-
<TooltipTrigger>Hover me</TooltipTrigger>
|
|
108
|
-
<TooltipContent>
|
|
109
|
-
Simple tooltip content
|
|
110
|
-
</TooltipContent>
|
|
111
|
-
</Tooltip>
|
|
112
|
-
\`\`\`
|
|
113
|
-
|
|
114
|
-
### Positioned Tooltip
|
|
115
|
-
\`\`\`tsx
|
|
116
|
-
<Tooltip variant="light">
|
|
117
|
-
<TooltipTrigger asChild>
|
|
118
|
-
<Button>Action Button</Button>
|
|
119
|
-
</TooltipTrigger>
|
|
120
|
-
<TooltipContent side="bottom" align="start" sideOffset={8}>
|
|
121
|
-
Positioned tooltip with offset
|
|
122
|
-
</TooltipContent>
|
|
123
|
-
</Tooltip>
|
|
124
|
-
\`\`\`
|
|
125
|
-
|
|
126
|
-
### With Provider (Multiple Tooltips)
|
|
127
|
-
\`\`\`tsx
|
|
128
|
-
<TooltipProvider delayDuration={500}>
|
|
129
|
-
<Tooltip variant="dark">
|
|
130
|
-
<TooltipTrigger>First</TooltipTrigger>
|
|
131
|
-
<TooltipContent>First tooltip</TooltipContent>
|
|
132
|
-
</Tooltip>
|
|
133
|
-
|
|
134
|
-
<Tooltip variant="light">
|
|
135
|
-
<TooltipTrigger>Second</TooltipTrigger>
|
|
136
|
-
<TooltipContent>Second tooltip</TooltipContent>
|
|
137
|
-
</Tooltip>
|
|
138
|
-
</TooltipProvider>
|
|
139
|
-
\`\`\`
|
|
140
|
-
|
|
141
|
-
### Rich Content
|
|
142
|
-
\`\`\`tsx
|
|
143
|
-
<Tooltip variant="light">
|
|
144
|
-
<TooltipTrigger>Info Button</TooltipTrigger>
|
|
145
|
-
<TooltipContent className="max-w-xs" side="right">
|
|
146
|
-
<div className="space-y-2">
|
|
147
|
-
<div className="font-medium">Feature Details</div>
|
|
148
|
-
<div className="text-xs opacity-70">
|
|
149
|
-
This feature allows you to perform advanced actions
|
|
150
|
-
with keyboard shortcuts.
|
|
151
|
-
</div>
|
|
152
|
-
<div className="text-xs">
|
|
153
|
-
Shortcut: <kbd>Ctrl+K</kbd>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</TooltipContent>
|
|
157
|
-
</Tooltip>
|
|
158
|
-
\`\`\`
|
|
159
|
-
|
|
160
|
-
## Best Practices
|
|
161
|
-
|
|
162
|
-
### Positioning
|
|
163
|
-
- Use \`center\` alignment for most cases
|
|
164
|
-
- Use \`start\`/\`end\` for edge-aligned triggers
|
|
165
|
-
- Add \`sideOffset\` for better visual separation
|
|
166
|
-
- Consider viewport boundaries for edge cases
|
|
167
|
-
|
|
168
|
-
### Content Guidelines
|
|
169
|
-
- Keep text concise and actionable
|
|
170
|
-
- Include keyboard shortcuts when relevant
|
|
171
|
-
- Provide context, not just label repetition
|
|
172
|
-
- Use rich content for complex information
|
|
173
|
-
|
|
174
|
-
### Performance
|
|
175
|
-
- Wrap multiple tooltips in single \`TooltipProvider\`
|
|
176
|
-
- Use appropriate delay durations for UX
|
|
177
|
-
- Consider tooltip density in complex UIs
|
|
178
|
-
|
|
179
|
-
### Accessibility
|
|
180
|
-
- Proper ARIA attributes automatically applied
|
|
181
|
-
- Keyboard navigation support included
|
|
182
|
-
- Screen reader announcements handled
|
|
183
|
-
- Focus management for interactive triggers
|
|
184
|
-
|
|
185
|
-
`,
|
|
37
|
+
component:
|
|
38
|
+
"A compound tooltip built on Radix UI with context-based variant management (dark/light), per-side radial gradient backgrounds, and matching arrow SVGs. Supports 4 sides × 3 alignments for 8 positioning combinations, a configurable sideOffset, and an optional delay. The variant is set once on the root Tooltip and inherited by the content and arrow.",
|
|
186
39
|
},
|
|
40
|
+
page: () => (
|
|
41
|
+
<AuralComponentDocsPage
|
|
42
|
+
features={[
|
|
43
|
+
{
|
|
44
|
+
title: "Dark & Light Variants",
|
|
45
|
+
description: "Gradient background",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: "12 Positions",
|
|
49
|
+
description: "4 sides × 3 alignments",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: "Arrow SVG",
|
|
53
|
+
description: "Matching gradient arrow",
|
|
54
|
+
},
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
),
|
|
187
58
|
},
|
|
188
59
|
},
|
|
189
60
|
tags: ["autodocs"],
|
|
@@ -191,443 +62,236 @@ Each positioning combination has a unique gradient optimized for that specific p
|
|
|
191
62
|
variant: {
|
|
192
63
|
control: "select",
|
|
193
64
|
options: ["dark", "light"],
|
|
194
|
-
description:
|
|
195
|
-
"Visual variant applied to tooltip content and arrow. Determines gradient styling and color scheme.",
|
|
65
|
+
description: "Visual variant controlling gradient and arrow style",
|
|
196
66
|
table: {
|
|
197
67
|
type: { summary: '"dark" | "light"' },
|
|
198
68
|
defaultValue: { summary: '"dark"' },
|
|
199
69
|
},
|
|
200
70
|
},
|
|
201
|
-
delayDuration: {
|
|
202
|
-
control: { type: "number", min: 0, max: 2000, step: 100 },
|
|
203
|
-
description:
|
|
204
|
-
"Delay before tooltip appears (ms). Set on TooltipProvider to affect all tooltips.",
|
|
205
|
-
table: {
|
|
206
|
-
type: { summary: "number" },
|
|
207
|
-
defaultValue: { summary: "0" },
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
71
|
},
|
|
211
72
|
}
|
|
212
73
|
|
|
213
74
|
export default meta
|
|
214
75
|
type Story = StoryObj<typeof Tooltip>
|
|
215
76
|
|
|
216
|
-
//
|
|
217
|
-
export const Basic: Story = {
|
|
218
|
-
render: () => (
|
|
219
|
-
<div className="p-8">
|
|
220
|
-
<Tooltip variant="dark">
|
|
221
|
-
<TooltipTrigger asChild>
|
|
222
|
-
<Button variant="outline">Hover for tooltip</Button>
|
|
223
|
-
</TooltipTrigger>
|
|
224
|
-
<TooltipContent>
|
|
225
|
-
<p>This is a basic dark tooltip</p>
|
|
226
|
-
</TooltipContent>
|
|
227
|
-
</Tooltip>
|
|
228
|
-
</div>
|
|
229
|
-
),
|
|
230
|
-
parameters: {
|
|
231
|
-
docs: {
|
|
232
|
-
description: {
|
|
233
|
-
story:
|
|
234
|
-
"A simple tooltip with dark variant that appears on hover. The variant is set once on the Tooltip component and inherited by the content and arrow.",
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
}
|
|
77
|
+
// ─── AllVariants ──────────────────────────────────────────────────────────────
|
|
239
78
|
|
|
240
|
-
|
|
241
|
-
export const VariantComparison: Story = {
|
|
79
|
+
export const AllVariants: Story = {
|
|
242
80
|
render: () => (
|
|
243
|
-
<div className="
|
|
244
|
-
|
|
245
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
246
|
-
Dark Variant (Default)
|
|
247
|
-
</h3>
|
|
248
|
-
<div className="flex justify-center">
|
|
249
|
-
<Tooltip variant="dark">
|
|
250
|
-
<TooltipTrigger asChild>
|
|
251
|
-
<Button variant="outline">Dark Tooltip</Button>
|
|
252
|
-
</TooltipTrigger>
|
|
253
|
-
<TooltipContent>
|
|
254
|
-
<p>Dark variant with purple gradient background</p>
|
|
255
|
-
</TooltipContent>
|
|
256
|
-
</Tooltip>
|
|
257
|
-
</div>
|
|
258
|
-
</div>
|
|
259
|
-
|
|
81
|
+
<div className="space-y-8">
|
|
82
|
+
{/* Variant axis */}
|
|
260
83
|
<div className="space-y-4">
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
</h3>
|
|
264
|
-
<div className="flex justify-center">
|
|
265
|
-
<Tooltip variant="light">
|
|
266
|
-
<TooltipTrigger asChild>
|
|
267
|
-
<Button variant="outline">Light Tooltip</Button>
|
|
268
|
-
</TooltipTrigger>
|
|
269
|
-
<TooltipContent>
|
|
270
|
-
<p>Light variant with sophisticated light gradients</p>
|
|
271
|
-
</TooltipContent>
|
|
272
|
-
</Tooltip>
|
|
273
|
-
</div>
|
|
274
|
-
</div>
|
|
275
|
-
</div>
|
|
276
|
-
),
|
|
277
|
-
parameters: {
|
|
278
|
-
docs: {
|
|
279
|
-
description: {
|
|
280
|
-
story:
|
|
281
|
-
"Comparison of the two available variants. Notice how the arrow automatically matches the tooltip background for each variant with unique gradient styling.",
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// 3. Complete Positioning Matrix
|
|
288
|
-
export const CompletePositioningMatrix: Story = {
|
|
289
|
-
render: () => (
|
|
290
|
-
<div className="space-y-12 p-12">
|
|
291
|
-
<h3 className="text-center text-xl font-medium text-white">
|
|
292
|
-
Complete Positioning Matrix - All Combinations
|
|
293
|
-
</h3>
|
|
294
|
-
|
|
295
|
-
{/* Top Side - All Alignments */}
|
|
296
|
-
<div className="space-y-6">
|
|
297
|
-
<h4 className="text-center text-lg font-medium text-white/80">
|
|
298
|
-
Top Side Tooltips
|
|
84
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
85
|
+
Variants
|
|
299
86
|
</h4>
|
|
300
|
-
<div className="
|
|
301
|
-
<div className="
|
|
302
|
-
<span className="text-sm text-white/60">Top + Start (Dark)</span>
|
|
87
|
+
<div className="flex flex-wrap gap-8 pt-10">
|
|
88
|
+
<div className="space-y-2 text-center">
|
|
303
89
|
<Tooltip variant="dark">
|
|
304
90
|
<TooltipTrigger asChild>
|
|
305
|
-
<Button variant="outline"
|
|
306
|
-
Top Start
|
|
307
|
-
</Button>
|
|
91
|
+
<Button variant="outline">Hover me</Button>
|
|
308
92
|
</TooltipTrigger>
|
|
309
|
-
<TooltipContent side="top" align="
|
|
310
|
-
|
|
93
|
+
<TooltipContent side="top" align="center">
|
|
94
|
+
Dark variant tooltip
|
|
311
95
|
</TooltipContent>
|
|
312
96
|
</Tooltip>
|
|
97
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
98
|
+
Dark (default)
|
|
99
|
+
</p>
|
|
313
100
|
</div>
|
|
314
101
|
|
|
315
|
-
<div className="
|
|
316
|
-
<span className="text-sm text-white/60">Top + Center (Light)</span>
|
|
102
|
+
<div className="space-y-2 text-center">
|
|
317
103
|
<Tooltip variant="light">
|
|
318
104
|
<TooltipTrigger asChild>
|
|
319
|
-
<Button variant="outline"
|
|
320
|
-
Top Center
|
|
321
|
-
</Button>
|
|
105
|
+
<Button variant="outline">Hover me</Button>
|
|
322
106
|
</TooltipTrigger>
|
|
323
107
|
<TooltipContent side="top" align="center">
|
|
324
|
-
|
|
325
|
-
Top side, center alignment with gradient from bottom-center
|
|
326
|
-
</p>
|
|
327
|
-
</TooltipContent>
|
|
328
|
-
</Tooltip>
|
|
329
|
-
</div>
|
|
330
|
-
|
|
331
|
-
<div className="flex flex-col items-center gap-4">
|
|
332
|
-
<span className="text-sm text-white/60">Top + End (Dark)</span>
|
|
333
|
-
<Tooltip variant="dark">
|
|
334
|
-
<TooltipTrigger asChild>
|
|
335
|
-
<Button variant="outline" size="lg">
|
|
336
|
-
Top End
|
|
337
|
-
</Button>
|
|
338
|
-
</TooltipTrigger>
|
|
339
|
-
<TooltipContent side="top" align="end">
|
|
340
|
-
<p>Top side, end alignment with gradient from bottom-left</p>
|
|
108
|
+
Light variant tooltip
|
|
341
109
|
</TooltipContent>
|
|
342
110
|
</Tooltip>
|
|
111
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
112
|
+
Light
|
|
113
|
+
</p>
|
|
343
114
|
</div>
|
|
344
115
|
</div>
|
|
345
116
|
</div>
|
|
346
117
|
|
|
347
|
-
{/*
|
|
348
|
-
<div className="space-y-
|
|
349
|
-
<h4 className="text-
|
|
350
|
-
|
|
118
|
+
{/* Side axis */}
|
|
119
|
+
<div className="space-y-4">
|
|
120
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
121
|
+
Sides
|
|
351
122
|
</h4>
|
|
352
|
-
<div className="
|
|
353
|
-
|
|
354
|
-
<
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
<TooltipTrigger asChild>
|
|
371
|
-
<Button variant="outline" size="lg">
|
|
372
|
-
Right Side
|
|
373
|
-
</Button>
|
|
374
|
-
</TooltipTrigger>
|
|
375
|
-
<TooltipContent side="right">
|
|
376
|
-
<p>Right side positioning with gradient from left edge</p>
|
|
377
|
-
</TooltipContent>
|
|
378
|
-
</Tooltip>
|
|
379
|
-
</div>
|
|
123
|
+
<div className="flex flex-wrap gap-8 px-10 py-10">
|
|
124
|
+
{(["top", "right", "bottom", "left"] as const).map((side) => (
|
|
125
|
+
<div key={side} className="space-y-2 text-center">
|
|
126
|
+
<Tooltip variant="dark">
|
|
127
|
+
<TooltipTrigger asChild>
|
|
128
|
+
<Button variant="outline" size="sm">
|
|
129
|
+
{side}
|
|
130
|
+
</Button>
|
|
131
|
+
</TooltipTrigger>
|
|
132
|
+
<TooltipContent side={side} align="center" sideOffset={6}>
|
|
133
|
+
Tooltip on {side}
|
|
134
|
+
</TooltipContent>
|
|
135
|
+
</Tooltip>
|
|
136
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm capitalize">
|
|
137
|
+
{side}
|
|
138
|
+
</p>
|
|
139
|
+
</div>
|
|
140
|
+
))}
|
|
380
141
|
</div>
|
|
381
142
|
</div>
|
|
382
143
|
|
|
383
|
-
{/*
|
|
384
|
-
<div className="space-y-
|
|
385
|
-
<h4 className="text-
|
|
386
|
-
|
|
144
|
+
{/* Alignment axis (top side) */}
|
|
145
|
+
<div className="space-y-4">
|
|
146
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
147
|
+
Alignments (top side)
|
|
387
148
|
</h4>
|
|
388
|
-
<div className="
|
|
389
|
-
|
|
390
|
-
<
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
<span className="text-sm text-white/60">
|
|
407
|
-
Bottom + Center (Dark)
|
|
408
|
-
</span>
|
|
409
|
-
<Tooltip variant="dark">
|
|
410
|
-
<TooltipTrigger asChild>
|
|
411
|
-
<Button variant="outline" size="lg">
|
|
412
|
-
Bottom Center
|
|
413
|
-
</Button>
|
|
414
|
-
</TooltipTrigger>
|
|
415
|
-
<TooltipContent side="bottom" align="center">
|
|
416
|
-
<p>
|
|
417
|
-
Bottom side, center alignment with gradient from top-center
|
|
418
|
-
</p>
|
|
419
|
-
</TooltipContent>
|
|
420
|
-
</Tooltip>
|
|
421
|
-
</div>
|
|
422
|
-
|
|
423
|
-
<div className="flex flex-col items-center gap-4">
|
|
424
|
-
<span className="text-sm text-white/60">Bottom + End (Light)</span>
|
|
425
|
-
<Tooltip variant="light">
|
|
426
|
-
<TooltipTrigger asChild>
|
|
427
|
-
<Button variant="outline" size="lg">
|
|
428
|
-
Bottom End
|
|
429
|
-
</Button>
|
|
430
|
-
</TooltipTrigger>
|
|
431
|
-
<TooltipContent side="bottom" align="end">
|
|
432
|
-
<p>Bottom side, end alignment with dual gradient system</p>
|
|
433
|
-
</TooltipContent>
|
|
434
|
-
</Tooltip>
|
|
435
|
-
</div>
|
|
149
|
+
<div className="flex flex-wrap gap-8 pt-12">
|
|
150
|
+
{(["start", "center", "end"] as const).map((align) => (
|
|
151
|
+
<div key={align} className="space-y-2 text-center">
|
|
152
|
+
<Tooltip variant="dark">
|
|
153
|
+
<TooltipTrigger asChild>
|
|
154
|
+
<Button variant="outline" size="sm">
|
|
155
|
+
{align}
|
|
156
|
+
</Button>
|
|
157
|
+
</TooltipTrigger>
|
|
158
|
+
<TooltipContent side="top" align={align} sideOffset={6}>
|
|
159
|
+
Align: {align}
|
|
160
|
+
</TooltipContent>
|
|
161
|
+
</Tooltip>
|
|
162
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm capitalize">
|
|
163
|
+
{align}
|
|
164
|
+
</p>
|
|
165
|
+
</div>
|
|
166
|
+
))}
|
|
436
167
|
</div>
|
|
437
168
|
</div>
|
|
438
|
-
|
|
439
|
-
<div className="space-y-2 text-center text-xs text-white/60">
|
|
440
|
-
<p>
|
|
441
|
-
All 8 positioning combinations shown with unique gradient backgrounds
|
|
442
|
-
</p>
|
|
443
|
-
<p>
|
|
444
|
-
Each gradient is positioned to create visual connection from arrow to
|
|
445
|
-
trigger
|
|
446
|
-
</p>
|
|
447
|
-
<p>
|
|
448
|
-
Notice how light variant tooltips use more complex multi-layer
|
|
449
|
-
gradients
|
|
450
|
-
</p>
|
|
451
|
-
</div>
|
|
452
169
|
</div>
|
|
453
170
|
),
|
|
454
171
|
parameters: {
|
|
455
|
-
layout: "fullscreen",
|
|
456
172
|
docs: {
|
|
457
173
|
description: {
|
|
458
174
|
story:
|
|
459
|
-
"
|
|
175
|
+
"Full visual matrix of both variants (dark, light), all four sides, and all three alignment options shown as labeled item cards.",
|
|
460
176
|
},
|
|
461
177
|
},
|
|
462
178
|
},
|
|
463
179
|
}
|
|
464
180
|
|
|
465
|
-
//
|
|
466
|
-
export const OffsetVariations: Story = {
|
|
467
|
-
render: () => (
|
|
468
|
-
<div className="space-y-8 p-8">
|
|
469
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
470
|
-
Side Offset Variations
|
|
471
|
-
</h3>
|
|
181
|
+
// ─── Configurations ───────────────────────────────────────────────────────────
|
|
472
182
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
<p>sideOffset = 0</p>
|
|
482
|
-
</TooltipContent>
|
|
483
|
-
</Tooltip>
|
|
484
|
-
</div>
|
|
183
|
+
export const Configurations: Story = {
|
|
184
|
+
render: () => (
|
|
185
|
+
<div className="space-y-8">
|
|
186
|
+
{/* All 4 sides × all alignments */}
|
|
187
|
+
<div className="space-y-4">
|
|
188
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
189
|
+
All Sides × All Alignments
|
|
190
|
+
</h4>
|
|
485
191
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
<
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
<
|
|
494
|
-
|
|
495
|
-
|
|
192
|
+
{/* Top side */}
|
|
193
|
+
<div className="space-y-2">
|
|
194
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
195
|
+
Top
|
|
196
|
+
</p>
|
|
197
|
+
<div className="flex flex-wrap gap-4 pt-12">
|
|
198
|
+
{(["start", "center", "end"] as const).map((align) => (
|
|
199
|
+
<div key={align} className="space-y-2 text-center">
|
|
200
|
+
<Tooltip variant="dark">
|
|
201
|
+
<TooltipTrigger asChild>
|
|
202
|
+
<Button variant="outline" size="sm">
|
|
203
|
+
top · {align}
|
|
204
|
+
</Button>
|
|
205
|
+
</TooltipTrigger>
|
|
206
|
+
<TooltipContent side="top" align={align} sideOffset={6}>
|
|
207
|
+
top / {align}
|
|
208
|
+
</TooltipContent>
|
|
209
|
+
</Tooltip>
|
|
210
|
+
</div>
|
|
211
|
+
))}
|
|
212
|
+
</div>
|
|
496
213
|
</div>
|
|
497
214
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
<
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
<
|
|
506
|
-
|
|
507
|
-
|
|
215
|
+
{/* Bottom side */}
|
|
216
|
+
<div className="space-y-2">
|
|
217
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
218
|
+
Bottom
|
|
219
|
+
</p>
|
|
220
|
+
<div className="flex flex-wrap gap-4 pb-12">
|
|
221
|
+
{(["start", "center", "end"] as const).map((align) => (
|
|
222
|
+
<div key={align} className="space-y-2 text-center">
|
|
223
|
+
<Tooltip variant="light">
|
|
224
|
+
<TooltipTrigger asChild>
|
|
225
|
+
<Button variant="outline" size="sm">
|
|
226
|
+
bottom · {align}
|
|
227
|
+
</Button>
|
|
228
|
+
</TooltipTrigger>
|
|
229
|
+
<TooltipContent side="bottom" align={align} sideOffset={6}>
|
|
230
|
+
bottom / {align}
|
|
231
|
+
</TooltipContent>
|
|
232
|
+
</Tooltip>
|
|
233
|
+
</div>
|
|
234
|
+
))}
|
|
235
|
+
</div>
|
|
508
236
|
</div>
|
|
509
237
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
<
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
<
|
|
517
|
-
<
|
|
518
|
-
|
|
519
|
-
|
|
238
|
+
{/* Left & Right sides */}
|
|
239
|
+
<div className="space-y-2">
|
|
240
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
241
|
+
Left & Right
|
|
242
|
+
</p>
|
|
243
|
+
<div className="flex flex-wrap gap-4 px-16">
|
|
244
|
+
<div className="space-y-2 text-center">
|
|
245
|
+
<Tooltip variant="dark">
|
|
246
|
+
<TooltipTrigger asChild>
|
|
247
|
+
<Button variant="outline" size="sm">
|
|
248
|
+
left · center
|
|
249
|
+
</Button>
|
|
250
|
+
</TooltipTrigger>
|
|
251
|
+
<TooltipContent side="left" align="center" sideOffset={6}>
|
|
252
|
+
left / center
|
|
253
|
+
</TooltipContent>
|
|
254
|
+
</Tooltip>
|
|
255
|
+
</div>
|
|
256
|
+
<div className="space-y-2 text-center">
|
|
257
|
+
<Tooltip variant="light">
|
|
258
|
+
<TooltipTrigger asChild>
|
|
259
|
+
<Button variant="outline" size="sm">
|
|
260
|
+
right · center
|
|
261
|
+
</Button>
|
|
262
|
+
</TooltipTrigger>
|
|
263
|
+
<TooltipContent side="right" align="center" sideOffset={6}>
|
|
264
|
+
right / center
|
|
265
|
+
</TooltipContent>
|
|
266
|
+
</Tooltip>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
520
269
|
</div>
|
|
521
270
|
</div>
|
|
522
271
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
<div className="space-y-8 p-8">
|
|
544
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
545
|
-
Content Variations with Gradient Backgrounds
|
|
546
|
-
</h3>
|
|
547
|
-
|
|
548
|
-
<div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
|
|
549
|
-
{/* Short Text */}
|
|
550
|
-
<div className="flex flex-col items-center gap-4">
|
|
551
|
-
<span className="text-sm text-white/60">Short Text (Dark)</span>
|
|
552
|
-
<Tooltip variant="dark">
|
|
553
|
-
<TooltipTrigger asChild>
|
|
554
|
-
<Button variant="outline">Save</Button>
|
|
555
|
-
</TooltipTrigger>
|
|
556
|
-
<TooltipContent side="top" align="center">
|
|
557
|
-
<p>Save changes</p>
|
|
558
|
-
</TooltipContent>
|
|
559
|
-
</Tooltip>
|
|
560
|
-
</div>
|
|
561
|
-
|
|
562
|
-
{/* Long Text */}
|
|
563
|
-
<div className="flex flex-col items-center gap-4">
|
|
564
|
-
<span className="text-sm text-white/60">Long Text (Light)</span>
|
|
565
|
-
<Tooltip variant="light">
|
|
566
|
-
<TooltipTrigger asChild>
|
|
567
|
-
<Button variant="outline">Learn More</Button>
|
|
568
|
-
</TooltipTrigger>
|
|
569
|
-
<TooltipContent className="max-w-xs" side="top" align="center">
|
|
570
|
-
<p>
|
|
571
|
-
This is a longer tooltip with more detailed information that
|
|
572
|
-
demonstrates text wrapping with gradient backgrounds.
|
|
272
|
+
{/* sideOffset variations */}
|
|
273
|
+
<div className="space-y-4">
|
|
274
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
275
|
+
Offset Variations
|
|
276
|
+
</h4>
|
|
277
|
+
<div className="flex flex-wrap gap-6 pt-12">
|
|
278
|
+
{([0, 4, 8, 16] as const).map((offset) => (
|
|
279
|
+
<div key={offset} className="space-y-2 text-center">
|
|
280
|
+
<Tooltip variant="dark">
|
|
281
|
+
<TooltipTrigger asChild>
|
|
282
|
+
<Button variant="outline" size="sm">
|
|
283
|
+
{offset}px
|
|
284
|
+
</Button>
|
|
285
|
+
</TooltipTrigger>
|
|
286
|
+
<TooltipContent side="top" align="center" sideOffset={offset}>
|
|
287
|
+
sideOffset={offset}
|
|
288
|
+
</TooltipContent>
|
|
289
|
+
</Tooltip>
|
|
290
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
291
|
+
sideOffset={offset}
|
|
573
292
|
</p>
|
|
574
|
-
</
|
|
575
|
-
|
|
576
|
-
</div>
|
|
577
|
-
|
|
578
|
-
{/* Rich Content - Dark */}
|
|
579
|
-
<div className="flex flex-col items-center gap-4">
|
|
580
|
-
<span className="text-sm text-white/60">Rich Content (Dark)</span>
|
|
581
|
-
<Tooltip variant="dark">
|
|
582
|
-
<TooltipTrigger asChild>
|
|
583
|
-
<Button variant="outline">
|
|
584
|
-
<AlertIcon className="h-4 w-4" />
|
|
585
|
-
</Button>
|
|
586
|
-
</TooltipTrigger>
|
|
587
|
-
<TooltipContent className="max-w-sm" side="right">
|
|
588
|
-
<div className="space-y-2">
|
|
589
|
-
<div className="font-medium text-white">Keyboard Shortcut</div>
|
|
590
|
-
<div className="text-xs text-white/80">
|
|
591
|
-
Use{" "}
|
|
592
|
-
<kbd className="rounded bg-white/20 px-1 py-0.5 text-xs">
|
|
593
|
-
Ctrl+S
|
|
594
|
-
</kbd>{" "}
|
|
595
|
-
to save your work quickly.
|
|
596
|
-
</div>
|
|
597
|
-
</div>
|
|
598
|
-
</TooltipContent>
|
|
599
|
-
</Tooltip>
|
|
600
|
-
</div>
|
|
601
|
-
|
|
602
|
-
{/* List Content - Light */}
|
|
603
|
-
<div className="flex flex-col items-center gap-4">
|
|
604
|
-
<span className="text-sm text-white/60">List Content (Light)</span>
|
|
605
|
-
<Tooltip variant="light">
|
|
606
|
-
<TooltipTrigger asChild>
|
|
607
|
-
<Button variant="outline">
|
|
608
|
-
<SearchIcon className="h-4 w-4" />
|
|
609
|
-
</Button>
|
|
610
|
-
</TooltipTrigger>
|
|
611
|
-
<TooltipContent className="max-w-xs" side="left">
|
|
612
|
-
<div className="space-y-2">
|
|
613
|
-
<div className="font-medium">Keyboard Shortcuts</div>
|
|
614
|
-
<ul className="space-y-1 text-xs opacity-80">
|
|
615
|
-
<li>
|
|
616
|
-
• <kbd className="rounded bg-black/10 px-1">Ctrl+C</kbd>{" "}
|
|
617
|
-
Copy
|
|
618
|
-
</li>
|
|
619
|
-
<li>
|
|
620
|
-
• <kbd className="rounded bg-black/10 px-1">Ctrl+V</kbd>{" "}
|
|
621
|
-
Paste
|
|
622
|
-
</li>
|
|
623
|
-
<li>
|
|
624
|
-
• <kbd className="rounded bg-black/10 px-1">Ctrl+Z</kbd>{" "}
|
|
625
|
-
Undo
|
|
626
|
-
</li>
|
|
627
|
-
</ul>
|
|
628
|
-
</div>
|
|
629
|
-
</TooltipContent>
|
|
630
|
-
</Tooltip>
|
|
293
|
+
</div>
|
|
294
|
+
))}
|
|
631
295
|
</div>
|
|
632
296
|
</div>
|
|
633
297
|
</div>
|
|
@@ -636,912 +300,220 @@ export const ContentVariations: Story = {
|
|
|
636
300
|
docs: {
|
|
637
301
|
description: {
|
|
638
302
|
story:
|
|
639
|
-
"
|
|
303
|
+
"All 4 sides × 3 alignments (8 positioning combinations) plus sideOffset variations from 0 px to 16 px. Each compound variant has a unique gradient optimised for that placement.",
|
|
640
304
|
},
|
|
641
305
|
},
|
|
642
306
|
},
|
|
643
307
|
}
|
|
644
308
|
|
|
645
|
-
//
|
|
646
|
-
export const DelayVariations: Story = {
|
|
647
|
-
render: () => (
|
|
648
|
-
<div className="space-y-8 p-8">
|
|
649
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
650
|
-
Delay Variations with TooltipProvider
|
|
651
|
-
</h3>
|
|
309
|
+
// ─── UseCases ─────────────────────────────────────────────────────────────────
|
|
652
310
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
311
|
+
export const UseCases: Story = {
|
|
312
|
+
render: () => (
|
|
313
|
+
<div className="mx-auto max-w-3xl space-y-8 p-8">
|
|
314
|
+
{/* Player controls */}
|
|
315
|
+
<div className="space-y-4">
|
|
316
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
317
|
+
Player Controls
|
|
318
|
+
</h4>
|
|
319
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-xl border p-6">
|
|
320
|
+
<div className="flex items-center justify-center gap-6 pt-10">
|
|
658
321
|
<Tooltip variant="dark">
|
|
659
322
|
<TooltipTrigger asChild>
|
|
660
|
-
<
|
|
323
|
+
<button
|
|
324
|
+
className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary rounded-lg p-2 transition-colors"
|
|
325
|
+
aria-label="Skip backward"
|
|
326
|
+
>
|
|
327
|
+
<SkipBackwardIcon className="h-5 w-5" />
|
|
328
|
+
</button>
|
|
661
329
|
</TooltipTrigger>
|
|
662
|
-
<TooltipContent side="top">
|
|
663
|
-
|
|
330
|
+
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
331
|
+
Previous track
|
|
664
332
|
</TooltipContent>
|
|
665
333
|
</Tooltip>
|
|
666
|
-
</TooltipProvider>
|
|
667
|
-
</div>
|
|
668
334
|
|
|
669
|
-
|
|
670
|
-
<div className="flex flex-col items-center gap-4">
|
|
671
|
-
<span className="text-sm text-white/60">Medium Delay (500ms)</span>
|
|
672
|
-
<TooltipProvider delayDuration={500}>
|
|
673
|
-
<Tooltip variant="light">
|
|
335
|
+
<Tooltip variant="dark">
|
|
674
336
|
<TooltipTrigger asChild>
|
|
675
|
-
<
|
|
337
|
+
<button
|
|
338
|
+
className="text-fm-primary hover:text-fm-secondary bg-fm-surface-primary hover:bg-fm-surface-secondary border-fm-divider-secondary rounded-full border p-3 transition-colors"
|
|
339
|
+
aria-label="Pause"
|
|
340
|
+
>
|
|
341
|
+
<PauseIcon className="h-6 w-6" />
|
|
342
|
+
</button>
|
|
676
343
|
</TooltipTrigger>
|
|
677
|
-
<TooltipContent side="top">
|
|
678
|
-
|
|
344
|
+
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
345
|
+
Pause (Space)
|
|
679
346
|
</TooltipContent>
|
|
680
347
|
</Tooltip>
|
|
681
|
-
</TooltipProvider>
|
|
682
|
-
</div>
|
|
683
348
|
|
|
684
|
-
{/* Long Delay */}
|
|
685
|
-
<div className="flex flex-col items-center gap-4">
|
|
686
|
-
<span className="text-sm text-white/60">Long Delay (1000ms)</span>
|
|
687
|
-
<TooltipProvider delayDuration={1000}>
|
|
688
349
|
<Tooltip variant="dark">
|
|
689
350
|
<TooltipTrigger asChild>
|
|
690
|
-
<
|
|
351
|
+
<button
|
|
352
|
+
className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary rounded-lg p-2 transition-colors"
|
|
353
|
+
aria-label="Skip forward"
|
|
354
|
+
>
|
|
355
|
+
<SkipForwardIcon className="h-5 w-5" />
|
|
356
|
+
</button>
|
|
691
357
|
</TooltipTrigger>
|
|
692
|
-
<TooltipContent side="top">
|
|
693
|
-
|
|
358
|
+
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
359
|
+
Next track
|
|
694
360
|
</TooltipContent>
|
|
695
361
|
</Tooltip>
|
|
696
|
-
</TooltipProvider>
|
|
697
|
-
</div>
|
|
698
|
-
</div>
|
|
699
|
-
|
|
700
|
-
<div className="text-center text-xs text-white/60">
|
|
701
|
-
<p>Hover over each button to experience different delay timings</p>
|
|
702
|
-
</div>
|
|
703
|
-
</div>
|
|
704
|
-
),
|
|
705
|
-
parameters: {
|
|
706
|
-
docs: {
|
|
707
|
-
description: {
|
|
708
|
-
story:
|
|
709
|
-
"Different delay durations configured through TooltipProvider. Useful for controlling when tooltips appear based on user interaction patterns.",
|
|
710
|
-
},
|
|
711
|
-
},
|
|
712
|
-
},
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
// 7. Icon Tooltips Showcase
|
|
716
|
-
export const IconTooltipsShowcase: Story = {
|
|
717
|
-
render: () => (
|
|
718
|
-
<div className="space-y-8 p-8">
|
|
719
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
720
|
-
Icon Tooltips with Gradient Styling
|
|
721
|
-
</h3>
|
|
722
|
-
|
|
723
|
-
<div className="grid grid-cols-2 gap-8 lg:grid-cols-4">
|
|
724
|
-
<div className="flex flex-col items-center gap-4">
|
|
725
|
-
<span className="text-sm text-white/60">Info (Dark)</span>
|
|
726
|
-
<Tooltip variant="dark">
|
|
727
|
-
<TooltipTrigger asChild>
|
|
728
|
-
<button className="rounded-full p-3 transition-colors hover:bg-white/10">
|
|
729
|
-
<AlertIcon className="h-6 w-6 text-blue-400" />
|
|
730
|
-
</button>
|
|
731
|
-
</TooltipTrigger>
|
|
732
|
-
<TooltipContent side="top" align="center">
|
|
733
|
-
<p>Important information available</p>
|
|
734
|
-
</TooltipContent>
|
|
735
|
-
</Tooltip>
|
|
736
|
-
</div>
|
|
737
|
-
|
|
738
|
-
<div className="flex flex-col items-center gap-4">
|
|
739
|
-
<span className="text-sm text-white/60">Search (Light)</span>
|
|
740
|
-
<Tooltip variant="light">
|
|
741
|
-
<TooltipTrigger asChild>
|
|
742
|
-
<button className="rounded-full p-3 transition-colors hover:bg-white/10">
|
|
743
|
-
<SearchIcon className="h-6 w-6 text-green-400" />
|
|
744
|
-
</button>
|
|
745
|
-
</TooltipTrigger>
|
|
746
|
-
<TooltipContent side="top" align="center">
|
|
747
|
-
<p>Search for items</p>
|
|
748
|
-
</TooltipContent>
|
|
749
|
-
</Tooltip>
|
|
750
|
-
</div>
|
|
751
|
-
|
|
752
|
-
<div className="flex flex-col items-center gap-4">
|
|
753
|
-
<span className="text-sm text-white/60">Edit (Dark)</span>
|
|
754
|
-
<Tooltip variant="dark">
|
|
755
|
-
<TooltipTrigger asChild>
|
|
756
|
-
<button className="rounded-full p-3 transition-colors hover:bg-white/10">
|
|
757
|
-
<EditBigIcon className="h-6 w-6 text-purple-400" />
|
|
758
|
-
</button>
|
|
759
|
-
</TooltipTrigger>
|
|
760
|
-
<TooltipContent side="top" align="center">
|
|
761
|
-
<p>Edit this item</p>
|
|
762
|
-
</TooltipContent>
|
|
763
|
-
</Tooltip>
|
|
764
|
-
</div>
|
|
765
362
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
<
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
</div>
|
|
780
|
-
</div>
|
|
781
|
-
),
|
|
782
|
-
parameters: {
|
|
783
|
-
docs: {
|
|
784
|
-
description: {
|
|
785
|
-
story:
|
|
786
|
-
"Common icon buttons with descriptive tooltips. Perfect for toolbar buttons, status indicators, and action triggers.",
|
|
787
|
-
},
|
|
788
|
-
},
|
|
789
|
-
},
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
// 8. Advanced Toolbar Example
|
|
793
|
-
export const AdvancedToolbarExample: Story = {
|
|
794
|
-
render: () => (
|
|
795
|
-
<div className="space-y-8 p-8">
|
|
796
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
797
|
-
Advanced Toolbar with Mixed Variants & Positioning
|
|
798
|
-
</h3>
|
|
799
|
-
|
|
800
|
-
<div className="flex items-center justify-center">
|
|
801
|
-
<div className="flex items-center gap-1 rounded-lg border border-white/10 bg-white/5 p-2">
|
|
802
|
-
<Tooltip variant="dark">
|
|
803
|
-
<TooltipTrigger asChild>
|
|
804
|
-
<button className="rounded p-2 transition-colors hover:bg-white/10">
|
|
805
|
-
<EditBigIcon className="h-5 w-5 text-white/70" />
|
|
806
|
-
</button>
|
|
807
|
-
</TooltipTrigger>
|
|
808
|
-
<TooltipContent side="top" align="start">
|
|
809
|
-
<div className="space-y-1">
|
|
810
|
-
<p>Edit</p>
|
|
811
|
-
<p className="text-xs text-white/60">Ctrl+E</p>
|
|
812
|
-
</div>
|
|
813
|
-
</TooltipContent>
|
|
814
|
-
</Tooltip>
|
|
815
|
-
|
|
816
|
-
<Tooltip variant="light">
|
|
817
|
-
<TooltipTrigger asChild>
|
|
818
|
-
<button className="rounded p-2 transition-colors hover:bg-white/10">
|
|
819
|
-
<SearchIcon className="h-5 w-5 text-white/70" />
|
|
820
|
-
</button>
|
|
821
|
-
</TooltipTrigger>
|
|
822
|
-
<TooltipContent side="top" align="center">
|
|
823
|
-
<div className="space-y-1">
|
|
824
|
-
<p>Search</p>
|
|
825
|
-
<p className="text-xs opacity-70">Ctrl+F</p>
|
|
826
|
-
</div>
|
|
827
|
-
</TooltipContent>
|
|
828
|
-
</Tooltip>
|
|
829
|
-
|
|
830
|
-
<Tooltip variant="dark">
|
|
831
|
-
<TooltipTrigger asChild>
|
|
832
|
-
<button className="rounded p-2 transition-colors hover:bg-white/10">
|
|
833
|
-
<PlusIcon className="h-5 w-5 text-white/70" />
|
|
834
|
-
</button>
|
|
835
|
-
</TooltipTrigger>
|
|
836
|
-
<TooltipContent side="top" align="center">
|
|
837
|
-
<div className="space-y-1">
|
|
838
|
-
<p>Add New</p>
|
|
839
|
-
<p className="text-xs text-white/60">Ctrl+N</p>
|
|
840
|
-
</div>
|
|
841
|
-
</TooltipContent>
|
|
842
|
-
</Tooltip>
|
|
843
|
-
|
|
844
|
-
<Tooltip variant="light">
|
|
845
|
-
<TooltipTrigger asChild>
|
|
846
|
-
<button className="rounded p-2 transition-colors hover:bg-white/10">
|
|
847
|
-
<FileChartIcon className="h-5 w-5 text-white/70" />
|
|
848
|
-
</button>
|
|
849
|
-
</TooltipTrigger>
|
|
850
|
-
<TooltipContent side="top" align="center">
|
|
851
|
-
<div className="space-y-1">
|
|
852
|
-
<p>Generate Report</p>
|
|
853
|
-
<p className="text-xs opacity-70">Ctrl+R</p>
|
|
854
|
-
</div>
|
|
855
|
-
</TooltipContent>
|
|
856
|
-
</Tooltip>
|
|
857
|
-
|
|
858
|
-
<Tooltip variant="dark">
|
|
859
|
-
<TooltipTrigger asChild>
|
|
860
|
-
<button className="rounded p-2 transition-colors hover:bg-white/10">
|
|
861
|
-
<TrashIcon className="h-5 w-5 text-white/70" />
|
|
862
|
-
</button>
|
|
863
|
-
</TooltipTrigger>
|
|
864
|
-
<TooltipContent side="top" align="end">
|
|
865
|
-
<div className="space-y-1">
|
|
866
|
-
<p>Delete</p>
|
|
867
|
-
<p className="text-xs text-white/60">Del</p>
|
|
868
|
-
</div>
|
|
869
|
-
</TooltipContent>
|
|
870
|
-
</Tooltip>
|
|
871
|
-
</div>
|
|
872
|
-
</div>
|
|
873
|
-
|
|
874
|
-
<div className="text-center text-xs text-white/60">
|
|
875
|
-
<p>
|
|
876
|
-
Each tooltip uses different variants and alignments for demonstration
|
|
877
|
-
</p>
|
|
878
|
-
</div>
|
|
879
|
-
</div>
|
|
880
|
-
),
|
|
881
|
-
parameters: {
|
|
882
|
-
docs: {
|
|
883
|
-
description: {
|
|
884
|
-
story:
|
|
885
|
-
"Realistic toolbar implementation showing mixed variants and different alignments. Notice how start/center/end alignments work with the toolbar layout.",
|
|
886
|
-
},
|
|
887
|
-
},
|
|
888
|
-
},
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// 9. Interactive States
|
|
892
|
-
export const InteractiveStates: Story = {
|
|
893
|
-
render: () => {
|
|
894
|
-
const [showPassword, setShowPassword] = React.useState(false)
|
|
895
|
-
const [isCompleted, setIsCompleted] = React.useState(false)
|
|
896
|
-
|
|
897
|
-
return (
|
|
898
|
-
<div className="space-y-8 p-8">
|
|
899
|
-
<h3 className="text-center text-lg font-medium text-white">
|
|
900
|
-
Interactive States with Dynamic Variants
|
|
901
|
-
</h3>
|
|
902
|
-
|
|
903
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
904
|
-
{/* Stateful Tooltips */}
|
|
905
|
-
<div className="space-y-4">
|
|
906
|
-
<h4 className="text-sm font-medium text-white/70">
|
|
907
|
-
State-Based Variants
|
|
908
|
-
</h4>
|
|
909
|
-
<div className="flex gap-4">
|
|
910
|
-
<Tooltip variant={showPassword ? "light" : "dark"}>
|
|
911
|
-
<TooltipTrigger asChild>
|
|
912
|
-
<button
|
|
913
|
-
className="rounded-full p-3 transition-colors hover:bg-white/10"
|
|
914
|
-
onClick={() => setShowPassword(!showPassword)}
|
|
915
|
-
>
|
|
916
|
-
{showPassword ? (
|
|
917
|
-
<EyeCloseIcon className="h-6 w-6 text-blue-400" />
|
|
918
|
-
) : (
|
|
919
|
-
<EyeOpenIcon className="h-6 w-6 text-white/50" />
|
|
920
|
-
)}
|
|
921
|
-
</button>
|
|
922
|
-
</TooltipTrigger>
|
|
923
|
-
<TooltipContent side="bottom" align="center">
|
|
924
|
-
<p>{showPassword ? "Hide password" : "Show password"}</p>
|
|
925
|
-
</TooltipContent>
|
|
926
|
-
</Tooltip>
|
|
927
|
-
|
|
928
|
-
<Tooltip variant={isCompleted ? "light" : "dark"}>
|
|
929
|
-
<TooltipTrigger asChild>
|
|
930
|
-
<button
|
|
931
|
-
className="rounded-full p-3 transition-colors hover:bg-white/10"
|
|
932
|
-
onClick={() => setIsCompleted(!isCompleted)}
|
|
933
|
-
>
|
|
934
|
-
<TickCircleIcon
|
|
935
|
-
className={`h-6 w-6 ${isCompleted ? "text-green-400" : "text-white/50"}`}
|
|
936
|
-
/>
|
|
937
|
-
</button>
|
|
938
|
-
</TooltipTrigger>
|
|
939
|
-
<TooltipContent side="bottom" align="center">
|
|
940
|
-
<p>
|
|
941
|
-
{isCompleted ? "Mark as incomplete" : "Mark as complete"}
|
|
942
|
-
</p>
|
|
943
|
-
</TooltipContent>
|
|
944
|
-
</Tooltip>
|
|
945
|
-
</div>
|
|
946
|
-
<div className="text-xs text-white/60">
|
|
947
|
-
<p>Tooltip variants change based on component state</p>
|
|
948
|
-
</div>
|
|
949
|
-
</div>
|
|
363
|
+
<Tooltip variant="dark">
|
|
364
|
+
<TooltipTrigger asChild>
|
|
365
|
+
<button
|
|
366
|
+
className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary rounded-lg p-2 transition-colors"
|
|
367
|
+
aria-label="Volume"
|
|
368
|
+
>
|
|
369
|
+
<VolumeFullIcon className="h-5 w-5" />
|
|
370
|
+
</button>
|
|
371
|
+
</TooltipTrigger>
|
|
372
|
+
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
373
|
+
Volume
|
|
374
|
+
</TooltipContent>
|
|
375
|
+
</Tooltip>
|
|
950
376
|
|
|
951
|
-
|
|
952
|
-
<div className="space-y-4">
|
|
953
|
-
<h4 className="text-sm font-medium text-white/70">
|
|
954
|
-
Complex Content Example
|
|
955
|
-
</h4>
|
|
956
|
-
<Tooltip variant="light">
|
|
377
|
+
<Tooltip variant="dark">
|
|
957
378
|
<TooltipTrigger asChild>
|
|
958
|
-
<
|
|
959
|
-
|
|
960
|
-
|
|
379
|
+
<button
|
|
380
|
+
className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary rounded-lg p-2 transition-colors"
|
|
381
|
+
aria-label="Like"
|
|
382
|
+
>
|
|
383
|
+
<HeartIcon className="h-5 w-5" />
|
|
384
|
+
</button>
|
|
961
385
|
</TooltipTrigger>
|
|
962
|
-
<TooltipContent side="
|
|
963
|
-
|
|
964
|
-
<div className="font-medium">API Key Management</div>
|
|
965
|
-
<div className="text-xs opacity-70">
|
|
966
|
-
Click to copy your API key to clipboard
|
|
967
|
-
</div>
|
|
968
|
-
<div className="text-xs opacity-60">
|
|
969
|
-
Shortcut: Ctrl+Shift+C
|
|
970
|
-
</div>
|
|
971
|
-
</div>
|
|
386
|
+
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
387
|
+
Add to favorites
|
|
972
388
|
</TooltipContent>
|
|
973
389
|
</Tooltip>
|
|
974
|
-
<div className="text-xs text-white/60">
|
|
975
|
-
<p>Complex tooltip content with gradient backgrounds</p>
|
|
976
|
-
</div>
|
|
977
390
|
</div>
|
|
978
391
|
</div>
|
|
979
392
|
</div>
|
|
980
|
-
)
|
|
981
|
-
},
|
|
982
|
-
parameters: {
|
|
983
|
-
docs: {
|
|
984
|
-
description: {
|
|
985
|
-
story:
|
|
986
|
-
"Interactive examples showing dynamic variant changes based on state and complex tooltip content with rich information.",
|
|
987
|
-
},
|
|
988
|
-
},
|
|
989
|
-
},
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
// 10. Complete Showcase
|
|
993
|
-
export const CompleteShowcase: Story = {
|
|
994
|
-
render: () => (
|
|
995
|
-
<div className="space-y-12 p-8">
|
|
996
|
-
<h3 className="text-center text-xl font-medium text-white">
|
|
997
|
-
Complete Tooltip System Showcase
|
|
998
|
-
</h3>
|
|
999
393
|
|
|
1000
|
-
{/*
|
|
394
|
+
{/* Action buttons */}
|
|
1001
395
|
<div className="space-y-4">
|
|
1002
|
-
<h4 className="text-
|
|
1003
|
-
|
|
396
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
397
|
+
Action Buttons
|
|
1004
398
|
</h4>
|
|
1005
|
-
<div className="
|
|
1006
|
-
<div className="flex items-center gap-
|
|
1007
|
-
<Tooltip variant="
|
|
399
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-xl border p-6">
|
|
400
|
+
<div className="flex items-center gap-3 pb-10">
|
|
401
|
+
<Tooltip variant="light">
|
|
1008
402
|
<TooltipTrigger asChild>
|
|
1009
|
-
<
|
|
403
|
+
<Button variant="outline" size="sm" className="gap-2">
|
|
404
|
+
<ShareIcon className="h-4 w-4" />
|
|
405
|
+
Share
|
|
406
|
+
</Button>
|
|
1010
407
|
</TooltipTrigger>
|
|
1011
|
-
<TooltipContent side="
|
|
1012
|
-
|
|
1013
|
-
<div className="font-medium text-white">Online</div>
|
|
1014
|
-
<div className="text-xs text-white/80">
|
|
1015
|
-
Last seen: Just now
|
|
1016
|
-
</div>
|
|
1017
|
-
</div>
|
|
408
|
+
<TooltipContent side="bottom" align="start" sideOffset={6}>
|
|
409
|
+
Share this track via link or social
|
|
1018
410
|
</TooltipContent>
|
|
1019
411
|
</Tooltip>
|
|
1020
|
-
<span className="text-sm text-white">Active User</span>
|
|
1021
|
-
</div>
|
|
1022
412
|
|
|
1023
|
-
<div className="flex items-center gap-2">
|
|
1024
413
|
<Tooltip variant="light">
|
|
1025
414
|
<TooltipTrigger asChild>
|
|
1026
|
-
<
|
|
415
|
+
<Button variant="outline" size="sm" className="gap-2">
|
|
416
|
+
<UploadIcon className="h-4 w-4" />
|
|
417
|
+
Export
|
|
418
|
+
</Button>
|
|
1027
419
|
</TooltipTrigger>
|
|
1028
|
-
<TooltipContent side="
|
|
1029
|
-
|
|
1030
|
-
<div className="font-medium">Away</div>
|
|
1031
|
-
<div className="text-xs opacity-70">
|
|
1032
|
-
Last seen: 5 minutes ago
|
|
1033
|
-
</div>
|
|
1034
|
-
</div>
|
|
420
|
+
<TooltipContent side="bottom" align="center" sideOffset={6}>
|
|
421
|
+
Export as MP3, FLAC, or WAV
|
|
1035
422
|
</TooltipContent>
|
|
1036
423
|
</Tooltip>
|
|
1037
|
-
<span className="text-sm text-white">Away User</span>
|
|
1038
|
-
</div>
|
|
1039
424
|
|
|
1040
|
-
|
|
1041
|
-
<Tooltip variant="dark">
|
|
425
|
+
<Tooltip variant="light">
|
|
1042
426
|
<TooltipTrigger asChild>
|
|
1043
|
-
<
|
|
427
|
+
<Button variant="outline" size="sm" className="gap-2">
|
|
428
|
+
<StarIcon className="h-4 w-4" />
|
|
429
|
+
Rate
|
|
430
|
+
</Button>
|
|
1044
431
|
</TooltipTrigger>
|
|
1045
|
-
<TooltipContent side="
|
|
1046
|
-
|
|
1047
|
-
<div className="font-medium text-white">Offline</div>
|
|
1048
|
-
<div className="text-xs text-white/80">
|
|
1049
|
-
Last seen: 2 hours ago
|
|
1050
|
-
</div>
|
|
1051
|
-
</div>
|
|
432
|
+
<TooltipContent side="bottom" align="end" sideOffset={6}>
|
|
433
|
+
Rate this track to improve recommendations
|
|
1052
434
|
</TooltipContent>
|
|
1053
435
|
</Tooltip>
|
|
1054
|
-
<span className="text-sm text-white">Offline User</span>
|
|
1055
|
-
</div>
|
|
1056
|
-
</div>
|
|
1057
|
-
</div>
|
|
1058
436
|
|
|
1059
|
-
|
|
1060
|
-
<div className="space-y-4">
|
|
1061
|
-
<h4 className="text-sm font-medium text-white/70">
|
|
1062
|
-
Data Metrics with Various Positioning
|
|
1063
|
-
</h4>
|
|
1064
|
-
<div className="grid grid-cols-2 gap-4 lg:grid-cols-4">
|
|
1065
|
-
{[
|
|
1066
|
-
{
|
|
1067
|
-
value: "1,234",
|
|
1068
|
-
label: "Users",
|
|
1069
|
-
change: "+12%",
|
|
1070
|
-
period: "vs last month",
|
|
1071
|
-
variant: "dark" as const,
|
|
1072
|
-
side: "top" as const,
|
|
1073
|
-
align: "start" as const,
|
|
1074
|
-
},
|
|
1075
|
-
{
|
|
1076
|
-
value: "$56.7k",
|
|
1077
|
-
label: "Revenue",
|
|
1078
|
-
change: "+8%",
|
|
1079
|
-
period: "vs last month",
|
|
1080
|
-
variant: "light" as const,
|
|
1081
|
-
side: "top" as const,
|
|
1082
|
-
align: "center" as const,
|
|
1083
|
-
},
|
|
1084
|
-
{
|
|
1085
|
-
value: "89.2%",
|
|
1086
|
-
label: "Uptime",
|
|
1087
|
-
change: "-0.3%",
|
|
1088
|
-
period: "vs last month",
|
|
1089
|
-
variant: "dark" as const,
|
|
1090
|
-
side: "bottom" as const,
|
|
1091
|
-
align: "center" as const,
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
value: "42ms",
|
|
1095
|
-
label: "Response",
|
|
1096
|
-
change: "-15%",
|
|
1097
|
-
period: "vs last month",
|
|
1098
|
-
variant: "light" as const,
|
|
1099
|
-
side: "bottom" as const,
|
|
1100
|
-
align: "end" as const,
|
|
1101
|
-
},
|
|
1102
|
-
].map((metric, index) => (
|
|
1103
|
-
<Tooltip key={index} variant={metric.variant}>
|
|
437
|
+
<Tooltip variant="light">
|
|
1104
438
|
<TooltipTrigger asChild>
|
|
1105
|
-
<
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
<
|
|
1110
|
-
</
|
|
439
|
+
<button
|
|
440
|
+
className="text-fm-secondary hover:text-fm-negative hover:bg-fm-surface-negative-sec rounded-lg p-2 transition-colors"
|
|
441
|
+
aria-label="Delete"
|
|
442
|
+
>
|
|
443
|
+
<TrashIcon className="h-4 w-4" />
|
|
444
|
+
</button>
|
|
1111
445
|
</TooltipTrigger>
|
|
1112
|
-
<TooltipContent side=
|
|
1113
|
-
|
|
1114
|
-
<div className="font-medium">{metric.label} Details</div>
|
|
1115
|
-
<div className="text-xs">
|
|
1116
|
-
<span
|
|
1117
|
-
className={
|
|
1118
|
-
metric.change.startsWith("+")
|
|
1119
|
-
? metric.variant === "dark"
|
|
1120
|
-
? "text-green-400"
|
|
1121
|
-
: "text-green-600"
|
|
1122
|
-
: metric.variant === "dark"
|
|
1123
|
-
? "text-red-400"
|
|
1124
|
-
: "text-red-600"
|
|
1125
|
-
}
|
|
1126
|
-
>
|
|
1127
|
-
{metric.change}
|
|
1128
|
-
</span>
|
|
1129
|
-
<span
|
|
1130
|
-
className={
|
|
1131
|
-
metric.variant === "dark"
|
|
1132
|
-
? "text-white/60"
|
|
1133
|
-
: "opacity-70"
|
|
1134
|
-
}
|
|
1135
|
-
>
|
|
1136
|
-
{" "}
|
|
1137
|
-
{metric.period}
|
|
1138
|
-
</span>
|
|
1139
|
-
</div>
|
|
1140
|
-
</div>
|
|
446
|
+
<TooltipContent side="bottom" align="end" sideOffset={6}>
|
|
447
|
+
Remove from library
|
|
1141
448
|
</TooltipContent>
|
|
1142
449
|
</Tooltip>
|
|
1143
|
-
))}
|
|
1144
|
-
</div>
|
|
1145
|
-
</div>
|
|
1146
|
-
|
|
1147
|
-
<div className="space-y-1 text-center text-xs text-white/60">
|
|
1148
|
-
<p>
|
|
1149
|
-
Complete demonstration of the tooltip system with gradient backgrounds
|
|
1150
|
-
</p>
|
|
1151
|
-
<p>
|
|
1152
|
-
Each tooltip uses different positioning and variants for optimal UX
|
|
1153
|
-
</p>
|
|
1154
|
-
<p>
|
|
1155
|
-
Notice how gradients are positioned to create visual connection points
|
|
1156
|
-
</p>
|
|
1157
|
-
</div>
|
|
1158
|
-
</div>
|
|
1159
|
-
),
|
|
1160
|
-
parameters: {
|
|
1161
|
-
layout: "fullscreen",
|
|
1162
|
-
docs: {
|
|
1163
|
-
description: {
|
|
1164
|
-
story:
|
|
1165
|
-
"Complete showcase demonstrating the full capability of the tooltip system with all positioning combinations, gradient backgrounds, and real-world usage patterns.",
|
|
1166
|
-
},
|
|
1167
|
-
},
|
|
1168
|
-
},
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
// 11. Complete Matrix Example - All Combinations
|
|
1172
|
-
export const AllCombinationsMatrix: Story = {
|
|
1173
|
-
render: () => (
|
|
1174
|
-
<div className="min-h-screen space-y-16 p-12">
|
|
1175
|
-
<h3 className="text-center text-2xl font-bold text-white">
|
|
1176
|
-
Complete Tooltip Matrix - All Combinations
|
|
1177
|
-
</h3>
|
|
1178
|
-
<p className="text-center text-white/70">
|
|
1179
|
-
Every possible combination of side, align, and variant
|
|
1180
|
-
</p>
|
|
1181
|
-
|
|
1182
|
-
{/* Dark Variant - All Combinations */}
|
|
1183
|
-
<div className="space-y-8">
|
|
1184
|
-
<h4 className="text-center text-xl font-semibold text-purple-300">
|
|
1185
|
-
Dark Variant - All Sides & Alignments
|
|
1186
|
-
</h4>
|
|
1187
|
-
|
|
1188
|
-
{/* Top Side - Dark */}
|
|
1189
|
-
<div className="space-y-4">
|
|
1190
|
-
<h5 className="text-center text-lg font-medium text-white/80">
|
|
1191
|
-
Top Side (Dark)
|
|
1192
|
-
</h5>
|
|
1193
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
|
|
1194
|
-
<div className="flex flex-col items-center gap-4">
|
|
1195
|
-
<span className="text-sm text-white/60">
|
|
1196
|
-
side="top" align="start"
|
|
1197
|
-
</span>
|
|
1198
|
-
<Tooltip variant="dark">
|
|
1199
|
-
<TooltipTrigger asChild>
|
|
1200
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1201
|
-
Top Start
|
|
1202
|
-
</div>
|
|
1203
|
-
</TooltipTrigger>
|
|
1204
|
-
<TooltipContent side="top" align="start" sideOffset={8}>
|
|
1205
|
-
<p>Dark variant, top side, start alignment</p>
|
|
1206
|
-
</TooltipContent>
|
|
1207
|
-
</Tooltip>
|
|
1208
|
-
</div>
|
|
1209
|
-
|
|
1210
|
-
<div className="flex flex-col items-center gap-4">
|
|
1211
|
-
<span className="text-sm text-white/60">
|
|
1212
|
-
side="top" align="center"
|
|
1213
|
-
</span>
|
|
1214
|
-
<Tooltip variant="dark">
|
|
1215
|
-
<TooltipTrigger asChild>
|
|
1216
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1217
|
-
Top Center
|
|
1218
|
-
</div>
|
|
1219
|
-
</TooltipTrigger>
|
|
1220
|
-
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
1221
|
-
<p>Dark variant, top side, center alignment</p>
|
|
1222
|
-
</TooltipContent>
|
|
1223
|
-
</Tooltip>
|
|
1224
|
-
</div>
|
|
1225
|
-
|
|
1226
|
-
<div className="flex flex-col items-center gap-4">
|
|
1227
|
-
<span className="text-sm text-white/60">
|
|
1228
|
-
side="top" align="end"
|
|
1229
|
-
</span>
|
|
1230
|
-
<Tooltip variant="dark">
|
|
1231
|
-
<TooltipTrigger asChild>
|
|
1232
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1233
|
-
Top End
|
|
1234
|
-
</div>
|
|
1235
|
-
</TooltipTrigger>
|
|
1236
|
-
<TooltipContent side="top" align="end" sideOffset={8}>
|
|
1237
|
-
<p>Dark variant, top side, end alignment</p>
|
|
1238
|
-
</TooltipContent>
|
|
1239
|
-
</Tooltip>
|
|
1240
|
-
</div>
|
|
1241
|
-
</div>
|
|
1242
|
-
</div>
|
|
1243
|
-
|
|
1244
|
-
{/* Right & Left Side - Dark */}
|
|
1245
|
-
<div className="space-y-4">
|
|
1246
|
-
<h5 className="text-center text-lg font-medium text-white/80">
|
|
1247
|
-
Right & Left Sides (Dark)
|
|
1248
|
-
</h5>
|
|
1249
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
1250
|
-
<div className="flex flex-col items-center gap-4">
|
|
1251
|
-
<span className="text-sm text-white/60">side="right"</span>
|
|
1252
|
-
<Tooltip variant="dark">
|
|
1253
|
-
<TooltipTrigger asChild>
|
|
1254
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1255
|
-
Right Side
|
|
1256
|
-
</div>
|
|
1257
|
-
</TooltipTrigger>
|
|
1258
|
-
<TooltipContent side="right" sideOffset={8}>
|
|
1259
|
-
<p>Dark variant, right side positioning</p>
|
|
1260
|
-
</TooltipContent>
|
|
1261
|
-
</Tooltip>
|
|
1262
|
-
</div>
|
|
1263
|
-
|
|
1264
|
-
<div className="flex flex-col items-center gap-4">
|
|
1265
|
-
<span className="text-sm text-white/60">side="left"</span>
|
|
1266
|
-
<Tooltip variant="dark">
|
|
1267
|
-
<TooltipTrigger asChild>
|
|
1268
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1269
|
-
Left Side
|
|
1270
|
-
</div>
|
|
1271
|
-
</TooltipTrigger>
|
|
1272
|
-
<TooltipContent side="left" sideOffset={8}>
|
|
1273
|
-
<p>Dark variant, left side positioning</p>
|
|
1274
|
-
</TooltipContent>
|
|
1275
|
-
</Tooltip>
|
|
1276
|
-
</div>
|
|
1277
|
-
</div>
|
|
1278
|
-
</div>
|
|
1279
|
-
|
|
1280
|
-
{/* Bottom Side - Dark */}
|
|
1281
|
-
<div className="space-y-4">
|
|
1282
|
-
<h5 className="text-center text-lg font-medium text-white/80">
|
|
1283
|
-
Bottom Side (Dark)
|
|
1284
|
-
</h5>
|
|
1285
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
|
|
1286
|
-
<div className="flex flex-col items-center gap-4">
|
|
1287
|
-
<span className="text-sm text-white/60">
|
|
1288
|
-
side="bottom" align="start"
|
|
1289
|
-
</span>
|
|
1290
|
-
<Tooltip variant="dark">
|
|
1291
|
-
<TooltipTrigger asChild>
|
|
1292
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1293
|
-
Bottom Start
|
|
1294
|
-
</div>
|
|
1295
|
-
</TooltipTrigger>
|
|
1296
|
-
<TooltipContent side="bottom" align="start" sideOffset={8}>
|
|
1297
|
-
<p>Dark variant, bottom side, start alignment</p>
|
|
1298
|
-
</TooltipContent>
|
|
1299
|
-
</Tooltip>
|
|
1300
|
-
</div>
|
|
1301
|
-
|
|
1302
|
-
<div className="flex flex-col items-center gap-4">
|
|
1303
|
-
<span className="text-sm text-white/60">
|
|
1304
|
-
side="bottom" align="center"
|
|
1305
|
-
</span>
|
|
1306
|
-
<Tooltip variant="dark">
|
|
1307
|
-
<TooltipTrigger asChild>
|
|
1308
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1309
|
-
Bottom Center
|
|
1310
|
-
</div>
|
|
1311
|
-
</TooltipTrigger>
|
|
1312
|
-
<TooltipContent side="bottom" align="center" sideOffset={8}>
|
|
1313
|
-
<p>Dark variant, bottom side, center alignment</p>
|
|
1314
|
-
</TooltipContent>
|
|
1315
|
-
</Tooltip>
|
|
1316
|
-
</div>
|
|
1317
|
-
|
|
1318
|
-
<div className="flex flex-col items-center gap-4">
|
|
1319
|
-
<span className="text-sm text-white/60">
|
|
1320
|
-
side="bottom" align="end"
|
|
1321
|
-
</span>
|
|
1322
|
-
<Tooltip variant="dark">
|
|
1323
|
-
<TooltipTrigger asChild>
|
|
1324
|
-
<div className="rounded-lg border border-purple-500/30 bg-purple-900/20 px-6 py-3 text-white">
|
|
1325
|
-
Bottom End
|
|
1326
|
-
</div>
|
|
1327
|
-
</TooltipTrigger>
|
|
1328
|
-
<TooltipContent side="bottom" align="end" sideOffset={8}>
|
|
1329
|
-
<p>Dark variant, bottom side, end alignment</p>
|
|
1330
|
-
</TooltipContent>
|
|
1331
|
-
</Tooltip>
|
|
1332
|
-
</div>
|
|
1333
450
|
</div>
|
|
1334
451
|
</div>
|
|
1335
452
|
</div>
|
|
1336
453
|
|
|
1337
|
-
{/*
|
|
1338
|
-
<div className="space-y-
|
|
1339
|
-
<h4 className="text-
|
|
1340
|
-
|
|
454
|
+
{/* Navigation icons */}
|
|
455
|
+
<div className="space-y-4">
|
|
456
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
457
|
+
Navigation Icons
|
|
1341
458
|
</h4>
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
<
|
|
1367
|
-
side="top" align="center"
|
|
1368
|
-
</span>
|
|
1369
|
-
<Tooltip variant="light">
|
|
1370
|
-
<TooltipTrigger asChild>
|
|
1371
|
-
<div className="rounded-lg border border-purple-300/50 bg-purple-100/10 px-6 py-3 text-white">
|
|
1372
|
-
Top Center
|
|
1373
|
-
</div>
|
|
1374
|
-
</TooltipTrigger>
|
|
1375
|
-
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
1376
|
-
<p>Light variant, top side, center alignment</p>
|
|
1377
|
-
</TooltipContent>
|
|
1378
|
-
</Tooltip>
|
|
1379
|
-
</div>
|
|
1380
|
-
|
|
1381
|
-
<div className="flex flex-col items-center gap-4">
|
|
1382
|
-
<span className="text-sm text-white/60">
|
|
1383
|
-
side="top" align="end"
|
|
1384
|
-
</span>
|
|
1385
|
-
<Tooltip variant="light">
|
|
1386
|
-
<TooltipTrigger asChild>
|
|
1387
|
-
<div className="rounded-lg border border-purple-300/50 bg-purple-100/10 px-6 py-3 text-white">
|
|
1388
|
-
Top End
|
|
1389
|
-
</div>
|
|
1390
|
-
</TooltipTrigger>
|
|
1391
|
-
<TooltipContent side="top" align="end" sideOffset={8}>
|
|
1392
|
-
<p>Light variant, top side, end alignment</p>
|
|
1393
|
-
</TooltipContent>
|
|
1394
|
-
</Tooltip>
|
|
1395
|
-
</div>
|
|
1396
|
-
</div>
|
|
1397
|
-
</div>
|
|
1398
|
-
|
|
1399
|
-
{/* Right & Left Side - Light */}
|
|
1400
|
-
<div className="space-y-4">
|
|
1401
|
-
<h5 className="text-center text-lg font-medium text-white/80">
|
|
1402
|
-
Right & Left Sides (Light)
|
|
1403
|
-
</h5>
|
|
1404
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
1405
|
-
<div className="flex flex-col items-center gap-4">
|
|
1406
|
-
<span className="text-sm text-white/60">side="right"</span>
|
|
1407
|
-
<Tooltip variant="light">
|
|
1408
|
-
<TooltipTrigger asChild>
|
|
1409
|
-
<div className="rounded-lg border border-purple-300/50 bg-purple-100/10 px-6 py-3 text-white">
|
|
1410
|
-
Right Side
|
|
1411
|
-
</div>
|
|
1412
|
-
</TooltipTrigger>
|
|
1413
|
-
<TooltipContent side="right" sideOffset={8}>
|
|
1414
|
-
<p>Light variant, right side positioning</p>
|
|
1415
|
-
</TooltipContent>
|
|
1416
|
-
</Tooltip>
|
|
1417
|
-
</div>
|
|
1418
|
-
|
|
1419
|
-
<div className="flex flex-col items-center gap-4">
|
|
1420
|
-
<span className="text-sm text-white/60">side="left"</span>
|
|
1421
|
-
<Tooltip variant="light">
|
|
1422
|
-
<TooltipTrigger asChild>
|
|
1423
|
-
<div className="rounded-lg border border-purple-300/50 bg-purple-100/10 px-6 py-3 text-white">
|
|
1424
|
-
Left Side
|
|
1425
|
-
</div>
|
|
1426
|
-
</TooltipTrigger>
|
|
1427
|
-
<TooltipContent side="left" sideOffset={8}>
|
|
1428
|
-
<p>Light variant, left side positioning</p>
|
|
1429
|
-
</TooltipContent>
|
|
1430
|
-
</Tooltip>
|
|
1431
|
-
</div>
|
|
1432
|
-
</div>
|
|
1433
|
-
</div>
|
|
1434
|
-
|
|
1435
|
-
{/* Bottom Side - Light */}
|
|
1436
|
-
<div className="space-y-4">
|
|
1437
|
-
<h5 className="text-center text-lg font-medium text-white/80">
|
|
1438
|
-
Bottom Side (Light)
|
|
1439
|
-
</h5>
|
|
1440
|
-
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
|
|
1441
|
-
<div className="flex flex-col items-center gap-4">
|
|
1442
|
-
<span className="text-sm text-white/60">
|
|
1443
|
-
side="bottom" align="start"
|
|
1444
|
-
</span>
|
|
1445
|
-
<Tooltip variant="light">
|
|
459
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-xl border p-6">
|
|
460
|
+
<div className="flex flex-col items-start gap-2">
|
|
461
|
+
{[
|
|
462
|
+
{
|
|
463
|
+
icon: MusicalNoteIcon,
|
|
464
|
+
label: "Library",
|
|
465
|
+
desc: "Your music library",
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
icon: SearchIcon,
|
|
469
|
+
label: "Search",
|
|
470
|
+
desc: "Find songs & artists",
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
icon: HeartIcon,
|
|
474
|
+
label: "Favorites",
|
|
475
|
+
desc: "Liked songs and playlists",
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
icon: SettingIcon,
|
|
479
|
+
label: "Settings",
|
|
480
|
+
desc: "App preferences & account",
|
|
481
|
+
},
|
|
482
|
+
].map(({ icon: Icon, label, desc }) => (
|
|
483
|
+
<Tooltip key={label} variant="dark">
|
|
1446
484
|
<TooltipTrigger asChild>
|
|
1447
|
-
<
|
|
1448
|
-
|
|
1449
|
-
|
|
485
|
+
<button
|
|
486
|
+
className="text-fm-secondary hover:text-fm-primary hover:bg-fm-surface-primary flex w-full items-center gap-3 rounded-lg px-3 py-2 transition-colors"
|
|
487
|
+
aria-label={label}
|
|
488
|
+
>
|
|
489
|
+
<Icon className="h-5 w-5 shrink-0" />
|
|
490
|
+
<span className="text-fm-primary font-fm-text text-fm-md leading-fm-md sr-only">
|
|
491
|
+
{label}
|
|
492
|
+
</span>
|
|
493
|
+
</button>
|
|
1450
494
|
</TooltipTrigger>
|
|
1451
|
-
<TooltipContent side="
|
|
1452
|
-
<
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
side="bottom" align="center"
|
|
1460
|
-
</span>
|
|
1461
|
-
<Tooltip variant="light">
|
|
1462
|
-
<TooltipTrigger asChild>
|
|
1463
|
-
<div className="rounded-lg border border-purple-300/50 bg-purple-100/10 px-6 py-3 text-white">
|
|
1464
|
-
Bottom Center
|
|
495
|
+
<TooltipContent side="right" align="center" sideOffset={8}>
|
|
496
|
+
<div className="space-y-0.5">
|
|
497
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm font-medium">
|
|
498
|
+
{label}
|
|
499
|
+
</p>
|
|
500
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
501
|
+
{desc}
|
|
502
|
+
</p>
|
|
1465
503
|
</div>
|
|
1466
|
-
</TooltipTrigger>
|
|
1467
|
-
<TooltipContent side="bottom" align="center" sideOffset={8}>
|
|
1468
|
-
<p>Light variant, bottom side, center alignment</p>
|
|
1469
504
|
</TooltipContent>
|
|
1470
505
|
</Tooltip>
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
<div className="flex flex-col items-center gap-4">
|
|
1474
|
-
<span className="text-sm text-white/60">
|
|
1475
|
-
side="bottom" align="end"
|
|
1476
|
-
</span>
|
|
1477
|
-
<Tooltip variant="light">
|
|
1478
|
-
<TooltipTrigger asChild>
|
|
1479
|
-
<div className="rounded-lg border border-purple-300/50 bg-purple-100/10 px-6 py-3 text-white">
|
|
1480
|
-
Bottom End
|
|
1481
|
-
</div>
|
|
1482
|
-
</TooltipTrigger>
|
|
1483
|
-
<TooltipContent side="bottom" align="end" sideOffset={8}>
|
|
1484
|
-
<p>Light variant, bottom side, end alignment</p>
|
|
1485
|
-
</TooltipContent>
|
|
1486
|
-
</Tooltip>
|
|
1487
|
-
</div>
|
|
506
|
+
))}
|
|
1488
507
|
</div>
|
|
1489
508
|
</div>
|
|
1490
509
|
</div>
|
|
1491
|
-
|
|
1492
|
-
{/* Code Example */}
|
|
1493
|
-
<div className="mx-auto max-w-4xl space-y-4 rounded-lg border border-white/10 bg-black/20 p-6">
|
|
1494
|
-
<h5 className="text-lg font-medium text-white">Code Examples</h5>
|
|
1495
|
-
<div className="space-y-4 text-sm">
|
|
1496
|
-
<div className="space-y-2">
|
|
1497
|
-
<p className="text-white/70">Dark variant with top positioning:</p>
|
|
1498
|
-
<pre className="overflow-x-auto rounded bg-black/40 p-3 text-purple-300">
|
|
1499
|
-
{`<Tooltip variant="dark">
|
|
1500
|
-
<TooltipTrigger>Trigger Element</TooltipTrigger>
|
|
1501
|
-
<TooltipContent side="top" align="center" sideOffset={8}>
|
|
1502
|
-
Tooltip content
|
|
1503
|
-
</TooltipContent>
|
|
1504
|
-
</Tooltip>`}
|
|
1505
|
-
</pre>
|
|
1506
|
-
</div>
|
|
1507
|
-
<div className="space-y-2">
|
|
1508
|
-
<p className="text-white/70">
|
|
1509
|
-
Light variant with right positioning:
|
|
1510
|
-
</p>
|
|
1511
|
-
<pre className="overflow-x-auto rounded bg-black/40 p-3 text-purple-300">
|
|
1512
|
-
{`<Tooltip variant="light">
|
|
1513
|
-
<TooltipTrigger>Trigger Element</TooltipTrigger>
|
|
1514
|
-
<TooltipContent side="right" sideOffset={12}>
|
|
1515
|
-
Tooltip content
|
|
1516
|
-
</TooltipContent>
|
|
1517
|
-
</Tooltip>`}
|
|
1518
|
-
</pre>
|
|
1519
|
-
</div>
|
|
1520
|
-
</div>
|
|
1521
|
-
</div>
|
|
1522
|
-
|
|
1523
|
-
<div className="space-y-2 text-center text-sm text-white/60">
|
|
1524
|
-
<p>
|
|
1525
|
-
<strong>16 total combinations:</strong> 2 variants × 8 positioning
|
|
1526
|
-
combinations
|
|
1527
|
-
</p>
|
|
1528
|
-
<p>
|
|
1529
|
-
Each combination has unique gradient backgrounds optimized for that
|
|
1530
|
-
specific position
|
|
1531
|
-
</p>
|
|
1532
|
-
<p>
|
|
1533
|
-
Notice how the light variant uses more complex multi-layer gradients
|
|
1534
|
-
for sophisticated styling
|
|
1535
|
-
</p>
|
|
1536
|
-
</div>
|
|
1537
510
|
</div>
|
|
1538
511
|
),
|
|
1539
512
|
parameters: {
|
|
1540
|
-
layout: "fullscreen",
|
|
1541
513
|
docs: {
|
|
1542
514
|
description: {
|
|
1543
515
|
story:
|
|
1544
|
-
"
|
|
516
|
+
"Realistic audio app scenarios: player transport controls with top tooltips, action buttons with bottom-positioned light tooltips showing all three alignments, and a collapsed icon-only navigation rail with right-side rich tooltips.",
|
|
1545
517
|
},
|
|
1546
518
|
},
|
|
1547
519
|
},
|