@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,439 @@
1
+ import React, { useState } from 'react'
2
+ import {
3
+ VocalIcon,
4
+ VocalsIcon,
5
+ DrumsIcon,
6
+ IsolateDrumsIcon,
7
+ ElectricGuitarIcon,
8
+ AcousticGuitarIcon,
9
+ BassIcon,
10
+ PianoIcon,
11
+ KeysIcon,
12
+ MusicIcon,
13
+ StringsIcon,
14
+ WindIcon,
15
+ LockIcon,
16
+ } from '../../icons'
17
+
18
+ import { MultiSelectCards } from './MultiSelectCards'
19
+ import { Flex, Text, Box } from '@radix-ui/themes'
20
+
21
+ export default {
22
+ title: 'Components/MultiSelectCards',
23
+ component: MultiSelectCards,
24
+ parameters: {
25
+ layout: 'centered',
26
+ docs: {
27
+ description: {
28
+ component: `
29
+ ## MultiSelectCards
30
+
31
+ A flexible multi-selection card component that allows users to select multiple items from a grid of cards. Each card can display an icon, name, and support various states like disabled, locked, and selected.
32
+
33
+ ### Features
34
+
35
+ - **Multi-selection**: Select and deselect multiple cards
36
+ - **Visual feedback**: Clear indication of selected, disabled, and locked states
37
+ - **Responsive grid**: Automatically adjusts to container width
38
+ - **Scrollable**: Handles overflow with vertical scrolling
39
+ - **Accessible**: Proper keyboard navigation and screen reader support
40
+
41
+ ### Usage
42
+
43
+ \`\`\`jsx
44
+ import { MultiSelectCards } from '@moises.ai/design-system'
45
+
46
+ const [selectedItems, setSelectedItems] = useState([])
47
+
48
+ const handleSelect = (item) => {
49
+ setSelectedItems(prev => {
50
+ if (prev.includes(item.value)) {
51
+ return prev.filter(value => value !== item.value)
52
+ } else {
53
+ return [...prev, item.value]
54
+ }
55
+ })
56
+ }
57
+
58
+ <MultiSelectCards
59
+ items={items}
60
+ value={selectedItems}
61
+ onSelect={handleSelect}
62
+ />
63
+ \`\`\`
64
+
65
+ ### Props
66
+
67
+ | Prop | Type | Default | Description |
68
+ |------|------|---------|-------------|
69
+ | \`items\` | \`Item[]\` | \`[]\` | Array of items to display |
70
+ | \`value\` | \`string[]\` | \`[]\` | Array of selected item values |
71
+ | \`onSelect\` | \`(item: Item) => void\` | \`undefined\` | Callback when item is selected/deselected |
72
+ | \`disabled\` | \`boolean\` | \`false\` | Disable all cards |
73
+ | \`className\` | \`string\` | \`undefined\` | Additional CSS class |
74
+
75
+ ### Item Structure
76
+
77
+ \`\`\`typescript
78
+ interface Item {
79
+ value: string // Unique identifier
80
+ name: string // Display name
81
+ icon?: React.ReactNode // Optional icon
82
+ disabled?: boolean // Disable this specific item
83
+ isLocked?: boolean // Show lock icon and prevent selection
84
+ }
85
+ \`\`\`
86
+ `,
87
+ },
88
+ },
89
+ },
90
+ tags: ['autodocs'],
91
+ argTypes: {
92
+ items: {
93
+ control: false,
94
+ description: 'Array of items to display in the grid',
95
+ },
96
+ value: {
97
+ control: false,
98
+ description: 'Array of selected item values',
99
+ },
100
+ onSelect: {
101
+ action: 'selected',
102
+ description: 'Callback when an item is selected or deselected',
103
+ },
104
+ disabled: {
105
+ control: 'boolean',
106
+ description: 'Disable all cards in the component',
107
+ },
108
+ className: {
109
+ control: 'text',
110
+ description: 'Additional CSS class for styling',
111
+ },
112
+ },
113
+ }
114
+
115
+ // Sample data for stories
116
+ const musicItems = [
117
+ { value: 'vocal', name: 'Vocal', icon: <VocalIcon width={16} height={16} /> },
118
+ {
119
+ value: 'vocals',
120
+ name: 'Vocals',
121
+ icon: <VocalsIcon width={16} height={16} />,
122
+ },
123
+ { value: 'drums', name: 'Drums', icon: <DrumsIcon width={16} height={16} /> },
124
+ {
125
+ value: 'drums-kit',
126
+ name: 'Drums Kit',
127
+ icon: <IsolateDrumsIcon width={16} height={16} />,
128
+ },
129
+ {
130
+ value: 'guitars',
131
+ name: 'Guitars',
132
+ icon: <ElectricGuitarIcon width={16} height={16} />,
133
+ },
134
+ {
135
+ value: 'acoustic-electric',
136
+ name: 'Acoustic & Electric Guitar',
137
+ icon: <AcousticGuitarIcon width={16} height={16} />,
138
+ },
139
+ {
140
+ value: 'rhythm-lead',
141
+ name: 'Rhythm & Lead Guitar',
142
+ icon: <ElectricGuitarIcon width={16} height={16} />,
143
+ },
144
+ { value: 'bass', name: 'Bass', icon: <BassIcon width={16} height={16} /> },
145
+ { value: 'piano', name: 'Piano', icon: <PianoIcon width={16} height={16} /> },
146
+ { value: 'keys', name: 'Keys', icon: <KeysIcon width={16} height={16} /> },
147
+ { value: 'music', name: 'Music', icon: <MusicIcon width={16} height={16} /> },
148
+ {
149
+ value: 'strings',
150
+ name: 'Strings',
151
+ icon: <StringsIcon width={16} height={16} />,
152
+ },
153
+ { value: 'wind', name: 'Wind', icon: <WindIcon width={16} height={16} /> },
154
+ ]
155
+
156
+ const itemsWithDisabled = [
157
+ {
158
+ value: 'vocal',
159
+ name: 'Vocal',
160
+ icon: <VocalIcon width={16} height={16} />,
161
+ disabled: true,
162
+ },
163
+ {
164
+ value: 'vocals',
165
+ name: 'Vocals',
166
+ icon: <VocalsIcon width={16} height={16} />,
167
+ },
168
+ {
169
+ value: 'drums',
170
+ name: 'Drums',
171
+ icon: <DrumsIcon width={16} height={16} />,
172
+ disabled: true,
173
+ },
174
+ {
175
+ value: 'drums-kit',
176
+ name: 'Drums Kit',
177
+ icon: <IsolateDrumsIcon width={16} height={16} />,
178
+ },
179
+ {
180
+ value: 'guitars',
181
+ name: 'Guitars',
182
+ icon: <ElectricGuitarIcon width={16} height={16} />,
183
+ disabled: true,
184
+ },
185
+ {
186
+ value: 'acoustic-electric',
187
+ name: 'Acoustic & Electric Guitar',
188
+ icon: <AcousticGuitarIcon width={16} height={16} />,
189
+ },
190
+ {
191
+ value: 'rhythm-lead',
192
+ name: 'Rhythm & Lead Guitar',
193
+ icon: <ElectricGuitarIcon width={16} height={16} />,
194
+ },
195
+ {
196
+ value: 'bass',
197
+ name: 'Bass',
198
+ icon: <BassIcon width={16} height={16} />,
199
+ disabled: true,
200
+ },
201
+ { value: 'piano', name: 'Piano', icon: <PianoIcon width={16} height={16} /> },
202
+ { value: 'keys', name: 'Keys', icon: <KeysIcon width={16} height={16} /> },
203
+ ]
204
+
205
+ const itemsWithLocked = [
206
+ {
207
+ value: 'vocal',
208
+ name: 'Vocal',
209
+ icon: <VocalIcon width={16} height={16} />,
210
+ isLocked: true,
211
+ },
212
+ {
213
+ value: 'vocals',
214
+ name: 'Vocals',
215
+ icon: <VocalsIcon width={16} height={16} />,
216
+ },
217
+ {
218
+ value: 'drums',
219
+ name: 'Drums',
220
+ icon: <DrumsIcon width={16} height={16} />,
221
+ isLocked: true,
222
+ },
223
+ {
224
+ value: 'drums-kit',
225
+ name: 'Drums Kit',
226
+ icon: <IsolateDrumsIcon width={16} height={16} />,
227
+ },
228
+ {
229
+ value: 'guitars',
230
+ name: 'Guitars',
231
+ icon: <ElectricGuitarIcon width={16} height={16} />,
232
+ },
233
+ {
234
+ value: 'acoustic-electric',
235
+ name: 'Acoustic & Electric Guitar',
236
+ icon: <AcousticGuitarIcon width={16} height={16} />,
237
+ isLocked: true,
238
+ },
239
+ ]
240
+
241
+ const itemsWithMixedStates = [
242
+ {
243
+ value: 'vocal',
244
+ name: 'Vocal',
245
+ icon: <VocalIcon width={16} height={16} />,
246
+ disabled: true,
247
+ },
248
+ {
249
+ value: 'vocals',
250
+ name: 'Vocals',
251
+ icon: <VocalsIcon width={16} height={16} />,
252
+ isLocked: true,
253
+ },
254
+ { value: 'drums', name: 'Drums', icon: <DrumsIcon width={16} height={16} /> },
255
+ {
256
+ value: 'drums-kit',
257
+ name: 'Drums Kit',
258
+ icon: <IsolateDrumsIcon width={16} height={16} />,
259
+ disabled: true,
260
+ },
261
+ {
262
+ value: 'guitars',
263
+ name: 'Guitars',
264
+ icon: <ElectricGuitarIcon width={16} height={16} />,
265
+ isLocked: true,
266
+ },
267
+ {
268
+ value: 'acoustic-electric',
269
+ name: 'Acoustic & Electric Guitar',
270
+ icon: <AcousticGuitarIcon width={16} height={16} />,
271
+ },
272
+ ]
273
+
274
+ // Wrapper component for interactive stories
275
+ const InteractiveWrapper = ({
276
+ items,
277
+ initialSelected = [],
278
+ disabled = false,
279
+ title,
280
+ }) => {
281
+ const [selectedItems, setSelectedItems] = useState(initialSelected)
282
+
283
+ const handleSelect = (item) => {
284
+ if (item.isLocked) {
285
+ console.log('Locked item clicked:', item.value)
286
+ alert(`🔒 Item bloqueado: ${item.name}`)
287
+ return
288
+ }
289
+
290
+ setSelectedItems((prevSelected) => {
291
+ if (prevSelected.includes(item.value)) {
292
+ return prevSelected.filter((value) => value !== item.value)
293
+ } else {
294
+ return [...prevSelected, item.value]
295
+ }
296
+ })
297
+ }
298
+
299
+ return (
300
+ <Box width="100%">
301
+ {title && (
302
+ <Text size="2" color="gray" mb="2" style={{ display: 'block' }}>
303
+ {title}
304
+ </Text>
305
+ )}
306
+ <Flex height="300px" width="360px">
307
+ <MultiSelectCards
308
+ items={items}
309
+ value={selectedItems}
310
+ onSelect={handleSelect}
311
+ disabled={disabled}
312
+ />
313
+ </Flex>
314
+ {selectedItems.length > 0 && (
315
+ <Text size="1" color="gray" mt="2" style={{ display: 'block' }}>
316
+ Selected: {selectedItems.join(', ')}
317
+ </Text>
318
+ )}
319
+ </Box>
320
+ )
321
+ }
322
+
323
+ // Story exports
324
+ export const Default = () => (
325
+ <InteractiveWrapper
326
+ items={musicItems}
327
+ title="Basic multi-selection with all items enabled"
328
+ />
329
+ )
330
+
331
+ export const WithPreselectedItems = () => (
332
+ <InteractiveWrapper
333
+ items={musicItems}
334
+ initialSelected={['vocal', 'drums', 'bass']}
335
+ title="Some items are pre-selected"
336
+ />
337
+ )
338
+
339
+ export const WithDisabledCards = () => (
340
+ <InteractiveWrapper
341
+ items={itemsWithDisabled}
342
+ title="Some cards are disabled (grayed out and non-interactive)"
343
+ />
344
+ )
345
+
346
+ export const WithLockedCards = () => (
347
+ <InteractiveWrapper
348
+ items={itemsWithLocked}
349
+ title="Some cards are locked (show lock icon and trigger alert on click)"
350
+ />
351
+ )
352
+
353
+ export const WithMixedStates = () => (
354
+ <InteractiveWrapper
355
+ items={itemsWithMixedStates}
356
+ title="Mix of normal, disabled, and locked cards"
357
+ />
358
+ )
359
+
360
+ export const SelectedWithDisabledCards = () => (
361
+ <InteractiveWrapper
362
+ items={itemsWithDisabled}
363
+ initialSelected={['vocal', 'drums', 'bass', 'vocals', 'guitars']}
364
+ title="Pre-selected items including some disabled ones"
365
+ />
366
+ )
367
+
368
+ export const ComponentDisabled = () => (
369
+ <InteractiveWrapper
370
+ items={musicItems}
371
+ initialSelected={['vocal', 'drums']}
372
+ disabled={true}
373
+ title="Entire component is disabled"
374
+ />
375
+ )
376
+
377
+ export const EmptyState = () => (
378
+ <InteractiveWrapper items={[]} title="No items to display" />
379
+ )
380
+
381
+ export const SingleItem = () => (
382
+ <InteractiveWrapper items={[musicItems[0]]} title="Single item selection" />
383
+ )
384
+
385
+ export const ManyItems = () => {
386
+ // Create a larger dataset for testing scrolling
387
+ const manyItems = Array.from({ length: 20 }, (_, index) => ({
388
+ value: `item-${index}`,
389
+ name: `Item ${index + 1}`,
390
+ icon: <MusicIcon width={16} height={16} />,
391
+ ...(index % 5 === 0 && { disabled: true }),
392
+ ...(index % 7 === 0 && { isLocked: true }),
393
+ }))
394
+
395
+ return (
396
+ <InteractiveWrapper
397
+ items={manyItems}
398
+ title="Many items to test scrolling behavior"
399
+ />
400
+ )
401
+ }
402
+
403
+ // Template for testing specific props
404
+ export const Template = (args) => {
405
+ const [selectedItems, setSelectedItems] = useState([])
406
+
407
+ const handleSelect = (item) => {
408
+ setSelectedItems((prevSelected) => {
409
+ if (prevSelected.includes(item.value)) {
410
+ return prevSelected.filter((value) => value !== item.value)
411
+ } else {
412
+ return [...prevSelected, item.value]
413
+ }
414
+ })
415
+ }
416
+
417
+ return (
418
+ <Flex height="300px" width="360px">
419
+ <MultiSelectCards
420
+ {...args}
421
+ value={selectedItems}
422
+ onSelect={handleSelect}
423
+ />
424
+ </Flex>
425
+ )
426
+ }
427
+
428
+ Template.args = {
429
+ items: musicItems,
430
+ disabled: false,
431
+ }
432
+
433
+ Template.parameters = {
434
+ docs: {
435
+ description: {
436
+ story: 'Template story for testing specific props and configurations.',
437
+ },
438
+ },
439
+ }
@@ -0,0 +1,227 @@
1
+ import styles from './PanControl.module.css'
2
+ import classNames from 'classnames'
3
+ import { useRef, useCallback, useMemo, useState, useEffect } from 'react'
4
+ import { useEventListener } from '../../utils/useEventListener'
5
+ import { Tooltip } from 'radix-ui'
6
+
7
+ const KNOB_CENTER_X = 10
8
+ const KNOB_CENTER_Y = 10
9
+ const KNOB_RADIUS = 9.5
10
+ const START_ANGLE = -Math.PI / 2
11
+ const STEP_SIZE = 0.01
12
+
13
+ const clampNorm = (v) => Math.max(-1, Math.min(1, v))
14
+ const denormalize = (normalized, minValue, maxValue) =>
15
+ ((normalized + 1) / 2) * (maxValue - minValue) + minValue
16
+
17
+ export const PanControl = ({
18
+ className,
19
+ value,
20
+ onChange,
21
+ disabled,
22
+ minValue = -0.65,
23
+ maxValue = 0.65,
24
+ }) => {
25
+ const containerRef = useRef(null)
26
+ const [open, setOpen] = useState(false)
27
+ const timeoutRef = useRef()
28
+ const [isDragging, setIsDragging] = useState(false)
29
+ const styleRef = useRef(null)
30
+
31
+ const startYRef = useRef(0)
32
+ const pendingNormRef = useRef(value)
33
+ const rafRef = useRef(0)
34
+
35
+ const showTooltip = useCallback(() => {
36
+ clearTimeout(timeoutRef.current)
37
+ setOpen(true)
38
+ }, [])
39
+
40
+ const hideTooltip = useCallback(() => {
41
+ if (isDragging) return
42
+ timeoutRef.current = setTimeout(() => setOpen(false), 300)
43
+ }, [isDragging])
44
+
45
+ useEffect(() => {
46
+ if (isDragging) {
47
+ const style = document.createElement('style')
48
+ style.textContent = '* { cursor: ns-resize !important; }'
49
+ document.head.appendChild(style)
50
+ styleRef.current = style
51
+ showTooltip()
52
+ } else {
53
+ if (styleRef.current) {
54
+ document.head.removeChild(styleRef.current)
55
+ styleRef.current = null
56
+ }
57
+ hideTooltip()
58
+ }
59
+ return () => {
60
+ if (styleRef.current) {
61
+ document.head.removeChild(styleRef.current)
62
+ styleRef.current = null
63
+ }
64
+ hideTooltip()
65
+ if (rafRef.current) cancelAnimationFrame(rafRef.current)
66
+ }
67
+ }, [isDragging, showTooltip, hideTooltip])
68
+
69
+ const scheduleEmit = useCallback(
70
+ (nextNormalized) => {
71
+ pendingNormRef.current = clampNorm(nextNormalized)
72
+ if (rafRef.current) return
73
+ rafRef.current = requestAnimationFrame(() => {
74
+ rafRef.current = 0
75
+ onChange(pendingNormRef.current)
76
+ })
77
+ },
78
+ [onChange],
79
+ )
80
+
81
+ const handleWheel = useCallback(
82
+ (e) => {
83
+ e.preventDefault()
84
+ e.stopPropagation()
85
+ const delta = e.wheelDelta ?? -e.deltaY * 25
86
+ if (!delta) return
87
+ const next = value + (delta > 0 ? STEP_SIZE : -STEP_SIZE)
88
+ scheduleEmit(next)
89
+ },
90
+ [value, scheduleEmit],
91
+ )
92
+ useEventListener('wheel', handleWheel, containerRef)
93
+
94
+ const onPointerDown = useCallback(
95
+ (e) => {
96
+ if (disabled) return
97
+ e.preventDefault()
98
+ const target = e.currentTarget
99
+ target.setPointerCapture?.(e.pointerId)
100
+ setIsDragging(true)
101
+ startYRef.current = e.clientY
102
+ },
103
+ [disabled],
104
+ )
105
+
106
+ const onPointerMove = useCallback(
107
+ (e) => {
108
+ if (!isDragging) return
109
+ const deltaY = startYRef.current - e.clientY
110
+ const next = value + deltaY * STEP_SIZE
111
+ scheduleEmit(next)
112
+ startYRef.current = e.clientY
113
+ },
114
+ [isDragging, value, scheduleEmit],
115
+ )
116
+
117
+ const onPointerUp = useCallback((e) => {
118
+ e.currentTarget?.releasePointerCapture?.(e.pointerId)
119
+ setIsDragging(false)
120
+ }, [])
121
+
122
+ const handleClick = useCallback(
123
+ (e) => {
124
+ if (e.detail === 2) scheduleEmit(0)
125
+ },
126
+ [scheduleEmit],
127
+ )
128
+
129
+ const { arcPath, pointerRotation, arcColor, pointerColor } = useMemo(() => {
130
+ const actual = denormalize(value, minValue, maxValue)
131
+ const displayNorm = clampNorm(actual)
132
+ const endAngle = START_ANGLE + displayNorm * Math.PI
133
+ const x1 = KNOB_CENTER_X + KNOB_RADIUS * Math.cos(START_ANGLE)
134
+ const y1 = KNOB_CENTER_Y + KNOB_RADIUS * Math.sin(START_ANGLE)
135
+ const x2 = KNOB_CENTER_X + KNOB_RADIUS * Math.cos(endAngle)
136
+ const y2 = KNOB_CENTER_Y + KNOB_RADIUS * Math.sin(endAngle)
137
+ const largeArc = 0
138
+ const sweep = displayNorm > 0 ? 1 : 0
139
+
140
+ return {
141
+ arcPath: `M ${x1.toFixed(3)} ${y1.toFixed(3)}
142
+ A ${KNOB_RADIUS} ${KNOB_RADIUS} 0 ${largeArc} ${sweep}
143
+ ${x2.toFixed(3)} ${y2.toFixed(3)}`,
144
+ pointerRotation: displayNorm * 180,
145
+ arcColor: disabled ? '#5A6169' : '#19E4F1',
146
+ pointerColor: disabled ? '#43484E' : '#B0B4BA',
147
+ }
148
+ }, [value, disabled, minValue, maxValue])
149
+
150
+ const panValueText = useMemo(() => {
151
+ const actual = denormalize(value, minValue, maxValue)
152
+ const pct = Math.round(actual * 100)
153
+ return `Pan: ${Math.abs(pct) < 1 ? 0 : pct}`
154
+ }, [value, minValue, maxValue])
155
+
156
+ return (
157
+ <div
158
+ ref={containerRef}
159
+ className={classNames(styles.content, className)}
160
+ data-no-drag="true"
161
+ onClick={handleClick}
162
+ style={{ cursor: disabled ? 'default' : 'ns-resize' }}
163
+ >
164
+ <Tooltip.Provider delayDuration={200}>
165
+ <Tooltip.Root open={open}>
166
+ <Tooltip.Trigger asChild>
167
+ <div
168
+ className={classNames(
169
+ styles.pan,
170
+ isDragging && styles.active,
171
+ disabled && styles.disabled,
172
+ )}
173
+ onPointerDown={onPointerDown}
174
+ onPointerMove={onPointerMove}
175
+ onPointerUp={onPointerUp}
176
+ onPointerCancel={onPointerUp}
177
+ >
178
+ <svg width={20} height={20} viewBox="0 0 20 20" fill="none">
179
+ <circle cx={KNOB_CENTER_X} cy={KNOB_CENTER_Y} r={10} />
180
+ <circle
181
+ cx={KNOB_CENTER_X}
182
+ cy={KNOB_CENTER_Y}
183
+ r={KNOB_RADIUS}
184
+ stroke="#D3EDF8"
185
+ strokeOpacity={0.113725}
186
+ />
187
+ {value !== 0 && (
188
+ <path
189
+ d={arcPath}
190
+ stroke={arcColor}
191
+ strokeLinecap="round"
192
+ strokeWidth={1}
193
+ fill="none"
194
+ />
195
+ )}
196
+ <g
197
+ transform={`rotate(${pointerRotation} ${KNOB_CENTER_X} ${KNOB_CENTER_Y})`}
198
+ >
199
+ <path
200
+ d="M10 0.5 L10 6"
201
+ stroke={pointerColor}
202
+ strokeLinecap="round"
203
+ strokeWidth={1}
204
+ />
205
+ </g>
206
+ </svg>
207
+ </div>
208
+ </Tooltip.Trigger>
209
+
210
+ <Tooltip.Content
211
+ className={styles.tooltipContent}
212
+ side="bottom"
213
+ align="center"
214
+ sideOffset={10}
215
+ >
216
+ <>
217
+ {panValueText}
218
+ <Tooltip.Arrow className={styles.tooltipArrow} />
219
+ </>
220
+ </Tooltip.Content>
221
+ </Tooltip.Root>
222
+ </Tooltip.Provider>
223
+ </div>
224
+ )
225
+ }
226
+
227
+ PanControl.displayName = 'PanControl'