@moises.ai/design-system 3.4.4 → 3.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +547 -545
- package/package.json +3 -2
- package/src/Introduction.mdx +56 -0
- package/src/colors/custom-styles.css +293 -0
- package/src/components/AdditionalItems/AdditionalItems.jsx +43 -0
- package/src/components/AdditionalItems/AdditionalItems.module.css +76 -0
- package/src/components/AdditionalItems/AdditionalItems.stories.jsx +32 -0
- package/src/components/BannerAnnouncement/BannerAnnouncement.jsx +77 -0
- package/src/components/BannerAnnouncement/BannerAnnouncement.module.css +58 -0
- package/src/components/BannerAnnouncement/BannerAnnouncement.stories.jsx +120 -0
- package/src/components/Button/Button.jsx +45 -0
- package/src/components/Button/Button.module.css +288 -0
- package/src/components/Button/Button.stories.jsx +269 -0
- package/src/components/Callout/Callout.jsx +47 -0
- package/src/components/Callout/Callout.module.css +56 -0
- package/src/components/Callout/Callout.stories.jsx +296 -0
- package/src/components/Card/Card.jsx +46 -0
- package/src/components/Card/Card.module.css +89 -0
- package/src/components/Card/Card.stories.jsx +116 -0
- package/src/components/Checkbox/Checkbox.jsx +36 -0
- package/src/components/Checkbox/Checkbox.module.css +136 -0
- package/src/components/Checkbox/Checkbox.stories.jsx +64 -0
- package/src/components/CigarBar/CigarBar.jsx +73 -0
- package/src/components/CigarBar/CigarBar.module.css +57 -0
- package/src/components/CigarBar/CigarBar.stories.jsx +66 -0
- package/src/components/ContextMenu/ContextMenu.jsx +56 -0
- package/src/components/ContextMenu/ContextMenu.stories.jsx +657 -0
- package/src/components/Countdown/Countdown.jsx +97 -0
- package/src/components/Countdown/Countdown.module.css +206 -0
- package/src/components/Countdown/Countdown.stories.jsx +108 -0
- package/src/components/DataTable/DataTable.jsx +300 -0
- package/src/components/DataTable/DataTable.module.css +372 -0
- package/src/components/DataTable/DataTable.stories.jsx +365 -0
- package/src/components/DropdownButton/DropdownButton.jsx +124 -0
- package/src/components/DropdownButton/DropdownButton.module.css +102 -0
- package/src/components/DropdownButton/DropdownButton.stories.jsx +267 -0
- package/src/components/DropdownMenu/DropdownMenu.jsx +102 -0
- package/src/components/DropdownMenu/DropdownMenu.stories.jsx +645 -0
- package/src/components/FloatingBanner/FloatingBanner.jsx +87 -0
- package/src/components/FloatingBanner/FloatingBanner.module.css +92 -0
- package/src/components/FloatingBanner/FloatingBanner.stories.jsx +115 -0
- package/src/components/FooterPanel/FooterPanel.jsx +56 -0
- package/src/components/FooterPanel/FooterPanel.stories.jsx +289 -0
- package/src/components/GenerationSourceCallout/GenerationSourceCallout.jsx +53 -0
- package/src/components/GenerationSourceCallout/GenerationSourceCallout.module.css +98 -0
- package/src/components/GroupButtons/GroupButtons.jsx +97 -0
- package/src/components/GroupButtons/GroupButtons.module.css +8 -0
- package/src/components/GroupButtons/GroupButtons.stories.jsx +301 -0
- package/src/components/HeaderPanel/HeaderPanel.jsx +115 -0
- package/src/components/HeaderPanel/HeaderPanel.stories.jsx +389 -0
- package/src/components/HorizontalVolume/HorizontalVolume.jsx +157 -0
- package/src/components/HorizontalVolume/HorizontalVolume.module.css +123 -0
- package/src/components/HorizontalVolume/HorizontalVolume.stories.jsx +109 -0
- package/src/components/IconButton/IconButton.jsx +47 -0
- package/src/components/IconButton/IconButton.module.css +302 -0
- package/src/components/IconButton/IconButton.stories.jsx +532 -0
- package/src/components/InstrumentSelector/InstrumentSelector.jsx +61 -0
- package/src/components/InstrumentSelector/InstrumentSelector.module.css +80 -0
- package/src/components/InstrumentSelector/InstrumentSelector.stories.jsx +33 -0
- package/src/components/Knob/Knob.jsx +173 -0
- package/src/components/Knob/Knob.module.css +70 -0
- package/src/components/Knob/Knob.stories.jsx +289 -0
- package/src/components/Knob/constants.js +38 -0
- package/src/components/Knob/useKnob.js +117 -0
- package/src/components/Knob/utils.js +117 -0
- package/src/components/ListCards/CardDetails.stories.jsx +484 -0
- package/src/components/ListCards/ListCards.jsx +297 -0
- package/src/components/ListCards/ListCards.module.css +234 -0
- package/src/components/ListCards/ListCards.stories.jsx +386 -0
- package/src/components/LokalisePoc/LokalisePoc.jsx +7 -0
- package/src/components/LokalisePoc/LokalisePoc.stories.jsx +63 -0
- package/src/components/MessageWithAction/MessageWithAction.jsx +54 -0
- package/src/components/MessageWithAction/MessageWithAction.module.css +16 -0
- package/src/components/MessageWithAction/MessageWithAction.stories.jsx +280 -0
- package/src/components/MetronomeForm/MetronomeForm.jsx +74 -0
- package/src/components/MetronomeForm/MetronomeForm.stories.jsx +137 -0
- package/src/components/MultiSelect/MultiSelect.jsx +129 -0
- package/src/components/MultiSelect/MultiSelect.module.css +105 -0
- package/src/components/MultiSelect/MultiSelect.stories.jsx +296 -0
- package/src/components/MultiSelectCards/MultiSelectCards.jsx +96 -0
- package/src/components/MultiSelectCards/MultiSelectCards.module.css +60 -0
- package/src/components/MultiSelectCards/MultiSelectCards.stories.jsx +439 -0
- package/src/components/PanControl/PanControl.jsx +227 -0
- package/src/components/PanControl/PanControl.module.css +71 -0
- package/src/components/PanControl/PanControl.stories.jsx +100 -0
- package/src/components/ProductsBrandPattern/Patterns/aiStudio.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/mastering.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/product.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/stemSeparation.png +0 -0
- package/src/components/ProductsBrandPattern/Patterns/voiceStudio.png +0 -0
- package/src/components/ProductsBrandPattern/ProductsBrandPattern.jsx +36 -0
- package/src/components/ProductsBrandPattern/ProductsBrandPattern.stories.jsx +47 -0
- package/src/components/ProductsList/ProductsList.jsx +54 -0
- package/src/components/ProductsList/ProductsList.module.css +81 -0
- package/src/components/ProductsList/ProductsList.stories.jsx +69 -0
- package/src/components/ProfileMenu/MenuTrigger.jsx +45 -0
- package/src/components/ProfileMenu/ProfileMenu.jsx +66 -0
- package/src/components/ProfileMenu/ProfileMenu.module.css +101 -0
- package/src/components/ProfileMenu/ProfileMenu.stories.jsx +44 -0
- package/src/components/RadioCardsGroup/RadioCardsGroup.jsx +35 -0
- package/src/components/RadioCardsGroup/RadioCardsGroup.module.css +66 -0
- package/src/components/RadioCardsGroup/RadioCardsGroup.stories.jsx +89 -0
- package/src/components/Rating/Rating.jsx +154 -0
- package/src/components/Rating/Rating.module.css +70 -0
- package/src/components/Rating/Rating.stories.jsx +215 -0
- package/src/components/RecordingForm/RecordingForm.jsx +142 -0
- package/src/components/RecordingForm/RecordingForm.module.css +49 -0
- package/src/components/RecordingForm/RecordingForm.stories.jsx +319 -0
- package/src/components/SectionExpander/SectionExpander.jsx +53 -0
- package/src/components/SectionExpander/SectionExpander.module.css +46 -0
- package/src/components/SectionExpander/SectionExpander.stories.jsx +48 -0
- package/src/components/SegmentedControl/SegmentedControl.jsx +48 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.jsx +133 -0
- package/src/components/SegmentedControl/SegmentedControl.styles.css +55 -0
- package/src/components/Select/Select.jsx +132 -0
- package/src/components/Select/Select.module.css +76 -0
- package/src/components/Select/Select.stories.jsx +294 -0
- package/src/components/SetlistList/SetlistList.jsx +338 -0
- package/src/components/SetlistList/SetlistList.module.css +246 -0
- package/src/components/SetlistList/SetlistList.stories.jsx +121 -0
- package/src/components/Shell/Shell.jsx +75 -0
- package/src/components/Shell/Shell.module.css +3 -0
- package/src/components/Shell/Shell.stories.jsx +354 -0
- package/src/components/Sidebar/Sidebar.jsx +173 -0
- package/src/components/Sidebar/Sidebar.module.css +267 -0
- package/src/components/Sidebar/Sidebar.stories.jsx +247 -0
- package/src/components/Sidebar/SidebarSection/SidebarSection.jsx +20 -0
- package/src/components/Sidebar/SidebarSection/SidebarSection.module.css +20 -0
- package/src/components/Slider/Slider.jsx +114 -0
- package/src/components/Slider/Slider.module.css +159 -0
- package/src/components/Slider/Slider.stories.jsx +199 -0
- package/src/components/StemGenerationForm/BesideFooter/BesideFooter.jsx +107 -0
- package/src/components/StemGenerationForm/BesideFooter/BesideFooter.module.css +4 -0
- package/src/components/StemGenerationForm/Concurrency/Concurrency.jsx +54 -0
- package/src/components/StemGenerationForm/Concurrency/Concurrency.module.css +26 -0
- package/src/components/StemGenerationForm/CreateFromPreset/CreateFromPreset.jsx +44 -0
- package/src/components/StemGenerationForm/CreateNew/CreateNew.jsx +107 -0
- package/src/components/StemGenerationForm/CreativeFreedomSection/CreativeFreedomSection.jsx +185 -0
- package/src/components/StemGenerationForm/CreativeFreedomSection/CreativeFreedomSection.module.css +8 -0
- package/src/components/StemGenerationForm/GenerationStatus/GenerationStatus.jsx +91 -0
- package/src/components/StemGenerationForm/StemGenerationForm.jsx +342 -0
- package/src/components/StemGenerationForm/StemGenerationForm.stories.jsx +703 -0
- package/src/components/StemGenerationForm/utils/constants.js +24 -0
- package/src/components/StemGenerationForm/utils/formatFileInfo.js +20 -0
- package/src/components/StemGenerationForm/utils/getInstrumentDescription.js +27 -0
- package/src/components/StemGenerationForm/utils/getLocalizedGenerationInstruments.js +31 -0
- package/src/components/StemGenerationForm/utils/index.js +13 -0
- package/src/components/StemGenerationForm/utils/secondsToTime.js +15 -0
- package/src/components/StemSeparationForm/GenerationStatus/GenerationStatus.jsx +70 -0
- package/src/components/StemSeparationForm/StemSeparationForm.jsx +354 -0
- package/src/components/StemSeparationForm/StemSeparationForm.module.css +0 -0
- package/src/components/StemSeparationForm/StemSeparationForm.stories.jsx +221 -0
- package/src/components/TempoControlsForm/AutoDetect/AutoDetect.jsx +114 -0
- package/src/components/TempoControlsForm/TempoControlsForm.jsx +59 -0
- package/src/components/TempoControlsForm/TempoControlsForm.stories.jsx +228 -0
- package/src/components/TempoControlsForm/TempoForm/TempoForm.jsx +94 -0
- package/src/components/TempoControlsForm/TempoFormInput/TempoFormInput.jsx +136 -0
- package/src/components/TempoControlsForm/TempoFormInput/TempoFormInput.module.css +19 -0
- package/src/components/TempoControlsForm/constants.js +77 -0
- package/src/components/TempoControlsForm/utils/formatDateTime.js +50 -0
- package/src/components/TempoControlsForm/utils/getTempoMarking.js +6 -0
- package/src/components/Text/Text.jsx +19 -0
- package/src/components/Text/Text.module.css +5 -0
- package/src/components/Text/Text.stories.jsx +117 -0
- package/src/components/TextArea/TextArea.jsx +53 -0
- package/src/components/TextArea/TextArea.module.css +35 -0
- package/src/components/TextArea/TextArea.stories.jsx +140 -0
- package/src/components/TextField/TextField.jsx +61 -0
- package/src/components/TextField/TextField.module.css +41 -0
- package/src/components/TextField/TextField.stories.jsx +243 -0
- package/src/components/ThumbnailPicker/ThumbColors/ThumbColors.js +101 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/ThumbGraphics.js +90 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/circles01.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/circles02.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/circles03.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/circles04.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/circles05.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/circles06.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/lines01.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/lines02.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/lines03.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/lines04.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/lines05.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/lines06.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/patterns01.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/patterns02.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/patterns03.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/patterns04.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes01.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes02.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes03.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes04.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes05.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes06.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes07.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes08.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/shapes09.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/synth01.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/synth02.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/synth03.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/synth04.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/synth05.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/waves01.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/waves02.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/waves03.png +0 -0
- package/src/components/ThumbnailPicker/ThumbGraphics/waves04.png +0 -0
- package/src/components/ThumbnailPicker/ThumbnailPicker.jsx +67 -0
- package/src/components/ThumbnailPicker/ThumbnailPicker.module.css +0 -0
- package/src/components/ThumbnailPicker/ThumbnailPicker.stories.jsx +406 -0
- package/src/components/ThumbnailPicker/getStyleFromID.js +31 -0
- package/src/components/TooltipWithInfoIcon/TooltipWithInfoIcon.jsx +18 -0
- package/src/components/TooltipWithInfoIcon/TooltipWithInfoIcon.module.css +6 -0
- package/src/components/TooltipWithInfoIcon/TooltipWithInfoIcon.stories.jsx +28 -0
- package/src/components/TrackControlButton/TrackControlButton.jsx +28 -0
- package/src/components/TrackControlButton/TrackControlButton.module.css +32 -0
- package/src/components/TrackControlButton/TrackControlButton.stories.jsx +47 -0
- package/src/components/TrackControlButton/index.js +1 -0
- package/src/components/TrackHeader/TrackHeader.jsx +143 -0
- package/src/components/TrackHeader/TrackHeader.module.css +194 -0
- package/src/components/TrackHeader/TrackHeader.stories.jsx +212 -0
- package/src/components/TrackHeader/TrackHeaderOptions/TrackHeaderOptions.jsx +18 -0
- package/src/components/TrackHeader/TrackHeaderOptions/TrackHeaderOptions.module.css +8 -0
- package/src/components/TrackHeader/TrackHeaderOptions/index.js +1 -0
- package/src/components/VoiceConversionForm/BesideFooter/BesideFooter.jsx +74 -0
- package/src/components/VoiceConversionForm/ClickableAvatar/ClickableAvatar.jsx +40 -0
- package/src/components/VoiceConversionForm/ClickableAvatar/ClickableAvatar.module.css +21 -0
- package/src/components/VoiceConversionForm/Concurrency/Concurrency.jsx +53 -0
- package/src/components/VoiceConversionForm/Concurrency/Concurrency.module.css +26 -0
- package/src/components/VoiceConversionForm/GenerationStatus/GenerationStatus.jsx +49 -0
- package/src/components/VoiceConversionForm/VoiceConversionForm.jsx +231 -0
- package/src/components/VoiceConversionForm/VoiceConversionForm.module.css +9 -0
- package/src/components/VoiceConversionForm/VoiceConversionForm.stories.jsx +582 -0
- package/src/components/VoiceConversionForm/VoiceDetails/VoiceDetails.jsx +93 -0
- package/src/components/VoiceConversionForm/VoiceDetails/VoiceDetails.module.css +44 -0
- package/src/components/VoiceConversionForm/VoiceList/VoiceList.jsx +84 -0
- package/src/components/VoiceConversionForm/VoiceList/VoiceList.module.css +11 -0
- package/src/components/VoiceConversionForm/Waveform/Waveform.jsx +262 -0
- package/src/components/VoiceConversionForm/Waveform/Waveform.module.css +36 -0
- package/src/components/theme/Theme.jsx +16 -0
- package/src/components/theme/Theme.stories.jsx +59 -0
- package/src/icons/AbbeyRoadIcon.jsx +117 -0
- package/src/icons/AccessibilityIcon.jsx +33 -0
- package/src/icons/AcousticGuitarIcon.jsx +16 -0
- package/src/icons/AddIcon.jsx +18 -0
- package/src/icons/AddLyricsIcon.jsx +25 -0
- package/src/icons/AddRoundIcon.jsx +26 -0
- package/src/icons/AirplayIcon.jsx +26 -0
- package/src/icons/AlertIcon.jsx +28 -0
- package/src/icons/AppIcon.jsx +18 -0
- package/src/icons/ArVrIcon.jsx +21 -0
- package/src/icons/ArrowDownIcon.jsx +26 -0
- package/src/icons/ArrowDownloadIcon.jsx +26 -0
- package/src/icons/ArrowLeftIcon.jsx +26 -0
- package/src/icons/ArrowRightIcon.jsx +26 -0
- package/src/icons/ArrowUpIcon.jsx +26 -0
- package/src/icons/ArrowsHorizontalIcon.jsx +26 -0
- package/src/icons/ArrowsVerticalIcon.jsx +26 -0
- package/src/icons/AtomIcon.jsx +32 -0
- package/src/icons/AttachmentIcon.jsx +26 -0
- package/src/icons/AudioAdjustmentsIcon.jsx +26 -0
- package/src/icons/AudioFileIcon.jsx +26 -0
- package/src/icons/AudioFilesIcon.jsx +26 -0
- package/src/icons/AutoplayIcon.jsx +26 -0
- package/src/icons/BackwardIcon.jsx +18 -0
- package/src/icons/BarsIcon.jsx +27 -0
- package/src/icons/BassIcon.jsx +39 -0
- package/src/icons/BoldIcon.jsx +21 -0
- package/src/icons/BookIcon.jsx +21 -0
- package/src/icons/BookmarkIcon.jsx +24 -0
- package/src/icons/BoxIcon.jsx +20 -0
- package/src/icons/BriefcaseIcon.jsx +26 -0
- package/src/icons/CalendarIcon.jsx +26 -0
- package/src/icons/CameraFlip2Icon.jsx +26 -0
- package/src/icons/CameraFlip3Icon.jsx +26 -0
- package/src/icons/CameraFlipIcon.jsx +26 -0
- package/src/icons/CameraIcon.jsx +33 -0
- package/src/icons/CameraRollIcon.jsx +31 -0
- package/src/icons/CarIcon.jsx +18 -0
- package/src/icons/CartIcon.jsx +28 -0
- package/src/icons/CassetteIcon.jsx +26 -0
- package/src/icons/CastIcon.jsx +20 -0
- package/src/icons/CdIcon.jsx +19 -0
- package/src/icons/CheckboxCicleIcon.jsx +26 -0
- package/src/icons/CheckboxFillIcon.jsx +25 -0
- package/src/icons/CheckboxOffIcon.jsx +25 -0
- package/src/icons/CheckboxOnIcon.jsx +25 -0
- package/src/icons/ChevronDownIcon.jsx +26 -0
- package/src/icons/ChevronLeftIcon.jsx +26 -0
- package/src/icons/ChevronRightIcon.jsx +26 -0
- package/src/icons/ChevronUpIcon.jsx +26 -0
- package/src/icons/ChordGrid2Icon.jsx +26 -0
- package/src/icons/ChordGridIcon.jsx +26 -0
- package/src/icons/ChordSequenceIcon.jsx +26 -0
- package/src/icons/Chords2Icon.jsx +25 -0
- package/src/icons/Chords3Icon.jsx +24 -0
- package/src/icons/ChordsDetection2Icon.jsx +31 -0
- package/src/icons/ChordsDetectionIcon.jsx +31 -0
- package/src/icons/ChordsIcon.jsx +25 -0
- package/src/icons/ClipIcon.jsx +27 -0
- package/src/icons/ClipboardIcon.jsx +23 -0
- package/src/icons/CloseIcon.jsx +27 -0
- package/src/icons/Cloud2Icon.jsx +24 -0
- package/src/icons/Cloud3Icon.jsx +24 -0
- package/src/icons/CloudDownload2Icon.jsx +26 -0
- package/src/icons/CloudDownloadErrorIcon.jsx +26 -0
- package/src/icons/CloudDownloadGradientIcon.jsx +44 -0
- package/src/icons/CloudDownloadIcon.jsx +26 -0
- package/src/icons/CloudIcon.jsx +20 -0
- package/src/icons/CloudUploadIcon.jsx +26 -0
- package/src/icons/CodeIcon.jsx +28 -0
- package/src/icons/CollectionsIcon.jsx +26 -0
- package/src/icons/CompressorIcon.jsx +25 -0
- package/src/icons/ComputerIcon.jsx +26 -0
- package/src/icons/CopilotIcon.jsx +26 -0
- package/src/icons/CountInIcon.jsx +23 -0
- package/src/icons/CountdownIcon.jsx +33 -0
- package/src/icons/CowbellIcon.jsx +25 -0
- package/src/icons/CropIcon.jsx +27 -0
- package/src/icons/CrownIcon.jsx +21 -0
- package/src/icons/CueBackIcon.jsx +25 -0
- package/src/icons/CueIcon.jsx +20 -0
- package/src/icons/CymbalsIcon.jsx +26 -0
- package/src/icons/DatabaseIcon.jsx +26 -0
- package/src/icons/DelayIcon.jsx +20 -0
- package/src/icons/DenoiserIcon.jsx +23 -0
- package/src/icons/DevicesIcon.jsx +26 -0
- package/src/icons/DialogueIcon.jsx +33 -0
- package/src/icons/DojoIcon.jsx +21 -0
- package/src/icons/DotsVertical2Icon.jsx +43 -0
- package/src/icons/DotsVerticalIcon.jsx +47 -0
- package/src/icons/DownloadApp2Icon.jsx +26 -0
- package/src/icons/DownloadAppIcon.jsx +23 -0
- package/src/icons/Drums2Icon.jsx +25 -0
- package/src/icons/DrumsIcon.jsx +18 -0
- package/src/icons/EditIcon.jsx +20 -0
- package/src/icons/EffectsIcon.jsx +25 -0
- package/src/icons/ElectricGuitarIcon.jsx +54 -0
- package/src/icons/EqIcon.jsx +20 -0
- package/src/icons/FeaturesIcon.jsx +24 -0
- package/src/icons/FileIcon.jsx +21 -0
- package/src/icons/FileNewIcon.jsx +26 -0
- package/src/icons/Filter2Icon.jsx +26 -0
- package/src/icons/FilterIcon.jsx +26 -0
- package/src/icons/FireIcon.jsx +21 -0
- package/src/icons/FlagIcon.jsx +21 -0
- package/src/icons/FlashGradientIcon.jsx +39 -0
- package/src/icons/FlashIcon.jsx +21 -0
- package/src/icons/FlatAndSharpIcon.jsx +25 -0
- package/src/icons/FlatIcon.jsx +20 -0
- package/src/icons/FolderIcon.jsx +32 -0
- package/src/icons/FolderPlusIcon.jsx +26 -0
- package/src/icons/ForwardIcon.jsx +18 -0
- package/src/icons/GiftIcon.jsx +21 -0
- package/src/icons/GlobeIcon.jsx +22 -0
- package/src/icons/GoalsIcon.jsx +25 -0
- package/src/icons/GraphIcon.jsx +21 -0
- package/src/icons/GuitarAmpIcon.jsx +41 -0
- package/src/icons/HamburgerMenu2Icon.jsx +26 -0
- package/src/icons/HamburgerMenu3Icon.jsx +26 -0
- package/src/icons/HandbagIcon.jsx +26 -0
- package/src/icons/HeadphonesIcon.jsx +26 -0
- package/src/icons/HeadphonesLeftIcon.jsx +30 -0
- package/src/icons/HeadphonesRightIcon.jsx +30 -0
- package/src/icons/HiFiGradientIcon.jsx +36 -0
- package/src/icons/HiFiIcon.jsx +112 -0
- package/src/icons/HiHatIcon.jsx +21 -0
- package/src/icons/HomeIcon.jsx +18 -0
- package/src/icons/Icons.stories.jsx +154 -0
- package/src/icons/ImageGalleryIcon.jsx +25 -0
- package/src/icons/ImageIcon.jsx +21 -0
- package/src/icons/Info2Icon.jsx +18 -0
- package/src/icons/InfoIcon.jsx +20 -0
- package/src/icons/InternetSignalIcon.jsx +26 -0
- package/src/icons/IpadIcon.jsx +20 -0
- package/src/icons/IsolateDrumsGradientIcon.jsx +41 -0
- package/src/icons/IsolateDrumsIcon.jsx +23 -0
- package/src/icons/KaraokeIcon.jsx +23 -0
- package/src/icons/KaraokeMicIcon.jsx +23 -0
- package/src/icons/KeyDetectionIcon.jsx +25 -0
- package/src/icons/KeyboardIcon.jsx +25 -0
- package/src/icons/KeysIcon.jsx +21 -0
- package/src/icons/KickdrumIcon.jsx +30 -0
- package/src/icons/Knob2Icon.jsx +27 -0
- package/src/icons/Knob3Icon.jsx +27 -0
- package/src/icons/KnobIcon.jsx +28 -0
- package/src/icons/LabIcon.jsx +21 -0
- package/src/icons/LaptopIcon.jsx +25 -0
- package/src/icons/LibraryIcon.jsx +31 -0
- package/src/icons/LinkIcon.jsx +21 -0
- package/src/icons/ListCheckIcon.jsx +26 -0
- package/src/icons/ListIcon.jsx +21 -0
- package/src/icons/LivePerformanceIcon.jsx +23 -0
- package/src/icons/LockIcon.jsx +28 -0
- package/src/icons/LogInIcon.jsx +21 -0
- package/src/icons/LogOutIcon.jsx +26 -0
- package/src/icons/LoopIcon.jsx +29 -0
- package/src/icons/LoopSection2Icon.jsx +26 -0
- package/src/icons/LoopSection3Icon.jsx +26 -0
- package/src/icons/LoopSectionIcon.jsx +26 -0
- package/src/icons/LyricsIcon.jsx +33 -0
- package/src/icons/MaracasIcon.jsx +24 -0
- package/src/icons/MasteringIcon.jsx +37 -0
- package/src/icons/Maximize2Icon.jsx +26 -0
- package/src/icons/MaximizeIcon.jsx +26 -0
- package/src/icons/MetronomeIcon.jsx +23 -0
- package/src/icons/Minimize2Icon.jsx +26 -0
- package/src/icons/MinimizeIcon.jsx +26 -0
- package/src/icons/Mixer2Icon.jsx +25 -0
- package/src/icons/MixerIcon.jsx +20 -0
- package/src/icons/MoisesIcon.jsx +47 -0
- package/src/icons/MoisesLogoIcon.jsx +43 -0
- package/src/icons/MoneyIcon.jsx +20 -0
- package/src/icons/MonoIcon.jsx +18 -0
- package/src/icons/MoonIcon.jsx +21 -0
- package/src/icons/More2Icon.jsx +44 -0
- package/src/icons/MoreIcon.jsx +51 -0
- package/src/icons/MultipleUsersIcon.jsx +26 -0
- package/src/icons/MusicAddIcon.jsx +26 -0
- package/src/icons/MusicControlIcon.jsx +23 -0
- package/src/icons/MusicDevice2Icon.jsx +23 -0
- package/src/icons/MusicDeviceIcon.jsx +25 -0
- package/src/icons/MusicIcon.jsx +26 -0
- package/src/icons/MusicListIcon.jsx +26 -0
- package/src/icons/MusicLoverIcon.jsx +23 -0
- package/src/icons/MusicNoteIcon.jsx +21 -0
- package/src/icons/MusicNotesIcon.jsx +26 -0
- package/src/icons/MusicRemoveIcon.jsx +26 -0
- package/src/icons/NewCollectionsIcon.jsx +25 -0
- package/src/icons/NextIcon.jsx +20 -0
- package/src/icons/NoAcousticGuitarIcon.jsx +23 -0
- package/src/icons/NoBassIcon.jsx +23 -0
- package/src/icons/NoChords2Icon.jsx +25 -0
- package/src/icons/NoChordsDetectionIcon.jsx +31 -0
- package/src/icons/NoCloud3Icon.jsx +23 -0
- package/src/icons/NoComputerIcon.jsx +26 -0
- package/src/icons/NoCymbalsIcon.jsx +26 -0
- package/src/icons/NoDialogueIcon.jsx +26 -0
- package/src/icons/NoDrums2Icon.jsx +23 -0
- package/src/icons/NoDrumsIcon.jsx +23 -0
- package/src/icons/NoElectricGuitarIcon.jsx +23 -0
- package/src/icons/NoFileIcon.jsx +26 -0
- package/src/icons/NoHeadphonesIcon.jsx +26 -0
- package/src/icons/NoHiHatIcon.jsx +26 -0
- package/src/icons/NoInternetSignalIcon.jsx +33 -0
- package/src/icons/NoKeysIcon.jsx +38 -0
- package/src/icons/NoKickdrumIcon.jsx +23 -0
- package/src/icons/NoLoopSection2Icon.jsx +23 -0
- package/src/icons/NoLoopSectionIcon.jsx +26 -0
- package/src/icons/NoLyricsIcon.jsx +25 -0
- package/src/icons/NoMaracasIcon.jsx +23 -0
- package/src/icons/NoMetronomeIcon.jsx +23 -0
- package/src/icons/NoMoneyIcon.jsx +26 -0
- package/src/icons/NoMusicIcon.jsx +32 -0
- package/src/icons/NoMusicNoteIcon.jsx +25 -0
- package/src/icons/NoPianoIcon.jsx +33 -0
- package/src/icons/NoSearchIcon.jsx +26 -0
- package/src/icons/NoSectionsIcon.jsx +25 -0
- package/src/icons/NoSnareIcon.jsx +26 -0
- package/src/icons/NoSoundEffectsIcon.jsx +23 -0
- package/src/icons/NoSoundIcon.jsx +23 -0
- package/src/icons/NoSoundtrackIcon.jsx +30 -0
- package/src/icons/NoSpliterIcon.jsx +23 -0
- package/src/icons/NoStringsIcon.jsx +23 -0
- package/src/icons/NoTomsIcon.jsx +23 -0
- package/src/icons/NoUkuleleIcon.jsx +26 -0
- package/src/icons/NoVideoIcon.jsx +26 -0
- package/src/icons/NoVocalsIcon.jsx +23 -0
- package/src/icons/NoVolume2Icon.jsx +26 -0
- package/src/icons/NoVolumeIcon.jsx +26 -0
- package/src/icons/NoWoodwindBrassIcon.jsx +23 -0
- package/src/icons/NotificationsIcon.jsx +26 -0
- package/src/icons/OffloadDeviceIcon.jsx +23 -0
- package/src/icons/PauseFilledIcon.jsx +27 -0
- package/src/icons/PauseIcon.jsx +22 -0
- package/src/icons/PianoIcon.jsx +25 -0
- package/src/icons/PinIcon.jsx +20 -0
- package/src/icons/Pip2Icon.jsx +18 -0
- package/src/icons/PipIcon.jsx +21 -0
- package/src/icons/PitchCorrectionIcon.jsx +25 -0
- package/src/icons/PitchIcon.jsx +21 -0
- package/src/icons/PlayAllIcon.jsx +25 -0
- package/src/icons/PlayBackSpeedIcon.jsx +37 -0
- package/src/icons/PlayCircleIcon.jsx +44 -0
- package/src/icons/PlayIcon.jsx +20 -0
- package/src/icons/PlayOnRepeatIcon.jsx +26 -0
- package/src/icons/PlusIcon.jsx +21 -0
- package/src/icons/PreferencesIcon.jsx +25 -0
- package/src/icons/PreviousIcon.jsx +25 -0
- package/src/icons/PriceTagIcon.jsx +26 -0
- package/src/icons/ProducerIcon.jsx +69 -0
- package/src/icons/PuzzlePiece2Icon.jsx +26 -0
- package/src/icons/PuzzlePieceIcon.jsx +26 -0
- package/src/icons/QuantizationIcon.jsx +25 -0
- package/src/icons/RadioIcon.jsx +36 -0
- package/src/icons/RadioOffIcon.jsx +26 -0
- package/src/icons/RecordIcon.jsx +15 -0
- package/src/icons/RecordingIcon.jsx +22 -0
- package/src/icons/RedoIcon.jsx +26 -0
- package/src/icons/RefreshBackIcon.jsx +32 -0
- package/src/icons/RefreshIcon.jsx +26 -0
- package/src/icons/RemoveFromDeviceIcon.jsx +23 -0
- package/src/icons/RemoveIcon.jsx +25 -0
- package/src/icons/ReorderIcon.jsx +26 -0
- package/src/icons/RepostIcon.jsx +26 -0
- package/src/icons/ReverbIcon.jsx +25 -0
- package/src/icons/RocketIcon.jsx +30 -0
- package/src/icons/SaveTimeIcon.jsx +26 -0
- package/src/icons/SearchIcon.jsx +32 -0
- package/src/icons/SectionsIcon.jsx +25 -0
- package/src/icons/Setlist2Icon.jsx +26 -0
- package/src/icons/SetlistIcon.jsx +26 -0
- package/src/icons/SettingsIcon.jsx +27 -0
- package/src/icons/SharpIcon.jsx +20 -0
- package/src/icons/ShiftIcon.jsx +20 -0
- package/src/icons/ShuffleIcon.jsx +26 -0
- package/src/icons/SidebarIslandIcon.jsx +26 -0
- package/src/icons/SidebarLeftIcon.jsx +25 -0
- package/src/icons/SidebarRightIcon.jsx +26 -0
- package/src/icons/SlidersIcon.jsx +26 -0
- package/src/icons/SnareIcon.jsx +18 -0
- package/src/icons/SongBarIcon.jsx +26 -0
- package/src/icons/SongDetailIcon.jsx +26 -0
- package/src/icons/Songkey2Icon.jsx +25 -0
- package/src/icons/SongwritingIcon.jsx +26 -0
- package/src/icons/SoundEffectsGradientIcon.jsx +39 -0
- package/src/icons/SoundEffectsIcon.jsx +26 -0
- package/src/icons/SoundbarIcon.jsx +26 -0
- package/src/icons/SoundtrackGradientIcon.jsx +44 -0
- package/src/icons/SoundtrackIcon.jsx +26 -0
- package/src/icons/SparkBarsIcon.jsx +25 -0
- package/src/icons/SparkleIcon.jsx +35 -0
- package/src/icons/SparklesGradientIcon.jsx +62 -0
- package/src/icons/SpatialAudioIcon.jsx +55 -0
- package/src/icons/SpeakerIcon.jsx +23 -0
- package/src/icons/SpeakerLoudIcon.jsx +34 -0
- package/src/icons/SpeedChangerIcon.jsx +30 -0
- package/src/icons/SpeedIcon.jsx +18 -0
- package/src/icons/SplitIcon.jsx +21 -0
- package/src/icons/SpliterGradientIcon.jsx +44 -0
- package/src/icons/SpliterIcon.jsx +26 -0
- package/src/icons/StarFilledIcon.jsx +23 -0
- package/src/icons/StarIcon.jsx +20 -0
- package/src/icons/Stop2Icon.jsx +15 -0
- package/src/icons/StringsIcon.jsx +36 -0
- package/src/icons/TargetIcon.jsx +33 -0
- package/src/icons/ThumbDownIcon.jsx +26 -0
- package/src/icons/ThumbUpIcon.jsx +26 -0
- package/src/icons/ThumbsIcon.jsx +26 -0
- package/src/icons/TomsIcon.jsx +21 -0
- package/src/icons/TransposeIcon.jsx +26 -0
- package/src/icons/TrashIcon.jsx +21 -0
- package/src/icons/TrimIcon.jsx +27 -0
- package/src/icons/Tuner2Icon.jsx +23 -0
- package/src/icons/TunerIcon.jsx +18 -0
- package/src/icons/TvIcon.jsx +20 -0
- package/src/icons/UkuleleIcon.jsx +49 -0
- package/src/icons/UndoIcon.jsx +26 -0
- package/src/icons/UploadIcon.jsx +29 -0
- package/src/icons/UserGroup3Icon.jsx +26 -0
- package/src/icons/UserGroupIcon.jsx +26 -0
- package/src/icons/UserIcon.jsx +27 -0
- package/src/icons/Video2Icon.jsx +31 -0
- package/src/icons/Video3Icon.jsx +24 -0
- package/src/icons/VideoFileIcon.jsx +30 -0
- package/src/icons/VideoFilesIcon.jsx +30 -0
- package/src/icons/VideoIcon.jsx +21 -0
- package/src/icons/VocalIcon.jsx +18 -0
- package/src/icons/VocalIsolationIcon.jsx +29 -0
- package/src/icons/VocalsBackgroundIcon.jsx +32 -0
- package/src/icons/VocalsIcon.jsx +26 -0
- package/src/icons/Volume0Icon.jsx +26 -0
- package/src/icons/Volume1Icon.jsx +26 -0
- package/src/icons/Volume2Icon.jsx +26 -0
- package/src/icons/VolumeBarIcon.jsx +25 -0
- package/src/icons/WaveIcon.jsx +21 -0
- package/src/icons/WaveformIcon.jsx +25 -0
- package/src/icons/WidgetIcon.jsx +35 -0
- package/src/icons/WindIcon.jsx +18 -0
- package/src/icons/WoodwindBrassIcon.jsx +23 -0
- package/src/icons/ZoomCloseIcon.jsx +38 -0
- package/src/icons/ZoomInIcon.jsx +32 -0
- package/src/icons.jsx +343 -0
- package/src/index.jsx +151 -0
- package/src/lib/menu/Menu.module.css +356 -0
- package/src/lib/menu/index.js +2 -0
- package/src/lib/menu/renderItem.jsx +190 -0
- package/src/primitives.jsx +71 -0
- package/src/styles.css +10 -0
- package/src/utils/avatarUtils.js +18 -0
- package/src/utils/constants.js +16 -0
- package/src/utils/use-isomorphic-layout-effect.js +6 -0
- package/src/utils/useEventListener.js +34 -0
- package/src/utils/useIsMobileViewport.js +32 -0
- package/src/utils/useMobileDrawer.js +41 -0
- package/src/utils/useSubmitWithFeedback.js +32 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Flex } from '../../index'
|
|
2
|
+
import { ProfileMenu } from './ProfileMenu'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/ProfileMenu',
|
|
6
|
+
component: ProfileMenu,
|
|
7
|
+
argTypes: {},
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Default = {
|
|
11
|
+
args: {
|
|
12
|
+
user: {
|
|
13
|
+
avatar: 'https://i.pravatar.cc/150?img=1',
|
|
14
|
+
name: 'Alex Smith',
|
|
15
|
+
plan: 'Premium',
|
|
16
|
+
},
|
|
17
|
+
menuOptions: [
|
|
18
|
+
{
|
|
19
|
+
type: 'item',
|
|
20
|
+
key: 'account-settings',
|
|
21
|
+
label: 'Account Settings',
|
|
22
|
+
onClick: () => console.log('Account Settings clicked'),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: 'item',
|
|
26
|
+
key: 'subscription',
|
|
27
|
+
label: 'Subscription',
|
|
28
|
+
onClick: () => console.log('Subscription clicked'),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'item',
|
|
32
|
+
key: 'notifications',
|
|
33
|
+
label: 'Notifications',
|
|
34
|
+
onClick: () => console.log('Notifications clicked'),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
collapsed: false,
|
|
38
|
+
},
|
|
39
|
+
render: (args) => (
|
|
40
|
+
<Flex width={args.collapsed ? "40px" : "300px"}>
|
|
41
|
+
<ProfileMenu {...args} />
|
|
42
|
+
</Flex>
|
|
43
|
+
),
|
|
44
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { RadioCards as RadioCardsRadix, Flex, Text } from '@radix-ui/themes'
|
|
3
|
+
import classNames from 'classnames'
|
|
4
|
+
import styles from './RadioCardsGroup.module.css'
|
|
5
|
+
|
|
6
|
+
export const RadioCardsGroup = ({
|
|
7
|
+
className,
|
|
8
|
+
items = [],
|
|
9
|
+
showRadio = true,
|
|
10
|
+
defaultValue,
|
|
11
|
+
columns = { initial: "1" },
|
|
12
|
+
...props
|
|
13
|
+
}) => {
|
|
14
|
+
return <RadioCardsRadix.Root
|
|
15
|
+
className={classNames(styles.RadioCardsGroup, className, {
|
|
16
|
+
[styles.showRadio]: showRadio
|
|
17
|
+
})}
|
|
18
|
+
columns={columns}
|
|
19
|
+
defaultValue={defaultValue}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
{items.map((item, idx) => (
|
|
23
|
+
<RadioCardsRadix.Item key={idx} value={item.value} disabled={item.disabled || false} className={styles.RadioCardsGroupItem}>
|
|
24
|
+
<Flex direction="column" width="100%" className={styles.RadioCardsGroupItemContent}>
|
|
25
|
+
<Text weight="regular" size="2">{item.label}</Text>
|
|
26
|
+
{item.description && (
|
|
27
|
+
<Text weight="regular" size="1" className={styles.RadioCardsGroupDescription}>{item.description}</Text>
|
|
28
|
+
)}
|
|
29
|
+
</Flex>
|
|
30
|
+
</RadioCardsRadix.Item>
|
|
31
|
+
))}
|
|
32
|
+
</RadioCardsRadix.Root>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
RadioCardsGroup.displayName = 'RadioCardsGroup'
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.RadioCardsGroup {
|
|
2
|
+
width: 100%;
|
|
3
|
+
gap: 12px;
|
|
4
|
+
|
|
5
|
+
.RadioCardsGroupItem {
|
|
6
|
+
--accent-indicator: var(--accent-9);
|
|
7
|
+
--base-card-border-radius: var(--radius-4);
|
|
8
|
+
|
|
9
|
+
&:where([data-state='checked'])::after {
|
|
10
|
+
outline-width: 2px;
|
|
11
|
+
outline-offset: -1px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:where(:disabled) {
|
|
15
|
+
--accent-indicator: var(--neutral-alpha-6);
|
|
16
|
+
color: var(--neutral-alpha-9);
|
|
17
|
+
|
|
18
|
+
&::selection {
|
|
19
|
+
background-color: var(--neutral-alpha-6);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&::before {
|
|
23
|
+
background-image: none;
|
|
24
|
+
background-color: var(--neutral-alpha-3);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&::after {
|
|
28
|
+
outline-color: var(--neutral-alpha-6);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.RadioCardsGroupDescription {
|
|
34
|
+
color: var(--neutral-alpha-9);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.showRadio {
|
|
38
|
+
.RadioCardsGroupItem {
|
|
39
|
+
&[data-state='checked'] {
|
|
40
|
+
.RadioCardsGroupItemContent::before {
|
|
41
|
+
border-color: var(--accent-indicator);
|
|
42
|
+
border-width: 5px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.RadioCardsGroupItemContent {
|
|
48
|
+
position: relative;
|
|
49
|
+
padding-right: 32px;
|
|
50
|
+
|
|
51
|
+
&::before {
|
|
52
|
+
content: '';
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 50%;
|
|
55
|
+
left: auto;
|
|
56
|
+
right: 0;
|
|
57
|
+
width: 18px;
|
|
58
|
+
height: 18px;
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
border: 1px solid var(--neutral-6);
|
|
61
|
+
transform: translateY(-50%);
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
import { RadioCardsGroup } from './RadioCardsGroup'
|
|
3
|
+
import { Flex, Text } from '@radix-ui/themes'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/RadioCardsGroup',
|
|
7
|
+
component: RadioCardsGroup,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {
|
|
13
|
+
items: {
|
|
14
|
+
control: 'object',
|
|
15
|
+
description: 'Array of radio cards items, each item should have a value and a label. Example: [{ value: "1", label: "8-core CPU" }, { value: "2", label: "32 GB RAM" }]',
|
|
16
|
+
},
|
|
17
|
+
defaultValue: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Value of the default checked radio card',
|
|
20
|
+
},
|
|
21
|
+
columns: {
|
|
22
|
+
control: 'object',
|
|
23
|
+
description: 'Number of columns. Example: { initial: "1", md: "3" }',
|
|
24
|
+
options: {
|
|
25
|
+
initial: "1",
|
|
26
|
+
sm: "2",
|
|
27
|
+
md: "3",
|
|
28
|
+
lg: "4",
|
|
29
|
+
xl: "5",
|
|
30
|
+
xxl: "6",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
control: 'select',
|
|
35
|
+
options: ['1', '2', '3'],
|
|
36
|
+
description: 'Size of the radio cards',
|
|
37
|
+
table: {
|
|
38
|
+
type: { summary: 'string' },
|
|
39
|
+
defaultValue: { summary: '2' },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
showRadio: {
|
|
43
|
+
control: 'boolean',
|
|
44
|
+
description: 'Whether to show the radio button',
|
|
45
|
+
table: {
|
|
46
|
+
type: { summary: 'boolean' },
|
|
47
|
+
defaultValue: { summary: 'true' },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
onValueChange: {
|
|
51
|
+
action: 'value changed',
|
|
52
|
+
description: 'Event handler called when the value state changes',
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: 'function' },
|
|
55
|
+
defaultValue: { summary: '—' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const Default = {
|
|
62
|
+
args: {
|
|
63
|
+
items: [
|
|
64
|
+
{ value: '1', label: 'I dont use the subscription enough', description: 'I want to cancel the subscription' },
|
|
65
|
+
{ value: '2', label: 'I dont use the subscription enough', description: 'I want to cancel the subscription', disabled: true },
|
|
66
|
+
{ value: '3', label: 'I cannot find the features or content that i need' },
|
|
67
|
+
{ value: '4', label: 'I have had techinical problems with the service I have had a o a c a v techinical problems with the service' },
|
|
68
|
+
{ value: '5', label: 'I am switching to a different plan', disabled: true },
|
|
69
|
+
{ value: '6', label: 'Title', description: 'Subtitle' },
|
|
70
|
+
{ value: '7', label: 'Title', description: 'Subtitle', disabled: true },
|
|
71
|
+
],
|
|
72
|
+
size: '2',
|
|
73
|
+
defaultValue: '7',
|
|
74
|
+
showRadio: true,
|
|
75
|
+
},
|
|
76
|
+
render: (args) => {
|
|
77
|
+
const [state, setState] = useState(args.defaultValue)
|
|
78
|
+
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
setState(args?.defaultValue)
|
|
81
|
+
}, [args.defaultValue])
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
return <Flex width="480px" direction="column" gap="2">
|
|
85
|
+
<Text weight="bold">Value: {state}</Text>
|
|
86
|
+
<RadioCardsGroup {...args} defaultValue={state} onValueChange={setState} />
|
|
87
|
+
</Flex>
|
|
88
|
+
},
|
|
89
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { useState, useCallback } from 'react'
|
|
2
|
+
import { StarIcon, StarFilledIcon } from '../../icons'
|
|
3
|
+
import styles from './Rating.module.css'
|
|
4
|
+
import classNames from 'classnames'
|
|
5
|
+
import { Flex, Text } from '@radix-ui/themes'
|
|
6
|
+
|
|
7
|
+
export const Rating = ({
|
|
8
|
+
count = 5,
|
|
9
|
+
value: controlledValue,
|
|
10
|
+
defaultValue,
|
|
11
|
+
disabled = false,
|
|
12
|
+
readOnly = false,
|
|
13
|
+
onValueChange,
|
|
14
|
+
onHoverChange,
|
|
15
|
+
className,
|
|
16
|
+
label,
|
|
17
|
+
minLabel,
|
|
18
|
+
maxLabel,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const [internalValue, setInternalValue] = useState(defaultValue || 0)
|
|
22
|
+
const [hoverValue, setHoverValue] = useState(0)
|
|
23
|
+
|
|
24
|
+
const value = controlledValue !== undefined ? controlledValue : internalValue
|
|
25
|
+
const isControlled = controlledValue !== undefined
|
|
26
|
+
|
|
27
|
+
const handleStarClick = useCallback(
|
|
28
|
+
(starIndex) => {
|
|
29
|
+
if (disabled || readOnly) return
|
|
30
|
+
|
|
31
|
+
const clickedValue = starIndex + 1
|
|
32
|
+
const newValue = clickedValue === value ? 0 : clickedValue
|
|
33
|
+
|
|
34
|
+
if (!isControlled) {
|
|
35
|
+
setInternalValue(newValue)
|
|
36
|
+
}
|
|
37
|
+
onValueChange?.({ value: newValue })
|
|
38
|
+
},
|
|
39
|
+
[disabled, readOnly, isControlled, onValueChange, value],
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
const handleMouseMove = useCallback(
|
|
43
|
+
(event) => {
|
|
44
|
+
if (disabled || readOnly) return
|
|
45
|
+
|
|
46
|
+
const rect = event.currentTarget.getBoundingClientRect()
|
|
47
|
+
const x = event.clientX - rect.left
|
|
48
|
+
const starWidth = rect.width / count
|
|
49
|
+
const starIndex = Math.floor(x / starWidth)
|
|
50
|
+
const clampedIndex = Math.max(0, Math.min(starIndex, count - 1))
|
|
51
|
+
|
|
52
|
+
const newHoverValue = clampedIndex + 1
|
|
53
|
+
if (newHoverValue !== hoverValue) {
|
|
54
|
+
setHoverValue(newHoverValue)
|
|
55
|
+
onHoverChange?.({ value: newHoverValue })
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[disabled, readOnly, count, hoverValue, onHoverChange],
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
const handleMouseLeave = useCallback(() => {
|
|
62
|
+
if (disabled || readOnly) return
|
|
63
|
+
|
|
64
|
+
setHoverValue(0)
|
|
65
|
+
onHoverChange?.({ value: 0 })
|
|
66
|
+
}, [disabled, readOnly, onHoverChange])
|
|
67
|
+
|
|
68
|
+
const renderStar = (index) => {
|
|
69
|
+
const isFilled = hoverValue > 0 ? index < hoverValue : index < value
|
|
70
|
+
const isHovered = hoverValue > 0 && index < hoverValue
|
|
71
|
+
const isActive = index < value
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<button
|
|
75
|
+
key={index}
|
|
76
|
+
type="button"
|
|
77
|
+
className={classNames(styles.starButton, {
|
|
78
|
+
[styles.filled]: isFilled,
|
|
79
|
+
[styles.hovered]: isHovered,
|
|
80
|
+
[styles.active]: isActive,
|
|
81
|
+
[styles.disabled]: disabled,
|
|
82
|
+
[styles.readOnly]: readOnly,
|
|
83
|
+
})}
|
|
84
|
+
onClick={() => handleStarClick(index)}
|
|
85
|
+
disabled={disabled || readOnly}
|
|
86
|
+
aria-label={`Rate ${index + 1} out of ${count}`}
|
|
87
|
+
{...props}
|
|
88
|
+
>
|
|
89
|
+
{isFilled ? (
|
|
90
|
+
<StarFilledIcon className={styles.starIcon} />
|
|
91
|
+
) : (
|
|
92
|
+
<StarIcon className={styles.starIcon} />
|
|
93
|
+
)}
|
|
94
|
+
</button>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<Flex
|
|
100
|
+
direction="column"
|
|
101
|
+
align="center"
|
|
102
|
+
gap="2"
|
|
103
|
+
width="100%"
|
|
104
|
+
className={classNames(className)}
|
|
105
|
+
>
|
|
106
|
+
{label && (
|
|
107
|
+
<Text size="2" weight="medium" className={styles.label}>
|
|
108
|
+
{label}
|
|
109
|
+
</Text>
|
|
110
|
+
)}
|
|
111
|
+
|
|
112
|
+
<Flex direction="column" gap="1" width="100%">
|
|
113
|
+
<Flex
|
|
114
|
+
direction="row"
|
|
115
|
+
align="center"
|
|
116
|
+
gap="2px"
|
|
117
|
+
justify="center"
|
|
118
|
+
className={styles.starsContainer}
|
|
119
|
+
role="radiogroup"
|
|
120
|
+
aria-label={`Rating: ${value} out of ${count} stars`}
|
|
121
|
+
onMouseMove={handleMouseMove}
|
|
122
|
+
onMouseLeave={handleMouseLeave}
|
|
123
|
+
>
|
|
124
|
+
{Array.from({ length: count }, (_, index) => renderStar(index))}
|
|
125
|
+
</Flex>
|
|
126
|
+
{(minLabel || maxLabel) && (
|
|
127
|
+
<Flex
|
|
128
|
+
direction="row"
|
|
129
|
+
align="center"
|
|
130
|
+
justify="between"
|
|
131
|
+
className={styles.labelsContainer}
|
|
132
|
+
>
|
|
133
|
+
{minLabel ? (
|
|
134
|
+
<Text size="2" className={styles.smallLabel} weight="regular">
|
|
135
|
+
{minLabel}
|
|
136
|
+
</Text>
|
|
137
|
+
) : (
|
|
138
|
+
<div />
|
|
139
|
+
)}
|
|
140
|
+
{maxLabel ? (
|
|
141
|
+
<Text size="2" className={styles.smallLabel} weight="regular">
|
|
142
|
+
{maxLabel}
|
|
143
|
+
</Text>
|
|
144
|
+
) : (
|
|
145
|
+
<div />
|
|
146
|
+
)}
|
|
147
|
+
</Flex>
|
|
148
|
+
)}
|
|
149
|
+
</Flex>
|
|
150
|
+
</Flex>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
Rating.displayName = 'Rating'
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.starButton {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
height: 48px;
|
|
6
|
+
border: none;
|
|
7
|
+
border-radius: 6px;
|
|
8
|
+
background-color: var(--neutral-alpha-2);
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
transition: all 0.2s ease;
|
|
11
|
+
padding: 0;
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
flex: 1;
|
|
14
|
+
min-width: 44px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.starButton:hover:not(.disabled):not(.readOnly):not(.active) {
|
|
18
|
+
background-color: var(--neutral-alpha-4);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.starButton.filled .starIcon {
|
|
22
|
+
color: var(--neutral-12);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.starButton:not(.filled) .starIcon {
|
|
26
|
+
color: var(--neutral-11);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.starButton.hovered:not(.active) {
|
|
30
|
+
background-color: var(--neutral-alpha-4);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.starButton.filled.active,
|
|
34
|
+
.starButton.filled.active.hovered,
|
|
35
|
+
.starButton.filled.active:focus {
|
|
36
|
+
background-color: var(--aqua-dark-5) !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.starButton.disabled {
|
|
40
|
+
opacity: 0.7;
|
|
41
|
+
cursor: default;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.starButton.readOnly {
|
|
45
|
+
cursor: default;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.starIcon {
|
|
49
|
+
width: 16px;
|
|
50
|
+
height: 16px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
.starsContainer {
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.labelsContainer {
|
|
59
|
+
width: 100%;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.label {
|
|
63
|
+
text-align: start;
|
|
64
|
+
color: #fff;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.smallLabel {
|
|
69
|
+
color: var(--neutral-alpha-9);
|
|
70
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { Rating } from './Rating'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import { Flex } from '@radix-ui/themes'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Rating',
|
|
7
|
+
component: Rating,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: `
|
|
13
|
+
### Complete Example
|
|
14
|
+
\`\`\`jsx
|
|
15
|
+
import { useState } from 'react'
|
|
16
|
+
import { Rating } from '@moises.ai/design-system'
|
|
17
|
+
|
|
18
|
+
function RatingExample() {
|
|
19
|
+
const [rating, setRating] = useState(0)
|
|
20
|
+
const [hoverRating, setHoverRating] = useState(0)
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<Rating
|
|
25
|
+
count={5}
|
|
26
|
+
value={rating}
|
|
27
|
+
onValueChange={({ value }) => setRating(value)}
|
|
28
|
+
onHoverChange={({ value }) => setHoverRating(value)}
|
|
29
|
+
label="How satisfied are you with AI Studio?"
|
|
30
|
+
minLabel="Very unsatisfied"
|
|
31
|
+
maxLabel="Very satisfied"
|
|
32
|
+
/>
|
|
33
|
+
<p>Selected: {rating} | Hover: {hoverRating}</p>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
\`\`\`
|
|
38
|
+
|
|
39
|
+
`,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
tags: ['autodocs'],
|
|
44
|
+
argTypes: {
|
|
45
|
+
count: {
|
|
46
|
+
control: { type: 'number', min: 1, max: 10 },
|
|
47
|
+
description: 'The total number of ratings',
|
|
48
|
+
},
|
|
49
|
+
value: {
|
|
50
|
+
control: { type: 'number', min: 0, max: 5 },
|
|
51
|
+
description: 'The controlled value of the rating',
|
|
52
|
+
},
|
|
53
|
+
defaultValue: {
|
|
54
|
+
control: { type: 'number', min: 0, max: 5 },
|
|
55
|
+
description: 'The initial value of the rating when rendered',
|
|
56
|
+
},
|
|
57
|
+
disabled: {
|
|
58
|
+
control: { type: 'boolean' },
|
|
59
|
+
description: 'Whether the rating is disabled',
|
|
60
|
+
},
|
|
61
|
+
readOnly: {
|
|
62
|
+
control: { type: 'boolean' },
|
|
63
|
+
description: 'Whether the rating is readonly',
|
|
64
|
+
},
|
|
65
|
+
label: {
|
|
66
|
+
control: { type: 'text' },
|
|
67
|
+
description: 'Optional label text to display above the rating stars',
|
|
68
|
+
},
|
|
69
|
+
minLabel: {
|
|
70
|
+
control: { type: 'text' },
|
|
71
|
+
description: 'Optional label for the minimum rating (left side)',
|
|
72
|
+
},
|
|
73
|
+
maxLabel: {
|
|
74
|
+
control: { type: 'text' },
|
|
75
|
+
description: 'Optional label for the maximum rating (right side)',
|
|
76
|
+
},
|
|
77
|
+
onValueChange: {
|
|
78
|
+
action: 'value changed',
|
|
79
|
+
description: 'Function to be called when the rating value changes',
|
|
80
|
+
},
|
|
81
|
+
onHoverChange: {
|
|
82
|
+
action: 'hover changed',
|
|
83
|
+
description: 'Function to be called when the rating value is hovered',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Default = {
|
|
89
|
+
args: {
|
|
90
|
+
count: 5,
|
|
91
|
+
defaultValue: 0,
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const WithValue = {
|
|
96
|
+
args: {
|
|
97
|
+
count: 5,
|
|
98
|
+
value: 3,
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const WithDefaultValue = {
|
|
103
|
+
args: {
|
|
104
|
+
count: 5,
|
|
105
|
+
defaultValue: 4,
|
|
106
|
+
},
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const Disabled = {
|
|
110
|
+
args: {
|
|
111
|
+
count: 5,
|
|
112
|
+
value: 3,
|
|
113
|
+
disabled: true,
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const ReadOnly = {
|
|
118
|
+
args: {
|
|
119
|
+
count: 5,
|
|
120
|
+
value: 3,
|
|
121
|
+
readOnly: true,
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const CustomCount = {
|
|
126
|
+
args: {
|
|
127
|
+
count: 10,
|
|
128
|
+
defaultValue: 7,
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const SurveyStyle = {
|
|
133
|
+
args: {
|
|
134
|
+
count: 5,
|
|
135
|
+
defaultValue: 0,
|
|
136
|
+
label: 'How satisfied are you with AI Studio?',
|
|
137
|
+
minLabel: 'Very unsatisfied',
|
|
138
|
+
maxLabel: 'Very satisfied',
|
|
139
|
+
},
|
|
140
|
+
parameters: {
|
|
141
|
+
docs: {
|
|
142
|
+
description: {
|
|
143
|
+
story:
|
|
144
|
+
'Rating component with survey-style question and labels, similar to the image shown.',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const WithQuestionOnly = {
|
|
151
|
+
args: {
|
|
152
|
+
count: 5,
|
|
153
|
+
defaultValue: 0,
|
|
154
|
+
label: 'Rate your experience',
|
|
155
|
+
},
|
|
156
|
+
parameters: {
|
|
157
|
+
docs: {
|
|
158
|
+
description: {
|
|
159
|
+
story: 'Rating component with only a question, no labels.',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const WithLabelsOnly = {
|
|
166
|
+
args: {
|
|
167
|
+
count: 5,
|
|
168
|
+
defaultValue: 0,
|
|
169
|
+
minLabel: 'Poor',
|
|
170
|
+
maxLabel: 'Excellent',
|
|
171
|
+
},
|
|
172
|
+
parameters: {
|
|
173
|
+
docs: {
|
|
174
|
+
description: {
|
|
175
|
+
story: 'Rating component with only labels, no question.',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const Interactive = {
|
|
182
|
+
parameters: {
|
|
183
|
+
docs: {
|
|
184
|
+
description: {
|
|
185
|
+
story:
|
|
186
|
+
'This is an interactive rating component. Try hovering over the stars to see the hover effect, and clicking to set a rating. Click on the same star to deselect it.',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
render: (args) => {
|
|
191
|
+
const [rating, setRating] = useState(0)
|
|
192
|
+
const [hoverRating, setHoverRating] = useState(0)
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
<Flex
|
|
196
|
+
direction="column"
|
|
197
|
+
align="center"
|
|
198
|
+
gap="16px"
|
|
199
|
+
justify="center"
|
|
200
|
+
style={{ width: '328px' }}
|
|
201
|
+
>
|
|
202
|
+
<Rating
|
|
203
|
+
{...args}
|
|
204
|
+
count={5}
|
|
205
|
+
value={rating}
|
|
206
|
+
onValueChange={({ value }) => setRating(value)}
|
|
207
|
+
onHoverChange={({ value }) => setHoverRating(value)}
|
|
208
|
+
/>
|
|
209
|
+
<p>
|
|
210
|
+
Selected: {rating} | Hover: {hoverRating}
|
|
211
|
+
</p>
|
|
212
|
+
</Flex>
|
|
213
|
+
)
|
|
214
|
+
},
|
|
215
|
+
}
|