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