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,1210 @@
1
+ import React, { useState } from "react"
2
+ import { Button } from "@components/button"
3
+ import { IconButton } from "@components/icon-button"
4
+ import {
5
+ AlertIcon,
6
+ AngleDownIcon,
7
+ ArrowRightIcon,
8
+ AudioBarIcon,
9
+ ChevronDownIcon,
10
+ CrossIcon,
11
+ EditBigIcon,
12
+ EyeCloseIcon,
13
+ EyeOpenIcon,
14
+ FileChartIcon,
15
+ ImageIcon,
16
+ PlusIcon,
17
+ SearchIcon,
18
+ SiteLogoIcon,
19
+ TickIcon,
20
+ TrashIcon,
21
+ UploadIcon,
22
+ } from "@icons/index"
23
+ import type { Meta, StoryObj } from "@storybook/react"
24
+
25
+ import {
26
+ DropdownArrow,
27
+ DropdownMenu,
28
+ DropdownMenuCheckboxItem,
29
+ DropdownMenuContent,
30
+ DropdownMenuGroup,
31
+ DropdownMenuItem,
32
+ DropdownMenuLabel,
33
+ DropdownMenuRadioGroup,
34
+ DropdownMenuRadioItem,
35
+ DropdownMenuSeparator,
36
+ DropdownMenuShortcut,
37
+ DropdownMenuSub,
38
+ DropdownMenuSubContent,
39
+ DropdownMenuSubTrigger,
40
+ DropdownMenuTrigger,
41
+ } from "."
42
+
43
+ const meta: Meta<typeof DropdownMenu> = {
44
+ title: "Components/UI/Dropdown",
45
+ component: DropdownMenu,
46
+ parameters: {
47
+ layout: "centered",
48
+ backgrounds: {
49
+ default: "dark",
50
+ values: [
51
+ { name: "dark", value: "#0a0a0a" },
52
+ { name: "light", value: "#ffffff" },
53
+ ],
54
+ },
55
+ docs: {
56
+ description: {
57
+ component: `
58
+ # Dropdown Menu Component
59
+
60
+ A comprehensive dropdown menu component system built on Radix UI with dark theme optimization and frosted glass effects.
61
+
62
+ ## Features
63
+
64
+ - **Dark Theme Optimized**: Frosted glass background with gradient borders
65
+ - **Flexible Content**: Support for items, labels, separators, checkboxes, and radio groups
66
+ - **Nested Menus**: Sub-menu support with hover triggers
67
+ - **Icon Integration**: Built-in icon support with proper sizing and theming
68
+ - **Keyboard Navigation**: Full accessibility with arrow keys and shortcuts
69
+ - **Custom Styling**: Granular control via \`classes\` prop
70
+ - **Smooth Animations**: Direction-aware entrance/exit animations
71
+ - **Portal Rendering**: Proper z-index layering and positioning
72
+ - **Logical Grouping**: Use \`DropdownMenuGroup\` for semantic organization
73
+
74
+ ## Component Structure
75
+
76
+ - **DropdownMenu**: Root container managing state
77
+ - **DropdownMenuTrigger**: Interactive element that opens the menu
78
+ - **DropdownMenuContent**: The floating menu panel with frosted glass effect
79
+ - **DropdownMenuItem**: Standard menu item with optional variants
80
+ - **DropdownMenuGroup**: Groups related menu items together
81
+ - **DropdownMenuLabel**: Section headers and labels
82
+ - **DropdownMenuSeparator**: Visual dividers between sections
83
+ - **DropdownMenuCheckboxItem**: Checkable items with indicators
84
+ - **DropdownMenuRadioGroup/RadioItem**: Radio button groups
85
+ - **DropdownMenuSub/SubTrigger/SubContent**: Nested sub-menus
86
+ - **DropdownMenuShortcut**: Keyboard shortcut display
87
+
88
+ ## Usage Examples
89
+
90
+ ### Basic Menu with Groups
91
+ \`\`\`tsx
92
+ <DropdownMenu>
93
+ <DropdownMenuTrigger asChild>
94
+ <Button>Open Menu</Button>
95
+ </DropdownMenuTrigger>
96
+ <DropdownMenuContent>
97
+ <DropdownMenuGroup>
98
+ <DropdownMenuItem>Edit</DropdownMenuItem>
99
+ <DropdownMenuItem>Copy</DropdownMenuItem>
100
+ </DropdownMenuGroup>
101
+ <DropdownMenuSeparator />
102
+ <DropdownMenuGroup>
103
+ <DropdownMenuItem variant="destructive">Delete</DropdownMenuItem>
104
+ </DropdownMenuGroup>
105
+ </DropdownMenuContent>
106
+ </DropdownMenu>
107
+ \`\`\`
108
+
109
+ ### With Custom Styling
110
+ \`\`\`tsx
111
+ <DropdownMenuContent
112
+ classes={{
113
+ root: "bg-blue-900/20",
114
+ border: "bg-gradient-to-r from-blue-500 to-purple-500"
115
+ }}
116
+ >
117
+ <DropdownMenuItem
118
+ classes={{
119
+ root: "text-blue-400 hover:bg-blue-500/20"
120
+ }}
121
+ >
122
+ Custom Item
123
+ </DropdownMenuItem>
124
+ </DropdownMenuContent>
125
+ \`\`\`
126
+ `,
127
+ },
128
+ },
129
+ },
130
+ tags: ["autodocs"],
131
+ }
132
+
133
+ export default meta
134
+ type Story = StoryObj<typeof DropdownMenu>
135
+
136
+ // 1. Basic Dropdown Examples
137
+ export const BasicDropdown: Story = {
138
+ render: () => (
139
+ <div className="space-y-8">
140
+ <div className="text-center">
141
+ <h3 className="mb-2 font-medium text-white">Basic Dropdown Menus</h3>
142
+ <p className="text-sm text-white/60">
143
+ Simple dropdown menus with different trigger styles and grouped
144
+ content
145
+ </p>
146
+ </div>
147
+
148
+ <div className="flex flex-wrap items-start justify-center gap-4">
149
+ {/* Basic Button Trigger */}
150
+ <DropdownMenu>
151
+ <DropdownMenuTrigger asChild>
152
+ <Button variant="outline" className="gap-2">
153
+ <SiteLogoIcon className="h-4 w-4" />
154
+ Options
155
+ <ChevronDownIcon className="h-4 w-4" />
156
+ </Button>
157
+ </DropdownMenuTrigger>
158
+ <DropdownMenuContent>
159
+ <DropdownMenuGroup>
160
+ <DropdownMenuItem>
161
+ <EditBigIcon className="h-4 w-4" />
162
+ Edit
163
+ </DropdownMenuItem>
164
+ <DropdownMenuItem>
165
+ <TickIcon className="h-4 w-4" />
166
+ Copy
167
+ </DropdownMenuItem>
168
+ </DropdownMenuGroup>
169
+ <DropdownMenuSeparator />
170
+ <DropdownMenuGroup>
171
+ <DropdownMenuItem variant="destructive">
172
+ <TrashIcon className="h-4 w-4" />
173
+ Delete
174
+ </DropdownMenuItem>
175
+ </DropdownMenuGroup>
176
+ </DropdownMenuContent>
177
+ </DropdownMenu>
178
+
179
+ {/* Icon Button Trigger */}
180
+ <DropdownMenu>
181
+ <DropdownMenuTrigger asChild>
182
+ <IconButton variant="ghost" icon={<AlertIcon />} label="" />
183
+ </DropdownMenuTrigger>
184
+ <DropdownMenuContent>
185
+ <DropdownMenuGroup>
186
+ <DropdownMenuItem>
187
+ <ArrowRightIcon className="h-4 w-4" />
188
+ Share
189
+ </DropdownMenuItem>
190
+ <DropdownMenuItem>
191
+ <TickIcon className="h-4 w-4" />
192
+ Favorite
193
+ </DropdownMenuItem>
194
+ <DropdownMenuItem>
195
+ <TickIcon className="h-4 w-4" />
196
+ Copy Link
197
+ </DropdownMenuItem>
198
+ </DropdownMenuGroup>
199
+ </DropdownMenuContent>
200
+ </DropdownMenu>
201
+
202
+ {/* User Menu */}
203
+ <DropdownMenu>
204
+ <DropdownMenuTrigger asChild>
205
+ <Button variant="text" className="gap-2">
206
+ <SiteLogoIcon className="h-4 w-4" />
207
+ Account
208
+ <ChevronDownIcon className="h-4 w-4" />
209
+ </Button>
210
+ </DropdownMenuTrigger>
211
+ <DropdownMenuContent align="end">
212
+ <DropdownMenuLabel>My Account</DropdownMenuLabel>
213
+ <DropdownMenuSeparator />
214
+ <DropdownMenuGroup>
215
+ <DropdownMenuItem>
216
+ <SiteLogoIcon className="h-4 w-4" />
217
+ Profile
218
+ </DropdownMenuItem>
219
+ <DropdownMenuItem>
220
+ <SiteLogoIcon className="h-4 w-4" />
221
+ Settings
222
+ </DropdownMenuItem>
223
+ </DropdownMenuGroup>
224
+ <DropdownMenuSeparator />
225
+ <DropdownMenuGroup>
226
+ <DropdownMenuItem variant="destructive">
227
+ <CrossIcon className="h-4 w-4" />
228
+ Log out
229
+ </DropdownMenuItem>
230
+ </DropdownMenuGroup>
231
+ </DropdownMenuContent>
232
+ </DropdownMenu>
233
+ </div>
234
+ </div>
235
+ ),
236
+ parameters: {
237
+ docs: {
238
+ description: {
239
+ story:
240
+ "Basic dropdown menu examples with different trigger styles and grouped content using DropdownMenuGroup.",
241
+ },
242
+ },
243
+ },
244
+ }
245
+
246
+ // 2. Interactive States
247
+ export const InteractiveStates: Story = {
248
+ render: () => {
249
+ const [notifications, setNotifications] = useState(true)
250
+ const [marketing, setMarketing] = useState(false)
251
+ const [theme, setTheme] = useState("dark")
252
+
253
+ return (
254
+ <div className="space-y-8">
255
+ <div className="text-center">
256
+ <h3 className="mb-2 font-medium text-white">Interactive States</h3>
257
+ <p className="text-sm text-white/60">
258
+ Checkboxes, radio groups, and stateful interactions with logical
259
+ grouping
260
+ </p>
261
+ </div>
262
+
263
+ <div className="flex flex-wrap justify-center gap-4">
264
+ {/* Checkbox Menu */}
265
+ <DropdownMenu>
266
+ <DropdownMenuTrigger asChild>
267
+ <Button variant="outline" className="gap-2">
268
+ <AlertIcon className="h-4 w-4" />
269
+ Notifications
270
+ <ChevronDownIcon className="h-4 w-4" />
271
+ </Button>
272
+ </DropdownMenuTrigger>
273
+ <DropdownMenuContent>
274
+ <DropdownMenuLabel>Email Preferences</DropdownMenuLabel>
275
+ <DropdownMenuSeparator />
276
+ <DropdownMenuGroup>
277
+ <DropdownMenuCheckboxItem
278
+ checked={notifications}
279
+ onCheckedChange={setNotifications}
280
+ >
281
+ System Notifications
282
+ </DropdownMenuCheckboxItem>
283
+ <DropdownMenuCheckboxItem
284
+ checked={marketing}
285
+ onCheckedChange={setMarketing}
286
+ >
287
+ Marketing Emails
288
+ </DropdownMenuCheckboxItem>
289
+ </DropdownMenuGroup>
290
+ </DropdownMenuContent>
291
+ </DropdownMenu>
292
+
293
+ {/* Radio Group Menu */}
294
+ <DropdownMenu>
295
+ <DropdownMenuTrigger asChild>
296
+ <Button variant="outline" className="gap-2">
297
+ Theme: {theme}
298
+ <ChevronDownIcon className="h-4 w-4" />
299
+ </Button>
300
+ </DropdownMenuTrigger>
301
+ <DropdownMenuContent>
302
+ <DropdownMenuLabel>Appearance</DropdownMenuLabel>
303
+ <DropdownMenuSeparator />
304
+ <DropdownMenuGroup>
305
+ <DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
306
+ <DropdownMenuRadioItem value="light">
307
+ Light
308
+ </DropdownMenuRadioItem>
309
+ <DropdownMenuRadioItem value="dark">
310
+ Dark
311
+ </DropdownMenuRadioItem>
312
+ <DropdownMenuRadioItem value="system">
313
+ System
314
+ </DropdownMenuRadioItem>
315
+ </DropdownMenuRadioGroup>
316
+ </DropdownMenuGroup>
317
+ </DropdownMenuContent>
318
+ </DropdownMenu>
319
+ </div>
320
+
321
+ {/* State Display */}
322
+ <div className="text-center">
323
+ <div className="inline-block rounded-lg border border-white/10 bg-white/5 p-4">
324
+ <h4 className="mb-2 text-sm font-medium text-white">
325
+ Current State
326
+ </h4>
327
+ <div className="space-y-1 text-xs text-white/60">
328
+ <div>Notifications: {notifications ? "On" : "Off"}</div>
329
+ <div>Marketing: {marketing ? "On" : "Off"}</div>
330
+ <div>Theme: {theme}</div>
331
+ </div>
332
+ </div>
333
+ </div>
334
+ </div>
335
+ )
336
+ },
337
+ parameters: {
338
+ docs: {
339
+ description: {
340
+ story:
341
+ "Interactive dropdown menus with checkboxes, radio groups, and state management using proper grouping.",
342
+ },
343
+ },
344
+ },
345
+ }
346
+
347
+ // 3. Nested Sub-menus
348
+ export const NestedMenus: Story = {
349
+ render: () => (
350
+ <div className="space-y-8">
351
+ <div className="text-center">
352
+ <h3 className="mb-2 font-medium text-white">Nested Sub-menus</h3>
353
+ <p className="text-sm text-white/60">
354
+ Multi-level menus with sub-menu navigation and logical grouping
355
+ </p>
356
+ </div>
357
+
358
+ <div className="flex justify-center">
359
+ <DropdownMenu>
360
+ <DropdownMenuTrigger asChild>
361
+ <Button variant="outline" className="gap-2">
362
+ <PlusIcon className="h-4 w-4" />
363
+ Create New
364
+ <ChevronDownIcon className="h-4 w-4" />
365
+ </Button>
366
+ </DropdownMenuTrigger>
367
+ <DropdownMenuContent>
368
+ <DropdownMenuLabel>Create</DropdownMenuLabel>
369
+ <DropdownMenuSeparator />
370
+
371
+ <DropdownMenuGroup>
372
+ <DropdownMenuSub>
373
+ <DropdownMenuSubTrigger>
374
+ <FileChartIcon className="h-4 w-4" />
375
+ Folder
376
+ </DropdownMenuSubTrigger>
377
+ <DropdownMenuSubContent>
378
+ <DropdownMenuGroup>
379
+ <DropdownMenuItem>
380
+ <FileChartIcon className="h-4 w-4" />
381
+ Project Folder
382
+ </DropdownMenuItem>
383
+ <DropdownMenuItem>
384
+ <FileChartIcon className="h-4 w-4" />
385
+ Asset Folder
386
+ </DropdownMenuItem>
387
+ <DropdownMenuItem>
388
+ <FileChartIcon className="h-4 w-4" />
389
+ Template Folder
390
+ </DropdownMenuItem>
391
+ </DropdownMenuGroup>
392
+ </DropdownMenuSubContent>
393
+ </DropdownMenuSub>
394
+
395
+ <DropdownMenuSub>
396
+ <DropdownMenuSubTrigger>
397
+ <FileChartIcon className="h-4 w-4" />
398
+ Document
399
+ </DropdownMenuSubTrigger>
400
+ <DropdownMenuSubContent>
401
+ <DropdownMenuGroup>
402
+ <DropdownMenuItem>
403
+ <FileChartIcon className="h-4 w-4" />
404
+ Text Document
405
+ </DropdownMenuItem>
406
+ <DropdownMenuItem>
407
+ <FileChartIcon className="h-4 w-4" />
408
+ Spreadsheet
409
+ </DropdownMenuItem>
410
+ <DropdownMenuItem>
411
+ <FileChartIcon className="h-4 w-4" />
412
+ Presentation
413
+ </DropdownMenuItem>
414
+ </DropdownMenuGroup>
415
+ <DropdownMenuSeparator />
416
+ <DropdownMenuGroup>
417
+ <DropdownMenuItem>
418
+ <ImageIcon className="h-4 w-4" />
419
+ From Template
420
+ </DropdownMenuItem>
421
+ </DropdownMenuGroup>
422
+ </DropdownMenuSubContent>
423
+ </DropdownMenuSub>
424
+ </DropdownMenuGroup>
425
+
426
+ <DropdownMenuSeparator />
427
+ <DropdownMenuGroup>
428
+ <DropdownMenuItem>
429
+ <UploadIcon className="h-4 w-4" />
430
+ Upload File
431
+ </DropdownMenuItem>
432
+ </DropdownMenuGroup>
433
+ </DropdownMenuContent>
434
+ </DropdownMenu>
435
+ </div>
436
+ </div>
437
+ ),
438
+ parameters: {
439
+ docs: {
440
+ description: {
441
+ story:
442
+ "Nested dropdown menus with sub-menu triggers and multi-level navigation using DropdownMenuGroup for organization.",
443
+ },
444
+ },
445
+ },
446
+ }
447
+
448
+ // 4. Keyboard Shortcuts
449
+ export const KeyboardShortcuts: Story = {
450
+ render: () => (
451
+ <div className="space-y-8">
452
+ <div className="text-center">
453
+ <h3 className="mb-2 font-medium text-white">Keyboard Shortcuts</h3>
454
+ <p className="text-sm text-white/60">
455
+ Menu items with keyboard shortcut indicators and logical grouping
456
+ </p>
457
+ </div>
458
+
459
+ <div className="flex justify-center">
460
+ <DropdownMenu>
461
+ <DropdownMenuTrigger asChild>
462
+ <Button variant="outline" className="gap-2">
463
+ <EditBigIcon className="h-4 w-4" />
464
+ Edit Menu
465
+ <ChevronDownIcon className="h-4 w-4" />
466
+ </Button>
467
+ </DropdownMenuTrigger>
468
+ <DropdownMenuContent className="w-56">
469
+ <DropdownMenuLabel>Edit</DropdownMenuLabel>
470
+ <DropdownMenuSeparator />
471
+
472
+ <DropdownMenuGroup>
473
+ <DropdownMenuItem>
474
+ <EditBigIcon className="h-4 w-4" />
475
+ Undo
476
+ <DropdownMenuShortcut>⌘Z</DropdownMenuShortcut>
477
+ </DropdownMenuItem>
478
+ <DropdownMenuItem>
479
+ <EditBigIcon className="h-4 w-4" />
480
+ Redo
481
+ <DropdownMenuShortcut>⌘⇧Z</DropdownMenuShortcut>
482
+ </DropdownMenuItem>
483
+ </DropdownMenuGroup>
484
+
485
+ <DropdownMenuSeparator />
486
+
487
+ <DropdownMenuGroup>
488
+ <DropdownMenuItem>
489
+ <TickIcon className="h-4 w-4" />
490
+ Cut
491
+ <DropdownMenuShortcut>⌘X</DropdownMenuShortcut>
492
+ </DropdownMenuItem>
493
+ <DropdownMenuItem>
494
+ <TickIcon className="h-4 w-4" />
495
+ Copy
496
+ <DropdownMenuShortcut>⌘C</DropdownMenuShortcut>
497
+ </DropdownMenuItem>
498
+ <DropdownMenuItem>
499
+ <TickIcon className="h-4 w-4" />
500
+ Paste
501
+ <DropdownMenuShortcut>⌘V</DropdownMenuShortcut>
502
+ </DropdownMenuItem>
503
+ </DropdownMenuGroup>
504
+
505
+ <DropdownMenuSeparator />
506
+
507
+ <DropdownMenuGroup>
508
+ <DropdownMenuItem>
509
+ Select All
510
+ <DropdownMenuShortcut>⌘A</DropdownMenuShortcut>
511
+ </DropdownMenuItem>
512
+ <DropdownMenuItem>
513
+ <SearchIcon className="h-4 w-4" />
514
+ Find
515
+ <DropdownMenuShortcut>⌘F</DropdownMenuShortcut>
516
+ </DropdownMenuItem>
517
+ </DropdownMenuGroup>
518
+ </DropdownMenuContent>
519
+ </DropdownMenu>
520
+ </div>
521
+ </div>
522
+ ),
523
+ parameters: {
524
+ docs: {
525
+ description: {
526
+ story:
527
+ "Dropdown menu with keyboard shortcut indicators for common actions, organized with DropdownMenuGroup.",
528
+ },
529
+ },
530
+ },
531
+ }
532
+
533
+ // 5. Custom Styling
534
+ export const CustomStyling: Story = {
535
+ render: () => (
536
+ <div className="space-y-8">
537
+ <div className="text-center">
538
+ <h3 className="mb-2 font-medium text-white">Custom Styling</h3>
539
+ <p className="text-sm text-white/60">
540
+ Dropdown menus with custom styling using the classes prop
541
+ </p>
542
+ </div>
543
+
544
+ <div className="flex flex-wrap justify-center gap-4">
545
+ {/* Blue Theme */}
546
+ <DropdownMenu>
547
+ <DropdownMenuTrigger asChild>
548
+ <Button>Blue Theme</Button>
549
+ </DropdownMenuTrigger>
550
+ <DropdownMenuContent
551
+ classes={{
552
+ root: "bg-blue-900/40 border-blue-500/20",
553
+ border: "bg-gradient-to-r from-blue-500 to-cyan-500",
554
+ }}
555
+ >
556
+ <DropdownMenuGroup>
557
+ <DropdownMenuItem
558
+ classes={{
559
+ root: "text-blue-200 hover:bg-blue-500/20 focus:bg-blue-500/20",
560
+ }}
561
+ >
562
+ <TickIcon className="h-4 w-4" />
563
+ Blue Item
564
+ </DropdownMenuItem>
565
+ <DropdownMenuItem
566
+ classes={{
567
+ root: "text-blue-200 hover:bg-blue-500/20 focus:bg-blue-500/20",
568
+ }}
569
+ >
570
+ <AudioBarIcon className="h-4 w-4" />
571
+ Another Item
572
+ </DropdownMenuItem>
573
+ </DropdownMenuGroup>
574
+ </DropdownMenuContent>
575
+ </DropdownMenu>
576
+
577
+ {/* Green Theme */}
578
+ <DropdownMenu>
579
+ <DropdownMenuTrigger asChild>
580
+ <Button>Green Theme</Button>
581
+ </DropdownMenuTrigger>
582
+ <DropdownMenuContent
583
+ classes={{
584
+ root: "bg-green-900/40 border-green-500/20",
585
+ border: "bg-gradient-to-r from-green-500 to-emerald-500",
586
+ }}
587
+ >
588
+ <DropdownMenuGroup>
589
+ <DropdownMenuItem
590
+ classes={{
591
+ root: "text-green-200 hover:bg-green-500/20 focus:bg-green-500/20",
592
+ }}
593
+ >
594
+ <TickIcon className="h-4 w-4" />
595
+ Green Item
596
+ </DropdownMenuItem>
597
+ <DropdownMenuItem
598
+ classes={{
599
+ root: "text-green-200 hover:bg-green-500/20 focus:bg-green-500/20",
600
+ }}
601
+ >
602
+ <AudioBarIcon className="h-4 w-4" />
603
+ Success Action
604
+ </DropdownMenuItem>
605
+ </DropdownMenuGroup>
606
+ </DropdownMenuContent>
607
+ </DropdownMenu>
608
+
609
+ {/* Purple Theme */}
610
+ <DropdownMenu>
611
+ <DropdownMenuTrigger asChild>
612
+ <Button>Purple Theme</Button>
613
+ </DropdownMenuTrigger>
614
+ <DropdownMenuContent
615
+ classes={{
616
+ root: "bg-purple-900/40 border-purple-500/20",
617
+ border: "bg-gradient-to-r from-purple-500 to-pink-500",
618
+ }}
619
+ >
620
+ <DropdownMenuGroup>
621
+ <DropdownMenuItem
622
+ classes={{
623
+ root: "text-purple-200 hover:bg-purple-500/20 focus:bg-purple-500/20",
624
+ }}
625
+ >
626
+ <TickIcon className="h-4 w-4" />
627
+ Purple Item
628
+ </DropdownMenuItem>
629
+ <DropdownMenuItem
630
+ classes={{
631
+ root: "text-purple-200 hover:bg-purple-500/20 focus:bg-purple-500/20",
632
+ }}
633
+ >
634
+ <AudioBarIcon className="h-4 w-4" />
635
+ Creative Action
636
+ </DropdownMenuItem>
637
+ </DropdownMenuGroup>
638
+ </DropdownMenuContent>
639
+ </DropdownMenu>
640
+ </div>
641
+ </div>
642
+ ),
643
+ parameters: {
644
+ docs: {
645
+ description: {
646
+ story:
647
+ "Custom styled dropdown menus using the classes prop for theme variations with logical grouping.",
648
+ },
649
+ },
650
+ },
651
+ }
652
+
653
+ // 6. Complex Menu Example
654
+ export const ComplexMenu: Story = {
655
+ render: () => {
656
+ const [bookmarked, setBookmarked] = useState(false)
657
+ const [notifications, setNotifications] = useState(true)
658
+ const [viewMode, setViewMode] = useState("grid")
659
+
660
+ return (
661
+ <div className="space-y-8">
662
+ <div className="text-center">
663
+ <h3 className="mb-2 font-medium text-white">Complex Menu</h3>
664
+ <p className="text-sm text-white/60">
665
+ Full-featured dropdown menu with all component types and logical
666
+ grouping
667
+ </p>
668
+ </div>
669
+
670
+ <div className="flex justify-center">
671
+ <DropdownMenu>
672
+ <DropdownMenuTrigger asChild>
673
+ <Button variant="outline" className="gap-2">
674
+ <AlertIcon className="h-4 w-4" />
675
+ More Actions
676
+ <ChevronDownIcon className="h-4 w-4" />
677
+ </Button>
678
+ </DropdownMenuTrigger>
679
+ <DropdownMenuContent className="w-64">
680
+ {/* Basic Actions Group */}
681
+ <DropdownMenuLabel>Quick Actions</DropdownMenuLabel>
682
+ <DropdownMenuSeparator />
683
+ <DropdownMenuGroup>
684
+ <DropdownMenuItem>
685
+ <EditBigIcon className="h-4 w-4" />
686
+ Edit Item
687
+ <DropdownMenuShortcut>⌘E</DropdownMenuShortcut>
688
+ </DropdownMenuItem>
689
+ <DropdownMenuItem>
690
+ <TickIcon className="h-4 w-4" />
691
+ Duplicate
692
+ <DropdownMenuShortcut>⌘D</DropdownMenuShortcut>
693
+ </DropdownMenuItem>
694
+ <DropdownMenuItem>
695
+ <ArrowRightIcon className="h-4 w-4" />
696
+ Share
697
+ <DropdownMenuShortcut>⌘⇧S</DropdownMenuShortcut>
698
+ </DropdownMenuItem>
699
+ </DropdownMenuGroup>
700
+
701
+ <DropdownMenuSeparator />
702
+
703
+ {/* Options Group */}
704
+ <DropdownMenuLabel>Options</DropdownMenuLabel>
705
+ <DropdownMenuSeparator />
706
+ <DropdownMenuGroup>
707
+ <DropdownMenuCheckboxItem
708
+ checked={bookmarked}
709
+ onCheckedChange={setBookmarked}
710
+ >
711
+ <TickIcon className="h-4 w-4" />
712
+ Bookmark
713
+ </DropdownMenuCheckboxItem>
714
+ <DropdownMenuCheckboxItem
715
+ checked={notifications}
716
+ onCheckedChange={setNotifications}
717
+ >
718
+ <AlertIcon className="h-4 w-4" />
719
+ Enable Notifications
720
+ </DropdownMenuCheckboxItem>
721
+ </DropdownMenuGroup>
722
+
723
+ <DropdownMenuSeparator />
724
+
725
+ {/* View Mode Group */}
726
+ <DropdownMenuLabel>View Mode</DropdownMenuLabel>
727
+ <DropdownMenuSeparator />
728
+ <DropdownMenuGroup>
729
+ <DropdownMenuRadioGroup
730
+ value={viewMode}
731
+ onValueChange={setViewMode}
732
+ >
733
+ <DropdownMenuRadioItem value="grid">
734
+ Grid View
735
+ </DropdownMenuRadioItem>
736
+ <DropdownMenuRadioItem value="list">
737
+ List View
738
+ </DropdownMenuRadioItem>
739
+ <DropdownMenuRadioItem value="card">
740
+ Card View
741
+ </DropdownMenuRadioItem>
742
+ </DropdownMenuRadioGroup>
743
+ </DropdownMenuGroup>
744
+
745
+ <DropdownMenuSeparator />
746
+
747
+ {/* Collections Group */}
748
+ <DropdownMenuGroup>
749
+ <DropdownMenuSub>
750
+ <DropdownMenuSubTrigger>
751
+ <PlusIcon className="h-4 w-4" />
752
+ Add to Collection
753
+ </DropdownMenuSubTrigger>
754
+ <DropdownMenuSubContent>
755
+ <DropdownMenuGroup>
756
+ <DropdownMenuItem>
757
+ <FileChartIcon className="h-4 w-4" />
758
+ Favorites
759
+ </DropdownMenuItem>
760
+ <DropdownMenuItem>
761
+ <FileChartIcon className="h-4 w-4" />
762
+ Work Projects
763
+ </DropdownMenuItem>
764
+ <DropdownMenuItem>
765
+ <FileChartIcon className="h-4 w-4" />
766
+ Personal
767
+ </DropdownMenuItem>
768
+ </DropdownMenuGroup>
769
+ <DropdownMenuSeparator />
770
+ <DropdownMenuGroup>
771
+ <DropdownMenuItem>
772
+ <PlusIcon className="h-4 w-4" />
773
+ Create New Collection
774
+ </DropdownMenuItem>
775
+ </DropdownMenuGroup>
776
+ </DropdownMenuSubContent>
777
+ </DropdownMenuSub>
778
+ </DropdownMenuGroup>
779
+
780
+ <DropdownMenuSeparator />
781
+
782
+ {/* Danger Group */}
783
+ <DropdownMenuGroup>
784
+ <DropdownMenuItem variant="destructive">
785
+ <TrashIcon className="h-4 w-4" />
786
+ Delete Item
787
+ <DropdownMenuShortcut>⌘⌫</DropdownMenuShortcut>
788
+ </DropdownMenuItem>
789
+ </DropdownMenuGroup>
790
+ </DropdownMenuContent>
791
+ </DropdownMenu>
792
+ </div>
793
+
794
+ {/* State Display */}
795
+ <div className="text-center">
796
+ <div className="inline-block rounded-lg border border-white/10 bg-white/5 p-4">
797
+ <h4 className="mb-2 text-sm font-medium text-white">
798
+ Current Settings
799
+ </h4>
800
+ <div className="space-y-1 text-xs text-white/60">
801
+ <div>Bookmarked: {bookmarked ? "Yes" : "No"}</div>
802
+ <div>Notifications: {notifications ? "Enabled" : "Disabled"}</div>
803
+ <div>View Mode: {viewMode}</div>
804
+ </div>
805
+ </div>
806
+ </div>
807
+ </div>
808
+ )
809
+ },
810
+ parameters: {
811
+ docs: {
812
+ description: {
813
+ story:
814
+ "Complex dropdown menu example showcasing all component features with proper logical grouping using DropdownMenuGroup for better organization and accessibility.",
815
+ },
816
+ },
817
+ },
818
+ }
819
+
820
+ // 7. Positioning Examples
821
+ export const PositioningExamples: Story = {
822
+ render: () => (
823
+ <div className="space-y-8">
824
+ <div className="text-center">
825
+ <h3 className="mb-2 font-medium text-white">Positioning Examples</h3>
826
+ <p className="text-sm text-white/60">
827
+ Different positioning and alignment options with grouped content
828
+ </p>
829
+ </div>
830
+
831
+ <div className="grid grid-cols-2 gap-8">
832
+ {/* Top Row */}
833
+ <div className="space-y-4">
834
+ <h4 className="text-sm font-medium text-white/80">
835
+ Alignment Options
836
+ </h4>
837
+ <div className="flex gap-2">
838
+ <DropdownMenu>
839
+ <DropdownMenuTrigger asChild>
840
+ <Button variant="outline" size="sm">
841
+ Align Start
842
+ </Button>
843
+ </DropdownMenuTrigger>
844
+ <DropdownMenuContent align="start">
845
+ <DropdownMenuGroup>
846
+ <DropdownMenuItem>Left aligned</DropdownMenuItem>
847
+ <DropdownMenuItem>Content</DropdownMenuItem>
848
+ </DropdownMenuGroup>
849
+ </DropdownMenuContent>
850
+ </DropdownMenu>
851
+
852
+ <DropdownMenu>
853
+ <DropdownMenuTrigger asChild>
854
+ <Button variant="outline" size="sm">
855
+ Align Center
856
+ </Button>
857
+ </DropdownMenuTrigger>
858
+ <DropdownMenuContent align="center">
859
+ <DropdownMenuGroup>
860
+ <DropdownMenuItem>Center aligned</DropdownMenuItem>
861
+ <DropdownMenuItem>Content</DropdownMenuItem>
862
+ </DropdownMenuGroup>
863
+ </DropdownMenuContent>
864
+ </DropdownMenu>
865
+
866
+ <DropdownMenu>
867
+ <DropdownMenuTrigger asChild>
868
+ <Button variant="outline" size="sm">
869
+ Align End
870
+ </Button>
871
+ </DropdownMenuTrigger>
872
+ <DropdownMenuContent align="end">
873
+ <DropdownMenuGroup>
874
+ <DropdownMenuItem>Right aligned</DropdownMenuItem>
875
+ <DropdownMenuItem>Content</DropdownMenuItem>
876
+ </DropdownMenuGroup>
877
+ </DropdownMenuContent>
878
+ </DropdownMenu>
879
+ </div>
880
+ </div>
881
+
882
+ {/* Bottom Row */}
883
+ <div className="space-y-4">
884
+ <h4 className="text-sm font-medium text-white/80">Side Offset</h4>
885
+ <div className="flex gap-2">
886
+ <DropdownMenu>
887
+ <DropdownMenuTrigger asChild>
888
+ <Button variant="outline" size="sm">
889
+ No Offset
890
+ </Button>
891
+ </DropdownMenuTrigger>
892
+ <DropdownMenuContent sideOffset={0}>
893
+ <DropdownMenuGroup>
894
+ <DropdownMenuItem>No spacing</DropdownMenuItem>
895
+ <DropdownMenuItem>From trigger</DropdownMenuItem>
896
+ </DropdownMenuGroup>
897
+ </DropdownMenuContent>
898
+ </DropdownMenu>
899
+
900
+ <DropdownMenu>
901
+ <DropdownMenuTrigger asChild>
902
+ <Button variant="outline" size="sm">
903
+ Default
904
+ </Button>
905
+ </DropdownMenuTrigger>
906
+ <DropdownMenuContent>
907
+ <DropdownMenuGroup>
908
+ <DropdownMenuItem>Default spacing</DropdownMenuItem>
909
+ <DropdownMenuItem>4px offset</DropdownMenuItem>
910
+ </DropdownMenuGroup>
911
+ </DropdownMenuContent>
912
+ </DropdownMenu>
913
+
914
+ <DropdownMenu>
915
+ <DropdownMenuTrigger asChild>
916
+ <Button variant="outline" size="sm">
917
+ Large Offset
918
+ </Button>
919
+ </DropdownMenuTrigger>
920
+ <DropdownMenuContent sideOffset={12}>
921
+ <DropdownMenuGroup>
922
+ <DropdownMenuItem>Large spacing</DropdownMenuItem>
923
+ <DropdownMenuItem>12px offset</DropdownMenuItem>
924
+ </DropdownMenuGroup>
925
+ </DropdownMenuContent>
926
+ </DropdownMenu>
927
+ </div>
928
+ </div>
929
+ </div>
930
+ </div>
931
+ ),
932
+ parameters: {
933
+ docs: {
934
+ description: {
935
+ story:
936
+ "Examples of different positioning options including alignment and offset configurations with proper content grouping.",
937
+ },
938
+ },
939
+ },
940
+ }
941
+
942
+ // 8. Grouping Showcase
943
+ export const GroupingShowcase: Story = {
944
+ render: () => (
945
+ <div className="space-y-8">
946
+ <div className="text-center">
947
+ <h3 className="mb-2 font-medium text-white">
948
+ DropdownMenuGroup Showcase
949
+ </h3>
950
+ <p className="text-sm text-white/60">
951
+ Demonstrating logical grouping for better organization and
952
+ accessibility
953
+ </p>
954
+ </div>
955
+
956
+ <div className="flex justify-center">
957
+ <DropdownMenu>
958
+ <DropdownMenuTrigger asChild>
959
+ <Button variant="outline" className="gap-2">
960
+ <SiteLogoIcon className="h-4 w-4" />
961
+ Grouped Menu
962
+ <AngleDownIcon className="h-4 w-4" />
963
+ </Button>
964
+ </DropdownMenuTrigger>
965
+ <DropdownMenuContent className="w-56">
966
+ {/* File Operations Group */}
967
+ <DropdownMenuLabel>File Operations</DropdownMenuLabel>
968
+ <DropdownMenuSeparator />
969
+ <DropdownMenuGroup>
970
+ <DropdownMenuItem>
971
+ <FileChartIcon className="h-4 w-4" />
972
+ New File
973
+ <DropdownMenuShortcut>⌘N</DropdownMenuShortcut>
974
+ </DropdownMenuItem>
975
+ <DropdownMenuItem>
976
+ <UploadIcon className="h-4 w-4" />
977
+ Upload
978
+ <DropdownMenuShortcut>⌘U</DropdownMenuShortcut>
979
+ </DropdownMenuItem>
980
+ <DropdownMenuItem>
981
+ <ImageIcon className="h-4 w-4" />
982
+ Import
983
+ <DropdownMenuShortcut>⌘I</DropdownMenuShortcut>
984
+ </DropdownMenuItem>
985
+ </DropdownMenuGroup>
986
+
987
+ <DropdownMenuSeparator />
988
+
989
+ {/* View Options Group */}
990
+ <DropdownMenuLabel>View Options</DropdownMenuLabel>
991
+ <DropdownMenuSeparator />
992
+ <DropdownMenuGroup>
993
+ <DropdownMenuItem>
994
+ <EyeOpenIcon className="h-4 w-4" />
995
+ Show Hidden Files
996
+ </DropdownMenuItem>
997
+ <DropdownMenuItem>
998
+ <EyeCloseIcon className="h-4 w-4" />
999
+ Hide Preview
1000
+ </DropdownMenuItem>
1001
+ <DropdownMenuItem>
1002
+ <SearchIcon className="h-4 w-4" />
1003
+ Search
1004
+ <DropdownMenuShortcut>⌘F</DropdownMenuShortcut>
1005
+ </DropdownMenuItem>
1006
+ </DropdownMenuGroup>
1007
+
1008
+ <DropdownMenuSeparator />
1009
+
1010
+ {/* Settings Group */}
1011
+ <DropdownMenuLabel>Settings</DropdownMenuLabel>
1012
+ <DropdownMenuSeparator />
1013
+ <DropdownMenuGroup>
1014
+ <DropdownMenuItem>
1015
+ <SiteLogoIcon className="h-4 w-4" />
1016
+ Preferences
1017
+ <DropdownMenuShortcut>⌘,</DropdownMenuShortcut>
1018
+ </DropdownMenuItem>
1019
+ <DropdownMenuItem>
1020
+ <SiteLogoIcon className="h-4 w-4" />
1021
+ Account
1022
+ </DropdownMenuItem>
1023
+ </DropdownMenuGroup>
1024
+
1025
+ <DropdownMenuSeparator />
1026
+
1027
+ {/* Danger Zone Group */}
1028
+ <DropdownMenuGroup>
1029
+ <DropdownMenuItem variant="destructive">
1030
+ <CrossIcon className="h-4 w-4" />
1031
+ Reset All Settings
1032
+ </DropdownMenuItem>
1033
+ </DropdownMenuGroup>
1034
+ </DropdownMenuContent>
1035
+ </DropdownMenu>
1036
+ </div>
1037
+ </div>
1038
+ ),
1039
+ parameters: {
1040
+ docs: {
1041
+ description: {
1042
+ story:
1043
+ "Showcase of DropdownMenuGroup component demonstrating how to logically group related menu items for better organization, navigation, and accessibility. Each group represents a semantic category of actions.",
1044
+ },
1045
+ },
1046
+ },
1047
+ }
1048
+
1049
+ // 9. Arrow Showcase
1050
+ export const ArrowShowcase: Story = {
1051
+ render: () => (
1052
+ <div className="space-y-8">
1053
+ <div className="text-center">
1054
+ <h3 className="mb-2 font-medium text-white">DropdownArrow Showcase</h3>
1055
+ <p className="text-sm text-white/60">
1056
+ Dropdown menus with arrow pointers for better visual connection to
1057
+ triggers
1058
+ </p>
1059
+ </div>
1060
+
1061
+ <div className="flex flex-wrap justify-center gap-8">
1062
+ {/* Basic Arrow */}
1063
+ <div className="space-y-4">
1064
+ <h4 className="text-center text-sm font-medium text-white/80">
1065
+ Basic Arrow
1066
+ </h4>
1067
+ <DropdownMenu>
1068
+ <DropdownMenuTrigger asChild>
1069
+ <Button variant="outline" className="gap-2">
1070
+ <SiteLogoIcon className="h-4 w-4" />
1071
+ With Arrow
1072
+ <ChevronDownIcon className="h-4 w-4" />
1073
+ </Button>
1074
+ </DropdownMenuTrigger>
1075
+ <DropdownMenuContent>
1076
+ <DropdownArrow className="h-4 w-6" />
1077
+ <DropdownMenuGroup>
1078
+ <DropdownMenuItem>
1079
+ <EditBigIcon className="h-4 w-4" />
1080
+ Edit Item
1081
+ </DropdownMenuItem>
1082
+ <DropdownMenuItem>
1083
+ <TickIcon className="h-4 w-4" />
1084
+ Copy Item
1085
+ </DropdownMenuItem>
1086
+ <DropdownMenuItem>
1087
+ <ArrowRightIcon className="h-4 w-4" />
1088
+ Share Item
1089
+ </DropdownMenuItem>
1090
+ </DropdownMenuGroup>
1091
+ </DropdownMenuContent>
1092
+ </DropdownMenu>
1093
+ </div>
1094
+
1095
+ {/* Custom Styled Arrow */}
1096
+ <div className="space-y-4">
1097
+ <h4 className="text-center text-sm font-medium text-white/80">
1098
+ Custom Styled Arrow
1099
+ </h4>
1100
+ <DropdownMenu>
1101
+ <DropdownMenuTrigger asChild>
1102
+ <Button>
1103
+ <AlertIcon className="h-4 w-4" />
1104
+ Blue Theme
1105
+ <AngleDownIcon className="h-4 w-4" />
1106
+ </Button>
1107
+ </DropdownMenuTrigger>
1108
+ <DropdownMenuContent
1109
+ classes={{
1110
+ root: "bg-blue-900/40 border-blue-500/20",
1111
+ border: "bg-gradient-to-r from-blue-500 to-cyan-500",
1112
+ }}
1113
+ >
1114
+ <DropdownArrow className="h-4 w-6 fill-blue-900" />
1115
+ <DropdownMenuGroup>
1116
+ <DropdownMenuItem
1117
+ classes={{
1118
+ root: "text-blue-200 hover:bg-blue-500/20 focus:bg-blue-500/20",
1119
+ }}
1120
+ >
1121
+ <TickIcon className="h-4 w-4" />
1122
+ Blue Action
1123
+ </DropdownMenuItem>
1124
+ <DropdownMenuItem
1125
+ classes={{
1126
+ root: "text-blue-200 hover:bg-blue-500/20 focus:bg-blue-500/20",
1127
+ }}
1128
+ >
1129
+ <AudioBarIcon className="h-4 w-4" />
1130
+ Another Action
1131
+ </DropdownMenuItem>
1132
+ </DropdownMenuGroup>
1133
+ </DropdownMenuContent>
1134
+ </DropdownMenu>
1135
+ </div>
1136
+
1137
+ {/* Arrow with Sub-menu */}
1138
+ <div className="space-y-4">
1139
+ <h4 className="text-center text-sm font-medium text-white/80">
1140
+ Arrow with Sub-menu
1141
+ </h4>
1142
+ <DropdownMenu>
1143
+ <DropdownMenuTrigger asChild>
1144
+ <Button variant="text" className="gap-2">
1145
+ <PlusIcon className="h-4 w-4" />
1146
+ Create Menu
1147
+ <ChevronDownIcon className="h-4 w-4" />
1148
+ </Button>
1149
+ </DropdownMenuTrigger>
1150
+ <DropdownMenuContent>
1151
+ <DropdownArrow className="fill-fm-surface-frosted h-4 w-6" />
1152
+ <DropdownMenuLabel>Create New</DropdownMenuLabel>
1153
+ <DropdownMenuSeparator />
1154
+ <DropdownMenuGroup>
1155
+ <DropdownMenuItem>
1156
+ <FileChartIcon className="h-4 w-4" />
1157
+ New Document
1158
+ </DropdownMenuItem>
1159
+ <DropdownMenuSub>
1160
+ <DropdownMenuSubTrigger>
1161
+ <ImageIcon className="h-4 w-4" />
1162
+ Import From
1163
+ </DropdownMenuSubTrigger>
1164
+ <DropdownMenuSubContent>
1165
+ <DropdownArrow className="fill-fm-surface-frosted h-4 w-4" />
1166
+ <DropdownMenuGroup>
1167
+ <DropdownMenuItem>
1168
+ <UploadIcon className="h-4 w-4" />
1169
+ Local File
1170
+ </DropdownMenuItem>
1171
+ <DropdownMenuItem>
1172
+ <ArrowRightIcon className="h-4 w-4" />
1173
+ URL
1174
+ </DropdownMenuItem>
1175
+ <DropdownMenuItem>
1176
+ <SiteLogoIcon className="h-4 w-4" />
1177
+ Cloud Service
1178
+ </DropdownMenuItem>
1179
+ </DropdownMenuGroup>
1180
+ </DropdownMenuSubContent>
1181
+ </DropdownMenuSub>
1182
+ </DropdownMenuGroup>
1183
+ </DropdownMenuContent>
1184
+ </DropdownMenu>
1185
+ </div>
1186
+ </div>
1187
+
1188
+ <div className="text-center">
1189
+ <div className="inline-block max-w-lg rounded-lg border border-white/10 bg-white/5 p-4">
1190
+ <h4 className="mb-2 text-sm font-medium text-white">Arrow Usage</h4>
1191
+ <p className="text-xs leading-relaxed text-white/60">
1192
+ The DropdownArrow component creates a visual pointer from the menu
1193
+ to its trigger. It automatically inherits the menu's background
1194
+ color and can be customized with the className prop. Use it to
1195
+ improve the visual connection between triggers and their associated
1196
+ menus.
1197
+ </p>
1198
+ </div>
1199
+ </div>
1200
+ </div>
1201
+ ),
1202
+ parameters: {
1203
+ docs: {
1204
+ description: {
1205
+ story:
1206
+ "Demonstration of DropdownArrow component showing how to add visual arrows that point from dropdown menus to their triggers. Includes basic usage, custom styling, and usage with sub-menus.",
1207
+ },
1208
+ },
1209
+ },
1210
+ }