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