@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,97 @@
1
+ import classNames from 'classnames'
2
+ import styles from './Countdown.module.css'
3
+
4
+ const padZero = (num) => String(num).padStart(2, '0')
5
+
6
+ export const Countdown = ({
7
+ i18n = { _: (text) => text },
8
+ show = true,
9
+ days = 0,
10
+ hours = 0,
11
+ minutes = 0,
12
+ seconds = 0,
13
+ ended = false,
14
+ loading = false,
15
+ theme = 'default',
16
+ variant = 'lg',
17
+ className,
18
+ showDays = true,
19
+ }) => {
20
+ if (!show || ended) {
21
+ return null
22
+ }
23
+
24
+ const themeClass = {
25
+ [styles.white]: theme === 'white',
26
+ [styles.gray]: theme === 'gray',
27
+ [styles.default]: theme === 'default',
28
+ [styles.sm]: variant === 'sm',
29
+ [styles.md]: variant === 'md',
30
+ [styles.lg]: variant === 'lg',
31
+ }
32
+
33
+ if (loading) {
34
+ return (
35
+ <div className={classNames(styles.skeletonBox, themeClass, className)}>
36
+ <div className={styles.skeleton} />
37
+ </div>
38
+ )
39
+ }
40
+
41
+ return (
42
+ <div className={classNames(styles.clock, className)}>
43
+ {showDays && days > 0 && (
44
+ <>
45
+ <div
46
+ className={classNames(styles.column, themeClass, {
47
+ [styles.days]: days > 0,
48
+ })}
49
+ >
50
+ <p className={classNames(styles.labelBig, themeClass)}>
51
+ {padZero(days)}
52
+ </p>
53
+ <p className={classNames(styles.labelSmall, themeClass)}>
54
+ {i18n._('Days')}
55
+ </p>
56
+ </div>
57
+ <p className={classNames(styles.colon, themeClass)}>:</p>
58
+ </>
59
+ )}
60
+
61
+ <div className={classNames(styles.column, themeClass)}>
62
+ <p className={classNames(styles.labelBig, themeClass)}>
63
+ {padZero(hours)}
64
+ </p>
65
+ <p className={classNames(styles.labelSmall, themeClass)}>
66
+ {i18n._('Hours')}
67
+ </p>
68
+ </div>
69
+ <p className={classNames(styles.colon, themeClass)}>:</p>
70
+
71
+ <div className={classNames(styles.column, themeClass)}>
72
+ <p className={classNames(styles.labelBig, themeClass)}>
73
+ {padZero(minutes)}
74
+ </p>
75
+ <p className={classNames(styles.labelSmall, themeClass)}>
76
+ {i18n._('Minutes')}
77
+ </p>
78
+ </div>
79
+ {(days <= 0 || !showDays) && (
80
+ <p className={classNames(styles.colon, themeClass)}>:</p>
81
+ )}
82
+
83
+ {(days <= 0 || !showDays) && (
84
+ <div className={classNames(styles.column, themeClass)}>
85
+ <p className={classNames(styles.labelBig, themeClass)}>
86
+ {padZero(seconds)}
87
+ </p>
88
+ <p className={classNames(styles.labelSmall, themeClass)}>
89
+ {i18n._('Sec')}
90
+ </p>
91
+ </div>
92
+ )}
93
+ </div>
94
+ )
95
+ }
96
+
97
+ Countdown.displayName = 'Countdown'
@@ -0,0 +1,206 @@
1
+
2
+ .clock {
3
+ display: flex;
4
+ text-align: center;
5
+ justify-content: center;
6
+ align-items: flex-start;
7
+ gap: 6px;
8
+ }
9
+
10
+ .column {
11
+ position: relative;
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ }
16
+
17
+
18
+ .column.sm {
19
+ height: 49px;
20
+ }
21
+
22
+ .column.md {
23
+ height: 60px;
24
+ }
25
+
26
+ .column.lg {
27
+ height: 72px;
28
+ }
29
+
30
+ .labelBig {
31
+ line-height: 1;
32
+ border-radius: 6px;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ font-weight: 400;
37
+ margin: 0;
38
+ }
39
+
40
+ .labelBig.gray {
41
+ color: var(--neutral-alpha-11);
42
+ background-color: var(--neutral-alpha-5);
43
+ }
44
+
45
+ .labelBig.white {
46
+ color: #737373;
47
+ background-color: #ffffff;
48
+ }
49
+
50
+ .labelBig.default {
51
+ color: var(--neutral-alpha-11);
52
+ background-color: transparent;
53
+ }
54
+
55
+ .labelBig.sm {
56
+ font-size: 24px;
57
+ padding: 4px;
58
+ width: 44px;
59
+ font-weight: 500;
60
+ }
61
+
62
+ .labelBig.md {
63
+ font-size: 40px;
64
+ padding: 4px 0px 2px 0;
65
+ width: 49px;
66
+ }
67
+
68
+ .labelBig.lg {
69
+ font-size: 40px;
70
+ padding: 6px 0;
71
+ width: 59px;
72
+ }
73
+
74
+ .labelSmall {
75
+ font-size: 10px;
76
+ letter-spacing: 2px;
77
+ text-transform: uppercase;
78
+ margin: 0;
79
+ position: absolute;
80
+ bottom: 0;
81
+ left: 50%;
82
+ transform: translateX(-50%);
83
+ white-space: nowrap;
84
+ }
85
+
86
+ .labelSmall.gray,
87
+ .labelSmall.default {
88
+ color: var(--neutral-alpha-11);
89
+ }
90
+
91
+ .labelSmall.white {
92
+ color: #737373;
93
+ }
94
+
95
+ .labelSmall.sm {
96
+ font-weight: 500;
97
+ }
98
+
99
+ .labelSmall.md {
100
+ font-weight: 400;
101
+ }
102
+
103
+ .labelSmall.lg {
104
+ font-weight: 400;
105
+ }
106
+
107
+ .colon {
108
+ color: var(--neutral-alpha-11);
109
+ animation: tick 1s steps(1, end) 0s infinite;
110
+ margin: 0;
111
+ align-self: flex-start;
112
+ }
113
+
114
+ .colon.gray {
115
+ color: var(--neutral-alpha-11);
116
+ }
117
+
118
+ .colon.white {
119
+ color: #737373;
120
+ }
121
+
122
+ .colon.sm {
123
+ font-size: 24px;
124
+ line-height: 1.2;
125
+ }
126
+
127
+ .colon.md {
128
+ font-size: 40px;
129
+ line-height: 1.1;
130
+ }
131
+
132
+ .colon.lg {
133
+ font-size: 40px;
134
+ line-height: 1.1;
135
+ }
136
+
137
+ @keyframes tick {
138
+ from {
139
+ opacity: 1;
140
+ }
141
+ 50% {
142
+ opacity: 0.1;
143
+ }
144
+ to {
145
+ opacity: 1;
146
+ }
147
+ }
148
+
149
+ .skeletonBox {
150
+ display: flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ }
154
+
155
+ .skeletonBox.white {
156
+ max-width: 162px;
157
+ width: 100%;
158
+ }
159
+
160
+ .skeletonBox.white .skeleton {
161
+ background: linear-gradient(90deg, #d5d5d5 4.69%, #a1a1a1 100%);
162
+ animation: skeleton_animate 1s infinite;
163
+ }
164
+
165
+ .skeleton {
166
+ width: 200px;
167
+ height: 60px;
168
+ background: linear-gradient(
169
+ 90deg,
170
+ var(--gray-3) 25%,
171
+ var(--gray-4) 50%,
172
+ var(--gray-3) 75%
173
+ );
174
+ background-size: 200% 100%;
175
+ animation: skeleton_animate 1.5s ease-in-out infinite;
176
+ border-radius: 8px;
177
+ }
178
+
179
+ .skeletonBox.lg .skeleton {
180
+ height: 72px;
181
+ width: 250px;
182
+ }
183
+
184
+ .skeletonBox.md .skeleton {
185
+ height: 60px;
186
+ width: 200px;
187
+ }
188
+
189
+ .skeletonBox.sm .skeleton {
190
+ height: 49px;
191
+ width: 150px;
192
+ }
193
+
194
+ @keyframes skeleton_animate {
195
+ 0% {
196
+ background-position: 0% 50%;
197
+ }
198
+
199
+ 50% {
200
+ background-position: 100% 50%;
201
+ }
202
+
203
+ 100% {
204
+ background-position: 0% 50%;
205
+ }
206
+ }
@@ -0,0 +1,108 @@
1
+ import { Countdown } from './Countdown'
2
+ import { Flex } from '@radix-ui/themes'
3
+ import { useState, useEffect } from 'react'
4
+
5
+ export default {
6
+ title: 'Components/Countdown',
7
+ component: Countdown,
8
+ tags: ['autodocs'],
9
+ argTypes: {
10
+ show: { control: 'boolean' },
11
+ days: { control: 'number' },
12
+ hours: { control: 'number' },
13
+ minutes: { control: 'number' },
14
+ seconds: { control: 'number' },
15
+ ended: { control: 'boolean' },
16
+ loading: { control: 'boolean' },
17
+ theme: {
18
+ control: 'select',
19
+ options: ['default', 'white', 'gray'],
20
+ },
21
+ variant: {
22
+ control: 'select',
23
+ options: ['sm', 'md', 'lg'],
24
+ },
25
+ showDays: { control: 'boolean' },
26
+ },
27
+ }
28
+
29
+ const withFlexContainer = (Story) => (
30
+ <Flex justify="center" align="center" style={{ padding: '40px' }}>
31
+ <Story />
32
+ </Flex>
33
+ )
34
+
35
+ export const Default = {
36
+ render: (args) => {
37
+ const [timeLeft, setTimeLeft] = useState({
38
+ days: args.days,
39
+ hours: args.hours,
40
+ minutes: args.minutes,
41
+ seconds: args.seconds,
42
+ })
43
+
44
+ useEffect(() => {
45
+ setTimeLeft({
46
+ days: args.days,
47
+ hours: args.hours,
48
+ minutes: args.minutes,
49
+ seconds: args.seconds,
50
+ })
51
+ }, [args.days, args.hours, args.minutes, args.seconds])
52
+
53
+ useEffect(() => {
54
+ const interval = setInterval(() => {
55
+ setTimeLeft((prev) => {
56
+ let { days, hours, minutes, seconds } = prev
57
+
58
+ if (seconds > 0) {
59
+ seconds--
60
+ } else if (minutes > 0) {
61
+ minutes--
62
+ seconds = 59
63
+ } else if (hours > 0) {
64
+ hours--
65
+ minutes = 59
66
+ seconds = 59
67
+ } else if (days > 0) {
68
+ days--
69
+ hours = 23
70
+ minutes = 59
71
+ seconds = 59
72
+ } else {
73
+ clearInterval(interval)
74
+ return prev
75
+ }
76
+
77
+ return { days, hours, minutes, seconds }
78
+ })
79
+ }, 1000)
80
+
81
+ return () => clearInterval(interval)
82
+ }, [])
83
+
84
+ return (
85
+ <Flex justify="center" align="center" style={{ padding: '40px' }}>
86
+ <Countdown
87
+ {...args}
88
+ days={timeLeft.days}
89
+ hours={timeLeft.hours}
90
+ minutes={timeLeft.minutes}
91
+ seconds={timeLeft.seconds}
92
+ />
93
+ </Flex>
94
+ )
95
+ },
96
+ args: {
97
+ show: true,
98
+ days: 2,
99
+ hours: 14,
100
+ minutes: 32,
101
+ seconds: 45,
102
+ ended: false,
103
+ loading: false,
104
+ theme: 'default',
105
+ variant: 'lg',
106
+ showDays: true,
107
+ },
108
+ }
@@ -0,0 +1,300 @@
1
+ import React, { useState, useCallback, useMemo } from 'react'
2
+ import {
3
+ Flex,
4
+ Table,
5
+ Checkbox,
6
+ Text,
7
+ ProductsBrandPattern,
8
+ DropdownMenu,
9
+ } from '../../index'
10
+ import { ArrowUpIcon, ArrowDownIcon, DotsVertical2Icon } from '../../icons'
11
+ import styles from './DataTable.module.css'
12
+ import classNames from 'classnames'
13
+
14
+ const toUpperCase = (str) => (typeof str === 'string' ? str.toUpperCase() : str)
15
+
16
+ const DataRow = React.memo(function DataRow({
17
+ row,
18
+ columns,
19
+ isSelected,
20
+ sortedKey,
21
+ hasDropdownOptions,
22
+ onRowClick,
23
+ onSelectRow,
24
+ renderProjectCell,
25
+ renderDataCell,
26
+ }) {
27
+ return (
28
+ <Table.Row
29
+ className={classNames({ [styles.rowSelected]: isSelected })}
30
+ onClick={() => onRowClick?.(row)}
31
+ style={
32
+ isSelected ? { '--row-bg': 'var(--aqua-dark-alpha-2)' } : undefined
33
+ }
34
+ >
35
+ <Table.Cell
36
+ className={styles.selectColumn}
37
+ data-column-id="select"
38
+ data-sorted="false"
39
+ >
40
+ <Checkbox
41
+ size="1"
42
+ checked={isSelected}
43
+ onClick={(e) => e.stopPropagation()}
44
+ onCheckedChange={(value) => onSelectRow?.(row.id, value === true)}
45
+ className={classNames(styles.checkboxCell, {
46
+ [styles.showCheckboxCell]: isSelected,
47
+ })}
48
+ />
49
+ </Table.Cell>
50
+
51
+ {columns.map((column, index) => (
52
+ <Table.Cell
53
+ key={column.id}
54
+ className={classNames(
55
+ styles.projectCell,
56
+ index === 0 ? styles.columnProject : styles.dataColumn,
57
+ { [styles.sortedColumn]: sortedKey === column.id },
58
+ )}
59
+ data-column-id={column.id}
60
+ data-sorted={sortedKey === column.id}
61
+ >
62
+ {index === 0
63
+ ? renderProjectCell(row)
64
+ : renderDataCell(row, column, index)}
65
+ </Table.Cell>
66
+ ))}
67
+
68
+ {hasDropdownOptions && (
69
+ <Table.Cell
70
+ className={classNames(styles.projectCell, styles.dropdownColumn)}
71
+ data-column-id="actions"
72
+ >
73
+ {row.dropdownOptions?.length ? (
74
+ <DropdownMenu
75
+ trigger={
76
+ <Flex
77
+ className={styles.dropdownTriggerWrapper}
78
+ aria-label={`More options for ${row.title}`}
79
+ >
80
+ <Flex className={styles.dropdownTriggerWrapperIcon}>
81
+ <DotsVertical2Icon />
82
+ </Flex>
83
+ </Flex>
84
+ }
85
+ options={row.dropdownOptions}
86
+ side="bottom"
87
+ align="end"
88
+ />
89
+ ) : null}
90
+ </Table.Cell>
91
+ )}
92
+ </Table.Row>
93
+ )
94
+ })
95
+
96
+ export const DataTable = ({
97
+ className,
98
+ columns,
99
+ data,
100
+ selectedRowIds = [],
101
+ onClick,
102
+ renderHeaderActions,
103
+ sorting,
104
+ onSort,
105
+ onSelectAll,
106
+ onSelectRow,
107
+ stickyOffset = 0,
108
+ ...props
109
+ }) => {
110
+ const [isHeaderHovering, setIsHeaderHovering] = useState(false)
111
+
112
+ const sortedKey = sorting?.field
113
+
114
+ const selectedSet = useMemo(() => new Set(selectedRowIds), [selectedRowIds])
115
+
116
+ const isRowSelected = useCallback((id) => selectedSet.has(id), [selectedSet])
117
+
118
+ const selectedCount = selectedRowIds.length
119
+ const total = data?.length ?? 0
120
+
121
+ const anyRowChecked = selectedCount > 0
122
+ const allRowsChecked = total > 0 && selectedCount === total
123
+
124
+ const hasDropdownOptions = useMemo(
125
+ () => data?.some((row) => row.dropdownOptions?.length),
126
+ [data],
127
+ )
128
+
129
+ const handleSortClick = useCallback(
130
+ (columnId) => {
131
+ const isActive = sorting?.field === columnId
132
+ const nextDirection =
133
+ isActive && sorting?.sort === 'ASC' ? 'DESC' : 'ASC'
134
+
135
+ onSort?.(columnId, nextDirection)
136
+ },
137
+ [onSort, sorting],
138
+ )
139
+
140
+ const handleRowClick = useCallback(
141
+ (row) => {
142
+ onClick?.(row)
143
+ },
144
+ [onClick],
145
+ )
146
+
147
+ const renderProjectCell = useCallback((row) => {
148
+ return (
149
+ <Flex align="center" gap="3">
150
+ {row.thumb ? (
151
+ <img
152
+ src={row.thumb}
153
+ alt={row.title}
154
+ width={48}
155
+ height={48}
156
+ className={styles.thumb}
157
+ />
158
+ ) : (
159
+ <ProductsBrandPattern
160
+ id={row.id}
161
+ size={48}
162
+ className={styles.thumb}
163
+ />
164
+ )}
165
+
166
+ <Flex direction="column" style={{ minWidth: 0, flex: 1 }}>
167
+ <Text size="2" className={styles.titleText}>
168
+ {row.title}
169
+ </Text>
170
+ <Text size="1" className={styles.artistText}>
171
+ {row.artist}
172
+ </Text>
173
+ </Flex>
174
+ </Flex>
175
+ )
176
+ }, [])
177
+
178
+ const renderDataCell = useCallback((row, column, index) => {
179
+ const baseValue = row?.[column.id] ?? row?.[`${column.id}Formatted`]
180
+ const value =
181
+ column.render?.({ row, value: baseValue, column, index }) ?? baseValue
182
+
183
+ const isPrimitive =
184
+ typeof value === 'string' || typeof value === 'number' || value == null
185
+
186
+ return isPrimitive ? (
187
+ <Text size="2" className={styles.cellText}>
188
+ {value}
189
+ </Text>
190
+ ) : (
191
+ value
192
+ )
193
+ }, [])
194
+
195
+ const { style, ...restProps } = props
196
+ const stickyOffsetValue =
197
+ typeof stickyOffset === 'number' ? `${stickyOffset}px` : stickyOffset
198
+
199
+ return (
200
+ <Table.Root
201
+ className={classNames(styles.DataTable, className)}
202
+ size="1"
203
+ style={{
204
+ '--datatable-sticky-offset': stickyOffsetValue,
205
+ ...style,
206
+ }}
207
+ {...restProps}
208
+ >
209
+ <Table.Header
210
+ onMouseEnter={() => setIsHeaderHovering(true)}
211
+ onMouseLeave={() => setIsHeaderHovering(false)}
212
+ >
213
+ <Table.Row className={styles.headerRow}>
214
+ <Table.Cell
215
+ className={classNames(styles.checkboxCell, styles.selectColumn, {
216
+ [styles.showCheckboxHeader]: isHeaderHovering || anyRowChecked,
217
+ })}
218
+ >
219
+ <Checkbox
220
+ size="1"
221
+ checked={allRowsChecked}
222
+ onCheckedChange={(value) => onSelectAll?.(value === true)}
223
+ {...(anyRowChecked && !allRowsChecked
224
+ ? { checked: 'indeterminate' }
225
+ : {})}
226
+ />
227
+ </Table.Cell>
228
+
229
+ {columns.map((column, index) => (
230
+ <Table.ColumnHeaderCell
231
+ key={column.id}
232
+ className={classNames(styles.columnHeaderCell, {
233
+ [styles.columnProject]: index === 0,
234
+ [styles.dataColumn]: index !== 0,
235
+ [styles.sortedColumn]: toUpperCase(sortedKey) === toUpperCase(column.id),
236
+ })}
237
+ >
238
+ <Flex align="center" gap="3" height="24px">
239
+ {index === 0 ? (
240
+ <Text size="2" className={styles.headerTextFirst}>
241
+ {column.label}
242
+ </Text>
243
+ ) : (
244
+ <button
245
+ type="button"
246
+ className={styles.sortButton}
247
+ onClick={() => handleSortClick(column.id)}
248
+ >
249
+ <Text size="2">{column.label}</Text>
250
+ {sortedKey === column.id &&
251
+ (sorting?.sort === 'DESC' ? (
252
+ <ArrowUpIcon width={16} height={16} />
253
+ ) : (
254
+ <ArrowDownIcon width={16} height={16} />
255
+ ))}
256
+ </button>
257
+ )}
258
+
259
+ {index === 0 && renderHeaderActions && (
260
+ <Flex gap="2" className={styles.headerActions}>
261
+ {renderHeaderActions({
262
+ selectedCount,
263
+ total,
264
+ anySelected: anyRowChecked,
265
+ allSelected: allRowsChecked,
266
+ })}
267
+ </Flex>
268
+ )}
269
+ </Flex>
270
+ </Table.ColumnHeaderCell>
271
+ ))}
272
+ {hasDropdownOptions && (
273
+ <Table.ColumnHeaderCell
274
+ className={styles.dropdownColumn}
275
+ ></Table.ColumnHeaderCell>
276
+ )}
277
+ </Table.Row>
278
+ </Table.Header>
279
+
280
+ <Table.Body>
281
+ {data.map((row) => (
282
+ <DataRow
283
+ key={row.id}
284
+ row={row}
285
+ columns={columns}
286
+ isSelected={isRowSelected(row.id)}
287
+ sortedKey={sortedKey}
288
+ hasDropdownOptions={hasDropdownOptions}
289
+ onRowClick={handleRowClick}
290
+ onSelectRow={onSelectRow}
291
+ renderProjectCell={renderProjectCell}
292
+ renderDataCell={renderDataCell}
293
+ />
294
+ ))}
295
+ </Table.Body>
296
+ </Table.Root>
297
+ )
298
+ }
299
+
300
+ DataTable.displayName = 'DataTable'