odaptos_design_system 2.0.5 → 2.0.7
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/LICENSE +20 -20
- package/README.md +112 -112
- package/dist/odaptos_design_system.cjs.development.js +35 -31
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +36 -32
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +103 -103
- package/src/Atoms/Avatar/Avatar.module.scss +72 -72
- package/src/Atoms/Avatar/Avatar.tsx +43 -43
- package/src/Atoms/Badge/Badge.modules.scss +108 -108
- package/src/Atoms/Badge/Badge.tsx +109 -109
- package/src/Atoms/Box/Box.module.scss +12 -12
- package/src/Atoms/Box/Box.tsx +18 -18
- package/src/Atoms/Buttons/Button.modules.scss +266 -266
- package/src/Atoms/Buttons/Button.tsx +69 -69
- package/src/Atoms/Buttons/IconButton.modules.scss +195 -195
- package/src/Atoms/Buttons/IconButton.tsx +65 -65
- package/src/Atoms/Cards/Card.modules.scss +12 -12
- package/src/Atoms/Cards/Card.tsx +24 -24
- package/src/Atoms/Cards/CardButton.modules.scss +23 -23
- package/src/Atoms/Cards/CardButton.tsx +14 -14
- package/src/Atoms/Checkbox/Checkbox.module.scss +5 -5
- package/src/Atoms/Checkbox/Checkbox.tsx +121 -121
- package/src/Atoms/ColorPicker/ColorPicker.modules.scss +46 -46
- package/src/Atoms/ColorPicker/ColorPicker.tsx +35 -35
- package/src/Atoms/DataProtectionDisclaimer/DataProtectionDisclaimer.tsx +23 -23
- package/src/Atoms/DataProtectionDisclaimer/data-protection-disclaimer.module.scss +14 -14
- package/src/Atoms/NumbersCode/NumbersCode.modules.scss +4 -4
- package/src/Atoms/NumbersCode/NumbersCode.tsx +224 -224
- package/src/Atoms/PopoverBeta/PopoverBeta.tsx +107 -107
- package/src/Atoms/QuestionButton/QuestionButton.module.scss +29 -29
- package/src/Atoms/QuestionButton/QuestionButton.tsx +26 -26
- package/src/Atoms/Radio/Radio.module.scss +9 -9
- package/src/Atoms/Radio/Radio.tsx +89 -89
- package/src/Atoms/Search/Search.tsx +32 -32
- package/src/Atoms/SquareText/SquareText.module.scss +7 -7
- package/src/Atoms/SquareText/SquareText.tsx +19 -19
- package/src/Atoms/Switch/Switch.module.scss +14 -14
- package/src/Atoms/Switch/Switch.tsx +64 -64
- package/src/Atoms/Tag/Tag.modules.scss +86 -86
- package/src/Atoms/Tag/Tag.tsx +134 -134
- package/src/Atoms/TimeInterval/TimeInterval.module.scss +5 -5
- package/src/Atoms/TimeInterval/TimeInterval.tsx +52 -52
- package/src/Atoms/Tooltip/Layout/TooltipCustomLayout.module.scss +54 -54
- package/src/Atoms/Tooltip/Layout/TooltipCustomLayout.tsx +140 -140
- package/src/Atoms/Tooltip/Tooltip.tsx +184 -184
- package/src/Atoms/Typography/Caption.modules.scss +17 -17
- package/src/Atoms/Typography/Caption.tsx +33 -33
- package/src/Atoms/Typography/Link.modules.scss +140 -140
- package/src/Atoms/Typography/Link.tsx +73 -73
- package/src/Atoms/Typography/Text.modules.scss +277 -277
- package/src/Atoms/Typography/Text.tsx +69 -69
- package/src/Atoms/Typography/TextForButton.modules.scss +29 -29
- package/src/Atoms/Typography/TextForButton.tsx +41 -41
- package/src/Atoms/Typography/TextForDropDownItem.modules.scss +31 -31
- package/src/Atoms/Typography/TextForDropDownItem.tsx +42 -42
- package/src/Atoms/Typography/TextWithLink.modules.scss +281 -281
- package/src/Atoms/Typography/TextWithLink.tsx +73 -73
- package/src/Atoms/Typography/Title.modules.scss +82 -82
- package/src/Atoms/Typography/Title.tsx +148 -148
- package/src/DesignTokens/ColorGuide/colors.ts +99 -99
- package/src/DesignTokens/Icons/Arrows/ArrowDoubleLineDownIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowDoubleLineLeftIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowDoubleLineRightIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowDoubleLineUpIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowFilledDownIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Arrows/ArrowFilledLeftIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Arrows/ArrowFilledRightIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Arrows/ArrowFilledUpIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Arrows/ArrowLineDownIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Arrows/ArrowLineLeftIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Arrows/ArrowLineRightIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Arrows/ArrowLineUpIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Arrows/ArrowPointerDown.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowPointerDownLeft.tsx +45 -45
- package/src/DesignTokens/Icons/Arrows/ArrowPointerDownRight.tsx +45 -45
- package/src/DesignTokens/Icons/Arrows/ArrowPointerLeft.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowPointerRight.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowPointerUp.tsx +52 -52
- package/src/DesignTokens/Icons/Arrows/ArrowPointerUpLeft.tsx +45 -45
- package/src/DesignTokens/Icons/Arrows/ArrowPointerUpRight.tsx +45 -45
- package/src/DesignTokens/Icons/Circled/AddCircledIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Circled/AlertCircledIcon.tsx +64 -64
- package/src/DesignTokens/Icons/Circled/CheckedCircled.tsx +52 -52
- package/src/DesignTokens/Icons/Circled/InfoCircledIcon.tsx +64 -64
- package/src/DesignTokens/Icons/Circled/MinusCircledIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Circled/NavigationCircledIcon.tsx +58 -58
- package/src/DesignTokens/Icons/Circled/QuestionCircledIcon.tsx +57 -57
- package/src/DesignTokens/Icons/Circled/RemoveCircledIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Circled/SearchCircledIcon.tsx +58 -58
- package/src/DesignTokens/Icons/Circled/SettingsCircledIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Equipment/CameraIcon.tsx +45 -45
- package/src/DesignTokens/Icons/Equipment/LaptopIcon.tsx +74 -74
- package/src/DesignTokens/Icons/Equipment/MicrophonePodcastIcon.tsx +38 -38
- package/src/DesignTokens/Icons/Equipment/MobileIcon.tsx +81 -81
- package/src/DesignTokens/Icons/Equipment/TvFlatScreenIcon.tsx +75 -75
- package/src/DesignTokens/Icons/Equipment/TvIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Illustrations/AI_UserTest.tsx +544 -544
- package/src/DesignTokens/Icons/Illustrations/AngryIntervieweeFemale.tsx +163 -163
- package/src/DesignTokens/Icons/Illustrations/Blog.tsx +124 -124
- package/src/DesignTokens/Icons/Illustrations/EmotionsHeatMap.tsx +113 -113
- package/src/DesignTokens/Icons/Illustrations/Faq.tsx +74 -74
- package/src/DesignTokens/Icons/Illustrations/HappyMen.tsx +254 -254
- package/src/DesignTokens/Icons/Illustrations/IntegratedUsabilityScore.tsx +101 -101
- package/src/DesignTokens/Icons/Illustrations/InterviewTranscript.tsx +162 -162
- package/src/DesignTokens/Icons/Illustrations/InterviewTranscriptGreen.tsx +162 -162
- package/src/DesignTokens/Icons/Illustrations/MenShowingSomething.tsx +141 -141
- package/src/DesignTokens/Icons/Illustrations/MetaAnalyse.tsx +112 -112
- package/src/DesignTokens/Icons/Illustrations/MetaAnalyse2.tsx +74 -74
- package/src/DesignTokens/Icons/Illustrations/Non_Moderated.tsx +86 -86
- package/src/DesignTokens/Icons/Illustrations/OdaAccountPro.tsx +204 -204
- package/src/DesignTokens/Icons/Illustrations/OdaWaiting.tsx +339 -339
- package/src/DesignTokens/Icons/Illustrations/ScheduleTasks.tsx +118 -118
- package/src/DesignTokens/Icons/Illustrations/Sentiment.tsx +112 -112
- package/src/DesignTokens/Icons/Illustrations/Success.tsx +228 -228
- package/src/DesignTokens/Icons/Illustrations/UsabilityBrowser.tsx +127 -127
- package/src/DesignTokens/Icons/Illustrations/UserFlows.tsx +133 -133
- package/src/DesignTokens/Icons/Illustrations/UserPanel.tsx +127 -127
- package/src/DesignTokens/Icons/Illustrations/UxGuide.tsx +151 -151
- package/src/DesignTokens/Icons/Illustrations/VideoFlag.tsx +67 -67
- package/src/DesignTokens/Icons/Illustrations/VideoFlag2.tsx +69 -69
- package/src/DesignTokens/Icons/Illustrations/VideoFlagGreen.tsx +69 -69
- package/src/DesignTokens/Icons/Illustrations/WaitingMen.tsx +249 -249
- package/src/DesignTokens/Icons/Interaction/AccountIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Interaction/AddIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Interaction/AddTagIcon.tsx +47 -47
- package/src/DesignTokens/Icons/Interaction/AgendaIcon.tsx +76 -76
- package/src/DesignTokens/Icons/Interaction/BillingIcon.tsx +75 -75
- package/src/DesignTokens/Icons/Interaction/BinIcon.tsx +73 -73
- package/src/DesignTokens/Icons/Interaction/CheckedIcon.tsx +38 -38
- package/src/DesignTokens/Icons/Interaction/ClockIcon.tsx +58 -58
- package/src/DesignTokens/Icons/Interaction/CloseIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Interaction/CogIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/CopyPasteIcon.tsx +83 -83
- package/src/DesignTokens/Icons/Interaction/DragDropIcon.tsx +42 -42
- package/src/DesignTokens/Icons/Interaction/EditIcon.tsx +56 -56
- package/src/DesignTokens/Icons/Interaction/EditTextIcon.tsx +64 -64
- package/src/DesignTokens/Icons/Interaction/FilterIcon.tsx +49 -49
- package/src/DesignTokens/Icons/Interaction/LayoutIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/LayoutLeftIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Interaction/LayoutRightIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Interaction/LockIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Interaction/LogoutIcon.tsx +58 -58
- package/src/DesignTokens/Icons/Interaction/MenuHorizontalIcon.tsx +36 -36
- package/src/DesignTokens/Icons/Interaction/MenuVerticalIcon.tsx +57 -57
- package/src/DesignTokens/Icons/Interaction/MinusIcon.tsx +34 -34
- package/src/DesignTokens/Icons/Interaction/PencilWriteIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/SearchIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Interaction/SearchRemoveIcon.tsx +63 -63
- package/src/DesignTokens/Icons/Interaction/SettingsSliderIcon.tsx +45 -45
- package/src/DesignTokens/Icons/Interaction/ShareIcon.tsx +62 -62
- package/src/DesignTokens/Icons/Interaction/SortingIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Interaction/TagAddIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/TagEditIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/TagRemoveIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/TeamIcon.tsx +76 -76
- package/src/DesignTokens/Icons/Interaction/UnLockIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/UndoIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Interaction/UnlockedIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Logos/LogoBeta.tsx +52 -52
- package/src/DesignTokens/Icons/Logos/LogoNormal.tsx +38 -38
- package/src/DesignTokens/Icons/Logos/LogoSmall.tsx +32 -32
- package/src/DesignTokens/Icons/Logos/LogoSquare.tsx +72 -72
- package/src/DesignTokens/Icons/Logos/LogoText.tsx +32 -32
- package/src/DesignTokens/Icons/Logos/LogoWhite.tsx +38 -38
- package/src/DesignTokens/Icons/MediaControl/CutClipIcon.tsx +39 -39
- package/src/DesignTokens/Icons/MediaControl/HangUpIcon.tsx +58 -58
- package/src/DesignTokens/Icons/MediaControl/MeetingIcon.tsx +45 -45
- package/src/DesignTokens/Icons/MediaControl/MicrophoneIcon.tsx +51 -51
- package/src/DesignTokens/Icons/MediaControl/MoveBackIcon.tsx +32 -32
- package/src/DesignTokens/Icons/MediaControl/MoveInIcon.tsx +59 -59
- package/src/DesignTokens/Icons/MediaControl/MuteIcon.tsx +51 -51
- package/src/DesignTokens/Icons/MediaControl/NoCameraIcon.tsx +54 -54
- package/src/DesignTokens/Icons/MediaControl/NoMicrophoneIcon.tsx +46 -46
- package/src/DesignTokens/Icons/MediaControl/PauseIcon.tsx +45 -45
- package/src/DesignTokens/Icons/MediaControl/PlayIcon.tsx +39 -39
- package/src/DesignTokens/Icons/MediaControl/PreviousIcon.tsx +49 -49
- package/src/DesignTokens/Icons/MediaControl/RecordIcon.tsx +40 -40
- package/src/DesignTokens/Icons/MediaControl/RecordingIcon.tsx +82 -82
- package/src/DesignTokens/Icons/MediaControl/StopRecordIcon.tsx +38 -38
- package/src/DesignTokens/Icons/MediaControl/TagIcon.tsx +46 -46
- package/src/DesignTokens/Icons/MediaControl/VolumeIcon.tsx +57 -57
- package/src/DesignTokens/Icons/Miscellaneous/AddSeatIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/AddUsersIcon.tsx +69 -69
- package/src/DesignTokens/Icons/Miscellaneous/AnonymizeIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/AppWindowPieIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/ArchiveIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/BillPdfIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/BinocularIcon.tsx +38 -38
- package/src/DesignTokens/Icons/Miscellaneous/BookFlipPageIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/BrainIcon.tsx +105 -105
- package/src/DesignTokens/Icons/Miscellaneous/BulbIcon.tsx +45 -45
- package/src/DesignTokens/Icons/Miscellaneous/CalendarIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/ChatBubbleIcon.tsx +68 -68
- package/src/DesignTokens/Icons/Miscellaneous/ChatIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/CheckoutIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/ClipIcon.tsx +57 -57
- package/src/DesignTokens/Icons/Miscellaneous/ContentPenWriteIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/CreditCardIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/DownloadIcon.tsx +78 -78
- package/src/DesignTokens/Icons/Miscellaneous/EarthIcon.tsx +58 -58
- package/src/DesignTokens/Icons/Miscellaneous/FaceCenterIcon.tsx +42 -42
- package/src/DesignTokens/Icons/Miscellaneous/FaceRecognitionIcon.tsx +88 -88
- package/src/DesignTokens/Icons/Miscellaneous/FileUploadIcon.tsx +65 -65
- package/src/DesignTokens/Icons/Miscellaneous/FilesIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Miscellaneous/FillRecordIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/FilledTaskIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/FlashIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/FolderIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/GoogleIcon.tsx +67 -67
- package/src/DesignTokens/Icons/Miscellaneous/GroupIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/HardDriveIcon.tsx +58 -58
- package/src/DesignTokens/Icons/Miscellaneous/HelpIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/HelpIconAlt.tsx +33 -33
- package/src/DesignTokens/Icons/Miscellaneous/LanguageIcon.tsx +34 -34
- package/src/DesignTokens/Icons/Miscellaneous/LinkIcon.tsx +42 -42
- package/src/DesignTokens/Icons/Miscellaneous/ListToDoIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/MessagesBubbleSquareQuestionIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/MetaAnalyseIcon.tsx +74 -74
- package/src/DesignTokens/Icons/Miscellaneous/ModeratedIcon.tsx +88 -88
- package/src/DesignTokens/Icons/Miscellaneous/MultipleUsersIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/NbOfUsersIcon.tsx +64 -64
- package/src/DesignTokens/Icons/Miscellaneous/NeutralBackgroudIcon.tsx +42 -42
- package/src/DesignTokens/Icons/Miscellaneous/OfficeDrawerIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/OneColumnIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/RefreshIcon.tsx +54 -54
- package/src/DesignTokens/Icons/Miscellaneous/ReportIcon.tsx +70 -70
- package/src/DesignTokens/Icons/Miscellaneous/SeatIcon.tsx +36 -36
- package/src/DesignTokens/Icons/Miscellaneous/SendEmailIcon.tsx +51 -51
- package/src/DesignTokens/Icons/Miscellaneous/SendIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/SmartBrainIcon.tsx +52 -52
- package/src/DesignTokens/Icons/Miscellaneous/StarIcon.tsx +44 -44
- package/src/DesignTokens/Icons/Miscellaneous/TaskIcon.tsx +64 -64
- package/src/DesignTokens/Icons/Miscellaneous/TestDetailsIcon.tsx +37 -37
- package/src/DesignTokens/Icons/Miscellaneous/TestIcon.tsx +47 -47
- package/src/DesignTokens/Icons/Miscellaneous/ThreeColumnIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/TwoColumnIcon.tsx +46 -46
- package/src/DesignTokens/Icons/Miscellaneous/UnmoderatedIcon.tsx +63 -63
- package/src/DesignTokens/Icons/Miscellaneous/ViewIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/ViewOffIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Miscellaneous/VoiceIcon.tsx +47 -47
- package/src/DesignTokens/Icons/Notifications/AlamBellIdleIcon.tsx +50 -50
- package/src/DesignTokens/Icons/Notifications/AlarmBellStatusIcon.tsx +56 -56
- package/src/DesignTokens/Icons/Notifications/ConversationIdleIcon.tsx +39 -39
- package/src/DesignTokens/Icons/Notifications/ConversationStatusIcon.tsx +54 -54
- package/src/DesignTokens/Icons/Notifications/NotifAlertIcon.tsx +41 -41
- package/src/DesignTokens/Icons/Other/DashedArrowSvg.tsx +38 -38
- package/src/DesignTokens/Icons/Other/ProjectHoverSvg.tsx +52 -52
- package/src/DesignTokens/Icons/Other/ProjectSvg.tsx +40 -40
- package/src/DesignTokens/Icons/Partners/Partner1.tsx +165 -165
- package/src/DesignTokens/Icons/Partners/Partner2.tsx +94 -94
- package/src/DesignTokens/Icons/Partners/Partner3.tsx +47 -47
- package/src/DesignTokens/Icons/Partners/Partner4.tsx +199 -199
- package/src/DesignTokens/Icons/Partners/Partner5.tsx +79 -79
- package/src/DesignTokens/Icons/Partners/Partner6.tsx +39 -39
- package/src/DesignTokens/Icons/Partners/Partner7.tsx +45 -45
- package/src/DesignTokens/Icons/Partners/Partner8.tsx +37 -37
- package/src/DesignTokens/Icons/Partners/Partner9.tsx +63 -63
- package/src/DesignTokens/Icons/index.ts +197 -197
- package/src/Molecules/Accordion/Accordion.modules.scss +41 -41
- package/src/Molecules/Accordion/Accordion.tsx +49 -49
- package/src/Molecules/ChatMessage/ChatMessage.module.scss +161 -161
- package/src/Molecules/ChatMessage/ChatMessage.tsx +110 -110
- package/src/Molecules/FeaturesTable/FeaturesTable.module.scss +212 -212
- package/src/Molecules/FeaturesTable/FeaturesTable.tsx +35 -35
- package/src/Molecules/FeaturesTable/components/TableBody/TableBody.tsx +54 -54
- package/src/Molecules/FeaturesTable/components/TableBody/components/FeatureGroup.tsx +36 -36
- package/src/Molecules/FeaturesTable/components/TableBody/components/FeatureRow.tsx +64 -64
- package/src/Molecules/FeaturesTable/components/TableBody/components/RowCell.tsx +29 -29
- package/src/Molecules/FeaturesTable/components/TableBody/components/SectionTitleRow.tsx +16 -16
- package/src/Molecules/FeaturesTable/components/TableHeader/TableHeader.tsx +37 -37
- package/src/Molecules/FeaturesTable/components/TableHeader/components/HeaderCell.tsx +69 -69
- package/src/Molecules/Interviews/Chat.modules.scss +221 -221
- package/src/Molecules/Interviews/Chat.tsx +374 -374
- package/src/Molecules/Interviews/ChatInput.modules.scss +33 -33
- package/src/Molecules/Interviews/ChatInput.tsx +42 -42
- package/src/Molecules/Interviews/CircleIconButton.modules.scss +51 -51
- package/src/Molecules/Interviews/CircledIconButton.tsx +37 -37
- package/src/Molecules/Interviews/ControlsBar.modules.scss +62 -62
- package/src/Molecules/Interviews/ControlsBar.tsx +247 -246
- package/src/Molecules/Interviews/EndRecording.module.scss +20 -20
- package/src/Molecules/Interviews/EndRecording.tsx +31 -31
- package/src/Molecules/Interviews/InterviewButton.modules.scss +112 -112
- package/src/Molecules/Interviews/InterviewButton.tsx +54 -54
- package/src/Molecules/Interviews/MarkUpBar.modules.scss +36 -36
- package/src/Molecules/Interviews/MarkUpBar.tsx +67 -67
- package/src/Molecules/Interviews/Scenario.modules.scss +21 -21
- package/src/Molecules/Interviews/Scenario.tsx +53 -53
- package/src/Molecules/Interviews/SusExplanation.module.scss +11 -11
- package/src/Molecules/Interviews/SusExplanation.tsx +17 -17
- package/src/Molecules/Interviews/Task.modules.scss +294 -294
- package/src/Molecules/Interviews/Task.tsx +258 -258
- package/src/Molecules/Interviews/WelcomeMessage.modules.scss +28 -28
- package/src/Molecules/Interviews/WelcomeMessage.tsx +33 -33
- package/src/Molecules/LogoSlider/LogoSlider.module.scss +6 -6
- package/src/Molecules/LogoSlider/LogoSlider.tsx +55 -55
- package/src/Molecules/Notifications/Banner.modules.scss +160 -160
- package/src/Molecules/Notifications/Banner.tsx +134 -134
- package/src/Molecules/Notifications/NotificationIcon.tsx +26 -26
- package/src/Molecules/Notifications/Toast.modules.scss +87 -87
- package/src/Molecules/Notifications/Toast.tsx +90 -90
- package/src/Molecules/PricingCard/PricingCard.module.scss +120 -120
- package/src/Molecules/PricingCard/PricingCard.tsx +284 -284
- package/src/Molecules/StarRating/StarRating.module.scss +24 -24
- package/src/Molecules/StarRating/StarRating.tsx +71 -71
- package/src/Molecules/Tabs/Tabs.tsx +83 -83
- package/src/Molecules/Tabs/TabsUnderLine.tsx +200 -199
- package/src/Molecules/Tabs/tabs.modules.scss +60 -60
- package/src/Molecules/Tabs/tabsUnderline.modules.scss +63 -63
- package/src/Molecules/Thematic/Thematic.modules.scss +121 -121
- package/src/Molecules/Thematic/Thematic.tsx +458 -458
- package/src/Molecules/ToggleTab/ToggleTab.module.scss +37 -37
- package/src/Molecules/ToggleTab/ToggleTab.tsx +118 -118
- package/src/Molecules/UserIndicator/UserIndicator.module.scss +16 -16
- package/src/Molecules/UserIndicator/UserIndicator.tsx +58 -58
- package/src/Organisms/DatePicker/DatePicker.modules.scss +68 -68
- package/src/Organisms/DatePicker/DatePicker.tsx +268 -268
- package/src/Organisms/FormQuestions/FormQuestions.module.scss +52 -52
- package/src/Organisms/FormQuestions/FormQuestions.tsx +78 -78
- package/src/Organisms/Modal/Modal.modules.scss +66 -66
- package/src/Organisms/Modal/Modal.tsx +163 -163
- package/src/Organisms/MultiSelect/MultiSelect.modules.scss +78 -78
- package/src/Organisms/MultiSelect/MultiSelect.tsx +303 -303
- package/src/Organisms/MultiSelect/MultiSelectWithCategories.modules.scss +78 -78
- package/src/Organisms/MultiSelect/MultiSelectWithCategories.tsx +325 -325
- package/src/Organisms/NumberField/NumberField.module.scss +60 -60
- package/src/Organisms/NumberField/NumberField.tsx +244 -244
- package/src/Organisms/PasswordField/PasswordField.module.scss +55 -55
- package/src/Organisms/PasswordField/PasswordField.tsx +231 -231
- package/src/Organisms/RatingScale/RatingScale.module.scss +26 -26
- package/src/Organisms/RatingScale/RatingScale.tsx +104 -104
- package/src/Organisms/SingleSelect/SingleSelect.modules.scss +64 -64
- package/src/Organisms/SingleSelect/SingleSelect.tsx +271 -271
- package/src/Organisms/Table/Table.modules.scss +6 -6
- package/src/Organisms/Table/TableFooter.modules.scss +56 -56
- package/src/Organisms/Table/TableFooter.tsx +43 -43
- package/src/Organisms/Table/header.modules.scss +24 -24
- package/src/Organisms/Table/header.tsx +80 -80
- package/src/Organisms/Table/index.tsx +79 -79
- package/src/Organisms/Table/rows.modules.scss +37 -37
- package/src/Organisms/Table/rows.tsx +86 -86
- package/src/Organisms/Table/table-cell.modules.scss +13 -13
- package/src/Organisms/Table/table-cell.tsx +40 -40
- package/src/Organisms/TextInput/TextInput.modules.scss +55 -55
- package/src/Organisms/TextInput/TextInput.tsx +222 -222
- package/src/Organisms/Textarea/Textarea.module.scss +19 -19
- package/src/Organisms/Textarea/Textarea.tsx +97 -97
- package/src/Organisms/TimePicker/TimePicker.modules.scss +67 -67
- package/src/Organisms/TimePicker/TimePicker.tsx +242 -242
- package/src/__mocks__/PricingPageData/pricingPageMockedData.js +2120 -2120
- package/src/hooks/useClickOutside.ts +30 -30
- package/src/index.ts +74 -74
- package/src/utils/changeColorLuminance.ts +22 -22
- package/src/utils/getIconSize.ts +7 -7
- package/src/utils/getReadableTextColor.ts +36 -36
|
@@ -1,458 +1,458 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import styles from './Thematic.modules.scss';
|
|
3
|
-
import {
|
|
4
|
-
Badge,
|
|
5
|
-
Tag,
|
|
6
|
-
IconButton,
|
|
7
|
-
AddTagIcon,
|
|
8
|
-
ArrowLineRightIcon,
|
|
9
|
-
BinIcon,
|
|
10
|
-
EditIcon,
|
|
11
|
-
Text,
|
|
12
|
-
colors,
|
|
13
|
-
Button,
|
|
14
|
-
TextInput,
|
|
15
|
-
Tooltip,
|
|
16
|
-
} from '../../';
|
|
17
|
-
import { Popover } from '@mui/material';
|
|
18
|
-
import { colord } from 'colord';
|
|
19
|
-
import { changeColorLuminance } from '../../utils/changeColorLuminance';
|
|
20
|
-
import { getReadableTextColor } from '../../utils/getReadableTextColor';
|
|
21
|
-
|
|
22
|
-
export interface ThematicProps {
|
|
23
|
-
thematicId: string;
|
|
24
|
-
name: string;
|
|
25
|
-
definition: string;
|
|
26
|
-
color: string;
|
|
27
|
-
tagsList: Array<{
|
|
28
|
-
name: string;
|
|
29
|
-
color: string;
|
|
30
|
-
amount: number;
|
|
31
|
-
definition?: string;
|
|
32
|
-
}>;
|
|
33
|
-
otherThematicsList?: Array<{
|
|
34
|
-
_id: string;
|
|
35
|
-
name: string;
|
|
36
|
-
color: string;
|
|
37
|
-
}>;
|
|
38
|
-
onClickValidateAddTag?: (thematicId: string, tag: Object) => void;
|
|
39
|
-
onClickValidateEditTag?: (thematicId: string, tag: Object) => void;
|
|
40
|
-
onSelectThematicToMoveTag?: (
|
|
41
|
-
currentThematicId: string,
|
|
42
|
-
tag: Object,
|
|
43
|
-
newThematicId: string
|
|
44
|
-
) => void;
|
|
45
|
-
onClickDeleteTag?: (thematicId: string, tag: Object) => void;
|
|
46
|
-
onClickEditThematic?: (thematicId: string) => void;
|
|
47
|
-
onClickDeleteThematic?: (thematicId: string) => void;
|
|
48
|
-
cmsContent?: {
|
|
49
|
-
addTag: string;
|
|
50
|
-
validate: string;
|
|
51
|
-
edit: string;
|
|
52
|
-
moveTo: string;
|
|
53
|
-
delete: string;
|
|
54
|
-
};
|
|
55
|
-
isAddTagHidden?: boolean;
|
|
56
|
-
isEditThematicHidden?: boolean;
|
|
57
|
-
isDeleteThematicHidden?: boolean;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const Thematic = ({
|
|
61
|
-
thematicId,
|
|
62
|
-
name,
|
|
63
|
-
definition,
|
|
64
|
-
color,
|
|
65
|
-
tagsList = [],
|
|
66
|
-
otherThematicsList = [],
|
|
67
|
-
onClickValidateAddTag,
|
|
68
|
-
onClickValidateEditTag,
|
|
69
|
-
onSelectThematicToMoveTag,
|
|
70
|
-
onClickDeleteTag,
|
|
71
|
-
onClickEditThematic,
|
|
72
|
-
onClickDeleteThematic,
|
|
73
|
-
cmsContent,
|
|
74
|
-
isAddTagHidden = false,
|
|
75
|
-
isEditThematicHidden = false,
|
|
76
|
-
isDeleteThematicHidden = false,
|
|
77
|
-
}: ThematicProps) => {
|
|
78
|
-
const [areActionsVisible, setAreActionsVisible] = useState(false);
|
|
79
|
-
const [newTagName, setNewTagName] = useState('');
|
|
80
|
-
const [selectedTag, setSelectedTag] = useState<Object | null>(null);
|
|
81
|
-
const [editedTagName, setEditedTagName] = useState('');
|
|
82
|
-
|
|
83
|
-
//----------------- Popover states ----------------- //
|
|
84
|
-
const [isAddTagPopoverOpen, setIsAddTagPopoverOpen] = useState(false);
|
|
85
|
-
const [isTagMenuPopoverOpen, setIsTagMenuPopoverOpen] = useState(false);
|
|
86
|
-
const [isEditTagPopoverOpen, setIsEditTagPopoverOpen] = useState(false);
|
|
87
|
-
const [isMoveTagPopoverOpen, setIsMoveTagPopoverOpen] = useState(false);
|
|
88
|
-
|
|
89
|
-
const [addTagPopoverAnchorPosition, setAddTagPopoverAnchorPosition] =
|
|
90
|
-
useState<HTMLElement | null>(null);
|
|
91
|
-
const [tagMenuPopoverAnchorPosition, setTagMenuPopoverAnchorPosition] =
|
|
92
|
-
useState<HTMLElement | null>(null);
|
|
93
|
-
const [editTagPopoverAnchorPosition, setEditTagPopoverAnchorPosition] =
|
|
94
|
-
useState<HTMLElement | null>(null);
|
|
95
|
-
const [moveTagPopoverAnchorPosition, setMoveTagPopoverAnchorPosition] =
|
|
96
|
-
useState<HTMLElement | null>(null);
|
|
97
|
-
|
|
98
|
-
//----------------- Color Calculations ----------------- //
|
|
99
|
-
const thematicColor = colord(color);
|
|
100
|
-
|
|
101
|
-
let tagColor = thematicColor;
|
|
102
|
-
|
|
103
|
-
const backgroundColor = changeColorLuminance(thematicColor, 97);
|
|
104
|
-
const badgeColor = changeColorLuminance(thematicColor, 90);
|
|
105
|
-
const iconsColor = changeColorLuminance(thematicColor, 40);
|
|
106
|
-
const borderColor = getReadableTextColor(colord(backgroundColor));
|
|
107
|
-
|
|
108
|
-
// If the contrast between the thematic color and the background color is too low, change the color of the tags to make them darker
|
|
109
|
-
if (thematicColor.contrast(backgroundColor) < 1.25) {
|
|
110
|
-
tagColor = colord(changeColorLuminance(thematicColor, 90));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// ----------------- Popover functions ----------------- //
|
|
114
|
-
const openAddTagPopover = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
115
|
-
setAddTagPopoverAnchorPosition(event.currentTarget);
|
|
116
|
-
setIsAddTagPopoverOpen(true);
|
|
117
|
-
};
|
|
118
|
-
const closeAddTagPopover = () => {
|
|
119
|
-
setAddTagPopoverAnchorPosition(null);
|
|
120
|
-
setIsAddTagPopoverOpen(false);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const openTagMenuPopover = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
124
|
-
setTagMenuPopoverAnchorPosition(event.currentTarget);
|
|
125
|
-
setIsTagMenuPopoverOpen(true);
|
|
126
|
-
};
|
|
127
|
-
const closeTagMenuPopover = () => {
|
|
128
|
-
setTagMenuPopoverAnchorPosition(null);
|
|
129
|
-
setIsTagMenuPopoverOpen(false);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const openEditTagPopover = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
133
|
-
setEditTagPopoverAnchorPosition(event.currentTarget);
|
|
134
|
-
setIsEditTagPopoverOpen(true);
|
|
135
|
-
};
|
|
136
|
-
const closeEditTagPopover = () => {
|
|
137
|
-
setEditTagPopoverAnchorPosition(null);
|
|
138
|
-
setIsEditTagPopoverOpen(false);
|
|
139
|
-
setIsTagMenuPopoverOpen(false);
|
|
140
|
-
setEditedTagName('');
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const openMoveTagPopover = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
144
|
-
setMoveTagPopoverAnchorPosition(event.currentTarget);
|
|
145
|
-
setIsMoveTagPopoverOpen(true);
|
|
146
|
-
};
|
|
147
|
-
const closeMoveTagPopover = () => {
|
|
148
|
-
setMoveTagPopoverAnchorPosition(null);
|
|
149
|
-
setIsMoveTagPopoverOpen(false);
|
|
150
|
-
setIsTagMenuPopoverOpen(false);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// ----------------- Event handlers ----------------- //
|
|
154
|
-
const handleOnClickAddTag = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
155
|
-
e.stopPropagation();
|
|
156
|
-
openAddTagPopover(e);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const handleOnClickValidateAddTag = () => {
|
|
160
|
-
if (onClickValidateAddTag) {
|
|
161
|
-
onClickValidateAddTag(thematicId, {
|
|
162
|
-
name: newTagName,
|
|
163
|
-
color: thematicColor.toHex(),
|
|
164
|
-
definition: '',
|
|
165
|
-
});
|
|
166
|
-
setNewTagName('');
|
|
167
|
-
}
|
|
168
|
-
setNewTagName('');
|
|
169
|
-
closeAddTagPopover();
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const handleOnClickEditThematic = (
|
|
173
|
-
e: React.MouseEvent<HTMLButtonElement>
|
|
174
|
-
) => {
|
|
175
|
-
e.stopPropagation();
|
|
176
|
-
if (onClickEditThematic) {
|
|
177
|
-
onClickEditThematic(thematicId);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const handleOnClickDeleteThematic = (
|
|
182
|
-
e: React.MouseEvent<HTMLButtonElement>
|
|
183
|
-
) => {
|
|
184
|
-
e.stopPropagation();
|
|
185
|
-
if (onClickDeleteThematic) {
|
|
186
|
-
onClickDeleteThematic(thematicId);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
const handleOnClickTag = (
|
|
190
|
-
e: React.MouseEvent<HTMLDivElement>,
|
|
191
|
-
tag: { name: string }
|
|
192
|
-
) => {
|
|
193
|
-
e.stopPropagation();
|
|
194
|
-
setSelectedTag(tag);
|
|
195
|
-
setEditedTagName(tag.name);
|
|
196
|
-
openTagMenuPopover(e);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const handleOnClickEditTag = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
200
|
-
openEditTagPopover(e);
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
const handleOnClickValidateEditTag = () => {
|
|
204
|
-
if (onClickValidateEditTag && selectedTag) {
|
|
205
|
-
onClickValidateEditTag(thematicId, {
|
|
206
|
-
...selectedTag,
|
|
207
|
-
name: editedTagName,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
closeEditTagPopover();
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const handleOnClickMoveTag = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
214
|
-
openMoveTagPopover(e);
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
const handleOnSelectThematicToMoveTag = (newThematicId: string) => {
|
|
218
|
-
if (onSelectThematicToMoveTag && selectedTag) {
|
|
219
|
-
onSelectThematicToMoveTag(thematicId, selectedTag, newThematicId);
|
|
220
|
-
}
|
|
221
|
-
closeMoveTagPopover();
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
const handleOnClickDeleteTag = () => {
|
|
225
|
-
if (onClickDeleteTag && selectedTag) {
|
|
226
|
-
onClickDeleteTag(thematicId, selectedTag);
|
|
227
|
-
}
|
|
228
|
-
closeTagMenuPopover();
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
return (
|
|
232
|
-
<div
|
|
233
|
-
className={styles.thematic}
|
|
234
|
-
style={{
|
|
235
|
-
backgroundColor: backgroundColor,
|
|
236
|
-
borderColor: borderColor,
|
|
237
|
-
}}
|
|
238
|
-
onMouseEnter={(e) => {
|
|
239
|
-
// Show the actions menu on hover
|
|
240
|
-
e.stopPropagation();
|
|
241
|
-
setAreActionsVisible(true);
|
|
242
|
-
}}
|
|
243
|
-
onMouseLeave={(e) => {
|
|
244
|
-
// Hide the actions menu on hover
|
|
245
|
-
e.stopPropagation();
|
|
246
|
-
setAreActionsVisible(false);
|
|
247
|
-
}}
|
|
248
|
-
>
|
|
249
|
-
<div className={styles.thematic__header}>
|
|
250
|
-
<Tooltip
|
|
251
|
-
tooltipDescription={definition}
|
|
252
|
-
placement="top"
|
|
253
|
-
isTooltipActive={!!definition}
|
|
254
|
-
arrow
|
|
255
|
-
>
|
|
256
|
-
<div>
|
|
257
|
-
<Badge
|
|
258
|
-
text={name}
|
|
259
|
-
size="base"
|
|
260
|
-
status={'idle'}
|
|
261
|
-
customColor={badgeColor}
|
|
262
|
-
className={styles.overflow_badge}
|
|
263
|
-
/>
|
|
264
|
-
</div>
|
|
265
|
-
</Tooltip>
|
|
266
|
-
{areActionsVisible && (
|
|
267
|
-
<div className={styles.thematic__header__actions}>
|
|
268
|
-
{/* Add tag */}
|
|
269
|
-
{!isAddTagHidden && (
|
|
270
|
-
<IconButton
|
|
271
|
-
icon={<AddTagIcon fill={iconsColor} stroke={iconsColor} />}
|
|
272
|
-
size="xs"
|
|
273
|
-
variant="tertiary"
|
|
274
|
-
onClick={handleOnClickAddTag}
|
|
275
|
-
/>
|
|
276
|
-
)}
|
|
277
|
-
{/* Edit thematic */}
|
|
278
|
-
{!isEditThematicHidden && (
|
|
279
|
-
<IconButton
|
|
280
|
-
icon={<EditIcon fill={iconsColor} stroke={iconsColor} />}
|
|
281
|
-
size="xs"
|
|
282
|
-
variant="tertiary"
|
|
283
|
-
onClick={handleOnClickEditThematic}
|
|
284
|
-
/>
|
|
285
|
-
)}
|
|
286
|
-
{/* Delete Tag */}
|
|
287
|
-
{!isDeleteThematicHidden && (
|
|
288
|
-
<IconButton
|
|
289
|
-
icon={<BinIcon fill={colors.red_500} stroke={colors.red_500} />}
|
|
290
|
-
size="xs"
|
|
291
|
-
variant="tertiary"
|
|
292
|
-
onClick={handleOnClickDeleteThematic}
|
|
293
|
-
/>
|
|
294
|
-
)}
|
|
295
|
-
</div>
|
|
296
|
-
)}
|
|
297
|
-
</div>
|
|
298
|
-
{tagsList.length > 0 && (
|
|
299
|
-
<div className={styles.tagsContainer}>
|
|
300
|
-
{tagsList.map((tag, idx) => (
|
|
301
|
-
<div
|
|
302
|
-
key={`${tag}-${idx}`}
|
|
303
|
-
className={styles.tag}
|
|
304
|
-
onClick={(e) => handleOnClickTag(e, tag)}
|
|
305
|
-
>
|
|
306
|
-
<Tooltip
|
|
307
|
-
tooltipDescription={tag.definition}
|
|
308
|
-
placement="top"
|
|
309
|
-
isTooltipActive={!!tag.definition}
|
|
310
|
-
arrow
|
|
311
|
-
>
|
|
312
|
-
<div>
|
|
313
|
-
<Tag
|
|
314
|
-
text={tag.name}
|
|
315
|
-
customColor={tagColor.toHex()}
|
|
316
|
-
size="base"
|
|
317
|
-
amountNumber={tag.amount}
|
|
318
|
-
className={styles.overflow_tag}
|
|
319
|
-
/>
|
|
320
|
-
</div>
|
|
321
|
-
</Tooltip>
|
|
322
|
-
</div>
|
|
323
|
-
))}
|
|
324
|
-
</div>
|
|
325
|
-
)}
|
|
326
|
-
|
|
327
|
-
{/* -------------------------- Popovers ----------------------------------- */}
|
|
328
|
-
|
|
329
|
-
{/* Add Tag Popover */}
|
|
330
|
-
<Popover
|
|
331
|
-
open={isAddTagPopoverOpen}
|
|
332
|
-
anchorEl={addTagPopoverAnchorPosition}
|
|
333
|
-
anchorOrigin={{
|
|
334
|
-
vertical: 'bottom',
|
|
335
|
-
horizontal: 'right',
|
|
336
|
-
}}
|
|
337
|
-
onClose={closeAddTagPopover}
|
|
338
|
-
className={styles.addTagPopover}
|
|
339
|
-
>
|
|
340
|
-
<div className={styles.content}>
|
|
341
|
-
<TextInput
|
|
342
|
-
placeholder={cmsContent ? cmsContent.addTag : 'Add tag'}
|
|
343
|
-
value={newTagName}
|
|
344
|
-
onChange={(e) => setNewTagName(e.target.value)}
|
|
345
|
-
onKeyDown={handleOnClickValidateAddTag}
|
|
346
|
-
/>
|
|
347
|
-
<div className={styles.actions}>
|
|
348
|
-
<Button
|
|
349
|
-
text={cmsContent ? cmsContent.validate : 'Validate'}
|
|
350
|
-
size="sm"
|
|
351
|
-
onClick={handleOnClickValidateAddTag}
|
|
352
|
-
disabled={newTagName === ''}
|
|
353
|
-
/>
|
|
354
|
-
</div>
|
|
355
|
-
</div>
|
|
356
|
-
</Popover>
|
|
357
|
-
|
|
358
|
-
{/* Tag Menu Popover */}
|
|
359
|
-
<Popover
|
|
360
|
-
open={isTagMenuPopoverOpen}
|
|
361
|
-
anchorEl={tagMenuPopoverAnchorPosition}
|
|
362
|
-
anchorOrigin={{
|
|
363
|
-
vertical: 'bottom',
|
|
364
|
-
horizontal: 'right',
|
|
365
|
-
}}
|
|
366
|
-
onClose={closeTagMenuPopover}
|
|
367
|
-
className={styles.tagMenuPopover}
|
|
368
|
-
>
|
|
369
|
-
<div className={styles.dropdown}>
|
|
370
|
-
<div className={styles.item} onClick={(e) => handleOnClickEditTag(e)}>
|
|
371
|
-
<Text text={cmsContent ? cmsContent.edit : 'Edit'} size="sm" />
|
|
372
|
-
<ArrowLineRightIcon fill={colors.black} size="base" />
|
|
373
|
-
</div>
|
|
374
|
-
{otherThematicsList.length > 0 && (
|
|
375
|
-
<div
|
|
376
|
-
className={styles.item}
|
|
377
|
-
onClick={(e) => handleOnClickMoveTag(e)}
|
|
378
|
-
>
|
|
379
|
-
<Text
|
|
380
|
-
text={cmsContent ? cmsContent.moveTo : 'Move to'}
|
|
381
|
-
size="sm"
|
|
382
|
-
/>
|
|
383
|
-
<ArrowLineRightIcon fill={colors.black} size="base" />
|
|
384
|
-
</div>
|
|
385
|
-
)}
|
|
386
|
-
<div className={styles.item} onClick={handleOnClickDeleteTag}>
|
|
387
|
-
<BinIcon fill={colors.red_500} size="base" />
|
|
388
|
-
<Text text={cmsContent ? cmsContent.delete : 'Delete'} size="sm" />
|
|
389
|
-
</div>
|
|
390
|
-
</div>
|
|
391
|
-
</Popover>
|
|
392
|
-
|
|
393
|
-
{/* Edit Tag Popover */}
|
|
394
|
-
<Popover
|
|
395
|
-
open={isEditTagPopoverOpen}
|
|
396
|
-
anchorEl={editTagPopoverAnchorPosition}
|
|
397
|
-
anchorOrigin={{
|
|
398
|
-
vertical: 'bottom',
|
|
399
|
-
horizontal: 'right',
|
|
400
|
-
}}
|
|
401
|
-
onClose={closeEditTagPopover}
|
|
402
|
-
className={styles.editTagPopover}
|
|
403
|
-
>
|
|
404
|
-
<div className={styles.content}>
|
|
405
|
-
<TextInput
|
|
406
|
-
placeholder={cmsContent ? cmsContent.edit : 'Edit'}
|
|
407
|
-
value={editedTagName}
|
|
408
|
-
onChange={(e) => setEditedTagName(e.target.value)}
|
|
409
|
-
onKeyDown={handleOnClickValidateEditTag}
|
|
410
|
-
/>
|
|
411
|
-
<div className={styles.actions}>
|
|
412
|
-
<Button
|
|
413
|
-
text={cmsContent ? cmsContent.validate : 'Validate'}
|
|
414
|
-
size="sm"
|
|
415
|
-
onClick={handleOnClickValidateEditTag}
|
|
416
|
-
disabled={editedTagName === ''}
|
|
417
|
-
/>
|
|
418
|
-
</div>
|
|
419
|
-
</div>
|
|
420
|
-
</Popover>
|
|
421
|
-
|
|
422
|
-
{/* Move Tag Popover */}
|
|
423
|
-
<Popover
|
|
424
|
-
open={isMoveTagPopoverOpen}
|
|
425
|
-
anchorEl={moveTagPopoverAnchorPosition}
|
|
426
|
-
anchorOrigin={{
|
|
427
|
-
vertical: 'bottom',
|
|
428
|
-
horizontal: 'right',
|
|
429
|
-
}}
|
|
430
|
-
onClose={closeMoveTagPopover}
|
|
431
|
-
className={styles.moveTagPopover}
|
|
432
|
-
>
|
|
433
|
-
<div className={styles.content}>
|
|
434
|
-
<div className={styles.otherThematicsContainer}>
|
|
435
|
-
{otherThematicsList.map((thematic, idx) => (
|
|
436
|
-
<div
|
|
437
|
-
key={`${thematic}-${idx}`}
|
|
438
|
-
className={styles.otherThematic}
|
|
439
|
-
onClick={() => handleOnSelectThematicToMoveTag(thematic._id)}
|
|
440
|
-
>
|
|
441
|
-
<div
|
|
442
|
-
className={styles.color}
|
|
443
|
-
style={{
|
|
444
|
-
backgroundColor: thematic.color,
|
|
445
|
-
height: '1rem',
|
|
446
|
-
width: '1rem',
|
|
447
|
-
borderRadius: '50%',
|
|
448
|
-
}}
|
|
449
|
-
/>
|
|
450
|
-
<Text text={thematic.name} size="sm" />
|
|
451
|
-
</div>
|
|
452
|
-
))}
|
|
453
|
-
</div>
|
|
454
|
-
</div>
|
|
455
|
-
</Popover>
|
|
456
|
-
</div>
|
|
457
|
-
);
|
|
458
|
-
};
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import styles from './Thematic.modules.scss';
|
|
3
|
+
import {
|
|
4
|
+
Badge,
|
|
5
|
+
Tag,
|
|
6
|
+
IconButton,
|
|
7
|
+
AddTagIcon,
|
|
8
|
+
ArrowLineRightIcon,
|
|
9
|
+
BinIcon,
|
|
10
|
+
EditIcon,
|
|
11
|
+
Text,
|
|
12
|
+
colors,
|
|
13
|
+
Button,
|
|
14
|
+
TextInput,
|
|
15
|
+
Tooltip,
|
|
16
|
+
} from '../../';
|
|
17
|
+
import { Popover } from '@mui/material';
|
|
18
|
+
import { colord } from 'colord';
|
|
19
|
+
import { changeColorLuminance } from '../../utils/changeColorLuminance';
|
|
20
|
+
import { getReadableTextColor } from '../../utils/getReadableTextColor';
|
|
21
|
+
|
|
22
|
+
export interface ThematicProps {
|
|
23
|
+
thematicId: string;
|
|
24
|
+
name: string;
|
|
25
|
+
definition: string;
|
|
26
|
+
color: string;
|
|
27
|
+
tagsList: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
color: string;
|
|
30
|
+
amount: number;
|
|
31
|
+
definition?: string;
|
|
32
|
+
}>;
|
|
33
|
+
otherThematicsList?: Array<{
|
|
34
|
+
_id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
color: string;
|
|
37
|
+
}>;
|
|
38
|
+
onClickValidateAddTag?: (thematicId: string, tag: Object) => void;
|
|
39
|
+
onClickValidateEditTag?: (thematicId: string, tag: Object) => void;
|
|
40
|
+
onSelectThematicToMoveTag?: (
|
|
41
|
+
currentThematicId: string,
|
|
42
|
+
tag: Object,
|
|
43
|
+
newThematicId: string
|
|
44
|
+
) => void;
|
|
45
|
+
onClickDeleteTag?: (thematicId: string, tag: Object) => void;
|
|
46
|
+
onClickEditThematic?: (thematicId: string) => void;
|
|
47
|
+
onClickDeleteThematic?: (thematicId: string) => void;
|
|
48
|
+
cmsContent?: {
|
|
49
|
+
addTag: string;
|
|
50
|
+
validate: string;
|
|
51
|
+
edit: string;
|
|
52
|
+
moveTo: string;
|
|
53
|
+
delete: string;
|
|
54
|
+
};
|
|
55
|
+
isAddTagHidden?: boolean;
|
|
56
|
+
isEditThematicHidden?: boolean;
|
|
57
|
+
isDeleteThematicHidden?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const Thematic = ({
|
|
61
|
+
thematicId,
|
|
62
|
+
name,
|
|
63
|
+
definition,
|
|
64
|
+
color,
|
|
65
|
+
tagsList = [],
|
|
66
|
+
otherThematicsList = [],
|
|
67
|
+
onClickValidateAddTag,
|
|
68
|
+
onClickValidateEditTag,
|
|
69
|
+
onSelectThematicToMoveTag,
|
|
70
|
+
onClickDeleteTag,
|
|
71
|
+
onClickEditThematic,
|
|
72
|
+
onClickDeleteThematic,
|
|
73
|
+
cmsContent,
|
|
74
|
+
isAddTagHidden = false,
|
|
75
|
+
isEditThematicHidden = false,
|
|
76
|
+
isDeleteThematicHidden = false,
|
|
77
|
+
}: ThematicProps) => {
|
|
78
|
+
const [areActionsVisible, setAreActionsVisible] = useState(false);
|
|
79
|
+
const [newTagName, setNewTagName] = useState('');
|
|
80
|
+
const [selectedTag, setSelectedTag] = useState<Object | null>(null);
|
|
81
|
+
const [editedTagName, setEditedTagName] = useState('');
|
|
82
|
+
|
|
83
|
+
//----------------- Popover states ----------------- //
|
|
84
|
+
const [isAddTagPopoverOpen, setIsAddTagPopoverOpen] = useState(false);
|
|
85
|
+
const [isTagMenuPopoverOpen, setIsTagMenuPopoverOpen] = useState(false);
|
|
86
|
+
const [isEditTagPopoverOpen, setIsEditTagPopoverOpen] = useState(false);
|
|
87
|
+
const [isMoveTagPopoverOpen, setIsMoveTagPopoverOpen] = useState(false);
|
|
88
|
+
|
|
89
|
+
const [addTagPopoverAnchorPosition, setAddTagPopoverAnchorPosition] =
|
|
90
|
+
useState<HTMLElement | null>(null);
|
|
91
|
+
const [tagMenuPopoverAnchorPosition, setTagMenuPopoverAnchorPosition] =
|
|
92
|
+
useState<HTMLElement | null>(null);
|
|
93
|
+
const [editTagPopoverAnchorPosition, setEditTagPopoverAnchorPosition] =
|
|
94
|
+
useState<HTMLElement | null>(null);
|
|
95
|
+
const [moveTagPopoverAnchorPosition, setMoveTagPopoverAnchorPosition] =
|
|
96
|
+
useState<HTMLElement | null>(null);
|
|
97
|
+
|
|
98
|
+
//----------------- Color Calculations ----------------- //
|
|
99
|
+
const thematicColor = colord(color);
|
|
100
|
+
|
|
101
|
+
let tagColor = thematicColor;
|
|
102
|
+
|
|
103
|
+
const backgroundColor = changeColorLuminance(thematicColor, 97);
|
|
104
|
+
const badgeColor = changeColorLuminance(thematicColor, 90);
|
|
105
|
+
const iconsColor = changeColorLuminance(thematicColor, 40);
|
|
106
|
+
const borderColor = getReadableTextColor(colord(backgroundColor));
|
|
107
|
+
|
|
108
|
+
// If the contrast between the thematic color and the background color is too low, change the color of the tags to make them darker
|
|
109
|
+
if (thematicColor.contrast(backgroundColor) < 1.25) {
|
|
110
|
+
tagColor = colord(changeColorLuminance(thematicColor, 90));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ----------------- Popover functions ----------------- //
|
|
114
|
+
const openAddTagPopover = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
115
|
+
setAddTagPopoverAnchorPosition(event.currentTarget);
|
|
116
|
+
setIsAddTagPopoverOpen(true);
|
|
117
|
+
};
|
|
118
|
+
const closeAddTagPopover = () => {
|
|
119
|
+
setAddTagPopoverAnchorPosition(null);
|
|
120
|
+
setIsAddTagPopoverOpen(false);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const openTagMenuPopover = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
124
|
+
setTagMenuPopoverAnchorPosition(event.currentTarget);
|
|
125
|
+
setIsTagMenuPopoverOpen(true);
|
|
126
|
+
};
|
|
127
|
+
const closeTagMenuPopover = () => {
|
|
128
|
+
setTagMenuPopoverAnchorPosition(null);
|
|
129
|
+
setIsTagMenuPopoverOpen(false);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const openEditTagPopover = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
133
|
+
setEditTagPopoverAnchorPosition(event.currentTarget);
|
|
134
|
+
setIsEditTagPopoverOpen(true);
|
|
135
|
+
};
|
|
136
|
+
const closeEditTagPopover = () => {
|
|
137
|
+
setEditTagPopoverAnchorPosition(null);
|
|
138
|
+
setIsEditTagPopoverOpen(false);
|
|
139
|
+
setIsTagMenuPopoverOpen(false);
|
|
140
|
+
setEditedTagName('');
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const openMoveTagPopover = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
144
|
+
setMoveTagPopoverAnchorPosition(event.currentTarget);
|
|
145
|
+
setIsMoveTagPopoverOpen(true);
|
|
146
|
+
};
|
|
147
|
+
const closeMoveTagPopover = () => {
|
|
148
|
+
setMoveTagPopoverAnchorPosition(null);
|
|
149
|
+
setIsMoveTagPopoverOpen(false);
|
|
150
|
+
setIsTagMenuPopoverOpen(false);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// ----------------- Event handlers ----------------- //
|
|
154
|
+
const handleOnClickAddTag = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
openAddTagPopover(e);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const handleOnClickValidateAddTag = () => {
|
|
160
|
+
if (onClickValidateAddTag) {
|
|
161
|
+
onClickValidateAddTag(thematicId, {
|
|
162
|
+
name: newTagName,
|
|
163
|
+
color: thematicColor.toHex(),
|
|
164
|
+
definition: '',
|
|
165
|
+
});
|
|
166
|
+
setNewTagName('');
|
|
167
|
+
}
|
|
168
|
+
setNewTagName('');
|
|
169
|
+
closeAddTagPopover();
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const handleOnClickEditThematic = (
|
|
173
|
+
e: React.MouseEvent<HTMLButtonElement>
|
|
174
|
+
) => {
|
|
175
|
+
e.stopPropagation();
|
|
176
|
+
if (onClickEditThematic) {
|
|
177
|
+
onClickEditThematic(thematicId);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const handleOnClickDeleteThematic = (
|
|
182
|
+
e: React.MouseEvent<HTMLButtonElement>
|
|
183
|
+
) => {
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
if (onClickDeleteThematic) {
|
|
186
|
+
onClickDeleteThematic(thematicId);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const handleOnClickTag = (
|
|
190
|
+
e: React.MouseEvent<HTMLDivElement>,
|
|
191
|
+
tag: { name: string }
|
|
192
|
+
) => {
|
|
193
|
+
e.stopPropagation();
|
|
194
|
+
setSelectedTag(tag);
|
|
195
|
+
setEditedTagName(tag.name);
|
|
196
|
+
openTagMenuPopover(e);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const handleOnClickEditTag = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
200
|
+
openEditTagPopover(e);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const handleOnClickValidateEditTag = () => {
|
|
204
|
+
if (onClickValidateEditTag && selectedTag) {
|
|
205
|
+
onClickValidateEditTag(thematicId, {
|
|
206
|
+
...selectedTag,
|
|
207
|
+
name: editedTagName,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
closeEditTagPopover();
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const handleOnClickMoveTag = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
214
|
+
openMoveTagPopover(e);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const handleOnSelectThematicToMoveTag = (newThematicId: string) => {
|
|
218
|
+
if (onSelectThematicToMoveTag && selectedTag) {
|
|
219
|
+
onSelectThematicToMoveTag(thematicId, selectedTag, newThematicId);
|
|
220
|
+
}
|
|
221
|
+
closeMoveTagPopover();
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const handleOnClickDeleteTag = () => {
|
|
225
|
+
if (onClickDeleteTag && selectedTag) {
|
|
226
|
+
onClickDeleteTag(thematicId, selectedTag);
|
|
227
|
+
}
|
|
228
|
+
closeTagMenuPopover();
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return (
|
|
232
|
+
<div
|
|
233
|
+
className={styles.thematic}
|
|
234
|
+
style={{
|
|
235
|
+
backgroundColor: backgroundColor,
|
|
236
|
+
borderColor: borderColor,
|
|
237
|
+
}}
|
|
238
|
+
onMouseEnter={(e) => {
|
|
239
|
+
// Show the actions menu on hover
|
|
240
|
+
e.stopPropagation();
|
|
241
|
+
setAreActionsVisible(true);
|
|
242
|
+
}}
|
|
243
|
+
onMouseLeave={(e) => {
|
|
244
|
+
// Hide the actions menu on hover
|
|
245
|
+
e.stopPropagation();
|
|
246
|
+
setAreActionsVisible(false);
|
|
247
|
+
}}
|
|
248
|
+
>
|
|
249
|
+
<div className={styles.thematic__header}>
|
|
250
|
+
<Tooltip
|
|
251
|
+
tooltipDescription={definition}
|
|
252
|
+
placement="top"
|
|
253
|
+
isTooltipActive={!!definition}
|
|
254
|
+
arrow
|
|
255
|
+
>
|
|
256
|
+
<div>
|
|
257
|
+
<Badge
|
|
258
|
+
text={name}
|
|
259
|
+
size="base"
|
|
260
|
+
status={'idle'}
|
|
261
|
+
customColor={badgeColor}
|
|
262
|
+
className={styles.overflow_badge}
|
|
263
|
+
/>
|
|
264
|
+
</div>
|
|
265
|
+
</Tooltip>
|
|
266
|
+
{areActionsVisible && (
|
|
267
|
+
<div className={styles.thematic__header__actions}>
|
|
268
|
+
{/* Add tag */}
|
|
269
|
+
{!isAddTagHidden && (
|
|
270
|
+
<IconButton
|
|
271
|
+
icon={<AddTagIcon fill={iconsColor} stroke={iconsColor} />}
|
|
272
|
+
size="xs"
|
|
273
|
+
variant="tertiary"
|
|
274
|
+
onClick={handleOnClickAddTag}
|
|
275
|
+
/>
|
|
276
|
+
)}
|
|
277
|
+
{/* Edit thematic */}
|
|
278
|
+
{!isEditThematicHidden && (
|
|
279
|
+
<IconButton
|
|
280
|
+
icon={<EditIcon fill={iconsColor} stroke={iconsColor} />}
|
|
281
|
+
size="xs"
|
|
282
|
+
variant="tertiary"
|
|
283
|
+
onClick={handleOnClickEditThematic}
|
|
284
|
+
/>
|
|
285
|
+
)}
|
|
286
|
+
{/* Delete Tag */}
|
|
287
|
+
{!isDeleteThematicHidden && (
|
|
288
|
+
<IconButton
|
|
289
|
+
icon={<BinIcon fill={colors.red_500} stroke={colors.red_500} />}
|
|
290
|
+
size="xs"
|
|
291
|
+
variant="tertiary"
|
|
292
|
+
onClick={handleOnClickDeleteThematic}
|
|
293
|
+
/>
|
|
294
|
+
)}
|
|
295
|
+
</div>
|
|
296
|
+
)}
|
|
297
|
+
</div>
|
|
298
|
+
{tagsList.length > 0 && (
|
|
299
|
+
<div className={styles.tagsContainer}>
|
|
300
|
+
{tagsList.map((tag, idx) => (
|
|
301
|
+
<div
|
|
302
|
+
key={`${tag}-${idx}`}
|
|
303
|
+
className={styles.tag}
|
|
304
|
+
onClick={(e) => handleOnClickTag(e, tag)}
|
|
305
|
+
>
|
|
306
|
+
<Tooltip
|
|
307
|
+
tooltipDescription={tag.definition}
|
|
308
|
+
placement="top"
|
|
309
|
+
isTooltipActive={!!tag.definition}
|
|
310
|
+
arrow
|
|
311
|
+
>
|
|
312
|
+
<div>
|
|
313
|
+
<Tag
|
|
314
|
+
text={tag.name}
|
|
315
|
+
customColor={tagColor.toHex()}
|
|
316
|
+
size="base"
|
|
317
|
+
amountNumber={tag.amount}
|
|
318
|
+
className={styles.overflow_tag}
|
|
319
|
+
/>
|
|
320
|
+
</div>
|
|
321
|
+
</Tooltip>
|
|
322
|
+
</div>
|
|
323
|
+
))}
|
|
324
|
+
</div>
|
|
325
|
+
)}
|
|
326
|
+
|
|
327
|
+
{/* -------------------------- Popovers ----------------------------------- */}
|
|
328
|
+
|
|
329
|
+
{/* Add Tag Popover */}
|
|
330
|
+
<Popover
|
|
331
|
+
open={isAddTagPopoverOpen}
|
|
332
|
+
anchorEl={addTagPopoverAnchorPosition}
|
|
333
|
+
anchorOrigin={{
|
|
334
|
+
vertical: 'bottom',
|
|
335
|
+
horizontal: 'right',
|
|
336
|
+
}}
|
|
337
|
+
onClose={closeAddTagPopover}
|
|
338
|
+
className={styles.addTagPopover}
|
|
339
|
+
>
|
|
340
|
+
<div className={styles.content}>
|
|
341
|
+
<TextInput
|
|
342
|
+
placeholder={cmsContent ? cmsContent.addTag : 'Add tag'}
|
|
343
|
+
value={newTagName}
|
|
344
|
+
onChange={(e) => setNewTagName(e.target.value)}
|
|
345
|
+
onKeyDown={handleOnClickValidateAddTag}
|
|
346
|
+
/>
|
|
347
|
+
<div className={styles.actions}>
|
|
348
|
+
<Button
|
|
349
|
+
text={cmsContent ? cmsContent.validate : 'Validate'}
|
|
350
|
+
size="sm"
|
|
351
|
+
onClick={handleOnClickValidateAddTag}
|
|
352
|
+
disabled={newTagName === ''}
|
|
353
|
+
/>
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
</Popover>
|
|
357
|
+
|
|
358
|
+
{/* Tag Menu Popover */}
|
|
359
|
+
<Popover
|
|
360
|
+
open={isTagMenuPopoverOpen}
|
|
361
|
+
anchorEl={tagMenuPopoverAnchorPosition}
|
|
362
|
+
anchorOrigin={{
|
|
363
|
+
vertical: 'bottom',
|
|
364
|
+
horizontal: 'right',
|
|
365
|
+
}}
|
|
366
|
+
onClose={closeTagMenuPopover}
|
|
367
|
+
className={styles.tagMenuPopover}
|
|
368
|
+
>
|
|
369
|
+
<div className={styles.dropdown}>
|
|
370
|
+
<div className={styles.item} onClick={(e) => handleOnClickEditTag(e)}>
|
|
371
|
+
<Text text={cmsContent ? cmsContent.edit : 'Edit'} size="sm" />
|
|
372
|
+
<ArrowLineRightIcon fill={colors.black} size="base" />
|
|
373
|
+
</div>
|
|
374
|
+
{otherThematicsList.length > 0 && (
|
|
375
|
+
<div
|
|
376
|
+
className={styles.item}
|
|
377
|
+
onClick={(e) => handleOnClickMoveTag(e)}
|
|
378
|
+
>
|
|
379
|
+
<Text
|
|
380
|
+
text={cmsContent ? cmsContent.moveTo : 'Move to'}
|
|
381
|
+
size="sm"
|
|
382
|
+
/>
|
|
383
|
+
<ArrowLineRightIcon fill={colors.black} size="base" />
|
|
384
|
+
</div>
|
|
385
|
+
)}
|
|
386
|
+
<div className={styles.item} onClick={handleOnClickDeleteTag}>
|
|
387
|
+
<BinIcon fill={colors.red_500} size="base" />
|
|
388
|
+
<Text text={cmsContent ? cmsContent.delete : 'Delete'} size="sm" />
|
|
389
|
+
</div>
|
|
390
|
+
</div>
|
|
391
|
+
</Popover>
|
|
392
|
+
|
|
393
|
+
{/* Edit Tag Popover */}
|
|
394
|
+
<Popover
|
|
395
|
+
open={isEditTagPopoverOpen}
|
|
396
|
+
anchorEl={editTagPopoverAnchorPosition}
|
|
397
|
+
anchorOrigin={{
|
|
398
|
+
vertical: 'bottom',
|
|
399
|
+
horizontal: 'right',
|
|
400
|
+
}}
|
|
401
|
+
onClose={closeEditTagPopover}
|
|
402
|
+
className={styles.editTagPopover}
|
|
403
|
+
>
|
|
404
|
+
<div className={styles.content}>
|
|
405
|
+
<TextInput
|
|
406
|
+
placeholder={cmsContent ? cmsContent.edit : 'Edit'}
|
|
407
|
+
value={editedTagName}
|
|
408
|
+
onChange={(e) => setEditedTagName(e.target.value)}
|
|
409
|
+
onKeyDown={handleOnClickValidateEditTag}
|
|
410
|
+
/>
|
|
411
|
+
<div className={styles.actions}>
|
|
412
|
+
<Button
|
|
413
|
+
text={cmsContent ? cmsContent.validate : 'Validate'}
|
|
414
|
+
size="sm"
|
|
415
|
+
onClick={handleOnClickValidateEditTag}
|
|
416
|
+
disabled={editedTagName === ''}
|
|
417
|
+
/>
|
|
418
|
+
</div>
|
|
419
|
+
</div>
|
|
420
|
+
</Popover>
|
|
421
|
+
|
|
422
|
+
{/* Move Tag Popover */}
|
|
423
|
+
<Popover
|
|
424
|
+
open={isMoveTagPopoverOpen}
|
|
425
|
+
anchorEl={moveTagPopoverAnchorPosition}
|
|
426
|
+
anchorOrigin={{
|
|
427
|
+
vertical: 'bottom',
|
|
428
|
+
horizontal: 'right',
|
|
429
|
+
}}
|
|
430
|
+
onClose={closeMoveTagPopover}
|
|
431
|
+
className={styles.moveTagPopover}
|
|
432
|
+
>
|
|
433
|
+
<div className={styles.content}>
|
|
434
|
+
<div className={styles.otherThematicsContainer}>
|
|
435
|
+
{otherThematicsList.map((thematic, idx) => (
|
|
436
|
+
<div
|
|
437
|
+
key={`${thematic}-${idx}`}
|
|
438
|
+
className={styles.otherThematic}
|
|
439
|
+
onClick={() => handleOnSelectThematicToMoveTag(thematic._id)}
|
|
440
|
+
>
|
|
441
|
+
<div
|
|
442
|
+
className={styles.color}
|
|
443
|
+
style={{
|
|
444
|
+
backgroundColor: thematic.color,
|
|
445
|
+
height: '1rem',
|
|
446
|
+
width: '1rem',
|
|
447
|
+
borderRadius: '50%',
|
|
448
|
+
}}
|
|
449
|
+
/>
|
|
450
|
+
<Text text={thematic.name} size="sm" />
|
|
451
|
+
</div>
|
|
452
|
+
))}
|
|
453
|
+
</div>
|
|
454
|
+
</div>
|
|
455
|
+
</Popover>
|
|
456
|
+
</div>
|
|
457
|
+
);
|
|
458
|
+
};
|