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,10 +1,10 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React, { useState } from "react"
|
|
2
2
|
import { Button } from "@components/button"
|
|
3
3
|
import Input from "@components/input"
|
|
4
4
|
import { Label } from "@components/label"
|
|
5
5
|
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AuralComponentDocsPage } from "src/ui/story-spec/components/component-story-docs-page"
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
Popover,
|
|
@@ -14,43 +14,35 @@ import {
|
|
|
14
14
|
PopoverContent,
|
|
15
15
|
PopoverTrigger,
|
|
16
16
|
} from "."
|
|
17
|
-
import { IconButton } from "../icon-button"
|
|
18
17
|
|
|
19
18
|
const meta: Meta<typeof Popover> = {
|
|
20
19
|
title: "Components/UI/Popover",
|
|
21
20
|
component: Popover,
|
|
22
21
|
parameters: {
|
|
23
22
|
layout: "centered",
|
|
24
|
-
backgrounds: {
|
|
25
|
-
default: "dark",
|
|
26
|
-
values: [
|
|
27
|
-
{ name: "dark", value: "#0a0a0a" },
|
|
28
|
-
{ name: "light", value: "#ffffff" },
|
|
29
|
-
],
|
|
30
|
-
},
|
|
31
23
|
docs: {
|
|
32
24
|
description: {
|
|
33
|
-
component:
|
|
34
|
-
A
|
|
35
|
-
|
|
36
|
-
## Components Overview
|
|
37
|
-
|
|
38
|
-
- **Popover**: Root container managing state and context
|
|
39
|
-
- **PopoverTrigger**: Interactive element that opens the popover
|
|
40
|
-
- **PopoverContent**: The floating content panel with frosted glass effect
|
|
41
|
-
- **PopoverAnchor**: Custom positioning anchor point
|
|
42
|
-
- **PopoverArrow**: Optional arrow pointer to trigger
|
|
43
|
-
- **PopoverClose**: Button to close popover from within content
|
|
44
|
-
|
|
45
|
-
## Features
|
|
46
|
-
- Dark theme optimized with frosted glass effect
|
|
47
|
-
- Smooth CSS animations with direction awareness
|
|
48
|
-
- Comprehensive accessibility support
|
|
49
|
-
- Flexible positioning and anchoring
|
|
50
|
-
- Self-contained content management
|
|
51
|
-
- Portal rendering for proper stacking
|
|
52
|
-
`,
|
|
25
|
+
component:
|
|
26
|
+
"A compound floating panel built on Radix UI. Composed of Popover (root state), PopoverTrigger (toggle element), PopoverContent (frosted-glass panel with gradient top stroke), PopoverClose (dismiss button inside content), PopoverArrow (optional pointer), and PopoverAnchor (custom positioning reference). Portal-rendered for proper z-index stacking.",
|
|
53
27
|
},
|
|
28
|
+
page: () => (
|
|
29
|
+
<AuralComponentDocsPage
|
|
30
|
+
features={[
|
|
31
|
+
{
|
|
32
|
+
title: "Floating Panel",
|
|
33
|
+
description: "Portal z-index layering",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: "Compound Parts",
|
|
37
|
+
description: "Trigger, content, arrow",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "Glass Aesthetic",
|
|
41
|
+
description: "Frosted top gradient",
|
|
42
|
+
},
|
|
43
|
+
]}
|
|
44
|
+
/>
|
|
45
|
+
),
|
|
54
46
|
},
|
|
55
47
|
},
|
|
56
48
|
tags: ["autodocs"],
|
|
@@ -59,979 +51,598 @@ A comprehensive popover component system built on Radix UI with dark theme optim
|
|
|
59
51
|
export default meta
|
|
60
52
|
type Story = StoryObj<typeof meta>
|
|
61
53
|
|
|
62
|
-
//
|
|
63
|
-
export const PopoverRoot: Story = {
|
|
64
|
-
render: () => (
|
|
65
|
-
<div className="space-y-4">
|
|
66
|
-
<div className="text-center">
|
|
67
|
-
<h3 className="mb-2 font-medium text-white">Popover Root Component</h3>
|
|
68
|
-
<p className="text-sm text-white/60">
|
|
69
|
-
The root Popover component manages state and provides context
|
|
70
|
-
</p>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<div className="flex justify-center gap-4">
|
|
74
|
-
{/* Uncontrolled Popover */}
|
|
75
|
-
<Popover>
|
|
76
|
-
<PopoverTrigger asChild>
|
|
77
|
-
<Button variant="outline">Uncontrolled</Button>
|
|
78
|
-
</PopoverTrigger>
|
|
79
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
80
|
-
<div className="p-4">
|
|
81
|
-
<p className="text-sm text-white">
|
|
82
|
-
This popover manages its own open/close state internally.
|
|
83
|
-
</p>
|
|
84
|
-
</div>
|
|
85
|
-
</PopoverContent>
|
|
86
|
-
</Popover>
|
|
54
|
+
// ─── Parts ───────────────────────────────────────────────────────────────────
|
|
87
55
|
|
|
88
|
-
|
|
89
|
-
<Popover defaultOpen={false}>
|
|
90
|
-
<PopoverTrigger asChild>
|
|
91
|
-
<Button variant="outline">Default Closed</Button>
|
|
92
|
-
</PopoverTrigger>
|
|
93
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
94
|
-
<div className="p-4">
|
|
95
|
-
<p className="text-sm text-white">
|
|
96
|
-
This popover starts in a closed state by default.
|
|
97
|
-
</p>
|
|
98
|
-
</div>
|
|
99
|
-
</PopoverContent>
|
|
100
|
-
</Popover>
|
|
101
|
-
|
|
102
|
-
{/* Modal Popover */}
|
|
103
|
-
<Popover modal>
|
|
104
|
-
<PopoverTrigger asChild>
|
|
105
|
-
<Button variant="outline">Modal Mode</Button>
|
|
106
|
-
</PopoverTrigger>
|
|
107
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
108
|
-
<div className="p-4">
|
|
109
|
-
<p className="text-sm text-white">
|
|
110
|
-
This is a modal popover that captures focus and blocks
|
|
111
|
-
interaction.
|
|
112
|
-
</p>
|
|
113
|
-
</div>
|
|
114
|
-
</PopoverContent>
|
|
115
|
-
</Popover>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
),
|
|
56
|
+
export const Parts: Story = {
|
|
119
57
|
parameters: {
|
|
120
58
|
docs: {
|
|
121
59
|
description: {
|
|
122
60
|
story:
|
|
123
|
-
"
|
|
61
|
+
"Every sub-component shown individually with a description of its role in the compound pattern.",
|
|
124
62
|
},
|
|
125
63
|
},
|
|
126
64
|
},
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// 2. PopoverTrigger Component Examples
|
|
130
|
-
export const PopoverTriggerVariants: Story = {
|
|
131
65
|
render: () => (
|
|
132
|
-
<div className="space-y-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
</
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
<div className="grid grid-cols-2 gap-4">
|
|
141
|
-
{/* Button Trigger */}
|
|
142
|
-
<Popover>
|
|
143
|
-
<PopoverTrigger asChild>
|
|
144
|
-
<Button>Button Trigger</Button>
|
|
145
|
-
</PopoverTrigger>
|
|
146
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
147
|
-
<div className="p-3">
|
|
148
|
-
<p className="text-sm text-white">
|
|
149
|
-
Triggered by a Button component
|
|
150
|
-
</p>
|
|
151
|
-
</div>
|
|
152
|
-
</PopoverContent>
|
|
153
|
-
</Popover>
|
|
154
|
-
|
|
155
|
-
{/* Text Link Trigger */}
|
|
156
|
-
<Popover>
|
|
157
|
-
<PopoverTrigger asChild>
|
|
158
|
-
<Button
|
|
159
|
-
variant="text"
|
|
160
|
-
className="text-sm text-blue-400 underline hover:text-blue-300"
|
|
161
|
-
>
|
|
162
|
-
Click this link
|
|
163
|
-
</Button>
|
|
164
|
-
</PopoverTrigger>
|
|
165
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
166
|
-
<div className="p-3">
|
|
167
|
-
<p className="text-sm text-white">Triggered by a text link</p>
|
|
168
|
-
</div>
|
|
169
|
-
</PopoverContent>
|
|
170
|
-
</Popover>
|
|
171
|
-
|
|
172
|
-
{/* Icon Trigger */}
|
|
173
|
-
<Popover>
|
|
174
|
-
<PopoverTrigger asChild>
|
|
175
|
-
<IconButton
|
|
176
|
-
label="Icon Popover Button"
|
|
177
|
-
icon={<FeatureShineIcon />}
|
|
178
|
-
/>
|
|
179
|
-
</PopoverTrigger>
|
|
180
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
181
|
-
<div className="p-3">
|
|
182
|
-
<p className="text-sm text-white">Triggered by an icon button</p>
|
|
183
|
-
</div>
|
|
184
|
-
</PopoverContent>
|
|
185
|
-
</Popover>
|
|
186
|
-
|
|
187
|
-
{/* Image Trigger */}
|
|
66
|
+
<div className="w-full max-w-2xl space-y-10">
|
|
67
|
+
{/* PopoverTrigger */}
|
|
68
|
+
<div className="space-y-3">
|
|
69
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
70
|
+
PopoverTrigger
|
|
71
|
+
</h4>
|
|
188
72
|
<Popover>
|
|
189
73
|
<PopoverTrigger asChild>
|
|
190
|
-
<
|
|
191
|
-
label="Profile Popover"
|
|
192
|
-
icon={null}
|
|
193
|
-
className="overflow-hidden"
|
|
194
|
-
>
|
|
195
|
-
<img
|
|
196
|
-
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=40&h=40&fit=crop&crop=face"
|
|
197
|
-
alt="Profile"
|
|
198
|
-
className="h-12 w-12 object-cover"
|
|
199
|
-
/>
|
|
200
|
-
</IconButton>
|
|
74
|
+
<Button variant="outline">Open Popover</Button>
|
|
201
75
|
</PopoverTrigger>
|
|
202
|
-
<PopoverContent className="rounded-lg
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
</
|
|
76
|
+
<PopoverContent className="rounded-lg p-4">
|
|
77
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
78
|
+
Triggered by the button above.
|
|
79
|
+
</p>
|
|
206
80
|
</PopoverContent>
|
|
207
81
|
</Popover>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
"PopoverTrigger examples showing different interactive elements: buttons, links, icons, and images.",
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// 3. PopoverContent Component Examples
|
|
222
|
-
export const PopoverContentVariants: Story = {
|
|
223
|
-
render: () => (
|
|
224
|
-
<div className="space-y-6">
|
|
225
|
-
<div className="text-center">
|
|
226
|
-
<h3 className="mb-2 font-medium text-white">PopoverContent Variants</h3>
|
|
227
|
-
<p className="text-sm text-white/60">
|
|
228
|
-
Different content layouts and styling options
|
|
229
|
-
</p>
|
|
82
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
83
|
+
<p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
|
|
84
|
+
The element that toggles the popover open/closed. Pass{" "}
|
|
85
|
+
<code>asChild</code> to render as any child element. Without{" "}
|
|
86
|
+
<code>asChild</code> it renders a plain <code><button></code>.
|
|
87
|
+
</p>
|
|
88
|
+
</div>
|
|
230
89
|
</div>
|
|
231
90
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<
|
|
91
|
+
{/* PopoverContent */}
|
|
92
|
+
<div className="space-y-3">
|
|
93
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
94
|
+
PopoverContent
|
|
95
|
+
</h4>
|
|
96
|
+
<Popover defaultOpen>
|
|
235
97
|
<PopoverTrigger asChild>
|
|
236
|
-
<Button variant="outline"
|
|
237
|
-
Simple Content
|
|
238
|
-
</Button>
|
|
98
|
+
<Button variant="outline">Content panel (open)</Button>
|
|
239
99
|
</PopoverTrigger>
|
|
240
|
-
<PopoverContent className="
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
</
|
|
100
|
+
<PopoverContent className="rounded-lg p-4">
|
|
101
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
102
|
+
Frosted-glass panel with a gradient top stroke. Default width{" "}
|
|
103
|
+
<code>w-72</code>, max height <code>max-h-96</code>. Rendered in a
|
|
104
|
+
portal — safe across any stacking context.
|
|
105
|
+
</p>
|
|
246
106
|
</PopoverContent>
|
|
247
107
|
</Popover>
|
|
108
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
109
|
+
<p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
|
|
110
|
+
Accepts <code>align</code> (start / center / end), <code>side</code>{" "}
|
|
111
|
+
(top / right / bottom / left), and <code>sideOffset</code>. The
|
|
112
|
+
gradient top-stroke is always rendered automatically.
|
|
113
|
+
</p>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
248
116
|
|
|
249
|
-
|
|
250
|
-
|
|
117
|
+
{/* PopoverClose */}
|
|
118
|
+
<div className="space-y-3">
|
|
119
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
120
|
+
PopoverClose
|
|
121
|
+
</h4>
|
|
122
|
+
<Popover defaultOpen>
|
|
251
123
|
<PopoverTrigger asChild>
|
|
252
|
-
<Button variant="outline"
|
|
253
|
-
Rich Content
|
|
254
|
-
</Button>
|
|
124
|
+
<Button variant="outline">Open (with close button)</Button>
|
|
255
125
|
</PopoverTrigger>
|
|
256
|
-
<PopoverContent className="
|
|
257
|
-
<div className="
|
|
258
|
-
<
|
|
259
|
-
|
|
260
|
-
<span className="text-sm font-medium text-white">JD</span>
|
|
261
|
-
</div>
|
|
262
|
-
<div>
|
|
263
|
-
<h4 className="font-medium text-white">John Doe</h4>
|
|
264
|
-
<p className="text-xs text-white/60">Software Developer</p>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
267
|
-
<p className="text-sm text-white/80">
|
|
268
|
-
Rich content with avatar, title, and description.
|
|
126
|
+
<PopoverContent className="rounded-lg p-4">
|
|
127
|
+
<div className="flex items-center justify-between gap-4">
|
|
128
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
129
|
+
Click × to dismiss.
|
|
269
130
|
</p>
|
|
131
|
+
<PopoverClose asChild>
|
|
132
|
+
<Button variant="text" size="sm">
|
|
133
|
+
×
|
|
134
|
+
</Button>
|
|
135
|
+
</PopoverClose>
|
|
270
136
|
</div>
|
|
271
137
|
</PopoverContent>
|
|
272
138
|
</Popover>
|
|
139
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
140
|
+
<p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
|
|
141
|
+
Closes the popover from within the content panel. Use with{" "}
|
|
142
|
+
<code>asChild</code> to render as any button or icon. Must be placed
|
|
143
|
+
inside <code>PopoverContent</code>.
|
|
144
|
+
</p>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
273
147
|
|
|
274
|
-
|
|
275
|
-
|
|
148
|
+
{/* PopoverArrow */}
|
|
149
|
+
<div className="space-y-3">
|
|
150
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
151
|
+
PopoverArrow
|
|
152
|
+
</h4>
|
|
153
|
+
<Popover defaultOpen>
|
|
276
154
|
<PopoverTrigger asChild>
|
|
277
|
-
<Button variant="outline"
|
|
278
|
-
Custom Style
|
|
279
|
-
</Button>
|
|
155
|
+
<Button variant="outline">Open (with arrow)</Button>
|
|
280
156
|
</PopoverTrigger>
|
|
281
|
-
<PopoverContent className="
|
|
282
|
-
<
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
</p>
|
|
287
|
-
</div>
|
|
157
|
+
<PopoverContent className="rounded-lg p-4" sideOffset={8}>
|
|
158
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
159
|
+
An arrow points back at the trigger.
|
|
160
|
+
</p>
|
|
161
|
+
<PopoverArrow className="fill-fm-surface-frosted/20" />
|
|
288
162
|
</PopoverContent>
|
|
289
163
|
</Popover>
|
|
164
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
165
|
+
<p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
|
|
166
|
+
Optional SVG arrow rendered inside <code>PopoverContent</code>.
|
|
167
|
+
Inherits positioning from the content and rotates automatically
|
|
168
|
+
based on side.
|
|
169
|
+
</p>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
290
172
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
173
|
+
{/* PopoverAnchor */}
|
|
174
|
+
<div className="space-y-3">
|
|
175
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
176
|
+
PopoverAnchor
|
|
177
|
+
</h4>
|
|
178
|
+
<Popover defaultOpen>
|
|
179
|
+
<div className="flex items-center gap-4">
|
|
180
|
+
<PopoverAnchor asChild>
|
|
181
|
+
<div className="border-fm-divider-secondary rounded-lg border px-4 py-2">
|
|
182
|
+
<span className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
183
|
+
Anchor element
|
|
184
|
+
</span>
|
|
185
|
+
</div>
|
|
186
|
+
</PopoverAnchor>
|
|
187
|
+
<PopoverTrigger asChild>
|
|
188
|
+
<Button variant="outline" size="sm">
|
|
189
|
+
Trigger
|
|
190
|
+
</Button>
|
|
191
|
+
</PopoverTrigger>
|
|
192
|
+
</div>
|
|
193
|
+
<PopoverContent className="rounded-lg p-4">
|
|
194
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
195
|
+
Positioned relative to the anchor box, not the trigger.
|
|
196
|
+
</p>
|
|
304
197
|
</PopoverContent>
|
|
305
198
|
</Popover>
|
|
199
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border p-4">
|
|
200
|
+
<p className="text-fm-secondary font-fm-text text-fm-md leading-fm-xl">
|
|
201
|
+
Decouples the visual anchor from the trigger. The popover positions
|
|
202
|
+
itself relative to <code>PopoverAnchor</code> while the trigger
|
|
203
|
+
retains click behavior. Useful for inline text flows or custom
|
|
204
|
+
layouts.
|
|
205
|
+
</p>
|
|
206
|
+
</div>
|
|
306
207
|
</div>
|
|
307
208
|
</div>
|
|
308
209
|
),
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ─── Configurations ──────────────────────────────────────────────────────────
|
|
213
|
+
|
|
214
|
+
export const Configurations: Story = {
|
|
309
215
|
parameters: {
|
|
310
216
|
docs: {
|
|
311
217
|
description: {
|
|
312
218
|
story:
|
|
313
|
-
"
|
|
219
|
+
"Positioning axes (side + align), sideOffset values, with close button, with arrow, and the anchored variant — all as live examples.",
|
|
314
220
|
},
|
|
315
221
|
},
|
|
316
222
|
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
223
|
+
render: () => (
|
|
224
|
+
<div className="w-full max-w-3xl space-y-8">
|
|
225
|
+
{/* Side positioning */}
|
|
226
|
+
<div className="space-y-4">
|
|
227
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
228
|
+
Side — side prop
|
|
229
|
+
</h4>
|
|
230
|
+
<div className="flex flex-wrap justify-center gap-4">
|
|
231
|
+
{(["top", "right", "bottom", "left"] as const).map((side) => (
|
|
232
|
+
<div key={side} className="space-y-2 text-center">
|
|
233
|
+
<Popover>
|
|
234
|
+
<PopoverTrigger asChild>
|
|
235
|
+
<Button variant="outline" size="sm">
|
|
236
|
+
{side}
|
|
237
|
+
</Button>
|
|
238
|
+
</PopoverTrigger>
|
|
239
|
+
<PopoverContent side={side} className="w-40 rounded-lg p-3">
|
|
240
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
241
|
+
Opens to the <strong>{side}</strong>.
|
|
242
|
+
</p>
|
|
243
|
+
</PopoverContent>
|
|
244
|
+
</Popover>
|
|
245
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
246
|
+
{side}
|
|
247
|
+
</p>
|
|
248
|
+
</div>
|
|
249
|
+
))}
|
|
333
250
|
</div>
|
|
251
|
+
</div>
|
|
334
252
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
<
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
253
|
+
{/* Alignment */}
|
|
254
|
+
<div className="space-y-4">
|
|
255
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
256
|
+
Alignment — align prop
|
|
257
|
+
</h4>
|
|
258
|
+
<div className="flex flex-wrap justify-center gap-4">
|
|
259
|
+
{(["start", "center", "end"] as const).map((align) => (
|
|
260
|
+
<div key={align} className="space-y-2 text-center">
|
|
261
|
+
<Popover>
|
|
262
|
+
<PopoverTrigger asChild>
|
|
263
|
+
<Button variant="outline" size="sm">
|
|
264
|
+
{align}
|
|
265
|
+
</Button>
|
|
266
|
+
</PopoverTrigger>
|
|
267
|
+
<PopoverContent align={align} className="rounded-lg p-3">
|
|
268
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
269
|
+
Aligned <strong>{align}</strong> to trigger.
|
|
270
|
+
</p>
|
|
271
|
+
</PopoverContent>
|
|
272
|
+
</Popover>
|
|
273
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
274
|
+
{align}
|
|
275
|
+
</p>
|
|
276
|
+
</div>
|
|
277
|
+
))}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
347
280
|
|
|
348
|
-
|
|
281
|
+
{/* With close button */}
|
|
282
|
+
<div className="space-y-4">
|
|
283
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
284
|
+
With Close Button
|
|
285
|
+
</h4>
|
|
286
|
+
<div className="flex justify-center">
|
|
349
287
|
<Popover>
|
|
350
|
-
<PopoverAnchor
|
|
351
|
-
style={{
|
|
352
|
-
position: "absolute",
|
|
353
|
-
left: anchorEl?.offsetLeft || 0,
|
|
354
|
-
top: anchorEl?.offsetTop || 0,
|
|
355
|
-
width: anchorEl?.offsetWidth || 0,
|
|
356
|
-
height: anchorEl?.offsetHeight || 0,
|
|
357
|
-
}}
|
|
358
|
-
/>
|
|
359
288
|
<PopoverTrigger asChild>
|
|
360
|
-
<Button variant="outline">Open
|
|
289
|
+
<Button variant="outline">Open panel</Button>
|
|
361
290
|
</PopoverTrigger>
|
|
362
|
-
<PopoverContent className="rounded-lg
|
|
363
|
-
<
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
<strong>Note:</strong> The popover appears near the anchor
|
|
372
|
-
point even though the trigger is elsewhere.
|
|
291
|
+
<PopoverContent className="w-64 rounded-lg p-4">
|
|
292
|
+
<div className="flex items-start justify-between gap-3">
|
|
293
|
+
<div className="space-y-1">
|
|
294
|
+
<p className="text-fm-primary font-fm-text text-fm-md leading-fm-md font-semibold">
|
|
295
|
+
Quick note
|
|
296
|
+
</p>
|
|
297
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
298
|
+
Dismiss with the × button.
|
|
299
|
+
</p>
|
|
373
300
|
</div>
|
|
301
|
+
<PopoverClose asChild>
|
|
302
|
+
<button className="text-fm-tertiary hover:text-fm-primary text-lg leading-none transition-colors outline-none">
|
|
303
|
+
×
|
|
304
|
+
</button>
|
|
305
|
+
</PopoverClose>
|
|
374
306
|
</div>
|
|
375
307
|
</PopoverContent>
|
|
376
308
|
</Popover>
|
|
377
309
|
</div>
|
|
378
|
-
|
|
379
|
-
{/* Multiple Anchors Example */}
|
|
380
|
-
<div className="mt-8">
|
|
381
|
-
<h4 className="mb-4 text-center font-medium text-white">
|
|
382
|
-
Multiple Anchor Points
|
|
383
|
-
</h4>
|
|
384
|
-
<div className="flex justify-center gap-4">
|
|
385
|
-
{["Anchor A", "Anchor B", "Anchor C"].map((label) => {
|
|
386
|
-
const [anchor, setAnchor] = React.useState<HTMLDivElement | null>(
|
|
387
|
-
null
|
|
388
|
-
)
|
|
389
|
-
|
|
390
|
-
return (
|
|
391
|
-
<div key={label} className="space-y-2 text-center">
|
|
392
|
-
<div
|
|
393
|
-
ref={setAnchor}
|
|
394
|
-
className="flex h-16 w-16 items-center justify-center rounded-lg border border-green-400 bg-green-600"
|
|
395
|
-
>
|
|
396
|
-
<span className="text-xs font-medium text-white">
|
|
397
|
-
{label}
|
|
398
|
-
</span>
|
|
399
|
-
</div>
|
|
400
|
-
|
|
401
|
-
<Popover>
|
|
402
|
-
<PopoverAnchor
|
|
403
|
-
style={{
|
|
404
|
-
position: "absolute",
|
|
405
|
-
left: anchor?.offsetLeft || 0,
|
|
406
|
-
top: anchor?.offsetTop || 0,
|
|
407
|
-
width: anchor?.offsetWidth || 0,
|
|
408
|
-
height: anchor?.offsetHeight || 0,
|
|
409
|
-
}}
|
|
410
|
-
/>
|
|
411
|
-
<PopoverTrigger asChild>
|
|
412
|
-
<Button size="sm" variant="outline">
|
|
413
|
-
Open {label}
|
|
414
|
-
</Button>
|
|
415
|
-
</PopoverTrigger>
|
|
416
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
417
|
-
<div className="p-3">
|
|
418
|
-
<p className="text-sm text-white">
|
|
419
|
-
Content for {label}
|
|
420
|
-
</p>
|
|
421
|
-
</div>
|
|
422
|
-
</PopoverContent>
|
|
423
|
-
</Popover>
|
|
424
|
-
</div>
|
|
425
|
-
)
|
|
426
|
-
})}
|
|
427
|
-
</div>
|
|
428
|
-
</div>
|
|
429
|
-
</div>
|
|
430
|
-
)
|
|
431
|
-
},
|
|
432
|
-
parameters: {
|
|
433
|
-
docs: {
|
|
434
|
-
description: {
|
|
435
|
-
story:
|
|
436
|
-
"PopoverAnchor examples showing how to position popovers relative to different elements than their triggers, including single and multiple anchor scenarios.",
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// 5. PopoverArrow Component Examples
|
|
443
|
-
export const PopoverArrowVariants: Story = {
|
|
444
|
-
render: () => (
|
|
445
|
-
<div className="space-y-6">
|
|
446
|
-
<div className="text-center">
|
|
447
|
-
<h3 className="mb-2 font-medium text-white">PopoverArrow Variants</h3>
|
|
448
|
-
<p className="text-sm text-white/60">
|
|
449
|
-
Different arrow styles and positioning options
|
|
450
|
-
</p>
|
|
451
310
|
</div>
|
|
452
311
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
<
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
<
|
|
460
|
-
<
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
</PopoverContent>
|
|
467
|
-
</Popover>
|
|
468
|
-
|
|
469
|
-
{/* Solid Arrow */}
|
|
470
|
-
<Popover>
|
|
471
|
-
<PopoverTrigger asChild>
|
|
472
|
-
<Button variant="outline">Solid Arrow</Button>
|
|
473
|
-
</PopoverTrigger>
|
|
474
|
-
<PopoverContent className="rounded-lg border border-gray-600 bg-gray-800 shadow-2xl">
|
|
475
|
-
<PopoverArrow className="fill-gray-800" />
|
|
476
|
-
<div className="p-3">
|
|
477
|
-
<p className="text-sm text-white">
|
|
478
|
-
Solid arrow matching background
|
|
479
|
-
</p>
|
|
480
|
-
</div>
|
|
481
|
-
</PopoverContent>
|
|
482
|
-
</Popover>
|
|
483
|
-
|
|
484
|
-
{/* Colored Arrow */}
|
|
485
|
-
<Popover>
|
|
486
|
-
<PopoverTrigger asChild>
|
|
487
|
-
<Button variant="outline">Colored Arrow</Button>
|
|
488
|
-
</PopoverTrigger>
|
|
489
|
-
<PopoverContent className="rounded-lg border border-blue-700 bg-blue-900 shadow-2xl">
|
|
490
|
-
<PopoverArrow className="fill-blue-700" />
|
|
491
|
-
<div className="p-3">
|
|
492
|
-
<p className="text-sm text-white">
|
|
493
|
-
Colored arrow with theme accent
|
|
494
|
-
</p>
|
|
495
|
-
</div>
|
|
496
|
-
</PopoverContent>
|
|
497
|
-
</Popover>
|
|
498
|
-
|
|
499
|
-
{/* Large Arrow */}
|
|
500
|
-
<Popover>
|
|
501
|
-
<PopoverTrigger asChild>
|
|
502
|
-
<Button variant="outline">Large Arrow</Button>
|
|
503
|
-
</PopoverTrigger>
|
|
504
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
505
|
-
<PopoverArrow className="h-4 w-4 fill-white/10" />
|
|
506
|
-
<div className="p-3">
|
|
507
|
-
<p className="text-sm text-white">Larger arrow size</p>
|
|
508
|
-
</div>
|
|
509
|
-
</PopoverContent>
|
|
510
|
-
</Popover>
|
|
511
|
-
|
|
512
|
-
{/* Gradient Arrow */}
|
|
513
|
-
<Popover>
|
|
514
|
-
<PopoverTrigger asChild>
|
|
515
|
-
<Button variant="outline">Gradient Arrow</Button>
|
|
516
|
-
</PopoverTrigger>
|
|
517
|
-
<PopoverContent className="rounded-lg border border-purple-600 bg-gradient-to-b from-purple-800 to-pink-800 shadow-2xl">
|
|
518
|
-
<PopoverArrow className="fill-purple-700" />
|
|
519
|
-
<div className="p-3">
|
|
520
|
-
<p className="text-sm text-white">
|
|
521
|
-
Arrow with gradient background
|
|
312
|
+
{/* With arrow */}
|
|
313
|
+
<div className="space-y-4">
|
|
314
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
315
|
+
With Arrow
|
|
316
|
+
</h4>
|
|
317
|
+
<div className="flex justify-center">
|
|
318
|
+
<Popover>
|
|
319
|
+
<PopoverTrigger asChild>
|
|
320
|
+
<Button variant="outline">Open with arrow</Button>
|
|
321
|
+
</PopoverTrigger>
|
|
322
|
+
<PopoverContent className="w-56 rounded-lg p-4" sideOffset={10}>
|
|
323
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
324
|
+
The arrow points back at the trigger.
|
|
522
325
|
</p>
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
{/* No Arrow */}
|
|
528
|
-
<Popover>
|
|
529
|
-
<PopoverTrigger asChild>
|
|
530
|
-
<Button variant="outline">No Arrow</Button>
|
|
531
|
-
</PopoverTrigger>
|
|
532
|
-
<PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
|
|
533
|
-
<div className="p-3">
|
|
534
|
-
<p className="text-sm text-white">Popover without arrow</p>
|
|
535
|
-
</div>
|
|
536
|
-
</PopoverContent>
|
|
537
|
-
</Popover>
|
|
326
|
+
<PopoverArrow className="fill-fm-surface-frosted/20" />
|
|
327
|
+
</PopoverContent>
|
|
328
|
+
</Popover>
|
|
329
|
+
</div>
|
|
538
330
|
</div>
|
|
539
331
|
|
|
540
|
-
{/*
|
|
541
|
-
<div className="
|
|
542
|
-
<h4 className="
|
|
543
|
-
|
|
332
|
+
{/* Anchored variant */}
|
|
333
|
+
<div className="space-y-4">
|
|
334
|
+
<h4 className="text-fm-secondary font-fm-text text-fm-md leading-fm-md font-medium">
|
|
335
|
+
Anchored Variant
|
|
544
336
|
</h4>
|
|
545
|
-
<div className="flex justify-center
|
|
546
|
-
|
|
547
|
-
<
|
|
337
|
+
<div className="flex justify-center">
|
|
338
|
+
<Popover>
|
|
339
|
+
<div className="flex items-center gap-3">
|
|
340
|
+
<PopoverAnchor asChild>
|
|
341
|
+
<div className="border-fm-divider-secondary min-w-32 rounded-lg border px-3 py-2">
|
|
342
|
+
<span className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
343
|
+
Search field
|
|
344
|
+
</span>
|
|
345
|
+
</div>
|
|
346
|
+
</PopoverAnchor>
|
|
548
347
|
<PopoverTrigger asChild>
|
|
549
|
-
<Button
|
|
550
|
-
{side}
|
|
551
|
-
</Button>
|
|
348
|
+
<Button size="sm">Suggest</Button>
|
|
552
349
|
</PopoverTrigger>
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
</div>
|
|
561
|
-
</PopoverContent>
|
|
562
|
-
</Popover>
|
|
563
|
-
))}
|
|
350
|
+
</div>
|
|
351
|
+
<PopoverContent className="w-64 rounded-lg p-4">
|
|
352
|
+
<p className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
353
|
+
Positioned over the anchor, not the trigger button.
|
|
354
|
+
</p>
|
|
355
|
+
</PopoverContent>
|
|
356
|
+
</Popover>
|
|
564
357
|
</div>
|
|
565
358
|
</div>
|
|
566
359
|
</div>
|
|
567
360
|
),
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// ─── Interactive ──────────────────────────────────────────────────────────────
|
|
364
|
+
|
|
365
|
+
export const Interactive: Story = {
|
|
568
366
|
parameters: {
|
|
569
367
|
docs: {
|
|
570
368
|
description: {
|
|
571
369
|
story:
|
|
572
|
-
"
|
|
370
|
+
"Live popovers with action panels inside — add to playlist and share options — demonstrating real audio-app workflows with controlled state.",
|
|
573
371
|
},
|
|
574
372
|
},
|
|
575
373
|
},
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
374
|
+
render: () => {
|
|
375
|
+
const AddToPlaylist = () => {
|
|
376
|
+
const [selected, setSelected] = useState<string[]>([])
|
|
377
|
+
const [newName, setNewName] = useState("")
|
|
378
|
+
|
|
379
|
+
const playlists = [
|
|
380
|
+
"Late Night Drives",
|
|
381
|
+
"Morning Workout",
|
|
382
|
+
"Focus Mode",
|
|
383
|
+
"Weekend Vibes",
|
|
384
|
+
]
|
|
385
|
+
|
|
386
|
+
const toggle = (name: string) =>
|
|
387
|
+
setSelected((prev) =>
|
|
388
|
+
prev.includes(name) ? prev.filter((p) => p !== name) : [...prev, name]
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
return (
|
|
591
392
|
<Popover>
|
|
592
393
|
<PopoverTrigger asChild>
|
|
593
|
-
<Button variant="outline"
|
|
394
|
+
<Button variant="outline" size="sm">
|
|
395
|
+
+ Add to Playlist
|
|
396
|
+
</Button>
|
|
594
397
|
</PopoverTrigger>
|
|
595
|
-
<PopoverContent className="w-72 rounded-
|
|
596
|
-
<
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
<h4 className="font-medium text-white">Settings</h4>
|
|
600
|
-
<PopoverClose asChild>
|
|
601
|
-
<Button variant="text" size="sm">
|
|
602
|
-
✕
|
|
603
|
-
</Button>
|
|
604
|
-
</PopoverClose>
|
|
605
|
-
</div>
|
|
606
|
-
<p className="text-sm text-white/70">
|
|
607
|
-
Close button in the header
|
|
398
|
+
<PopoverContent className="w-72 rounded-xl">
|
|
399
|
+
<div className="space-y-4 p-4">
|
|
400
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
|
|
401
|
+
Add to Playlist
|
|
608
402
|
</p>
|
|
609
|
-
</div>
|
|
610
|
-
</PopoverContent>
|
|
611
|
-
</Popover>
|
|
612
403
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
404
|
+
<div className="space-y-1">
|
|
405
|
+
{playlists.map((pl) => (
|
|
406
|
+
<button
|
|
407
|
+
key={pl}
|
|
408
|
+
onClick={() => toggle(pl)}
|
|
409
|
+
className="hover:bg-fm-surface-secondary flex w-full items-center justify-between rounded-lg px-3 py-2 transition-colors"
|
|
410
|
+
>
|
|
411
|
+
<span className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
412
|
+
{pl}
|
|
413
|
+
</span>
|
|
414
|
+
{selected.includes(pl) && (
|
|
415
|
+
<span className="text-fm-positive font-fm-text text-fm-xs leading-fm-xs">
|
|
416
|
+
✓
|
|
417
|
+
</span>
|
|
418
|
+
)}
|
|
419
|
+
</button>
|
|
420
|
+
))}
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<div className="border-fm-divider-secondary space-y-2 border-t pt-3">
|
|
424
|
+
<Label className="text-fm-secondary font-fm-text text-fm-xs leading-fm-xs">
|
|
425
|
+
New playlist
|
|
426
|
+
</Label>
|
|
427
|
+
<div className="flex gap-2">
|
|
428
|
+
<Input
|
|
429
|
+
value={newName}
|
|
430
|
+
onChange={(e) => setNewName(e.target.value)}
|
|
431
|
+
placeholder="Playlist name…"
|
|
432
|
+
className="text-fm-sm flex-1"
|
|
433
|
+
/>
|
|
434
|
+
<PopoverClose asChild>
|
|
435
|
+
<Button
|
|
436
|
+
size="sm"
|
|
437
|
+
disabled={!newName.trim()}
|
|
438
|
+
onClick={() => setNewName("")}
|
|
439
|
+
>
|
|
440
|
+
Create
|
|
441
|
+
</Button>
|
|
442
|
+
</PopoverClose>
|
|
443
|
+
</div>
|
|
632
444
|
</div>
|
|
633
445
|
</div>
|
|
634
446
|
</PopoverContent>
|
|
635
447
|
</Popover>
|
|
448
|
+
)
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const ShareOptions = () => {
|
|
452
|
+
const [copied, setCopied] = useState(false)
|
|
453
|
+
|
|
454
|
+
const copy = () => {
|
|
455
|
+
setCopied(true)
|
|
456
|
+
setTimeout(() => setCopied(false), 1500)
|
|
457
|
+
}
|
|
636
458
|
|
|
637
|
-
|
|
459
|
+
return (
|
|
638
460
|
<Popover>
|
|
639
461
|
<PopoverTrigger asChild>
|
|
640
|
-
<Button variant="outline"
|
|
462
|
+
<Button variant="outline" size="sm">
|
|
463
|
+
Share Track
|
|
464
|
+
</Button>
|
|
641
465
|
</PopoverTrigger>
|
|
642
|
-
<PopoverContent className="w-
|
|
643
|
-
<PopoverArrow className="fill-white/10" />
|
|
466
|
+
<PopoverContent className="w-72 rounded-xl">
|
|
644
467
|
<div className="space-y-4 p-4">
|
|
645
468
|
<div className="flex items-center justify-between">
|
|
646
|
-
<
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
✕
|
|
650
|
-
</Button>
|
|
651
|
-
</PopoverClose>
|
|
652
|
-
</div>
|
|
653
|
-
|
|
654
|
-
<div className="space-y-2">
|
|
655
|
-
<PopoverClose asChild>
|
|
656
|
-
<button className="w-full rounded px-3 py-2 text-left text-sm text-white hover:bg-white/10">
|
|
657
|
-
Save and Close
|
|
658
|
-
</button>
|
|
659
|
-
</PopoverClose>
|
|
469
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
|
|
470
|
+
Share
|
|
471
|
+
</p>
|
|
660
472
|
<PopoverClose asChild>
|
|
661
|
-
<button className="
|
|
662
|
-
|
|
473
|
+
<button className="text-fm-tertiary hover:text-fm-primary text-lg leading-none transition-colors outline-none">
|
|
474
|
+
×
|
|
663
475
|
</button>
|
|
664
476
|
</PopoverClose>
|
|
665
|
-
<button className="w-full rounded px-3 py-2 text-left text-sm text-white hover:bg-white/10">
|
|
666
|
-
Keep Open
|
|
667
|
-
</button>
|
|
668
477
|
</div>
|
|
669
|
-
</div>
|
|
670
|
-
</PopoverContent>
|
|
671
|
-
</Popover>
|
|
672
478
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
<PopoverClose asChild>
|
|
689
|
-
<Button variant="text" size="sm">
|
|
690
|
-
<svg
|
|
691
|
-
className="h-4 w-4"
|
|
692
|
-
fill="none"
|
|
693
|
-
stroke="currentColor"
|
|
694
|
-
viewBox="0 0 24 24"
|
|
695
|
-
>
|
|
696
|
-
<path
|
|
697
|
-
strokeLinecap="round"
|
|
698
|
-
strokeLinejoin="round"
|
|
699
|
-
strokeWidth={2}
|
|
700
|
-
d="M6 18L18 6M6 6l12 12"
|
|
701
|
-
/>
|
|
702
|
-
</svg>
|
|
703
|
-
</Button>
|
|
704
|
-
</PopoverClose>
|
|
705
|
-
</div>
|
|
706
|
-
</div>
|
|
707
|
-
</PopoverContent>
|
|
708
|
-
</Popover>
|
|
709
|
-
|
|
710
|
-
{/* Text Close Link */}
|
|
711
|
-
<Popover>
|
|
712
|
-
<PopoverTrigger asChild>
|
|
713
|
-
<Button variant="outline">Text Close</Button>
|
|
714
|
-
</PopoverTrigger>
|
|
715
|
-
<PopoverContent className="w-64 rounded-lg border border-white/10 shadow-2xl">
|
|
716
|
-
<PopoverArrow className="fill-white/10" />
|
|
717
|
-
<div className="space-y-3 p-4">
|
|
718
|
-
<h4 className="font-medium text-white">Quick Tip</h4>
|
|
719
|
-
<p className="text-sm text-white/70">
|
|
720
|
-
Use keyboard shortcuts to speed up your workflow.
|
|
721
|
-
</p>
|
|
722
|
-
<div className="text-right">
|
|
723
|
-
<PopoverClose asChild>
|
|
724
|
-
<button className="text-sm text-blue-400 underline hover:text-blue-300">
|
|
725
|
-
Got it, thanks!
|
|
479
|
+
<div className="space-y-2">
|
|
480
|
+
{[
|
|
481
|
+
"Copy Link",
|
|
482
|
+
"Share to Profile",
|
|
483
|
+
"Send to Friend",
|
|
484
|
+
"Embed",
|
|
485
|
+
].map((action) => (
|
|
486
|
+
<button
|
|
487
|
+
key={action}
|
|
488
|
+
onClick={action === "Copy Link" ? copy : undefined}
|
|
489
|
+
className="hover:bg-fm-surface-secondary flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors"
|
|
490
|
+
>
|
|
491
|
+
<span className="text-fm-primary font-fm-text text-fm-sm leading-fm-sm">
|
|
492
|
+
{action === "Copy Link" && copied ? "Copied!" : action}
|
|
493
|
+
</span>
|
|
726
494
|
</button>
|
|
727
|
-
|
|
495
|
+
))}
|
|
728
496
|
</div>
|
|
729
|
-
</div>
|
|
730
|
-
</PopoverContent>
|
|
731
|
-
</Popover>
|
|
732
497
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
</PopoverTrigger>
|
|
738
|
-
<PopoverContent className="w-72 rounded-lg border border-white/10 shadow-2xl">
|
|
739
|
-
<PopoverArrow className="fill-white/10" />
|
|
740
|
-
<div className="space-y-3 p-4">
|
|
741
|
-
<h4 className="font-medium text-white">Quick Actions</h4>
|
|
742
|
-
<div className="grid grid-cols-2 gap-2">
|
|
743
|
-
<PopoverClose asChild>
|
|
744
|
-
<Button size="sm" variant="outline">
|
|
745
|
-
Copy
|
|
746
|
-
</Button>
|
|
747
|
-
</PopoverClose>
|
|
748
|
-
<PopoverClose asChild>
|
|
749
|
-
<Button size="sm" variant="outline">
|
|
750
|
-
Share
|
|
751
|
-
</Button>
|
|
752
|
-
</PopoverClose>
|
|
753
|
-
<PopoverClose asChild>
|
|
754
|
-
<Button size="sm" variant="outline">
|
|
755
|
-
Download
|
|
756
|
-
</Button>
|
|
757
|
-
</PopoverClose>
|
|
758
|
-
<PopoverClose asChild>
|
|
759
|
-
<Button size="sm" variant="outline">
|
|
760
|
-
Delete
|
|
761
|
-
</Button>
|
|
762
|
-
</PopoverClose>
|
|
498
|
+
<div className="border-fm-divider-secondary border-t pt-3">
|
|
499
|
+
<p className="text-fm-tertiary font-fm-text text-fm-xs leading-fm-xs">
|
|
500
|
+
Midnight Rain · Taylor Swift · Midnights
|
|
501
|
+
</p>
|
|
763
502
|
</div>
|
|
764
|
-
<p className="text-xs text-white/50">
|
|
765
|
-
Actions will close the popover automatically
|
|
766
|
-
</p>
|
|
767
503
|
</div>
|
|
768
504
|
</PopoverContent>
|
|
769
505
|
</Popover>
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
render: () => (
|
|
786
|
-
<div className="space-y-6">
|
|
787
|
-
<div className="text-center">
|
|
788
|
-
<h3 className="mb-2 font-medium text-white">Complete Integration</h3>
|
|
789
|
-
<p className="text-sm text-white/60">
|
|
790
|
-
All components working together in real-world scenarios
|
|
791
|
-
</p>
|
|
792
|
-
</div>
|
|
793
|
-
|
|
794
|
-
<div className="flex justify-center gap-4">
|
|
795
|
-
{/* Complete User Menu */}
|
|
506
|
+
)
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const EQSettings = () => {
|
|
510
|
+
const bands = [
|
|
511
|
+
{ label: "Bass", freq: "80 Hz", default: 3 },
|
|
512
|
+
{ label: "Low Mid", freq: "500 Hz", default: 0 },
|
|
513
|
+
{ label: "High Mid", freq: "3 kHz", default: -1 },
|
|
514
|
+
{ label: "Treble", freq: "10 kHz", default: -2 },
|
|
515
|
+
]
|
|
516
|
+
const [values, setValues] = useState<Record<string, number>>(
|
|
517
|
+
Object.fromEntries(bands.map(({ label, default: d }) => [label, d]))
|
|
518
|
+
)
|
|
519
|
+
|
|
520
|
+
return (
|
|
796
521
|
<Popover>
|
|
797
522
|
<PopoverTrigger asChild>
|
|
798
|
-
<Button variant="
|
|
799
|
-
|
|
800
|
-
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=32&h=32&fit=crop&crop=face"
|
|
801
|
-
alt="Profile"
|
|
802
|
-
className="h-8 w-8 rounded-full border border-white/20"
|
|
803
|
-
/>
|
|
804
|
-
<span className="text-sm">John Doe</span>
|
|
805
|
-
<svg
|
|
806
|
-
className="h-4 w-4 text-white/60"
|
|
807
|
-
fill="none"
|
|
808
|
-
stroke="currentColor"
|
|
809
|
-
viewBox="0 0 24 24"
|
|
810
|
-
>
|
|
811
|
-
<path
|
|
812
|
-
strokeLinecap="round"
|
|
813
|
-
strokeLinejoin="round"
|
|
814
|
-
strokeWidth={2}
|
|
815
|
-
d="M19 9l-7 7-7-7"
|
|
816
|
-
/>
|
|
817
|
-
</svg>
|
|
523
|
+
<Button variant="outline" size="sm">
|
|
524
|
+
EQ Settings
|
|
818
525
|
</Button>
|
|
819
526
|
</PopoverTrigger>
|
|
820
|
-
<PopoverContent
|
|
821
|
-
align="end"
|
|
822
|
-
className="w-80 rounded-lg border border-white/10 shadow-2xl"
|
|
823
|
-
>
|
|
824
|
-
<PopoverArrow className="fill-white/10" />
|
|
527
|
+
<PopoverContent className="w-72 rounded-xl">
|
|
825
528
|
<div className="space-y-4 p-4">
|
|
826
|
-
{/* Header with close */}
|
|
827
529
|
<div className="flex items-center justify-between">
|
|
828
|
-
<
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
530
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
|
|
531
|
+
Equalizer
|
|
532
|
+
</p>
|
|
533
|
+
<button
|
|
534
|
+
onClick={() =>
|
|
535
|
+
setValues(
|
|
536
|
+
Object.fromEntries(
|
|
537
|
+
bands.map(({ label, default: d }) => [label, d])
|
|
538
|
+
)
|
|
539
|
+
)
|
|
540
|
+
}
|
|
541
|
+
className="text-fm-tertiary hover:text-fm-primary font-fm-text text-fm-xs leading-fm-xs transition-colors"
|
|
542
|
+
>
|
|
543
|
+
Reset
|
|
544
|
+
</button>
|
|
834
545
|
</div>
|
|
835
546
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
547
|
+
<div className="space-y-3">
|
|
548
|
+
{bands.map(({ label, freq }) => (
|
|
549
|
+
<div key={label} className="space-y-1">
|
|
550
|
+
<div className="flex items-center justify-between">
|
|
551
|
+
<span className="text-fm-secondary font-fm-text text-fm-xs leading-fm-xs">
|
|
552
|
+
{label} · {freq}
|
|
553
|
+
</span>
|
|
554
|
+
<span className="text-fm-primary font-fm-text text-fm-xs leading-fm-xs w-12 text-right">
|
|
555
|
+
{values[label] > 0 ? "+" : ""}
|
|
556
|
+
{values[label]} dB
|
|
557
|
+
</span>
|
|
558
|
+
</div>
|
|
559
|
+
<input
|
|
560
|
+
type="range"
|
|
561
|
+
min={-12}
|
|
562
|
+
max={12}
|
|
563
|
+
step={1}
|
|
564
|
+
value={values[label]}
|
|
565
|
+
onChange={(e) =>
|
|
566
|
+
setValues((v) => ({
|
|
567
|
+
...v,
|
|
568
|
+
[label]: Number(e.target.value),
|
|
569
|
+
}))
|
|
570
|
+
}
|
|
571
|
+
className="accent-fm-primary h-1 w-full"
|
|
572
|
+
/>
|
|
573
|
+
</div>
|
|
574
|
+
))}
|
|
847
575
|
</div>
|
|
848
576
|
|
|
849
|
-
|
|
850
|
-
<div className="grid grid-cols-2 gap-2">
|
|
577
|
+
<div className="flex gap-2 pt-1">
|
|
851
578
|
<PopoverClose asChild>
|
|
852
|
-
<Button size="sm"
|
|
853
|
-
|
|
579
|
+
<Button size="sm" className="flex-1">
|
|
580
|
+
Apply
|
|
854
581
|
</Button>
|
|
855
582
|
</PopoverClose>
|
|
856
583
|
<PopoverClose asChild>
|
|
857
|
-
<Button
|
|
858
|
-
|
|
584
|
+
<Button variant="outline" size="sm">
|
|
585
|
+
Cancel
|
|
859
586
|
</Button>
|
|
860
587
|
</PopoverClose>
|
|
861
588
|
</div>
|
|
862
|
-
|
|
863
|
-
{/* Menu Items */}
|
|
864
|
-
<div className="space-y-1">
|
|
865
|
-
<PopoverClose asChild>
|
|
866
|
-
<button className="flex w-full items-center gap-2 rounded px-3 py-2 text-left text-sm text-white hover:bg-white/10">
|
|
867
|
-
<svg
|
|
868
|
-
className="h-4 w-4"
|
|
869
|
-
fill="none"
|
|
870
|
-
stroke="currentColor"
|
|
871
|
-
viewBox="0 0 24 24"
|
|
872
|
-
>
|
|
873
|
-
<path
|
|
874
|
-
strokeLinecap="round"
|
|
875
|
-
strokeLinejoin="round"
|
|
876
|
-
strokeWidth={2}
|
|
877
|
-
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
878
|
-
/>
|
|
879
|
-
</svg>
|
|
880
|
-
My Documents
|
|
881
|
-
</button>
|
|
882
|
-
</PopoverClose>
|
|
883
|
-
<PopoverClose asChild>
|
|
884
|
-
<button className="flex w-full items-center gap-2 rounded px-3 py-2 text-left text-sm text-white hover:bg-white/10">
|
|
885
|
-
<svg
|
|
886
|
-
className="h-4 w-4"
|
|
887
|
-
fill="none"
|
|
888
|
-
stroke="currentColor"
|
|
889
|
-
viewBox="0 0 24 24"
|
|
890
|
-
>
|
|
891
|
-
<path
|
|
892
|
-
strokeLinecap="round"
|
|
893
|
-
strokeLinejoin="round"
|
|
894
|
-
strokeWidth={2}
|
|
895
|
-
d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"
|
|
896
|
-
/>
|
|
897
|
-
</svg>
|
|
898
|
-
Billing
|
|
899
|
-
</button>
|
|
900
|
-
</PopoverClose>
|
|
901
|
-
<PopoverClose asChild>
|
|
902
|
-
<button className="flex w-full items-center gap-2 rounded px-3 py-2 text-left text-sm text-white hover:bg-white/10">
|
|
903
|
-
<svg
|
|
904
|
-
className="h-4 w-4"
|
|
905
|
-
fill="none"
|
|
906
|
-
stroke="currentColor"
|
|
907
|
-
viewBox="0 0 24 24"
|
|
908
|
-
>
|
|
909
|
-
<path
|
|
910
|
-
strokeLinecap="round"
|
|
911
|
-
strokeLinejoin="round"
|
|
912
|
-
strokeWidth={2}
|
|
913
|
-
d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"
|
|
914
|
-
/>
|
|
915
|
-
</svg>
|
|
916
|
-
Help & Support
|
|
917
|
-
</button>
|
|
918
|
-
</PopoverClose>
|
|
919
|
-
</div>
|
|
920
|
-
|
|
921
|
-
{/* Sign Out */}
|
|
922
|
-
<div className="border-t border-white/10 pt-3">
|
|
923
|
-
<PopoverClose asChild>
|
|
924
|
-
<button className="flex w-full items-center gap-2 rounded px-3 py-2 text-left text-sm text-red-400 hover:bg-red-500/10">
|
|
925
|
-
<svg
|
|
926
|
-
className="h-4 w-4"
|
|
927
|
-
fill="none"
|
|
928
|
-
stroke="currentColor"
|
|
929
|
-
viewBox="0 0 24 24"
|
|
930
|
-
>
|
|
931
|
-
<path
|
|
932
|
-
strokeLinecap="round"
|
|
933
|
-
strokeLinejoin="round"
|
|
934
|
-
strokeWidth={2}
|
|
935
|
-
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
|
|
936
|
-
/>
|
|
937
|
-
</svg>
|
|
938
|
-
Sign Out
|
|
939
|
-
</button>
|
|
940
|
-
</PopoverClose>
|
|
941
|
-
</div>
|
|
942
589
|
</div>
|
|
943
590
|
</PopoverContent>
|
|
944
591
|
</Popover>
|
|
592
|
+
)
|
|
593
|
+
}
|
|
945
594
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
<
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
595
|
+
return (
|
|
596
|
+
<div className="w-full p-8">
|
|
597
|
+
<div className="mx-auto max-w-3xl space-y-6">
|
|
598
|
+
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
|
599
|
+
{/* Controls panel */}
|
|
600
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary space-y-5 rounded-xl border p-5">
|
|
601
|
+
<p className="text-fm-primary font-fm-brand text-fm-sm leading-fm-sm font-semibold tracking-widest uppercase">
|
|
602
|
+
Track Actions
|
|
603
|
+
</p>
|
|
604
|
+
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
605
|
+
Open any popover to interact with a live action panel.
|
|
606
|
+
</p>
|
|
607
|
+
<div className="border-fm-divider-secondary border-t pt-4" />
|
|
608
|
+
<div className="space-y-3">
|
|
609
|
+
<AddToPlaylist />
|
|
610
|
+
<ShareOptions />
|
|
611
|
+
<EQSettings />
|
|
962
612
|
</div>
|
|
613
|
+
</div>
|
|
963
614
|
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
<Label htmlFor="email" className="text-sm text-white/90">
|
|
978
|
-
Email
|
|
979
|
-
</Label>
|
|
980
|
-
<Input
|
|
981
|
-
id="email"
|
|
982
|
-
defaultValue="john@example.com"
|
|
983
|
-
className="border-white/20 bg-white/5 text-white placeholder:text-white/40"
|
|
984
|
-
/>
|
|
985
|
-
</div>
|
|
986
|
-
<div>
|
|
987
|
-
<Label htmlFor="role" className="text-sm text-white/90">
|
|
988
|
-
Role
|
|
989
|
-
</Label>
|
|
990
|
-
<select
|
|
991
|
-
id="role"
|
|
992
|
-
className="w-full rounded-md border border-white/20 bg-white/5 px-3 py-2 text-sm text-white focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:outline-none"
|
|
993
|
-
>
|
|
994
|
-
<option value="developer">Developer</option>
|
|
995
|
-
<option value="designer">Designer</option>
|
|
996
|
-
<option value="manager">Manager</option>
|
|
997
|
-
</select>
|
|
615
|
+
{/* Preview stage */}
|
|
616
|
+
<div className="flex flex-col gap-3 lg:col-span-2">
|
|
617
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary flex-1 space-y-3 rounded-xl border p-5">
|
|
618
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
619
|
+
Now playing
|
|
620
|
+
</p>
|
|
621
|
+
<div className="space-y-1">
|
|
622
|
+
<p className="text-fm-primary font-fm-brand text-fm-xl leading-fm-xl font-semibold">
|
|
623
|
+
Midnight Rain
|
|
624
|
+
</p>
|
|
625
|
+
<p className="text-fm-secondary font-fm-text text-fm-md leading-fm-md">
|
|
626
|
+
Taylor Swift · Midnights · 2022
|
|
627
|
+
</p>
|
|
998
628
|
</div>
|
|
999
|
-
<div>
|
|
1000
|
-
<
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
rows={3}
|
|
1006
|
-
className="w-full rounded-md border border-white/20 bg-white/5 px-3 py-2 text-sm text-white placeholder:text-white/40 focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:outline-none"
|
|
1007
|
-
defaultValue="Software developer passionate about creating great user experiences."
|
|
1008
|
-
/>
|
|
629
|
+
<div className="border-fm-divider-secondary border-t pt-3">
|
|
630
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
631
|
+
Use the action buttons on the left to open interactive
|
|
632
|
+
popovers: add this track to a playlist, share it, or adjust
|
|
633
|
+
the equalizer.
|
|
634
|
+
</p>
|
|
1009
635
|
</div>
|
|
1010
636
|
</div>
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
<Button size="sm">Save Changes</Button>
|
|
1016
|
-
</PopoverClose>
|
|
1017
|
-
<PopoverClose asChild>
|
|
1018
|
-
<Button size="sm" variant="outline">
|
|
1019
|
-
Cancel
|
|
1020
|
-
</Button>
|
|
1021
|
-
</PopoverClose>
|
|
637
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary rounded-lg border px-4 py-3">
|
|
638
|
+
<code className="text-fm-secondary text-fm-md leading-fm-md font-(--font-fm-mono)">
|
|
639
|
+
{`<Popover><PopoverTrigger asChild>…</PopoverTrigger><PopoverContent>…<PopoverClose /></PopoverContent></Popover>`}
|
|
640
|
+
</code>
|
|
1022
641
|
</div>
|
|
1023
642
|
</div>
|
|
1024
|
-
</
|
|
1025
|
-
</
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
1026
645
|
</div>
|
|
1027
|
-
|
|
1028
|
-
),
|
|
1029
|
-
parameters: {
|
|
1030
|
-
docs: {
|
|
1031
|
-
description: {
|
|
1032
|
-
story:
|
|
1033
|
-
"Complete integration examples showing all popover components working together in realistic user interface scenarios.",
|
|
1034
|
-
},
|
|
1035
|
-
},
|
|
646
|
+
)
|
|
1036
647
|
},
|
|
1037
648
|
}
|