aural-ui 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +456 -0
  3. package/dist/components/aspect-ratio/AspectRatio.stories.tsx +1327 -0
  4. package/dist/components/aspect-ratio/index.tsx +10 -0
  5. package/dist/components/aspect-ratio/meta.ts +8 -0
  6. package/dist/components/avatar/Avatar.stories.tsx +645 -0
  7. package/dist/components/avatar/index.tsx +50 -0
  8. package/dist/components/avatar/meta.ts +8 -0
  9. package/dist/components/badge/Badge.stories.tsx +169 -0
  10. package/dist/components/badge/index.tsx +28 -0
  11. package/dist/components/badge/meta.ts +6 -0
  12. package/dist/components/banner/Banner.stories.tsx +475 -0
  13. package/dist/components/banner/index.tsx +256 -0
  14. package/dist/components/banner/meta.ts +36 -0
  15. package/dist/components/button/Button.stories.tsx +74 -0
  16. package/dist/components/button/index.tsx +158 -0
  17. package/dist/components/button/meta.ts +33 -0
  18. package/dist/components/card/Card.stories.tsx +377 -0
  19. package/dist/components/card/index.tsx +85 -0
  20. package/dist/components/card/meta.ts +14 -0
  21. package/dist/components/char-count/CharCount.stories.tsx +334 -0
  22. package/dist/components/char-count/index.tsx +51 -0
  23. package/dist/components/char-count/meta.ts +13 -0
  24. package/dist/components/checkbox/Checkbox.stories.tsx +209 -0
  25. package/dist/components/checkbox/index.tsx +34 -0
  26. package/dist/components/checkbox/meta.ts +19 -0
  27. package/dist/components/chip/Chip.stories.tsx +207 -0
  28. package/dist/components/chip/index.tsx +92 -0
  29. package/dist/components/chip/meta.ts +17 -0
  30. package/dist/components/circular-loader/CircularLoader.stories.tsx +741 -0
  31. package/dist/components/circular-loader/index.tsx +138 -0
  32. package/dist/components/circular-loader/meta.ts +11 -0
  33. package/dist/components/collapsible/Collapsible.stories.tsx +319 -0
  34. package/dist/components/collapsible/index.tsx +158 -0
  35. package/dist/components/collapsible/meta.ts +22 -0
  36. package/dist/components/command/Command.stories.tsx +996 -0
  37. package/dist/components/command/index.tsx +324 -0
  38. package/dist/components/command/meta.ts +18 -0
  39. package/dist/components/dialog/Dialog.stories.tsx +963 -0
  40. package/dist/components/dialog/index.tsx +250 -0
  41. package/dist/components/dialog/meta.ts +28 -0
  42. package/dist/components/divider/Divider.stories.tsx +633 -0
  43. package/dist/components/divider/index.tsx +181 -0
  44. package/dist/components/divider/meta.ts +12 -0
  45. package/dist/components/dot-loader/DotLoader.stories.tsx +352 -0
  46. package/dist/components/dot-loader/index.tsx +78 -0
  47. package/dist/components/dot-loader/meta.ts +14 -0
  48. package/dist/components/dropdown/Dropdown.stories.tsx +1210 -0
  49. package/dist/components/dropdown/index.tsx +479 -0
  50. package/dist/components/dropdown/meta.ts +21 -0
  51. package/dist/components/form/Form.stories.tsx +320 -0
  52. package/dist/components/form/index.tsx +183 -0
  53. package/dist/components/form/meta.ts +11 -0
  54. package/dist/components/helper-text/HelperText.stories.tsx +254 -0
  55. package/dist/components/helper-text/index.tsx +102 -0
  56. package/dist/components/helper-text/meta.ts +18 -0
  57. package/dist/components/hover-card/HoverCard.stories.tsx +1328 -0
  58. package/dist/components/hover-card/index.tsx +42 -0
  59. package/dist/components/hover-card/meta.ts +12 -0
  60. package/dist/components/icon-button/IconButton.stories.tsx +252 -0
  61. package/dist/components/icon-button/index.tsx +130 -0
  62. package/dist/components/icon-button/meta.ts +20 -0
  63. package/dist/components/if-else/if-else.stories.tsx +100 -0
  64. package/dist/components/if-else/index.tsx +56 -0
  65. package/dist/components/if-else/meta.ts +6 -0
  66. package/dist/components/index.ts +70 -0
  67. package/dist/components/input/Input.stories.tsx +431 -0
  68. package/dist/components/input/index.tsx +487 -0
  69. package/dist/components/input/meta.ts +28 -0
  70. package/dist/components/label/Label.stories.tsx +200 -0
  71. package/dist/components/label/index.tsx +43 -0
  72. package/dist/components/label/meta.ts +14 -0
  73. package/dist/components/list/List.stories.tsx +963 -0
  74. package/dist/components/list/index.tsx +567 -0
  75. package/dist/components/list/meta.ts +24 -0
  76. package/dist/components/marquee/Marquee.stories.tsx +819 -0
  77. package/dist/components/marquee/index.tsx +107 -0
  78. package/dist/components/marquee/meta.ts +6 -0
  79. package/dist/components/overlay/Overlay.stories.tsx +954 -0
  80. package/dist/components/overlay/index.tsx +58 -0
  81. package/dist/components/overlay/meta.ts +10 -0
  82. package/dist/components/pagination/Pagination.stories.tsx +354 -0
  83. package/dist/components/pagination/index.tsx +455 -0
  84. package/dist/components/pagination/meta.ts +29 -0
  85. package/dist/components/popover/Popover.stories.tsx +1037 -0
  86. package/dist/components/popover/index.tsx +67 -0
  87. package/dist/components/popover/meta.ts +12 -0
  88. package/dist/components/radio/Radio.stories.tsx +146 -0
  89. package/dist/components/radio/index.tsx +41 -0
  90. package/dist/components/radio/meta.ts +19 -0
  91. package/dist/components/resizable/Resizable.stories.tsx +866 -0
  92. package/dist/components/resizable/index.tsx +55 -0
  93. package/dist/components/resizable/meta.ts +12 -0
  94. package/dist/components/scroll-area/ScrollArea.stories.tsx +1104 -0
  95. package/dist/components/scroll-area/index.tsx +55 -0
  96. package/dist/components/scroll-area/meta.ts +8 -0
  97. package/dist/components/search/Search.stories.tsx +678 -0
  98. package/dist/components/search/index.tsx +141 -0
  99. package/dist/components/search/meta.ts +6 -0
  100. package/dist/components/select/Select.stories.tsx +962 -0
  101. package/dist/components/select/index.tsx +512 -0
  102. package/dist/components/select/meta.ts +40 -0
  103. package/dist/components/sheet/Sheet.stories.tsx +1060 -0
  104. package/dist/components/sheet/index.tsx +440 -0
  105. package/dist/components/sheet/meta.ts +38 -0
  106. package/dist/components/skelton/Skelton.stories.tsx +859 -0
  107. package/dist/components/skelton/index.tsx +17 -0
  108. package/dist/components/skelton/meta.ts +6 -0
  109. package/dist/components/slider/Slider.stories.tsx +876 -0
  110. package/dist/components/slider/index.tsx +156 -0
  111. package/dist/components/slider/meta.ts +29 -0
  112. package/dist/components/stepper/Stepper.stories.tsx +639 -0
  113. package/dist/components/stepper/index.tsx +650 -0
  114. package/dist/components/stepper/meta.ts +19 -0
  115. package/dist/components/switch/Switch.stories.tsx +85 -0
  116. package/dist/components/switch/index.tsx +37 -0
  117. package/dist/components/switch/meta.ts +24 -0
  118. package/dist/components/switch-case/SwitchCase.stories.tsx +209 -0
  119. package/dist/components/switch-case/index.tsx +89 -0
  120. package/dist/components/switch-case/meta.ts +6 -0
  121. package/dist/components/table/Table.stories.tsx +1095 -0
  122. package/dist/components/table/index.tsx +113 -0
  123. package/dist/components/table/meta.ts +20 -0
  124. package/dist/components/tabs/Tabs.stories.tsx +1379 -0
  125. package/dist/components/tabs/index.tsx +186 -0
  126. package/dist/components/tabs/meta.ts +25 -0
  127. package/dist/components/tag/Tag.stories.tsx +625 -0
  128. package/dist/components/tag/index.tsx +320 -0
  129. package/dist/components/tag/meta.ts +52 -0
  130. package/dist/components/textarea/TextArea.stories.tsx +723 -0
  131. package/dist/components/textarea/index.tsx +480 -0
  132. package/dist/components/textarea/meta.ts +23 -0
  133. package/dist/components/toast/Toast.stories.tsx +1427 -0
  134. package/dist/components/toast/index.tsx +26 -0
  135. package/dist/components/toast/meta.ts +19 -0
  136. package/dist/components/toggle/Toggle.stories.tsx +1093 -0
  137. package/dist/components/toggle/index.tsx +44 -0
  138. package/dist/components/toggle/meta.ts +19 -0
  139. package/dist/components/tooltip/Tooltip.stories.tsx +1548 -0
  140. package/dist/components/tooltip/index.tsx +304 -0
  141. package/dist/components/tooltip/meta.ts +21 -0
  142. package/dist/components/typography/Typography.stories.tsx +197 -0
  143. package/dist/components/typography/index.tsx +184 -0
  144. package/dist/components/typography/meta.ts +38 -0
  145. package/dist/fonts/LabGrotesque-Regular.ttf +0 -0
  146. package/dist/fonts/LabGrotesqueTRIAL-Bold.otf +0 -0
  147. package/dist/fonts/LabGrotesqueTRIAL-Light.otf +0 -0
  148. package/dist/fonts/LabGrotesqueTRIAL-Medium.otf +0 -0
  149. package/dist/fonts/LabGrotesqueTRIAL-Regular.otf +0 -0
  150. package/dist/fonts/PPSupplySans-Regular (1).otf +0 -0
  151. package/dist/fonts/PPSupplySans-Regular.otf +0 -0
  152. package/dist/fonts/PPSupplySans-Ultralight.otf +0 -0
  153. package/dist/hooks/index.ts +3 -0
  154. package/dist/hooks/use-previous/UsePrevious.stories.tsx +997 -0
  155. package/dist/hooks/use-previous/index.ts +15 -0
  156. package/dist/hooks/use-previous/meta.ts +6 -0
  157. package/dist/hooks/use-standalone-pagination/UseStandalonePagination.stories.tsx +983 -0
  158. package/dist/hooks/use-standalone-pagination/index.ts +146 -0
  159. package/dist/hooks/use-standalone-pagination/meta.ts +6 -0
  160. package/dist/icons/Icons.stories.tsx +29 -0
  161. package/dist/icons/alert-icon/AlertIcon.stories.tsx +991 -0
  162. package/dist/icons/alert-icon/index.tsx +48 -0
  163. package/dist/icons/alert-icon/meta.ts +8 -0
  164. package/dist/icons/all-icons.tsx +738 -0
  165. package/dist/icons/angle-down-icon/AngleDownIcon.stories.tsx +1031 -0
  166. package/dist/icons/angle-down-icon/index.tsx +25 -0
  167. package/dist/icons/angle-down-icon/meta.ts +8 -0
  168. package/dist/icons/arrow-box-left-icon/ArrowBoxLeftIcon.stories.tsx +1080 -0
  169. package/dist/icons/arrow-box-left-icon/index.tsx +24 -0
  170. package/dist/icons/arrow-box-left-icon/meta.ts +8 -0
  171. package/dist/icons/arrow-right-icon/ArrowRightIcon.stories.tsx +1151 -0
  172. package/dist/icons/arrow-right-icon/index.tsx +26 -0
  173. package/dist/icons/arrow-right-icon/meta.ts +8 -0
  174. package/dist/icons/arrow-right-up-icon/ArrowRightUpIcon.stories.tsx +1273 -0
  175. package/dist/icons/arrow-right-up-icon/index.tsx +24 -0
  176. package/dist/icons/arrow-right-up-icon/meta.ts +8 -0
  177. package/dist/icons/art-board-icon/ArtBoardIcon.stories.tsx +670 -0
  178. package/dist/icons/art-board-icon/index.tsx +24 -0
  179. package/dist/icons/art-board-icon/meta.ts +7 -0
  180. package/dist/icons/audio-bar-icon/AudioBarIcon.stories.tsx +1244 -0
  181. package/dist/icons/audio-bar-icon/index.tsx +19 -0
  182. package/dist/icons/audio-bar-icon/meta.ts +8 -0
  183. package/dist/icons/bubble-check-icon/BubbleCheckIcon.stories.tsx +1239 -0
  184. package/dist/icons/bubble-check-icon/index.tsx +24 -0
  185. package/dist/icons/bubble-check-icon/meta.ts +8 -0
  186. package/dist/icons/bubble-crossed-icon/BubbleCrossedIcon.stories.tsx +1228 -0
  187. package/dist/icons/bubble-crossed-icon/index.tsx +24 -0
  188. package/dist/icons/bubble-crossed-icon/meta.ts +8 -0
  189. package/dist/icons/bubble-sparkle-icon/BubbleSparkleIcon.stories.tsx +912 -0
  190. package/dist/icons/bubble-sparkle-icon/index.tsx +26 -0
  191. package/dist/icons/bubble-sparkle-icon/meta.ts +8 -0
  192. package/dist/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.stories.tsx +1021 -0
  193. package/dist/icons/chevron-double-left-icon/index.tsx +34 -0
  194. package/dist/icons/chevron-double-left-icon/meta.ts +8 -0
  195. package/dist/icons/chevron-double-right-icon/ChevronDoubleRightIcon.stories.tsx +1021 -0
  196. package/dist/icons/chevron-double-right-icon/index.tsx +34 -0
  197. package/dist/icons/chevron-double-right-icon/meta.ts +8 -0
  198. package/dist/icons/chevron-down-icon/ChevronDownIcon.stories.tsx +1001 -0
  199. package/dist/icons/chevron-down-icon/index.tsx +27 -0
  200. package/dist/icons/chevron-down-icon/meta.ts +8 -0
  201. package/dist/icons/chevron-left-icon/ChevronLeftIcon.stories.tsx +1029 -0
  202. package/dist/icons/chevron-left-icon/index.tsx +27 -0
  203. package/dist/icons/chevron-left-icon/meta.ts +8 -0
  204. package/dist/icons/chevron-right-icon/ChevronRightIcon.stories.tsx +1021 -0
  205. package/dist/icons/chevron-right-icon/index.tsx +27 -0
  206. package/dist/icons/chevron-right-icon/meta.ts +8 -0
  207. package/dist/icons/chevron-up-icon/ChevronUpIcon.stories.tsx +1036 -0
  208. package/dist/icons/chevron-up-icon/index.tsx +27 -0
  209. package/dist/icons/chevron-up-icon/meta.ts +8 -0
  210. package/dist/icons/command-icon/CommandIcon.stories.tsx +1098 -0
  211. package/dist/icons/command-icon/index.tsx +24 -0
  212. package/dist/icons/command-icon/meta.ts +8 -0
  213. package/dist/icons/cross-circle-icon/CrossCircleIcon.stories.tsx +1061 -0
  214. package/dist/icons/cross-circle-icon/index.tsx +23 -0
  215. package/dist/icons/cross-circle-icon/meta.ts +8 -0
  216. package/dist/icons/cross-icon/CrossIcon.stories.tsx +1027 -0
  217. package/dist/icons/cross-icon/index.tsx +24 -0
  218. package/dist/icons/cross-icon/meta.ts +8 -0
  219. package/dist/icons/edit-big-icon/EditBigIcon.stories.tsx +1092 -0
  220. package/dist/icons/edit-big-icon/index.tsx +22 -0
  221. package/dist/icons/edit-big-icon/meta.ts +8 -0
  222. package/dist/icons/eye-close-icon/EyeCloseIcon.stories.tsx +1090 -0
  223. package/dist/icons/eye-close-icon/index.tsx +26 -0
  224. package/dist/icons/eye-close-icon/meta.ts +8 -0
  225. package/dist/icons/eye-open-icon/EyeOpenIcon.stories.tsx +1098 -0
  226. package/dist/icons/eye-open-icon/index.tsx +24 -0
  227. package/dist/icons/eye-open-icon/meta.ts +8 -0
  228. package/dist/icons/feature-shine-icon/FeatureShineIcon.stories.tsx +1071 -0
  229. package/dist/icons/feature-shine-icon/index.tsx +29 -0
  230. package/dist/icons/feature-shine-icon/meta.ts +8 -0
  231. package/dist/icons/file-chart-icon/FileChartIcon.stories.tsx +1115 -0
  232. package/dist/icons/file-chart-icon/index.tsx +24 -0
  233. package/dist/icons/file-chart-icon/meta.ts +8 -0
  234. package/dist/icons/file-text-icon/FileTextIcon.stories.tsx +668 -0
  235. package/dist/icons/file-text-icon/index.tsx +24 -0
  236. package/dist/icons/file-text-icon/meta.ts +8 -0
  237. package/dist/icons/grip-vertical-icon/GripVerticalIcon.stories.tsx +1239 -0
  238. package/dist/icons/grip-vertical-icon/index.tsx +28 -0
  239. package/dist/icons/grip-vertical-icon/meta.ts +8 -0
  240. package/dist/icons/image-icon/ImageIcon.stories.tsx +1181 -0
  241. package/dist/icons/image-icon/index.tsx +24 -0
  242. package/dist/icons/image-icon/meta.ts +8 -0
  243. package/dist/icons/import-folder-icon/ImportFolderIcon.stories.tsx +1248 -0
  244. package/dist/icons/import-folder-icon/index.tsx +22 -0
  245. package/dist/icons/import-folder-icon/meta.ts +8 -0
  246. package/dist/icons/index.ts +46 -0
  247. package/dist/icons/light-bulb-simple-icon/LightBulbSimpleIcon.stories.tsx +1272 -0
  248. package/dist/icons/light-bulb-simple-icon/index.tsx +24 -0
  249. package/dist/icons/light-bulb-simple-icon/meta.ts +8 -0
  250. package/dist/icons/magic-book-icon/MagicBookIcon.stories.tsx +1245 -0
  251. package/dist/icons/magic-book-icon/index.tsx +32 -0
  252. package/dist/icons/magic-book-icon/meta.ts +8 -0
  253. package/dist/icons/maintenance-icon/MaintenanceIcon.stories.tsx +1251 -0
  254. package/dist/icons/maintenance-icon/index.tsx +23 -0
  255. package/dist/icons/maintenance-icon/meta.ts +8 -0
  256. package/dist/icons/message-icon/MessageIcon.stories.tsx +595 -0
  257. package/dist/icons/message-icon/index.tsx +30 -0
  258. package/dist/icons/message-icon/meta.ts +8 -0
  259. package/dist/icons/move-horizontal-icon/MoveHorizontalIcon.stories.tsx +1245 -0
  260. package/dist/icons/move-horizontal-icon/index.tsx +23 -0
  261. package/dist/icons/move-horizontal-icon/meta.ts +8 -0
  262. package/dist/icons/move-vertical-icon/MoveVerticalIcon.stories.tsx +1196 -0
  263. package/dist/icons/move-vertical-icon/index.tsx +23 -0
  264. package/dist/icons/move-vertical-icon/meta.ts +8 -0
  265. package/dist/icons/page-search-icon/PageSearchIcon.stories.tsx +1167 -0
  266. package/dist/icons/page-search-icon/index.tsx +21 -0
  267. package/dist/icons/page-search-icon/meta.ts +8 -0
  268. package/dist/icons/pencil-icon/PencilIcon.stories.tsx +1131 -0
  269. package/dist/icons/pencil-icon/index.tsx +21 -0
  270. package/dist/icons/pencil-icon/meta.ts +8 -0
  271. package/dist/icons/plus-icon/PlusIcon.stories.tsx +1151 -0
  272. package/dist/icons/plus-icon/index.tsx +24 -0
  273. package/dist/icons/plus-icon/meta.ts +8 -0
  274. package/dist/icons/search-icon/SearchIcon.stories.tsx +1181 -0
  275. package/dist/icons/search-icon/index.tsx +24 -0
  276. package/dist/icons/search-icon/meta.ts +8 -0
  277. package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +1167 -0
  278. package/dist/icons/site-logo-icon/index.tsx +79 -0
  279. package/dist/icons/site-logo-icon/meta.ts +8 -0
  280. package/dist/icons/spinner-gradient-icon/SpinnerGradientIcon.stories.tsx +637 -0
  281. package/dist/icons/spinner-gradient-icon/index.tsx +53 -0
  282. package/dist/icons/spinner-gradient-icon/meta.ts +8 -0
  283. package/dist/icons/spinner-solid-icon/SpinnerSolidIcon.stories.tsx +644 -0
  284. package/dist/icons/spinner-solid-icon/index.tsx +59 -0
  285. package/dist/icons/spinner-solid-icon/meta.ts +8 -0
  286. package/dist/icons/spinner-solid-neutral-icon/SpinnerSolidINeutralcon.stories.tsx +736 -0
  287. package/dist/icons/spinner-solid-neutral-icon/index.tsx +53 -0
  288. package/dist/icons/spinner-solid-neutral-icon/meta.ts +8 -0
  289. package/dist/icons/tick-circle-icon/TickCircleIcon.stories.tsx +1204 -0
  290. package/dist/icons/tick-circle-icon/index.tsx +23 -0
  291. package/dist/icons/tick-circle-icon/meta.ts +8 -0
  292. package/dist/icons/tick-icon/TickIcon.stories.tsx +1340 -0
  293. package/dist/icons/tick-icon/index.tsx +24 -0
  294. package/dist/icons/tick-icon/meta.ts +8 -0
  295. package/dist/icons/trash-icon/TrashIcon.stories.tsx +996 -0
  296. package/dist/icons/trash-icon/index.tsx +24 -0
  297. package/dist/icons/trash-icon/meta.ts +8 -0
  298. package/dist/icons/upload-icon/UploadIcon.stories.tsx +947 -0
  299. package/dist/icons/upload-icon/index.tsx +24 -0
  300. package/dist/icons/upload-icon/meta.ts +8 -0
  301. package/dist/icons/vertical-menu-icon/VerticalMenuIcon.stories.tsx +1045 -0
  302. package/dist/icons/vertical-menu-icon/index.tsx +27 -0
  303. package/dist/icons/vertical-menu-icon/meta.ts +8 -0
  304. package/dist/index.d.ts +6 -0
  305. package/dist/index.js +206 -0
  306. package/dist/lib/utils.ts +6 -0
  307. package/dist/styles/aural-theme.css +1008 -0
  308. package/package.json +142 -0
@@ -0,0 +1,1037 @@
1
+ import React from "react"
2
+ import { Button } from "@components/button"
3
+ import Input from "@components/input"
4
+ import { Label } from "@components/label"
5
+ import type { Meta, StoryObj } from "@storybook/react"
6
+
7
+ import { FeatureShineIcon } from "src/ui/icons"
8
+
9
+ import {
10
+ Popover,
11
+ PopoverAnchor,
12
+ PopoverArrow,
13
+ PopoverClose,
14
+ PopoverContent,
15
+ PopoverTrigger,
16
+ } from "."
17
+ import { IconButton } from "../icon-button"
18
+
19
+ const meta: Meta<typeof Popover> = {
20
+ title: "Components/UI/Popover",
21
+ component: Popover,
22
+ parameters: {
23
+ layout: "centered",
24
+ backgrounds: {
25
+ default: "dark",
26
+ values: [
27
+ { name: "dark", value: "#0a0a0a" },
28
+ { name: "light", value: "#ffffff" },
29
+ ],
30
+ },
31
+ docs: {
32
+ description: {
33
+ component: `
34
+ A comprehensive popover component system built on Radix UI with dark theme optimization.
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
+ `,
53
+ },
54
+ },
55
+ },
56
+ tags: ["autodocs"],
57
+ }
58
+
59
+ export default meta
60
+ type Story = StoryObj<typeof meta>
61
+
62
+ // 1. Popover Root Component Example
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>
87
+
88
+ {/* Controlled Popover */}
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
+ ),
119
+ parameters: {
120
+ docs: {
121
+ description: {
122
+ story:
123
+ "The Popover root component with different configuration options: uncontrolled, default state, and modal behavior.",
124
+ },
125
+ },
126
+ },
127
+ }
128
+
129
+ // 2. PopoverTrigger Component Examples
130
+ export const PopoverTriggerVariants: Story = {
131
+ render: () => (
132
+ <div className="space-y-6">
133
+ <div className="text-center">
134
+ <h3 className="mb-2 font-medium text-white">PopoverTrigger Variants</h3>
135
+ <p className="text-sm text-white/60">
136
+ Different types of trigger elements using asChild prop
137
+ </p>
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 */}
188
+ <Popover>
189
+ <PopoverTrigger asChild>
190
+ <IconButton
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>
201
+ </PopoverTrigger>
202
+ <PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
203
+ <div className="p-3">
204
+ <p className="text-sm text-white">Triggered by an avatar image</p>
205
+ </div>
206
+ </PopoverContent>
207
+ </Popover>
208
+ </div>
209
+ </div>
210
+ ),
211
+ parameters: {
212
+ docs: {
213
+ description: {
214
+ story:
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>
230
+ </div>
231
+
232
+ <div className="flex flex-wrap justify-center gap-4">
233
+ {/* Simple Content */}
234
+ <Popover>
235
+ <PopoverTrigger asChild>
236
+ <Button variant="outline" size="sm">
237
+ Simple Content
238
+ </Button>
239
+ </PopoverTrigger>
240
+ <PopoverContent className="w-56 rounded-lg border border-white/10 shadow-2xl">
241
+ <div className="p-3">
242
+ <p className="text-sm text-white">
243
+ Simple text content in a popover.
244
+ </p>
245
+ </div>
246
+ </PopoverContent>
247
+ </Popover>
248
+
249
+ {/* Rich Content */}
250
+ <Popover>
251
+ <PopoverTrigger asChild>
252
+ <Button variant="outline" size="sm">
253
+ Rich Content
254
+ </Button>
255
+ </PopoverTrigger>
256
+ <PopoverContent className="w-72 rounded-lg border border-white/10 shadow-2xl">
257
+ <div className="space-y-3 p-4">
258
+ <div className="flex items-center gap-3">
259
+ <div className="flex h-10 w-10 items-center justify-center rounded-full bg-blue-600">
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.
269
+ </p>
270
+ </div>
271
+ </PopoverContent>
272
+ </Popover>
273
+
274
+ {/* Custom Styled Content */}
275
+ <Popover>
276
+ <PopoverTrigger asChild>
277
+ <Button variant="outline" size="sm">
278
+ Custom Style
279
+ </Button>
280
+ </PopoverTrigger>
281
+ <PopoverContent className="w-64 rounded-lg border border-purple-500/30 bg-gradient-to-b from-purple-900/90 to-blue-900/90 shadow-2xl">
282
+ <div className="p-4">
283
+ <h4 className="mb-2 font-medium text-white">Custom Theme</h4>
284
+ <p className="text-sm text-purple-200">
285
+ PopoverContent with custom gradient background and purple theme.
286
+ </p>
287
+ </div>
288
+ </PopoverContent>
289
+ </Popover>
290
+
291
+ {/* No Border Content */}
292
+ <Popover>
293
+ <PopoverTrigger asChild>
294
+ <Button variant="outline" size="sm">
295
+ No Border
296
+ </Button>
297
+ </PopoverTrigger>
298
+ <PopoverContent className="w-56 rounded-xl bg-gray-800 shadow-2xl">
299
+ <div className="p-4">
300
+ <p className="text-sm text-white">
301
+ Content without border, just shadow and background.
302
+ </p>
303
+ </div>
304
+ </PopoverContent>
305
+ </Popover>
306
+ </div>
307
+ </div>
308
+ ),
309
+ parameters: {
310
+ docs: {
311
+ description: {
312
+ story:
313
+ "PopoverContent examples with different styling approaches: simple, rich content, custom themes, and borderless variants.",
314
+ },
315
+ },
316
+ },
317
+ }
318
+
319
+ // 4. PopoverAnchor Component Example
320
+ export const PopoverAnchorExample: Story = {
321
+ render: () => {
322
+ const [anchorEl, setAnchorEl] = React.useState<HTMLDivElement | null>(null)
323
+
324
+ return (
325
+ <div className="space-y-6">
326
+ <div className="text-center">
327
+ <h3 className="mb-2 font-medium text-white">
328
+ PopoverAnchor Component
329
+ </h3>
330
+ <p className="text-sm text-white/60">
331
+ Position popover relative to a different element than the trigger
332
+ </p>
333
+ </div>
334
+
335
+ <div className="flex items-center justify-center gap-8">
336
+ {/* Anchor Target */}
337
+ <div
338
+ ref={setAnchorEl}
339
+ className="flex h-20 w-20 items-center justify-center rounded-lg border-2 border-dashed border-blue-400 bg-gradient-to-br from-blue-500 to-purple-600"
340
+ >
341
+ <span className="text-center text-xs font-medium text-white">
342
+ Anchor
343
+ <br />
344
+ Point
345
+ </span>
346
+ </div>
347
+
348
+ {/* Trigger (separate from anchor) */}
349
+ <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
+ <PopoverTrigger asChild>
360
+ <Button variant="outline">Open at Anchor</Button>
361
+ </PopoverTrigger>
362
+ <PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
363
+ <PopoverArrow className="fill-white/10" />
364
+ <div className="space-y-2 p-4">
365
+ <h4 className="font-medium text-white">Anchored Popover</h4>
366
+ <p className="text-sm text-white/70">
367
+ This popover is positioned relative to the blue anchor box,
368
+ not the trigger button.
369
+ </p>
370
+ <div className="rounded bg-white/5 p-2 text-xs text-white/50">
371
+ <strong>Note:</strong> The popover appears near the anchor
372
+ point even though the trigger is elsewhere.
373
+ </div>
374
+ </div>
375
+ </PopoverContent>
376
+ </Popover>
377
+ </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
+ </div>
452
+
453
+ <div className="grid grid-cols-2 gap-6">
454
+ {/* Default Arrow */}
455
+ <Popover>
456
+ <PopoverTrigger asChild>
457
+ <Button variant="outline">Default Arrow</Button>
458
+ </PopoverTrigger>
459
+ <PopoverContent className="rounded-lg border border-white/10 shadow-2xl">
460
+ <PopoverArrow className="fill-white/10" />
461
+ <div className="p-3">
462
+ <p className="text-sm text-white">
463
+ Default semi-transparent arrow
464
+ </p>
465
+ </div>
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
522
+ </p>
523
+ </div>
524
+ </PopoverContent>
525
+ </Popover>
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>
538
+ </div>
539
+
540
+ {/* Arrow Positioning */}
541
+ <div className="mt-8">
542
+ <h4 className="mb-4 text-center font-medium text-white">
543
+ Arrow Positioning
544
+ </h4>
545
+ <div className="flex justify-center gap-4">
546
+ {(["top", "right", "bottom", "left"] as const).map((side) => (
547
+ <Popover key={side}>
548
+ <PopoverTrigger asChild>
549
+ <Button variant="outline" size="sm">
550
+ {side}
551
+ </Button>
552
+ </PopoverTrigger>
553
+ <PopoverContent
554
+ side={side}
555
+ className="rounded-lg border border-white/10 shadow-2xl"
556
+ >
557
+ <PopoverArrow className="fill-white/10" />
558
+ <div className="p-3">
559
+ <p className="text-sm text-white">Arrow on {side}</p>
560
+ </div>
561
+ </PopoverContent>
562
+ </Popover>
563
+ ))}
564
+ </div>
565
+ </div>
566
+ </div>
567
+ ),
568
+ parameters: {
569
+ docs: {
570
+ description: {
571
+ story:
572
+ "PopoverArrow examples showing different styling options: default, solid, colored, large, gradient, and positioning on different sides.",
573
+ },
574
+ },
575
+ },
576
+ }
577
+
578
+ // 6. PopoverClose Component Examples
579
+ export const PopoverCloseVariants: Story = {
580
+ render: () => (
581
+ <div className="space-y-6">
582
+ <div className="text-center">
583
+ <h3 className="mb-2 font-medium text-white">PopoverClose Variants</h3>
584
+ <p className="text-sm text-white/60">
585
+ Different ways to implement close functionality
586
+ </p>
587
+ </div>
588
+
589
+ <div className="grid grid-cols-2 gap-4">
590
+ {/* Close Button in Header */}
591
+ <Popover>
592
+ <PopoverTrigger asChild>
593
+ <Button variant="outline">Header Close</Button>
594
+ </PopoverTrigger>
595
+ <PopoverContent className="w-72 rounded-lg border border-white/10 shadow-2xl">
596
+ <PopoverArrow className="fill-white/10" />
597
+ <div className="p-4">
598
+ <div className="mb-3 flex items-center justify-between">
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
608
+ </p>
609
+ </div>
610
+ </PopoverContent>
611
+ </Popover>
612
+
613
+ {/* Close Button in Footer */}
614
+ <Popover>
615
+ <PopoverTrigger asChild>
616
+ <Button variant="outline">Footer Close</Button>
617
+ </PopoverTrigger>
618
+ <PopoverContent className="w-72 rounded-lg border border-white/10 shadow-2xl">
619
+ <PopoverArrow className="fill-white/10" />
620
+ <div className="space-y-3 p-4">
621
+ <h4 className="font-medium text-white">Confirmation</h4>
622
+ <p className="text-sm text-white/70">
623
+ Are you sure you want to continue?
624
+ </p>
625
+ <div className="flex gap-2">
626
+ <Button size="sm">Confirm</Button>
627
+ <PopoverClose asChild>
628
+ <Button size="sm" variant="outline">
629
+ Cancel
630
+ </Button>
631
+ </PopoverClose>
632
+ </div>
633
+ </div>
634
+ </PopoverContent>
635
+ </Popover>
636
+
637
+ {/* Multiple Close Options */}
638
+ <Popover>
639
+ <PopoverTrigger asChild>
640
+ <Button variant="outline">Multiple Close</Button>
641
+ </PopoverTrigger>
642
+ <PopoverContent className="w-80 rounded-lg border border-white/10 shadow-2xl">
643
+ <PopoverArrow className="fill-white/10" />
644
+ <div className="space-y-4 p-4">
645
+ <div className="flex items-center justify-between">
646
+ <h4 className="font-medium text-white">Actions</h4>
647
+ <PopoverClose asChild>
648
+ <Button variant="text" size="sm">
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>
660
+ <PopoverClose asChild>
661
+ <button className="w-full rounded px-3 py-2 text-left text-sm text-white hover:bg-white/10">
662
+ Discard and Close
663
+ </button>
664
+ </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
+ </div>
669
+ </div>
670
+ </PopoverContent>
671
+ </Popover>
672
+
673
+ {/* Icon Close Button */}
674
+ <Popover>
675
+ <PopoverTrigger asChild>
676
+ <Button variant="outline">Icon Close</Button>
677
+ </PopoverTrigger>
678
+ <PopoverContent className="w-64 rounded-lg border border-white/10 shadow-2xl">
679
+ <PopoverArrow className="fill-white/10" />
680
+ <div className="p-4">
681
+ <div className="mb-3 flex items-start justify-between">
682
+ <div>
683
+ <h4 className="font-medium text-white">Notification</h4>
684
+ <p className="mt-1 text-sm text-white/70">
685
+ New message received
686
+ </p>
687
+ </div>
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!
726
+ </button>
727
+ </PopoverClose>
728
+ </div>
729
+ </div>
730
+ </PopoverContent>
731
+ </Popover>
732
+
733
+ {/* Auto-close on Action */}
734
+ <Popover>
735
+ <PopoverTrigger asChild>
736
+ <Button variant="outline">Auto Close</Button>
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>
763
+ </div>
764
+ <p className="text-xs text-white/50">
765
+ Actions will close the popover automatically
766
+ </p>
767
+ </div>
768
+ </PopoverContent>
769
+ </Popover>
770
+ </div>
771
+ </div>
772
+ ),
773
+ parameters: {
774
+ docs: {
775
+ description: {
776
+ story:
777
+ "PopoverClose examples showing different implementation patterns: header close, footer close, multiple options, icon buttons, text links, and auto-close actions.",
778
+ },
779
+ },
780
+ },
781
+ }
782
+
783
+ // 7. Complete Integration Example
784
+ export const CompleteIntegration: Story = {
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 */}
796
+ <Popover>
797
+ <PopoverTrigger asChild>
798
+ <Button variant="text">
799
+ <img
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>
818
+ </Button>
819
+ </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" />
825
+ <div className="space-y-4 p-4">
826
+ {/* Header with close */}
827
+ <div className="flex items-center justify-between">
828
+ <h4 className="font-medium text-white">Account Menu</h4>
829
+ <PopoverClose asChild>
830
+ <Button variant="text" size="sm">
831
+
832
+ </Button>
833
+ </PopoverClose>
834
+ </div>
835
+
836
+ {/* User Info */}
837
+ <div className="flex items-center gap-3 rounded-lg bg-white/5 p-3">
838
+ <img
839
+ src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=48&h=48&fit=crop&crop=face"
840
+ alt="Profile"
841
+ className="h-12 w-12 rounded-full border border-white/20"
842
+ />
843
+ <div>
844
+ <div className="font-medium text-white">John Doe</div>
845
+ <div className="text-sm text-white/60">john@example.com</div>
846
+ </div>
847
+ </div>
848
+
849
+ {/* Quick Actions */}
850
+ <div className="grid grid-cols-2 gap-2">
851
+ <PopoverClose asChild>
852
+ <Button size="sm" variant="outline">
853
+ Profile
854
+ </Button>
855
+ </PopoverClose>
856
+ <PopoverClose asChild>
857
+ <Button size="sm" variant="outline">
858
+ Settings
859
+ </Button>
860
+ </PopoverClose>
861
+ </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
+ </div>
943
+ </PopoverContent>
944
+ </Popover>
945
+
946
+ {/* Complete Form Editor */}
947
+ <Popover>
948
+ <PopoverTrigger asChild>
949
+ <Button>Edit Profile</Button>
950
+ </PopoverTrigger>
951
+ <PopoverContent className="w-96 rounded-lg border border-white/10 shadow-2xl">
952
+ <PopoverArrow className="fill-white/10" />
953
+ <div className="space-y-4 p-4">
954
+ {/* Header */}
955
+ <div className="flex items-center justify-between">
956
+ <h4 className="font-medium text-white">Edit Profile</h4>
957
+ <PopoverClose asChild>
958
+ <Button variant="text" size="sm">
959
+
960
+ </Button>
961
+ </PopoverClose>
962
+ </div>
963
+
964
+ {/* Form Fields */}
965
+ <div className="space-y-3">
966
+ <div>
967
+ <Label htmlFor="name" className="text-sm text-white/90">
968
+ Full Name
969
+ </Label>
970
+ <Input
971
+ id="name"
972
+ defaultValue="John Doe"
973
+ className="border-white/20 bg-white/5 text-white placeholder:text-white/40"
974
+ />
975
+ </div>
976
+ <div>
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>
998
+ </div>
999
+ <div>
1000
+ <Label htmlFor="bio" className="text-sm text-white/90">
1001
+ Bio
1002
+ </Label>
1003
+ <textarea
1004
+ id="bio"
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
+ />
1009
+ </div>
1010
+ </div>
1011
+
1012
+ {/* Action Buttons */}
1013
+ <div className="flex gap-2 pt-2">
1014
+ <PopoverClose asChild>
1015
+ <Button size="sm">Save Changes</Button>
1016
+ </PopoverClose>
1017
+ <PopoverClose asChild>
1018
+ <Button size="sm" variant="outline">
1019
+ Cancel
1020
+ </Button>
1021
+ </PopoverClose>
1022
+ </div>
1023
+ </div>
1024
+ </PopoverContent>
1025
+ </Popover>
1026
+ </div>
1027
+ </div>
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
+ },
1036
+ },
1037
+ }