@moises.ai/design-system 3.4.5 → 3.4.6

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 (594) hide show
  1. package/package.json +3 -2
  2. package/src/Introduction.mdx +56 -0
  3. package/src/colors/custom-styles.css +293 -0
  4. package/src/components/AdditionalItems/AdditionalItems.jsx +43 -0
  5. package/src/components/AdditionalItems/AdditionalItems.module.css +76 -0
  6. package/src/components/AdditionalItems/AdditionalItems.stories.jsx +32 -0
  7. package/src/components/BannerAnnouncement/BannerAnnouncement.jsx +77 -0
  8. package/src/components/BannerAnnouncement/BannerAnnouncement.module.css +58 -0
  9. package/src/components/BannerAnnouncement/BannerAnnouncement.stories.jsx +120 -0
  10. package/src/components/Button/Button.jsx +45 -0
  11. package/src/components/Button/Button.module.css +288 -0
  12. package/src/components/Button/Button.stories.jsx +269 -0
  13. package/src/components/Callout/Callout.jsx +47 -0
  14. package/src/components/Callout/Callout.module.css +56 -0
  15. package/src/components/Callout/Callout.stories.jsx +296 -0
  16. package/src/components/Card/Card.jsx +46 -0
  17. package/src/components/Card/Card.module.css +89 -0
  18. package/src/components/Card/Card.stories.jsx +116 -0
  19. package/src/components/Checkbox/Checkbox.jsx +36 -0
  20. package/src/components/Checkbox/Checkbox.module.css +136 -0
  21. package/src/components/Checkbox/Checkbox.stories.jsx +64 -0
  22. package/src/components/CigarBar/CigarBar.jsx +73 -0
  23. package/src/components/CigarBar/CigarBar.module.css +57 -0
  24. package/src/components/CigarBar/CigarBar.stories.jsx +66 -0
  25. package/src/components/ContextMenu/ContextMenu.jsx +56 -0
  26. package/src/components/ContextMenu/ContextMenu.stories.jsx +657 -0
  27. package/src/components/Countdown/Countdown.jsx +97 -0
  28. package/src/components/Countdown/Countdown.module.css +206 -0
  29. package/src/components/Countdown/Countdown.stories.jsx +108 -0
  30. package/src/components/DataTable/DataTable.jsx +300 -0
  31. package/src/components/DataTable/DataTable.module.css +372 -0
  32. package/src/components/DataTable/DataTable.stories.jsx +365 -0
  33. package/src/components/DropdownButton/DropdownButton.jsx +124 -0
  34. package/src/components/DropdownButton/DropdownButton.module.css +102 -0
  35. package/src/components/DropdownButton/DropdownButton.stories.jsx +267 -0
  36. package/src/components/DropdownMenu/DropdownMenu.jsx +102 -0
  37. package/src/components/DropdownMenu/DropdownMenu.stories.jsx +645 -0
  38. package/src/components/FloatingBanner/FloatingBanner.jsx +87 -0
  39. package/src/components/FloatingBanner/FloatingBanner.module.css +92 -0
  40. package/src/components/FloatingBanner/FloatingBanner.stories.jsx +115 -0
  41. package/src/components/FooterPanel/FooterPanel.jsx +56 -0
  42. package/src/components/FooterPanel/FooterPanel.stories.jsx +289 -0
  43. package/src/components/GenerationSourceCallout/GenerationSourceCallout.jsx +53 -0
  44. package/src/components/GenerationSourceCallout/GenerationSourceCallout.module.css +98 -0
  45. package/src/components/GroupButtons/GroupButtons.jsx +97 -0
  46. package/src/components/GroupButtons/GroupButtons.module.css +8 -0
  47. package/src/components/GroupButtons/GroupButtons.stories.jsx +301 -0
  48. package/src/components/HeaderPanel/HeaderPanel.jsx +115 -0
  49. package/src/components/HeaderPanel/HeaderPanel.stories.jsx +389 -0
  50. package/src/components/HorizontalVolume/HorizontalVolume.jsx +157 -0
  51. package/src/components/HorizontalVolume/HorizontalVolume.module.css +123 -0
  52. package/src/components/HorizontalVolume/HorizontalVolume.stories.jsx +109 -0
  53. package/src/components/IconButton/IconButton.jsx +47 -0
  54. package/src/components/IconButton/IconButton.module.css +302 -0
  55. package/src/components/IconButton/IconButton.stories.jsx +532 -0
  56. package/src/components/InstrumentSelector/InstrumentSelector.jsx +61 -0
  57. package/src/components/InstrumentSelector/InstrumentSelector.module.css +80 -0
  58. package/src/components/InstrumentSelector/InstrumentSelector.stories.jsx +33 -0
  59. package/src/components/Knob/Knob.jsx +173 -0
  60. package/src/components/Knob/Knob.module.css +70 -0
  61. package/src/components/Knob/Knob.stories.jsx +289 -0
  62. package/src/components/Knob/constants.js +38 -0
  63. package/src/components/Knob/useKnob.js +117 -0
  64. package/src/components/Knob/utils.js +117 -0
  65. package/src/components/ListCards/CardDetails.stories.jsx +484 -0
  66. package/src/components/ListCards/ListCards.jsx +297 -0
  67. package/src/components/ListCards/ListCards.module.css +234 -0
  68. package/src/components/ListCards/ListCards.stories.jsx +386 -0
  69. package/src/components/LokalisePoc/LokalisePoc.jsx +7 -0
  70. package/src/components/LokalisePoc/LokalisePoc.stories.jsx +63 -0
  71. package/src/components/MessageWithAction/MessageWithAction.jsx +54 -0
  72. package/src/components/MessageWithAction/MessageWithAction.module.css +16 -0
  73. package/src/components/MessageWithAction/MessageWithAction.stories.jsx +280 -0
  74. package/src/components/MetronomeForm/MetronomeForm.jsx +74 -0
  75. package/src/components/MetronomeForm/MetronomeForm.stories.jsx +137 -0
  76. package/src/components/MultiSelect/MultiSelect.jsx +129 -0
  77. package/src/components/MultiSelect/MultiSelect.module.css +105 -0
  78. package/src/components/MultiSelect/MultiSelect.stories.jsx +296 -0
  79. package/src/components/MultiSelectCards/MultiSelectCards.jsx +96 -0
  80. package/src/components/MultiSelectCards/MultiSelectCards.module.css +60 -0
  81. package/src/components/MultiSelectCards/MultiSelectCards.stories.jsx +439 -0
  82. package/src/components/PanControl/PanControl.jsx +227 -0
  83. package/src/components/PanControl/PanControl.module.css +71 -0
  84. package/src/components/PanControl/PanControl.stories.jsx +100 -0
  85. package/src/components/ProductsBrandPattern/Patterns/aiStudio.png +0 -0
  86. package/src/components/ProductsBrandPattern/Patterns/mastering.png +0 -0
  87. package/src/components/ProductsBrandPattern/Patterns/product.png +0 -0
  88. package/src/components/ProductsBrandPattern/Patterns/stemSeparation.png +0 -0
  89. package/src/components/ProductsBrandPattern/Patterns/voiceStudio.png +0 -0
  90. package/src/components/ProductsBrandPattern/ProductsBrandPattern.jsx +36 -0
  91. package/src/components/ProductsBrandPattern/ProductsBrandPattern.stories.jsx +47 -0
  92. package/src/components/ProductsList/ProductsList.jsx +54 -0
  93. package/src/components/ProductsList/ProductsList.module.css +81 -0
  94. package/src/components/ProductsList/ProductsList.stories.jsx +69 -0
  95. package/src/components/ProfileMenu/MenuTrigger.jsx +45 -0
  96. package/src/components/ProfileMenu/ProfileMenu.jsx +66 -0
  97. package/src/components/ProfileMenu/ProfileMenu.module.css +101 -0
  98. package/src/components/ProfileMenu/ProfileMenu.stories.jsx +44 -0
  99. package/src/components/RadioCardsGroup/RadioCardsGroup.jsx +35 -0
  100. package/src/components/RadioCardsGroup/RadioCardsGroup.module.css +66 -0
  101. package/src/components/RadioCardsGroup/RadioCardsGroup.stories.jsx +89 -0
  102. package/src/components/Rating/Rating.jsx +154 -0
  103. package/src/components/Rating/Rating.module.css +70 -0
  104. package/src/components/Rating/Rating.stories.jsx +215 -0
  105. package/src/components/RecordingForm/RecordingForm.jsx +142 -0
  106. package/src/components/RecordingForm/RecordingForm.module.css +49 -0
  107. package/src/components/RecordingForm/RecordingForm.stories.jsx +319 -0
  108. package/src/components/SectionExpander/SectionExpander.jsx +53 -0
  109. package/src/components/SectionExpander/SectionExpander.module.css +46 -0
  110. package/src/components/SectionExpander/SectionExpander.stories.jsx +48 -0
  111. package/src/components/SegmentedControl/SegmentedControl.jsx +48 -0
  112. package/src/components/SegmentedControl/SegmentedControl.stories.jsx +133 -0
  113. package/src/components/SegmentedControl/SegmentedControl.styles.css +55 -0
  114. package/src/components/Select/Select.jsx +132 -0
  115. package/src/components/Select/Select.module.css +76 -0
  116. package/src/components/Select/Select.stories.jsx +294 -0
  117. package/src/components/SetlistList/SetlistList.jsx +338 -0
  118. package/src/components/SetlistList/SetlistList.module.css +246 -0
  119. package/src/components/SetlistList/SetlistList.stories.jsx +121 -0
  120. package/src/components/Shell/Shell.jsx +75 -0
  121. package/src/components/Shell/Shell.module.css +3 -0
  122. package/src/components/Shell/Shell.stories.jsx +354 -0
  123. package/src/components/Sidebar/Sidebar.jsx +173 -0
  124. package/src/components/Sidebar/Sidebar.module.css +267 -0
  125. package/src/components/Sidebar/Sidebar.stories.jsx +247 -0
  126. package/src/components/Sidebar/SidebarSection/SidebarSection.jsx +20 -0
  127. package/src/components/Sidebar/SidebarSection/SidebarSection.module.css +20 -0
  128. package/src/components/Slider/Slider.jsx +114 -0
  129. package/src/components/Slider/Slider.module.css +159 -0
  130. package/src/components/Slider/Slider.stories.jsx +199 -0
  131. package/src/components/StemGenerationForm/BesideFooter/BesideFooter.jsx +107 -0
  132. package/src/components/StemGenerationForm/BesideFooter/BesideFooter.module.css +4 -0
  133. package/src/components/StemGenerationForm/Concurrency/Concurrency.jsx +54 -0
  134. package/src/components/StemGenerationForm/Concurrency/Concurrency.module.css +26 -0
  135. package/src/components/StemGenerationForm/CreateFromPreset/CreateFromPreset.jsx +44 -0
  136. package/src/components/StemGenerationForm/CreateNew/CreateNew.jsx +107 -0
  137. package/src/components/StemGenerationForm/CreativeFreedomSection/CreativeFreedomSection.jsx +185 -0
  138. package/src/components/StemGenerationForm/CreativeFreedomSection/CreativeFreedomSection.module.css +8 -0
  139. package/src/components/StemGenerationForm/GenerationStatus/GenerationStatus.jsx +91 -0
  140. package/src/components/StemGenerationForm/StemGenerationForm.jsx +342 -0
  141. package/src/components/StemGenerationForm/StemGenerationForm.stories.jsx +703 -0
  142. package/src/components/StemGenerationForm/utils/constants.js +24 -0
  143. package/src/components/StemGenerationForm/utils/formatFileInfo.js +20 -0
  144. package/src/components/StemGenerationForm/utils/getInstrumentDescription.js +27 -0
  145. package/src/components/StemGenerationForm/utils/getLocalizedGenerationInstruments.js +31 -0
  146. package/src/components/StemGenerationForm/utils/index.js +13 -0
  147. package/src/components/StemGenerationForm/utils/secondsToTime.js +15 -0
  148. package/src/components/StemSeparationForm/GenerationStatus/GenerationStatus.jsx +70 -0
  149. package/src/components/StemSeparationForm/StemSeparationForm.jsx +354 -0
  150. package/src/components/StemSeparationForm/StemSeparationForm.module.css +0 -0
  151. package/src/components/StemSeparationForm/StemSeparationForm.stories.jsx +221 -0
  152. package/src/components/TempoControlsForm/AutoDetect/AutoDetect.jsx +114 -0
  153. package/src/components/TempoControlsForm/TempoControlsForm.jsx +59 -0
  154. package/src/components/TempoControlsForm/TempoControlsForm.stories.jsx +228 -0
  155. package/src/components/TempoControlsForm/TempoForm/TempoForm.jsx +94 -0
  156. package/src/components/TempoControlsForm/TempoFormInput/TempoFormInput.jsx +136 -0
  157. package/src/components/TempoControlsForm/TempoFormInput/TempoFormInput.module.css +19 -0
  158. package/src/components/TempoControlsForm/constants.js +77 -0
  159. package/src/components/TempoControlsForm/utils/formatDateTime.js +50 -0
  160. package/src/components/TempoControlsForm/utils/getTempoMarking.js +6 -0
  161. package/src/components/Text/Text.jsx +19 -0
  162. package/src/components/Text/Text.module.css +5 -0
  163. package/src/components/Text/Text.stories.jsx +117 -0
  164. package/src/components/TextArea/TextArea.jsx +53 -0
  165. package/src/components/TextArea/TextArea.module.css +35 -0
  166. package/src/components/TextArea/TextArea.stories.jsx +140 -0
  167. package/src/components/TextField/TextField.jsx +61 -0
  168. package/src/components/TextField/TextField.module.css +41 -0
  169. package/src/components/TextField/TextField.stories.jsx +243 -0
  170. package/src/components/ThumbnailPicker/ThumbColors/ThumbColors.js +101 -0
  171. package/src/components/ThumbnailPicker/ThumbGraphics/ThumbGraphics.js +90 -0
  172. package/src/components/ThumbnailPicker/ThumbGraphics/circles01.png +0 -0
  173. package/src/components/ThumbnailPicker/ThumbGraphics/circles02.png +0 -0
  174. package/src/components/ThumbnailPicker/ThumbGraphics/circles03.png +0 -0
  175. package/src/components/ThumbnailPicker/ThumbGraphics/circles04.png +0 -0
  176. package/src/components/ThumbnailPicker/ThumbGraphics/circles05.png +0 -0
  177. package/src/components/ThumbnailPicker/ThumbGraphics/circles06.png +0 -0
  178. package/src/components/ThumbnailPicker/ThumbGraphics/lines01.png +0 -0
  179. package/src/components/ThumbnailPicker/ThumbGraphics/lines02.png +0 -0
  180. package/src/components/ThumbnailPicker/ThumbGraphics/lines03.png +0 -0
  181. package/src/components/ThumbnailPicker/ThumbGraphics/lines04.png +0 -0
  182. package/src/components/ThumbnailPicker/ThumbGraphics/lines05.png +0 -0
  183. package/src/components/ThumbnailPicker/ThumbGraphics/lines06.png +0 -0
  184. package/src/components/ThumbnailPicker/ThumbGraphics/patterns01.png +0 -0
  185. package/src/components/ThumbnailPicker/ThumbGraphics/patterns02.png +0 -0
  186. package/src/components/ThumbnailPicker/ThumbGraphics/patterns03.png +0 -0
  187. package/src/components/ThumbnailPicker/ThumbGraphics/patterns04.png +0 -0
  188. package/src/components/ThumbnailPicker/ThumbGraphics/shapes01.png +0 -0
  189. package/src/components/ThumbnailPicker/ThumbGraphics/shapes02.png +0 -0
  190. package/src/components/ThumbnailPicker/ThumbGraphics/shapes03.png +0 -0
  191. package/src/components/ThumbnailPicker/ThumbGraphics/shapes04.png +0 -0
  192. package/src/components/ThumbnailPicker/ThumbGraphics/shapes05.png +0 -0
  193. package/src/components/ThumbnailPicker/ThumbGraphics/shapes06.png +0 -0
  194. package/src/components/ThumbnailPicker/ThumbGraphics/shapes07.png +0 -0
  195. package/src/components/ThumbnailPicker/ThumbGraphics/shapes08.png +0 -0
  196. package/src/components/ThumbnailPicker/ThumbGraphics/shapes09.png +0 -0
  197. package/src/components/ThumbnailPicker/ThumbGraphics/synth01.png +0 -0
  198. package/src/components/ThumbnailPicker/ThumbGraphics/synth02.png +0 -0
  199. package/src/components/ThumbnailPicker/ThumbGraphics/synth03.png +0 -0
  200. package/src/components/ThumbnailPicker/ThumbGraphics/synth04.png +0 -0
  201. package/src/components/ThumbnailPicker/ThumbGraphics/synth05.png +0 -0
  202. package/src/components/ThumbnailPicker/ThumbGraphics/waves01.png +0 -0
  203. package/src/components/ThumbnailPicker/ThumbGraphics/waves02.png +0 -0
  204. package/src/components/ThumbnailPicker/ThumbGraphics/waves03.png +0 -0
  205. package/src/components/ThumbnailPicker/ThumbGraphics/waves04.png +0 -0
  206. package/src/components/ThumbnailPicker/ThumbnailPicker.jsx +67 -0
  207. package/src/components/ThumbnailPicker/ThumbnailPicker.module.css +0 -0
  208. package/src/components/ThumbnailPicker/ThumbnailPicker.stories.jsx +406 -0
  209. package/src/components/ThumbnailPicker/getStyleFromID.js +31 -0
  210. package/src/components/TooltipWithInfoIcon/TooltipWithInfoIcon.jsx +18 -0
  211. package/src/components/TooltipWithInfoIcon/TooltipWithInfoIcon.module.css +6 -0
  212. package/src/components/TooltipWithInfoIcon/TooltipWithInfoIcon.stories.jsx +28 -0
  213. package/src/components/TrackControlButton/TrackControlButton.jsx +28 -0
  214. package/src/components/TrackControlButton/TrackControlButton.module.css +32 -0
  215. package/src/components/TrackControlButton/TrackControlButton.stories.jsx +47 -0
  216. package/src/components/TrackControlButton/index.js +1 -0
  217. package/src/components/TrackHeader/TrackHeader.jsx +143 -0
  218. package/src/components/TrackHeader/TrackHeader.module.css +194 -0
  219. package/src/components/TrackHeader/TrackHeader.stories.jsx +212 -0
  220. package/src/components/TrackHeader/TrackHeaderOptions/TrackHeaderOptions.jsx +18 -0
  221. package/src/components/TrackHeader/TrackHeaderOptions/TrackHeaderOptions.module.css +8 -0
  222. package/src/components/TrackHeader/TrackHeaderOptions/index.js +1 -0
  223. package/src/components/VoiceConversionForm/BesideFooter/BesideFooter.jsx +74 -0
  224. package/src/components/VoiceConversionForm/ClickableAvatar/ClickableAvatar.jsx +40 -0
  225. package/src/components/VoiceConversionForm/ClickableAvatar/ClickableAvatar.module.css +21 -0
  226. package/src/components/VoiceConversionForm/Concurrency/Concurrency.jsx +53 -0
  227. package/src/components/VoiceConversionForm/Concurrency/Concurrency.module.css +26 -0
  228. package/src/components/VoiceConversionForm/GenerationStatus/GenerationStatus.jsx +49 -0
  229. package/src/components/VoiceConversionForm/VoiceConversionForm.jsx +231 -0
  230. package/src/components/VoiceConversionForm/VoiceConversionForm.module.css +9 -0
  231. package/src/components/VoiceConversionForm/VoiceConversionForm.stories.jsx +582 -0
  232. package/src/components/VoiceConversionForm/VoiceDetails/VoiceDetails.jsx +93 -0
  233. package/src/components/VoiceConversionForm/VoiceDetails/VoiceDetails.module.css +44 -0
  234. package/src/components/VoiceConversionForm/VoiceList/VoiceList.jsx +84 -0
  235. package/src/components/VoiceConversionForm/VoiceList/VoiceList.module.css +11 -0
  236. package/src/components/VoiceConversionForm/Waveform/Waveform.jsx +262 -0
  237. package/src/components/VoiceConversionForm/Waveform/Waveform.module.css +36 -0
  238. package/src/components/theme/Theme.jsx +16 -0
  239. package/src/components/theme/Theme.stories.jsx +59 -0
  240. package/src/icons/AbbeyRoadIcon.jsx +117 -0
  241. package/src/icons/AccessibilityIcon.jsx +33 -0
  242. package/src/icons/AcousticGuitarIcon.jsx +16 -0
  243. package/src/icons/AddIcon.jsx +18 -0
  244. package/src/icons/AddLyricsIcon.jsx +25 -0
  245. package/src/icons/AddRoundIcon.jsx +26 -0
  246. package/src/icons/AirplayIcon.jsx +26 -0
  247. package/src/icons/AlertIcon.jsx +28 -0
  248. package/src/icons/AppIcon.jsx +18 -0
  249. package/src/icons/ArVrIcon.jsx +21 -0
  250. package/src/icons/ArrowDownIcon.jsx +26 -0
  251. package/src/icons/ArrowDownloadIcon.jsx +26 -0
  252. package/src/icons/ArrowLeftIcon.jsx +26 -0
  253. package/src/icons/ArrowRightIcon.jsx +26 -0
  254. package/src/icons/ArrowUpIcon.jsx +26 -0
  255. package/src/icons/ArrowsHorizontalIcon.jsx +26 -0
  256. package/src/icons/ArrowsVerticalIcon.jsx +26 -0
  257. package/src/icons/AtomIcon.jsx +32 -0
  258. package/src/icons/AttachmentIcon.jsx +26 -0
  259. package/src/icons/AudioAdjustmentsIcon.jsx +26 -0
  260. package/src/icons/AudioFileIcon.jsx +26 -0
  261. package/src/icons/AudioFilesIcon.jsx +26 -0
  262. package/src/icons/AutoplayIcon.jsx +26 -0
  263. package/src/icons/BackwardIcon.jsx +18 -0
  264. package/src/icons/BarsIcon.jsx +27 -0
  265. package/src/icons/BassIcon.jsx +39 -0
  266. package/src/icons/BoldIcon.jsx +21 -0
  267. package/src/icons/BookIcon.jsx +21 -0
  268. package/src/icons/BookmarkIcon.jsx +24 -0
  269. package/src/icons/BoxIcon.jsx +20 -0
  270. package/src/icons/BriefcaseIcon.jsx +26 -0
  271. package/src/icons/CalendarIcon.jsx +26 -0
  272. package/src/icons/CameraFlip2Icon.jsx +26 -0
  273. package/src/icons/CameraFlip3Icon.jsx +26 -0
  274. package/src/icons/CameraFlipIcon.jsx +26 -0
  275. package/src/icons/CameraIcon.jsx +33 -0
  276. package/src/icons/CameraRollIcon.jsx +31 -0
  277. package/src/icons/CarIcon.jsx +18 -0
  278. package/src/icons/CartIcon.jsx +28 -0
  279. package/src/icons/CassetteIcon.jsx +26 -0
  280. package/src/icons/CastIcon.jsx +20 -0
  281. package/src/icons/CdIcon.jsx +19 -0
  282. package/src/icons/CheckboxCicleIcon.jsx +26 -0
  283. package/src/icons/CheckboxFillIcon.jsx +25 -0
  284. package/src/icons/CheckboxOffIcon.jsx +25 -0
  285. package/src/icons/CheckboxOnIcon.jsx +25 -0
  286. package/src/icons/ChevronDownIcon.jsx +26 -0
  287. package/src/icons/ChevronLeftIcon.jsx +26 -0
  288. package/src/icons/ChevronRightIcon.jsx +26 -0
  289. package/src/icons/ChevronUpIcon.jsx +26 -0
  290. package/src/icons/ChordGrid2Icon.jsx +26 -0
  291. package/src/icons/ChordGridIcon.jsx +26 -0
  292. package/src/icons/ChordSequenceIcon.jsx +26 -0
  293. package/src/icons/Chords2Icon.jsx +25 -0
  294. package/src/icons/Chords3Icon.jsx +24 -0
  295. package/src/icons/ChordsDetection2Icon.jsx +31 -0
  296. package/src/icons/ChordsDetectionIcon.jsx +31 -0
  297. package/src/icons/ChordsIcon.jsx +25 -0
  298. package/src/icons/ClipIcon.jsx +27 -0
  299. package/src/icons/ClipboardIcon.jsx +23 -0
  300. package/src/icons/CloseIcon.jsx +27 -0
  301. package/src/icons/Cloud2Icon.jsx +24 -0
  302. package/src/icons/Cloud3Icon.jsx +24 -0
  303. package/src/icons/CloudDownload2Icon.jsx +26 -0
  304. package/src/icons/CloudDownloadErrorIcon.jsx +26 -0
  305. package/src/icons/CloudDownloadGradientIcon.jsx +44 -0
  306. package/src/icons/CloudDownloadIcon.jsx +26 -0
  307. package/src/icons/CloudIcon.jsx +20 -0
  308. package/src/icons/CloudUploadIcon.jsx +26 -0
  309. package/src/icons/CodeIcon.jsx +28 -0
  310. package/src/icons/CollectionsIcon.jsx +26 -0
  311. package/src/icons/CompressorIcon.jsx +25 -0
  312. package/src/icons/ComputerIcon.jsx +26 -0
  313. package/src/icons/CopilotIcon.jsx +26 -0
  314. package/src/icons/CountInIcon.jsx +23 -0
  315. package/src/icons/CountdownIcon.jsx +33 -0
  316. package/src/icons/CowbellIcon.jsx +25 -0
  317. package/src/icons/CropIcon.jsx +27 -0
  318. package/src/icons/CrownIcon.jsx +21 -0
  319. package/src/icons/CueBackIcon.jsx +25 -0
  320. package/src/icons/CueIcon.jsx +20 -0
  321. package/src/icons/CymbalsIcon.jsx +26 -0
  322. package/src/icons/DatabaseIcon.jsx +26 -0
  323. package/src/icons/DelayIcon.jsx +20 -0
  324. package/src/icons/DenoiserIcon.jsx +23 -0
  325. package/src/icons/DevicesIcon.jsx +26 -0
  326. package/src/icons/DialogueIcon.jsx +33 -0
  327. package/src/icons/DojoIcon.jsx +21 -0
  328. package/src/icons/DotsVertical2Icon.jsx +43 -0
  329. package/src/icons/DotsVerticalIcon.jsx +47 -0
  330. package/src/icons/DownloadApp2Icon.jsx +26 -0
  331. package/src/icons/DownloadAppIcon.jsx +23 -0
  332. package/src/icons/Drums2Icon.jsx +25 -0
  333. package/src/icons/DrumsIcon.jsx +18 -0
  334. package/src/icons/EditIcon.jsx +20 -0
  335. package/src/icons/EffectsIcon.jsx +25 -0
  336. package/src/icons/ElectricGuitarIcon.jsx +54 -0
  337. package/src/icons/EqIcon.jsx +20 -0
  338. package/src/icons/FeaturesIcon.jsx +24 -0
  339. package/src/icons/FileIcon.jsx +21 -0
  340. package/src/icons/FileNewIcon.jsx +26 -0
  341. package/src/icons/Filter2Icon.jsx +26 -0
  342. package/src/icons/FilterIcon.jsx +26 -0
  343. package/src/icons/FireIcon.jsx +21 -0
  344. package/src/icons/FlagIcon.jsx +21 -0
  345. package/src/icons/FlashGradientIcon.jsx +39 -0
  346. package/src/icons/FlashIcon.jsx +21 -0
  347. package/src/icons/FlatAndSharpIcon.jsx +25 -0
  348. package/src/icons/FlatIcon.jsx +20 -0
  349. package/src/icons/FolderIcon.jsx +32 -0
  350. package/src/icons/FolderPlusIcon.jsx +26 -0
  351. package/src/icons/ForwardIcon.jsx +18 -0
  352. package/src/icons/GiftIcon.jsx +21 -0
  353. package/src/icons/GlobeIcon.jsx +22 -0
  354. package/src/icons/GoalsIcon.jsx +25 -0
  355. package/src/icons/GraphIcon.jsx +21 -0
  356. package/src/icons/GuitarAmpIcon.jsx +41 -0
  357. package/src/icons/HamburgerMenu2Icon.jsx +26 -0
  358. package/src/icons/HamburgerMenu3Icon.jsx +26 -0
  359. package/src/icons/HandbagIcon.jsx +26 -0
  360. package/src/icons/HeadphonesIcon.jsx +26 -0
  361. package/src/icons/HeadphonesLeftIcon.jsx +30 -0
  362. package/src/icons/HeadphonesRightIcon.jsx +30 -0
  363. package/src/icons/HiFiGradientIcon.jsx +36 -0
  364. package/src/icons/HiFiIcon.jsx +112 -0
  365. package/src/icons/HiHatIcon.jsx +21 -0
  366. package/src/icons/HomeIcon.jsx +18 -0
  367. package/src/icons/Icons.stories.jsx +154 -0
  368. package/src/icons/ImageGalleryIcon.jsx +25 -0
  369. package/src/icons/ImageIcon.jsx +21 -0
  370. package/src/icons/Info2Icon.jsx +18 -0
  371. package/src/icons/InfoIcon.jsx +20 -0
  372. package/src/icons/InternetSignalIcon.jsx +26 -0
  373. package/src/icons/IpadIcon.jsx +20 -0
  374. package/src/icons/IsolateDrumsGradientIcon.jsx +41 -0
  375. package/src/icons/IsolateDrumsIcon.jsx +23 -0
  376. package/src/icons/KaraokeIcon.jsx +23 -0
  377. package/src/icons/KaraokeMicIcon.jsx +23 -0
  378. package/src/icons/KeyDetectionIcon.jsx +25 -0
  379. package/src/icons/KeyboardIcon.jsx +25 -0
  380. package/src/icons/KeysIcon.jsx +21 -0
  381. package/src/icons/KickdrumIcon.jsx +30 -0
  382. package/src/icons/Knob2Icon.jsx +27 -0
  383. package/src/icons/Knob3Icon.jsx +27 -0
  384. package/src/icons/KnobIcon.jsx +28 -0
  385. package/src/icons/LabIcon.jsx +21 -0
  386. package/src/icons/LaptopIcon.jsx +25 -0
  387. package/src/icons/LibraryIcon.jsx +31 -0
  388. package/src/icons/LinkIcon.jsx +21 -0
  389. package/src/icons/ListCheckIcon.jsx +26 -0
  390. package/src/icons/ListIcon.jsx +21 -0
  391. package/src/icons/LivePerformanceIcon.jsx +23 -0
  392. package/src/icons/LockIcon.jsx +28 -0
  393. package/src/icons/LogInIcon.jsx +21 -0
  394. package/src/icons/LogOutIcon.jsx +26 -0
  395. package/src/icons/LoopIcon.jsx +29 -0
  396. package/src/icons/LoopSection2Icon.jsx +26 -0
  397. package/src/icons/LoopSection3Icon.jsx +26 -0
  398. package/src/icons/LoopSectionIcon.jsx +26 -0
  399. package/src/icons/LyricsIcon.jsx +33 -0
  400. package/src/icons/MaracasIcon.jsx +24 -0
  401. package/src/icons/MasteringIcon.jsx +37 -0
  402. package/src/icons/Maximize2Icon.jsx +26 -0
  403. package/src/icons/MaximizeIcon.jsx +26 -0
  404. package/src/icons/MetronomeIcon.jsx +23 -0
  405. package/src/icons/Minimize2Icon.jsx +26 -0
  406. package/src/icons/MinimizeIcon.jsx +26 -0
  407. package/src/icons/Mixer2Icon.jsx +25 -0
  408. package/src/icons/MixerIcon.jsx +20 -0
  409. package/src/icons/MoisesIcon.jsx +47 -0
  410. package/src/icons/MoisesLogoIcon.jsx +43 -0
  411. package/src/icons/MoneyIcon.jsx +20 -0
  412. package/src/icons/MonoIcon.jsx +18 -0
  413. package/src/icons/MoonIcon.jsx +21 -0
  414. package/src/icons/More2Icon.jsx +44 -0
  415. package/src/icons/MoreIcon.jsx +51 -0
  416. package/src/icons/MultipleUsersIcon.jsx +26 -0
  417. package/src/icons/MusicAddIcon.jsx +26 -0
  418. package/src/icons/MusicControlIcon.jsx +23 -0
  419. package/src/icons/MusicDevice2Icon.jsx +23 -0
  420. package/src/icons/MusicDeviceIcon.jsx +25 -0
  421. package/src/icons/MusicIcon.jsx +26 -0
  422. package/src/icons/MusicListIcon.jsx +26 -0
  423. package/src/icons/MusicLoverIcon.jsx +23 -0
  424. package/src/icons/MusicNoteIcon.jsx +21 -0
  425. package/src/icons/MusicNotesIcon.jsx +26 -0
  426. package/src/icons/MusicRemoveIcon.jsx +26 -0
  427. package/src/icons/NewCollectionsIcon.jsx +25 -0
  428. package/src/icons/NextIcon.jsx +20 -0
  429. package/src/icons/NoAcousticGuitarIcon.jsx +23 -0
  430. package/src/icons/NoBassIcon.jsx +23 -0
  431. package/src/icons/NoChords2Icon.jsx +25 -0
  432. package/src/icons/NoChordsDetectionIcon.jsx +31 -0
  433. package/src/icons/NoCloud3Icon.jsx +23 -0
  434. package/src/icons/NoComputerIcon.jsx +26 -0
  435. package/src/icons/NoCymbalsIcon.jsx +26 -0
  436. package/src/icons/NoDialogueIcon.jsx +26 -0
  437. package/src/icons/NoDrums2Icon.jsx +23 -0
  438. package/src/icons/NoDrumsIcon.jsx +23 -0
  439. package/src/icons/NoElectricGuitarIcon.jsx +23 -0
  440. package/src/icons/NoFileIcon.jsx +26 -0
  441. package/src/icons/NoHeadphonesIcon.jsx +26 -0
  442. package/src/icons/NoHiHatIcon.jsx +26 -0
  443. package/src/icons/NoInternetSignalIcon.jsx +33 -0
  444. package/src/icons/NoKeysIcon.jsx +38 -0
  445. package/src/icons/NoKickdrumIcon.jsx +23 -0
  446. package/src/icons/NoLoopSection2Icon.jsx +23 -0
  447. package/src/icons/NoLoopSectionIcon.jsx +26 -0
  448. package/src/icons/NoLyricsIcon.jsx +25 -0
  449. package/src/icons/NoMaracasIcon.jsx +23 -0
  450. package/src/icons/NoMetronomeIcon.jsx +23 -0
  451. package/src/icons/NoMoneyIcon.jsx +26 -0
  452. package/src/icons/NoMusicIcon.jsx +32 -0
  453. package/src/icons/NoMusicNoteIcon.jsx +25 -0
  454. package/src/icons/NoPianoIcon.jsx +33 -0
  455. package/src/icons/NoSearchIcon.jsx +26 -0
  456. package/src/icons/NoSectionsIcon.jsx +25 -0
  457. package/src/icons/NoSnareIcon.jsx +26 -0
  458. package/src/icons/NoSoundEffectsIcon.jsx +23 -0
  459. package/src/icons/NoSoundIcon.jsx +23 -0
  460. package/src/icons/NoSoundtrackIcon.jsx +30 -0
  461. package/src/icons/NoSpliterIcon.jsx +23 -0
  462. package/src/icons/NoStringsIcon.jsx +23 -0
  463. package/src/icons/NoTomsIcon.jsx +23 -0
  464. package/src/icons/NoUkuleleIcon.jsx +26 -0
  465. package/src/icons/NoVideoIcon.jsx +26 -0
  466. package/src/icons/NoVocalsIcon.jsx +23 -0
  467. package/src/icons/NoVolume2Icon.jsx +26 -0
  468. package/src/icons/NoVolumeIcon.jsx +26 -0
  469. package/src/icons/NoWoodwindBrassIcon.jsx +23 -0
  470. package/src/icons/NotificationsIcon.jsx +26 -0
  471. package/src/icons/OffloadDeviceIcon.jsx +23 -0
  472. package/src/icons/PauseFilledIcon.jsx +27 -0
  473. package/src/icons/PauseIcon.jsx +22 -0
  474. package/src/icons/PianoIcon.jsx +25 -0
  475. package/src/icons/PinIcon.jsx +20 -0
  476. package/src/icons/Pip2Icon.jsx +18 -0
  477. package/src/icons/PipIcon.jsx +21 -0
  478. package/src/icons/PitchCorrectionIcon.jsx +25 -0
  479. package/src/icons/PitchIcon.jsx +21 -0
  480. package/src/icons/PlayAllIcon.jsx +25 -0
  481. package/src/icons/PlayBackSpeedIcon.jsx +37 -0
  482. package/src/icons/PlayCircleIcon.jsx +44 -0
  483. package/src/icons/PlayIcon.jsx +20 -0
  484. package/src/icons/PlayOnRepeatIcon.jsx +26 -0
  485. package/src/icons/PlusIcon.jsx +21 -0
  486. package/src/icons/PreferencesIcon.jsx +25 -0
  487. package/src/icons/PreviousIcon.jsx +25 -0
  488. package/src/icons/PriceTagIcon.jsx +26 -0
  489. package/src/icons/ProducerIcon.jsx +69 -0
  490. package/src/icons/PuzzlePiece2Icon.jsx +26 -0
  491. package/src/icons/PuzzlePieceIcon.jsx +26 -0
  492. package/src/icons/QuantizationIcon.jsx +25 -0
  493. package/src/icons/RadioIcon.jsx +36 -0
  494. package/src/icons/RadioOffIcon.jsx +26 -0
  495. package/src/icons/RecordIcon.jsx +15 -0
  496. package/src/icons/RecordingIcon.jsx +22 -0
  497. package/src/icons/RedoIcon.jsx +26 -0
  498. package/src/icons/RefreshBackIcon.jsx +32 -0
  499. package/src/icons/RefreshIcon.jsx +26 -0
  500. package/src/icons/RemoveFromDeviceIcon.jsx +23 -0
  501. package/src/icons/RemoveIcon.jsx +25 -0
  502. package/src/icons/ReorderIcon.jsx +26 -0
  503. package/src/icons/RepostIcon.jsx +26 -0
  504. package/src/icons/ReverbIcon.jsx +25 -0
  505. package/src/icons/RocketIcon.jsx +30 -0
  506. package/src/icons/SaveTimeIcon.jsx +26 -0
  507. package/src/icons/SearchIcon.jsx +32 -0
  508. package/src/icons/SectionsIcon.jsx +25 -0
  509. package/src/icons/Setlist2Icon.jsx +26 -0
  510. package/src/icons/SetlistIcon.jsx +26 -0
  511. package/src/icons/SettingsIcon.jsx +27 -0
  512. package/src/icons/SharpIcon.jsx +20 -0
  513. package/src/icons/ShiftIcon.jsx +20 -0
  514. package/src/icons/ShuffleIcon.jsx +26 -0
  515. package/src/icons/SidebarIslandIcon.jsx +26 -0
  516. package/src/icons/SidebarLeftIcon.jsx +25 -0
  517. package/src/icons/SidebarRightIcon.jsx +26 -0
  518. package/src/icons/SlidersIcon.jsx +26 -0
  519. package/src/icons/SnareIcon.jsx +18 -0
  520. package/src/icons/SongBarIcon.jsx +26 -0
  521. package/src/icons/SongDetailIcon.jsx +26 -0
  522. package/src/icons/Songkey2Icon.jsx +25 -0
  523. package/src/icons/SongwritingIcon.jsx +26 -0
  524. package/src/icons/SoundEffectsGradientIcon.jsx +39 -0
  525. package/src/icons/SoundEffectsIcon.jsx +26 -0
  526. package/src/icons/SoundbarIcon.jsx +26 -0
  527. package/src/icons/SoundtrackGradientIcon.jsx +44 -0
  528. package/src/icons/SoundtrackIcon.jsx +26 -0
  529. package/src/icons/SparkBarsIcon.jsx +25 -0
  530. package/src/icons/SparkleIcon.jsx +35 -0
  531. package/src/icons/SparklesGradientIcon.jsx +62 -0
  532. package/src/icons/SpatialAudioIcon.jsx +55 -0
  533. package/src/icons/SpeakerIcon.jsx +23 -0
  534. package/src/icons/SpeakerLoudIcon.jsx +34 -0
  535. package/src/icons/SpeedChangerIcon.jsx +30 -0
  536. package/src/icons/SpeedIcon.jsx +18 -0
  537. package/src/icons/SplitIcon.jsx +21 -0
  538. package/src/icons/SpliterGradientIcon.jsx +44 -0
  539. package/src/icons/SpliterIcon.jsx +26 -0
  540. package/src/icons/StarFilledIcon.jsx +23 -0
  541. package/src/icons/StarIcon.jsx +20 -0
  542. package/src/icons/Stop2Icon.jsx +15 -0
  543. package/src/icons/StringsIcon.jsx +36 -0
  544. package/src/icons/TargetIcon.jsx +33 -0
  545. package/src/icons/ThumbDownIcon.jsx +26 -0
  546. package/src/icons/ThumbUpIcon.jsx +26 -0
  547. package/src/icons/ThumbsIcon.jsx +26 -0
  548. package/src/icons/TomsIcon.jsx +21 -0
  549. package/src/icons/TransposeIcon.jsx +26 -0
  550. package/src/icons/TrashIcon.jsx +21 -0
  551. package/src/icons/TrimIcon.jsx +27 -0
  552. package/src/icons/Tuner2Icon.jsx +23 -0
  553. package/src/icons/TunerIcon.jsx +18 -0
  554. package/src/icons/TvIcon.jsx +20 -0
  555. package/src/icons/UkuleleIcon.jsx +49 -0
  556. package/src/icons/UndoIcon.jsx +26 -0
  557. package/src/icons/UploadIcon.jsx +29 -0
  558. package/src/icons/UserGroup3Icon.jsx +26 -0
  559. package/src/icons/UserGroupIcon.jsx +26 -0
  560. package/src/icons/UserIcon.jsx +27 -0
  561. package/src/icons/Video2Icon.jsx +31 -0
  562. package/src/icons/Video3Icon.jsx +24 -0
  563. package/src/icons/VideoFileIcon.jsx +30 -0
  564. package/src/icons/VideoFilesIcon.jsx +30 -0
  565. package/src/icons/VideoIcon.jsx +21 -0
  566. package/src/icons/VocalIcon.jsx +18 -0
  567. package/src/icons/VocalIsolationIcon.jsx +29 -0
  568. package/src/icons/VocalsBackgroundIcon.jsx +32 -0
  569. package/src/icons/VocalsIcon.jsx +26 -0
  570. package/src/icons/Volume0Icon.jsx +26 -0
  571. package/src/icons/Volume1Icon.jsx +26 -0
  572. package/src/icons/Volume2Icon.jsx +26 -0
  573. package/src/icons/VolumeBarIcon.jsx +25 -0
  574. package/src/icons/WaveIcon.jsx +21 -0
  575. package/src/icons/WaveformIcon.jsx +25 -0
  576. package/src/icons/WidgetIcon.jsx +35 -0
  577. package/src/icons/WindIcon.jsx +18 -0
  578. package/src/icons/WoodwindBrassIcon.jsx +23 -0
  579. package/src/icons/ZoomCloseIcon.jsx +38 -0
  580. package/src/icons/ZoomInIcon.jsx +32 -0
  581. package/src/icons.jsx +343 -0
  582. package/src/index.jsx +151 -0
  583. package/src/lib/menu/Menu.module.css +356 -0
  584. package/src/lib/menu/index.js +2 -0
  585. package/src/lib/menu/renderItem.jsx +190 -0
  586. package/src/primitives.jsx +71 -0
  587. package/src/styles.css +10 -0
  588. package/src/utils/avatarUtils.js +18 -0
  589. package/src/utils/constants.js +16 -0
  590. package/src/utils/use-isomorphic-layout-effect.js +6 -0
  591. package/src/utils/useEventListener.js +34 -0
  592. package/src/utils/useIsMobileViewport.js +32 -0
  593. package/src/utils/useMobileDrawer.js +41 -0
  594. package/src/utils/useSubmitWithFeedback.js +32 -0
@@ -0,0 +1,645 @@
1
+ import React, { useState } from 'react'
2
+ import { DropdownMenu } from './DropdownMenu'
3
+ import { IconButton } from '../IconButton/IconButton'
4
+ import { Flex } from '@radix-ui/themes'
5
+ import {
6
+ DotsVerticalIcon,
7
+ GearIcon,
8
+ MixerHorizontalIcon,
9
+ } from '@radix-ui/react-icons'
10
+
11
+ export default {
12
+ title: 'Components/DropdownMenu',
13
+ component: DropdownMenu,
14
+ parameters: {
15
+ layout: 'centered',
16
+ docs: {
17
+ description: {
18
+ component: `
19
+ DropdownMenu provides a list of actions or options that appear when triggered by a button. It's built on top of Radix UI's DropdownMenu component and supports various configurations including submenus, separators, labels, and keybindings.
20
+
21
+ ## Usage
22
+
23
+ \`\`\`jsx
24
+ import { DropdownMenu } from '@moises.ai/design-system'
25
+ import { DotsVerticalIcon } from '@moises.ai/design-system/icons'
26
+ import { IconButton } from '@moises.ai/design-system'
27
+
28
+ const MyComponent = () => (
29
+ <DropdownMenu
30
+ trigger={
31
+ <IconButton>
32
+ <DotsVerticalIcon />
33
+ </IconButton>
34
+ }
35
+ options={[
36
+ {
37
+ type: 'item',
38
+ key: 'edit',
39
+ label: 'Edit',
40
+ onClick: () => console.log('Edit clicked'),
41
+ },
42
+ {
43
+ type: 'item',
44
+ key: 'duplicate',
45
+ label: 'Duplicate',
46
+ onClick: () => console.log('Duplicate clicked'),
47
+ },
48
+ { type: 'separator', key: 'sep1' },
49
+ {
50
+ type: 'item',
51
+ key: 'delete',
52
+ label: 'Delete',
53
+ onClick: () => console.log('Delete clicked'),
54
+ },
55
+ ]}
56
+ onSelectionChange={(selectedItem) => {
57
+ console.log('Selected item:', selectedItem)
58
+ // Handle the selected item
59
+ }}
60
+ disabled={false} // Optional: prevents dropdown from opening when true
61
+ />
62
+ )
63
+ \`\`\`
64
+
65
+ ## Options API
66
+
67
+ The \`options\` prop accepts an array of objects with the following types:
68
+
69
+ ### Menu Item
70
+ \`\`\`js
71
+ {
72
+ type: 'item',
73
+ key: 'uniqueKey', // Required unique identifier
74
+ label: 'Item Label', // Text to display
75
+ secondaryText: 'Secondary text', // Optional, secondary text
76
+ secondaryTextPosition: 'bottom' | 'right', // Optional, position of secondary text (default: 'bottom')
77
+ icon: <Icon />, // Optional, icon displayed before the label
78
+ onClick: () => {}, // Function called when clicked
79
+ disabled: false, // Optional, disables the item when true
80
+ keybinding: '⌘C', // Optional, displays a keyboard shortcut
81
+ rightIcon: <Icon />, // Optional, icon displayed on the right side
82
+ color: 'red' | 'cyan', // Optional: custom color for this item
83
+ }
84
+ \`\`\`
85
+
86
+ ### Submenu
87
+ \`\`\`js
88
+ {
89
+ type: 'sub',
90
+ key: 'uniqueKey', // Required unique identifier
91
+ label: 'Submenu Label', // Text to display
92
+ children: [], // Array of menu items for the submenu
93
+ color: 'red' | 'cyan', // Optional: custom color for this submenu trigger
94
+ }
95
+ \`\`\`
96
+
97
+ ### Separator
98
+ \`\`\`js
99
+ {
100
+ type: 'separator',
101
+ key: 'uniqueKey', // Required unique identifier
102
+ }
103
+ \`\`\`
104
+
105
+ ### Label
106
+ \`\`\`js
107
+ {
108
+ type: 'label',
109
+ key: 'uniqueKey', // Required unique identifier
110
+ label: 'Section Label', // Text to display as a non-interactive label
111
+ color: 'red' | 'cyan', // Optional: custom color for this label
112
+ }
113
+ \`\`\`
114
+
115
+ ### Checkbox
116
+ \`\`\`js
117
+ {
118
+ type: 'checkbox',
119
+ key: 'uniqueKey', // Required unique identifier
120
+ label: 'Checkbox Label', // Text to display
121
+ secondaryText: 'Secondary text', // Optional, secondary text
122
+ secondaryTextPosition: 'bottom' | 'right', // Optional, position of secondary text (default: 'bottom')
123
+ icon: <Icon />, // Optional, icon displayed after the checkmark placeholder
124
+ checked: true, // Whether the checkbox is checked (always reserves space for checkmark)
125
+ onChange: (checked) => {}, // Function called when toggled, receives new checked state
126
+ disabled: false, // Optional, disables the checkbox when true
127
+ keybinding: '⌘C', // Optional, displays a keyboard shortcut
128
+ rightIcon: <Icon />, // Optional, icon displayed on the right side
129
+ color: 'red' | 'cyan', // Optional: custom color for this checkbox item
130
+ }
131
+ \`\`\`
132
+ `,
133
+ },
134
+ },
135
+ },
136
+ tags: ['autodocs'],
137
+ argTypes: {
138
+ trigger: {
139
+ control: false,
140
+ description: 'The button that triggers the dropdown menu **(REQUIRED)**',
141
+ table: {
142
+ type: { summary: 'React.ReactNode' },
143
+ },
144
+ },
145
+ options: {
146
+ control: false,
147
+ description: 'Array of menu items configuration **(REQUIRED)**',
148
+ table: {
149
+ type: { summary: 'Array<MenuItem>' },
150
+ },
151
+ },
152
+ side: {
153
+ options: ['top', 'right', 'bottom', 'left'],
154
+ control: { type: 'select' },
155
+ description: 'The preferred side of the trigger to render the menu',
156
+ table: {
157
+ type: { summary: 'string' },
158
+ defaultValue: { summary: 'bottom' },
159
+ },
160
+ },
161
+ align: {
162
+ options: ['start', 'center', 'end'],
163
+ control: { type: 'select' },
164
+ description: 'The preferred alignment against the trigger',
165
+ table: {
166
+ type: { summary: 'string' },
167
+ defaultValue: { summary: 'end' },
168
+ },
169
+ },
170
+ size: {
171
+ options: ['1', '2'],
172
+ control: { type: 'select' },
173
+ description: 'The size of the dropdown menu',
174
+ table: {
175
+ type: { summary: 'string' },
176
+ defaultValue: { summary: '2' },
177
+ },
178
+ },
179
+ className: {
180
+ control: false,
181
+ description: 'Additional CSS class names to apply to the dropdown menu',
182
+ table: {
183
+ type: { summary: 'string' },
184
+ defaultValue: { summary: 'undefined' },
185
+ },
186
+ },
187
+ showActiveTrigger: {
188
+ control: { type: 'boolean' },
189
+ description:
190
+ 'When true, applies a red background with 3px border radius to the trigger button',
191
+ table: {
192
+ type: { summary: 'boolean' },
193
+ defaultValue: { summary: 'false' },
194
+ },
195
+ },
196
+ onSelectionChange: {
197
+ control: false,
198
+ description:
199
+ 'Callback function called when any menu item is selected, receives the selected item as parameter',
200
+ table: {
201
+ type: { summary: 'function' },
202
+ defaultValue: { summary: 'undefined' },
203
+ },
204
+ },
205
+ closeOnSelect: {
206
+ control: { type: 'boolean' },
207
+ description:
208
+ 'When false, keeps the menu open after selecting an option (useful for multi-action flows)',
209
+ table: {
210
+ type: { summary: 'boolean' },
211
+ defaultValue: { summary: 'true' },
212
+ },
213
+ },
214
+ disabled: {
215
+ control: { type: 'boolean' },
216
+ description:
217
+ 'When true, prevents the dropdown menu from opening and disables the trigger',
218
+ table: {
219
+ type: { summary: 'boolean' },
220
+ defaultValue: { summary: 'false' },
221
+ },
222
+ },
223
+ },
224
+ }
225
+
226
+ export const Default = {
227
+ args: {
228
+ side: 'bottom',
229
+ align: 'end',
230
+ trigger: (
231
+ <IconButton>
232
+ <DotsVerticalIcon />
233
+ </IconButton>
234
+ ),
235
+ options: [
236
+ {
237
+ type: 'item',
238
+ key: 'item1',
239
+ label: 'Edit',
240
+ onClick: () => console.log('Edit clicked'),
241
+ },
242
+ {
243
+ type: 'item',
244
+ key: 'item2',
245
+ label: 'Duplicate',
246
+ onClick: () => console.log('Duplicate clicked'),
247
+ },
248
+ { type: 'separator', key: 'sep1' },
249
+ {
250
+ type: 'item',
251
+ key: 'item3',
252
+ label: 'Delete',
253
+ onClick: () => console.log('Delete clicked'),
254
+ },
255
+ ],
256
+ },
257
+ render: (args) => (
258
+ <Flex justify="center" align="start" height="300px">
259
+ <DropdownMenu {...args} />
260
+ </Flex>
261
+ ),
262
+ }
263
+
264
+ export const StayOpenAfterSelect = {
265
+ args: {
266
+ closeOnSelect: false,
267
+ },
268
+ render: (args) => {
269
+ const [count, setCount] = useState(0)
270
+
271
+ const options = [
272
+ {
273
+ type: 'item',
274
+ key: 'inc',
275
+ label: 'Increment counter',
276
+ onClick: () => setCount((current) => current + 1),
277
+ },
278
+ {
279
+ type: 'item',
280
+ key: 'reset',
281
+ label: 'Reset counter',
282
+ onClick: () => setCount(0),
283
+ },
284
+ ]
285
+
286
+ return (
287
+ <Flex direction="column" gap="2" align="center" height="280px">
288
+ <DropdownMenu
289
+ {...args}
290
+ options={options}
291
+ trigger={
292
+ <IconButton variant="ghost">
293
+ <DotsVerticalIcon />
294
+ </IconButton>
295
+ }
296
+ />
297
+ <div style={{ fontSize: '14px', color: '#4b5563' }}>
298
+ Counter: {count} (menu stays open to keep clicking)
299
+ </div>
300
+ </Flex>
301
+ )
302
+ },
303
+ }
304
+
305
+ const ItemPlaygroundComponent = ({
306
+ size,
307
+ // Item 1
308
+ item1Type,
309
+ item1Label,
310
+ item1SecondaryText,
311
+ item1SecondaryTextPosition,
312
+ item1ShowIcon,
313
+ item1Keybinding,
314
+ item1ShowRightIcon,
315
+ item1Disabled,
316
+ item1Color,
317
+ // Item 2
318
+ item2Type,
319
+ item2Label,
320
+ item2SecondaryText,
321
+ item2SecondaryTextPosition,
322
+ item2ShowIcon,
323
+ item2Keybinding,
324
+ item2ShowRightIcon,
325
+ item2Disabled,
326
+ item2Color,
327
+ // Submenu
328
+ showSubmenu,
329
+ submenuLabel,
330
+ // Sub Item
331
+ subItemType,
332
+ subItemLabel,
333
+ subItemSecondaryText,
334
+ subItemSecondaryTextPosition,
335
+ subItemShowIcon,
336
+ subItemKeybinding,
337
+ subItemDisabled,
338
+ }) => {
339
+ const [item1IsChecked, setItem1IsChecked] = useState(false)
340
+ const [item2IsChecked, setItem2IsChecked] = useState(true)
341
+ const [subItemIsChecked, setSubItemIsChecked] = useState(false)
342
+
343
+ const item1Config = {
344
+ type: item1Type,
345
+ key: 'item-1',
346
+ label: item1Label,
347
+ secondaryText: item1SecondaryText || undefined,
348
+ secondaryTextPosition: item1SecondaryTextPosition,
349
+ icon: item1ShowIcon ? <GearIcon /> : undefined,
350
+ keybinding: item1Keybinding || undefined,
351
+ rightIcon: item1ShowRightIcon ? <DotsVerticalIcon /> : undefined,
352
+ disabled: item1Disabled,
353
+ color: item1Color === 'default' ? undefined : item1Color,
354
+ ...(item1Type === 'checkbox'
355
+ ? {
356
+ checked: item1IsChecked,
357
+ onChange: (checked) => setItem1IsChecked(checked),
358
+ }
359
+ : {
360
+ onClick: () => console.log('Item 1 clicked'),
361
+ }),
362
+ }
363
+
364
+ const item2Config = {
365
+ type: item2Type,
366
+ key: 'item-2',
367
+ label: item2Label,
368
+ secondaryText: item2SecondaryText || undefined,
369
+ secondaryTextPosition: item2SecondaryTextPosition,
370
+ icon: item2ShowIcon ? <MixerHorizontalIcon /> : undefined,
371
+ keybinding: item2Keybinding || undefined,
372
+ rightIcon: item2ShowRightIcon ? <DotsVerticalIcon /> : undefined,
373
+ disabled: item2Disabled,
374
+ color: item2Color === 'default' ? undefined : item2Color,
375
+ ...(item2Type === 'checkbox'
376
+ ? {
377
+ checked: item2IsChecked,
378
+ onChange: (checked) => setItem2IsChecked(checked),
379
+ }
380
+ : {
381
+ onClick: () => console.log('Item 2 clicked'),
382
+ }),
383
+ }
384
+
385
+ const subItemConfig = {
386
+ type: subItemType,
387
+ key: 'sub-item',
388
+ label: subItemLabel,
389
+ secondaryText: subItemSecondaryText || undefined,
390
+ secondaryTextPosition: subItemSecondaryTextPosition,
391
+ icon: subItemShowIcon ? <GearIcon /> : undefined,
392
+ keybinding: subItemKeybinding || undefined,
393
+ disabled: subItemDisabled,
394
+ ...(subItemType === 'checkbox'
395
+ ? {
396
+ checked: subItemIsChecked,
397
+ onChange: (checked) => setSubItemIsChecked(checked),
398
+ }
399
+ : {
400
+ onClick: () => console.log('Sub item clicked'),
401
+ }),
402
+ }
403
+
404
+ const options = [
405
+ {
406
+ type: 'label',
407
+ key: 'label',
408
+ label: 'Menu Items',
409
+ },
410
+ item1Config,
411
+ item2Config,
412
+ { type: 'separator', key: 'sep1' },
413
+ ...(showSubmenu
414
+ ? [
415
+ {
416
+ type: 'sub',
417
+ key: 'submenu',
418
+ label: submenuLabel,
419
+ children: [subItemConfig],
420
+ },
421
+ ]
422
+ : []),
423
+ ]
424
+
425
+ return (
426
+ <Flex direction="column" gap="4" align="center">
427
+ <div>
428
+ <h4>DropdownMenu Playground</h4>
429
+ <p style={{ fontSize: '14px', color: '#6b7280', marginBottom: '16px' }}>
430
+ Use the controls to customize all dropdown items.
431
+ </p>
432
+ </div>
433
+ <DropdownMenu
434
+ options={options}
435
+ size={size}
436
+ trigger={
437
+ <IconButton>
438
+ <DotsVerticalIcon />
439
+ </IconButton>
440
+ }
441
+ />
442
+ </Flex>
443
+ )
444
+ }
445
+
446
+ export const Playground = {
447
+ args: {
448
+ size: '2',
449
+ // Item 1
450
+ item1Type: 'item',
451
+ item1Label: 'Item 1',
452
+ item1SecondaryText: 'Secondary text',
453
+ item1SecondaryTextPosition: 'bottom',
454
+ item1ShowIcon: true,
455
+ item1Keybinding: '⌘ C',
456
+ item1ShowRightIcon: true,
457
+ item1Disabled: false,
458
+ item1Color: 'default',
459
+ // Item 2
460
+ item2Type: 'checkbox',
461
+ item2Label: 'Item 2',
462
+ item2SecondaryText: '',
463
+ item2SecondaryTextPosition: 'bottom',
464
+ item2ShowIcon: true,
465
+ item2Keybinding: '⌘ S',
466
+ item2ShowRightIcon: false,
467
+ item2Disabled: false,
468
+ item2Color: 'default',
469
+ // Submenu
470
+ showSubmenu: true,
471
+ submenuLabel: 'More Options',
472
+ // Sub Item
473
+ subItemType: 'item',
474
+ subItemLabel: 'Sub Item',
475
+ subItemSecondaryText: 'Description',
476
+ subItemSecondaryTextPosition: 'bottom',
477
+ subItemShowIcon: false,
478
+ subItemKeybinding: '',
479
+ subItemDisabled: false,
480
+ },
481
+ argTypes: {
482
+ size: {
483
+ options: ['1', '2'],
484
+ control: { type: 'select' },
485
+ description: 'Size of the dropdown menu items',
486
+ table: { category: 'General' },
487
+ },
488
+ // Item 1
489
+ item1Type: {
490
+ options: ['item', 'checkbox'],
491
+ control: { type: 'select' },
492
+ description: 'Type of the menu item (regular item or checkbox)',
493
+ table: { category: 'Item 1' },
494
+ },
495
+ item1Label: {
496
+ control: { type: 'text' },
497
+ description: 'Label text',
498
+ table: { category: 'Item 1' },
499
+ },
500
+ item1SecondaryText: {
501
+ control: { type: 'text' },
502
+ description: 'Secondary text',
503
+ table: { category: 'Item 1' },
504
+ },
505
+ item1SecondaryTextPosition: {
506
+ options: ['bottom', 'right'],
507
+ control: { type: 'select' },
508
+ description: 'Secondary text position',
509
+ table: { category: 'Item 1' },
510
+ },
511
+ item1ShowIcon: {
512
+ control: { type: 'boolean' },
513
+ description: 'Show left icon',
514
+ table: { category: 'Item 1' },
515
+ },
516
+ item1Keybinding: {
517
+ control: { type: 'text' },
518
+ description: 'Keyboard shortcut',
519
+ table: { category: 'Item 1' },
520
+ },
521
+ item1ShowRightIcon: {
522
+ control: { type: 'boolean' },
523
+ description: 'Show right icon',
524
+ table: { category: 'Item 1' },
525
+ },
526
+ item1Disabled: {
527
+ control: { type: 'boolean' },
528
+ description: 'Disabled state',
529
+ table: { category: 'Item 1' },
530
+ },
531
+ item1Color: {
532
+ options: ['default', 'red', 'cyan'],
533
+ control: { type: 'select' },
534
+ description: 'Color variant',
535
+ table: { category: 'Item 1' },
536
+ },
537
+ // Item 2
538
+ item2Type: {
539
+ options: ['item', 'checkbox'],
540
+ control: { type: 'select' },
541
+ description: 'Type of the menu item (regular item or checkbox)',
542
+ table: { category: 'Item 2' },
543
+ },
544
+ item2Label: {
545
+ control: { type: 'text' },
546
+ description: 'Label text',
547
+ table: { category: 'Item 2' },
548
+ },
549
+ item2SecondaryText: {
550
+ control: { type: 'text' },
551
+ description: 'Secondary text',
552
+ table: { category: 'Item 2' },
553
+ },
554
+ item2SecondaryTextPosition: {
555
+ options: ['bottom', 'right'],
556
+ control: { type: 'select' },
557
+ description: 'Secondary text position',
558
+ table: { category: 'Item 2' },
559
+ },
560
+ item2ShowIcon: {
561
+ control: { type: 'boolean' },
562
+ description: 'Show left icon',
563
+ table: { category: 'Item 2' },
564
+ },
565
+ item2Keybinding: {
566
+ control: { type: 'text' },
567
+ description: 'Keyboard shortcut',
568
+ table: { category: 'Item 2' },
569
+ },
570
+ item2ShowRightIcon: {
571
+ control: { type: 'boolean' },
572
+ description: 'Show right icon',
573
+ table: { category: 'Item 2' },
574
+ },
575
+ item2Disabled: {
576
+ control: { type: 'boolean' },
577
+ description: 'Disabled state',
578
+ table: { category: 'Item 2' },
579
+ },
580
+ item2Color: {
581
+ options: ['default', 'red', 'cyan'],
582
+ control: { type: 'select' },
583
+ description: 'Color variant',
584
+ table: { category: 'Item 2' },
585
+ },
586
+ // Submenu
587
+ showSubmenu: {
588
+ control: { type: 'boolean' },
589
+ description: 'Show submenu',
590
+ table: { category: 'Submenu' },
591
+ },
592
+ submenuLabel: {
593
+ control: { type: 'text' },
594
+ description: 'Submenu trigger label',
595
+ table: { category: 'Submenu' },
596
+ if: { arg: 'showSubmenu' },
597
+ },
598
+ // Sub Item
599
+ subItemType: {
600
+ options: ['item', 'checkbox'],
601
+ control: { type: 'select' },
602
+ description: 'Type of the sub menu item (regular item or checkbox)',
603
+ table: { category: 'Sub Item' },
604
+ if: { arg: 'showSubmenu' },
605
+ },
606
+ subItemLabel: {
607
+ control: { type: 'text' },
608
+ description: 'Label text',
609
+ table: { category: 'Sub Item' },
610
+ if: { arg: 'showSubmenu' },
611
+ },
612
+ subItemSecondaryText: {
613
+ control: { type: 'text' },
614
+ description: 'Secondary text',
615
+ table: { category: 'Sub Item' },
616
+ if: { arg: 'showSubmenu' },
617
+ },
618
+ subItemSecondaryTextPosition: {
619
+ options: ['bottom', 'right'],
620
+ control: { type: 'select' },
621
+ description: 'Secondary text position',
622
+ table: { category: 'Sub Item' },
623
+ if: { arg: 'showSubmenu' },
624
+ },
625
+ subItemShowIcon: {
626
+ control: { type: 'boolean' },
627
+ description: 'Show left icon',
628
+ table: { category: 'Sub Item' },
629
+ if: { arg: 'showSubmenu' },
630
+ },
631
+ subItemKeybinding: {
632
+ control: { type: 'text' },
633
+ description: 'Keyboard shortcut',
634
+ table: { category: 'Sub Item' },
635
+ if: { arg: 'showSubmenu' },
636
+ },
637
+ subItemDisabled: {
638
+ control: { type: 'boolean' },
639
+ description: 'Disabled state',
640
+ table: { category: 'Sub Item' },
641
+ if: { arg: 'showSubmenu' },
642
+ },
643
+ },
644
+ render: (args) => <ItemPlaygroundComponent {...args} />,
645
+ }