frst-components 0.37.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -52
- package/dist/esm/index.js +154 -0
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js +28 -0
- package/dist/esm/public/customIcons/CircledAlert.js +7 -0
- package/dist/esm/public/customIcons/CircledCheck.js +7 -0
- package/dist/esm/public/customIcons/DefaultProfile.js +7 -0
- package/dist/esm/public/customIcons/ExcludeVoteIcon.js +7 -0
- package/dist/esm/public/customIcons/LanguageIcon.js +7 -0
- package/dist/esm/public/customIcons/SmallTrash.js +7 -0
- package/dist/esm/public/customIcons/SwitchVoteIcon.js +7 -0
- package/dist/esm/public/customIcons/TagAlert.js +7 -0
- package/dist/esm/public/customIcons/VoteCurrentIcon.js +7 -0
- package/dist/esm/public/customIcons/VoteIcon.js +7 -0
- package/dist/esm/public/customIcons/WarningIcon.js +7 -0
- package/dist/esm/public/customIcons/newVoteIcon.js +7 -0
- package/dist/esm/public/img/Nonotification.png.js +3 -0
- package/dist/esm/public/img/TargetIcon.png.js +3 -0
- package/dist/esm/src/components/DS/CardJourney/index.js +12 -0
- package/dist/esm/src/components/DS/CardJourney/style.js +123 -0
- package/dist/esm/src/components/DS/ConfirmationModal/ComfirmModalDownload/ComfirmModalDownload.js +20 -0
- package/dist/esm/src/components/DS/ConfirmationModal/ConfirmationModal.js +10 -0
- package/dist/esm/src/components/DS/ConfirmationModal/styles.js +56 -0
- package/dist/esm/src/components/DS/LightTooltip/index.js +24 -0
- package/dist/esm/src/components/DS/admButton/admButton.styles.js +52 -0
- package/dist/esm/src/components/DS/admButton/index.js +17 -0
- package/dist/esm/src/components/DS/cardPeople/cardPeople.styles.js +71 -0
- package/dist/esm/src/components/DS/cardPeople/index.js +63 -0
- package/dist/esm/src/components/DS/cardUser/cardUser.styles.js +70 -0
- package/dist/esm/src/components/DS/cardUser/index.js +14 -0
- package/dist/esm/src/components/DS/dropdown-Multiselect/index.js +186 -0
- package/dist/esm/src/components/DS/dropdown-Multiselect/styles/multiselectStyles.js +214 -0
- package/dist/esm/src/components/DS/dropdown-Multiselect/styles/primereact.css.js +6 -0
- package/dist/esm/src/components/DS/dropdown-Multiselect/styles/stylesMulti.css.js +6 -0
- package/dist/esm/src/components/DS/groups-table/groupTableStyles.js +95 -0
- package/dist/esm/src/components/DS/groups-table/index.js +113 -0
- package/dist/esm/src/components/DS/hypotesisAndImpediment/UpDownButtons/index.js +8 -0
- package/dist/esm/src/components/DS/hypotesisAndImpediment/UpDownButtons/upDownButtons.styles.js +43 -0
- package/dist/esm/src/components/DS/hypotesisAndImpediment/Voting/index.js +40 -0
- package/dist/esm/src/components/DS/hypotesisAndImpediment/Voting/voting.styles.js +126 -0
- package/dist/esm/src/components/DS/hypotesisAndImpediment/hypothesisAndImpediment.style.js +115 -0
- package/dist/esm/src/components/DS/hypotesisAndImpediment/index.js +161 -0
- package/dist/esm/src/components/DS/impedimentosTab/addImpedimentoModal/index.js +35 -0
- package/dist/esm/src/components/DS/impedimentosTab/addImpedimentoModal/styles.js +14 -0
- package/dist/esm/src/components/DS/impedimentosTab/dropDown/index.js +20 -0
- package/dist/esm/src/components/DS/impedimentosTab/dropDown/styles.js +38 -0
- package/dist/esm/src/components/DS/impedimentosTab/index.js +180 -0
- package/dist/esm/src/components/DS/impedimentosTab/styles.js +178 -0
- package/dist/esm/src/components/DS/loading/index.js +45 -0
- package/dist/esm/src/components/DS/loading/loadingStyle.js +39 -0
- package/dist/esm/src/components/DS/modal/index.js +55 -0
- package/dist/esm/src/components/DS/modal/styles.js +86 -0
- package/dist/esm/src/components/DS/newCards/articles/index.js +12 -0
- package/dist/esm/src/components/DS/newCards/articles/styles.js +92 -0
- package/dist/esm/src/components/DS/newCards/challenge/index.js +82 -0
- package/dist/esm/src/components/DS/newCards/challenge/styles.js +198 -0
- package/dist/esm/src/components/DS/newCards/channels/index.js +10 -0
- package/dist/esm/src/components/DS/newCards/channels/styles.js +46 -0
- package/dist/esm/src/components/DS/newCards/content/index.js +16 -0
- package/dist/esm/src/components/DS/newCards/content/styles.js +103 -0
- package/dist/esm/src/components/DS/newCards/mentoring/index.js +38 -0
- package/dist/esm/src/components/DS/newCards/mentoring/styles.js +37 -0
- package/dist/esm/src/components/DS/newCards/people/index.js +120 -0
- package/dist/esm/src/components/DS/newCards/people/styles.js +75 -0
- package/dist/esm/src/components/DS/newCards/trail/index.js +10 -0
- package/dist/esm/src/components/DS/newCards/trail/styles.js +60 -0
- package/dist/esm/src/components/DS/onboarding-progress-menu/index.js +56 -0
- package/dist/esm/src/components/DS/onboarding-progress-menu/onboardingProgressMenuStyles.js +98 -0
- package/dist/esm/src/components/DS/progressGoalBar/index.js +29 -0
- package/dist/esm/src/components/DS/progressGoalBar/progressGoalBarStyles.js +183 -0
- package/dist/esm/src/components/DS/progressGoalBar/progressTexts.js +17 -0
- package/dist/esm/src/components/DS/progressGoalBar/useProgressGoalBar.js +232 -0
- package/dist/esm/src/components/DS/resourceInfoDrop/index.js +53 -0
- package/dist/esm/src/components/DS/resourceInfoDrop/styles.js +142 -0
- package/dist/esm/src/components/DS/resultFilterTabs/dropDownResult/index.js +20 -0
- package/dist/esm/src/components/DS/resultFilterTabs/dropDownResult/styles.js +38 -0
- package/dist/esm/src/components/DS/resultFilterTabs/index.js +162 -0
- package/dist/esm/src/components/DS/resultFilterTabs/resultFilterTabsStyles.js +167 -0
- package/dist/esm/src/components/DS/resultFilterTabs/rsuite.min.css.js +6 -0
- package/dist/esm/src/components/DS/scroll-container-v2/ButtonControl/buttonControlStyles.js +65 -0
- package/dist/esm/src/components/DS/scroll-container-v2/ButtonControl/index.js +19 -0
- package/dist/esm/src/components/DS/scroll-container-v2/ButtonControl/useLongPress.js +26 -0
- package/dist/esm/src/components/DS/scroll-container-v2/index.js +29 -0
- package/dist/esm/src/components/DS/scroll-container-v2/scrollContainerStyles.js +51 -0
- package/dist/esm/src/components/DS/scroll-container-v2/useScroll.js +85 -0
- package/dist/esm/src/components/DS/select/Select.js +50 -0
- package/dist/esm/src/components/DS/select/SelectContext.js +6 -0
- package/dist/esm/src/components/DS/select/SelectItem.js +46 -0
- package/dist/esm/src/components/DS/select/index.js +9 -0
- package/dist/esm/src/components/DS/select/styles/StylesSelect.js +107 -0
- package/dist/esm/src/components/DS/steps-progress/index.js +27 -0
- package/dist/esm/src/components/DS/steps-progress/stepsProgressStyles.js +85 -0
- package/dist/esm/src/components/DS/toast/index.js +35 -0
- package/dist/esm/src/components/DS/toast/toast.styles.js +68 -0
- package/dist/esm/src/components/DS/toast-v2/index.js +76 -0
- package/dist/esm/src/components/DS/toast-v2/toast-v2.styles.js +18 -0
- package/dist/esm/src/components/DS/tooltip/index.js +98 -0
- package/dist/esm/src/components/DS/tooltip/styles.js +146 -0
- package/dist/esm/src/components/EBR/buttons-group/index.js +17 -0
- package/dist/esm/src/components/EBR/buttons-group/styles.js +9 -0
- package/dist/esm/src/components/EBR/group-statistics/groupStatisticsStyles.js +56 -0
- package/dist/esm/src/components/EBR/group-statistics/index.js +61 -0
- package/dist/esm/src/components/EBR/objective-step/index.js +8 -0
- package/dist/esm/src/components/EBR/objective-step/objectiveStepStyles.js +36 -0
- package/dist/esm/src/components/EBR/rating/index.js +78 -0
- package/dist/esm/src/components/EBR/rating/ratingStyles.js +25 -0
- package/dist/esm/src/components/EBR/specialist-contact/index.js +11 -0
- package/dist/esm/src/components/EBR/specialist-contact/specialistContactStyles.js +91 -0
- package/dist/esm/src/components/EBR/stepper/stepper.js +8 -0
- package/dist/esm/src/components/EBR/stepper/stepperItem.js +13 -0
- package/dist/esm/src/components/EBR/stepper/styles.js +137 -0
- package/dist/esm/src/components/EBR/trail-list/index.js +57 -0
- package/dist/esm/src/components/EBR/trail-list/trailListStyles.js +51 -0
- package/dist/esm/src/components/FI/ThreadComments/index.js +45 -0
- package/dist/esm/src/components/FI/ThreadComments/threadComments.styles.js +51 -0
- package/dist/esm/src/components/FI/ThreadComments/utilitiesComponents/commentaryBoxReply/index.js +20 -0
- package/dist/esm/src/components/FI/ThreadComments/utilitiesComponents/inputReply/index.js +67 -0
- package/dist/esm/src/components/FI/ThreadComments/utilitiesComponents/inputReply/inputReply.styles.js +39 -0
- package/dist/esm/src/components/FI/bannerProblemFeed/bannerProblemFeedStyles.js +156 -0
- package/dist/esm/src/components/FI/bannerProblemFeed/index.js +161 -0
- package/dist/esm/src/components/FI/bannerSRG/bannerSRGStyle.js +217 -0
- package/dist/esm/src/components/FI/bannerSRG/index.js +15 -0
- package/dist/esm/src/components/FI/feedInteraction/feedInteractionStyles.js +137 -0
- package/dist/esm/src/components/FI/feedInteraction/index.js +88 -0
- package/dist/esm/src/components/FI/feedInteractionV2/feedInteractionStyles.js +52 -0
- package/dist/esm/src/components/FI/feedInteractionV2/index.js +22 -0
- package/dist/esm/src/components/FI/feedInteractionV3/feedInteractionV3Styles.js +49 -0
- package/dist/esm/src/components/FI/feedInteractionV3/index.js +29 -0
- package/dist/esm/src/components/FI/inputCommentPost-it/index.js +118 -0
- package/dist/esm/src/components/FI/inputCommentPost-it/inputCommentPost-It.utils.js +20 -0
- package/dist/esm/src/components/FI/inputCommentPost-it/inputCommentPost-ItStyles.js +190 -0
- package/dist/esm/src/components/FI/interactionsModal/InteractionsModalStyles.js +152 -0
- package/dist/esm/src/components/FI/interactionsModal/index.js +43 -0
- package/dist/esm/src/components/FI/modal-invite/index.js +146 -0
- package/dist/esm/src/components/FI/modal-invite/modalInviteStyles.js +115 -0
- package/dist/esm/src/components/FI/notificationCard/index.js +41 -0
- package/dist/esm/src/components/FI/notificationCard/notificationCardStyles.js +84 -0
- package/dist/esm/src/components/FI/notificationPopOver/index.js +59 -0
- package/dist/esm/src/components/FI/notificationPopOver/notificationPopOverStyles.js +112 -0
- package/dist/esm/src/components/FI/postFeed/index.js +53 -0
- package/dist/esm/src/components/FI/postFeed/postFeedStyles.js +181 -0
- package/dist/esm/src/components/FI/searchBox/SearchBoxStyles.js +23 -0
- package/dist/esm/src/components/FI/searchBox/index.js +11 -0
- package/dist/esm/src/components/FI/sessionFilters/index.js +72 -0
- package/dist/esm/src/components/FI/sessionFilters/sessionFiltersStyle.js +80 -0
- package/dist/esm/src/components/FI/smallSRGBanner/frstFundo.png.js +3 -0
- package/dist/esm/src/components/FI/smallSRGBanner/g12.png.js +3 -0
- package/dist/esm/src/components/FI/smallSRGBanner/index.js +12 -0
- package/dist/esm/src/components/FI/smallSRGBanner/smallSRGBannerStyles.js +61 -0
- package/dist/esm/src/components/IJ/ContentCycle/ContentCycleStyles.js +146 -0
- package/dist/esm/src/components/IJ/ContentCycle/index.js +21 -0
- package/dist/esm/src/components/IJ/ListContentCycle/ListContentCycleStyles.js +12 -0
- package/dist/esm/src/components/IJ/ListContentCycle/index.js +11 -0
- package/dist/esm/src/components/IJ/StepLearningCycle/StepLearningCycleStyle.js +94 -0
- package/dist/esm/src/components/IJ/StepLearningCycle/index.js +117 -0
- package/dist/esm/src/components/IJ/favorite/favoriteStyles.js +17 -0
- package/dist/esm/src/components/IJ/favorite/index.js +36 -0
- package/dist/esm/src/components/IJ/learningCycleCard/components/menu/index.js +49 -0
- package/dist/esm/src/components/IJ/learningCycleCard/components/menu/menuStyle.js +28 -0
- package/dist/esm/src/components/IJ/learningCycleCard/index.js +36 -0
- package/dist/esm/src/components/IJ/learningCycleCard/learningCycleCardStyle.js +153 -0
- package/dist/esm/src/components/IJ/listSelector/index.js +39 -0
- package/dist/esm/src/components/IJ/listSelector/listSelectorStyles.js +46 -0
- package/dist/esm/src/components/IJ/pagination/index.js +82 -0
- package/dist/esm/src/components/IJ/pagination/paginationStyles.js +59 -0
- package/dist/esm/src/components/IJ/participantCard/index.js +37 -0
- package/dist/esm/src/components/IJ/participantCard/participantCardStyle.js +273 -0
- package/dist/esm/src/components/IJ/participantCardOld/index.js +58 -0
- package/dist/esm/src/components/IJ/participantCardOld/participantCardStyle.js +293 -0
- package/dist/esm/src/components/IJ/thumbListContent/index.js +28 -0
- package/dist/esm/src/components/IJ/thumbListContent/thumbListContentStyles.js +250 -0
- package/dist/esm/src/components/IncrementarIdeia/icrementarIdeiaStyles.js +115 -0
- package/dist/esm/src/components/IncrementarIdeia/index.js +98 -0
- package/dist/esm/src/components/IncrementarIdeia/useAutosizeTextArea.js +13 -0
- package/dist/esm/src/components/LXP/AccordionList/AccordionList.styles.js +101 -0
- package/dist/esm/src/components/LXP/AccordionList/index.js +26 -0
- package/dist/esm/src/components/LXP/accordionTrack/accordionTrack.js +179 -0
- package/dist/esm/src/components/LXP/accordionTrack/accordionTrackList.js +187 -0
- package/dist/esm/src/components/LXP/accordionTrack/accordionTrackStyle.js +194 -0
- package/dist/esm/src/components/LXP/accordionTrack/contentCourses.js +8 -0
- package/dist/esm/src/components/LXP/accordionTrack/contentCoursesTrails.js +189 -0
- package/dist/esm/src/components/LXP/accordionTrack/vectorDown.js +13 -0
- package/dist/esm/src/components/LXP/accordionTrack/vectorUp.js +13 -0
- package/dist/esm/src/components/LXP/avatarAssociatedChannel/avatarAssociatedChannelStyles.js +83 -0
- package/dist/esm/src/components/LXP/avatarAssociatedChannel/index.js +11 -0
- package/dist/esm/src/components/LXP/avatarChannel/avatarChannelStyles.js +106 -0
- package/dist/esm/src/components/LXP/avatarChannel/index.js +32 -0
- package/dist/esm/src/components/LXP/bannerLxp/bannerLxp.js +150 -0
- package/dist/esm/src/components/LXP/bannerLxp/index.js +124 -0
- package/dist/esm/src/components/LXP/buttonContent/buttonContentStyle.js +63 -0
- package/dist/esm/src/components/LXP/buttonContent/index.js +11 -0
- package/dist/esm/src/components/LXP/calendarLxp/calendar.css.js +6 -0
- package/dist/esm/src/components/LXP/calendarLxp/calendarLxp.module.css.js +7 -0
- package/dist/esm/src/components/LXP/calendarLxp/defaultRanges.js +79 -0
- package/dist/esm/src/components/LXP/calendarLxp/index.js +26 -0
- package/dist/esm/src/components/LXP/colorpicker/colorpickerStyles.js +43 -0
- package/dist/esm/src/components/LXP/colorpicker/index.js +20 -0
- package/dist/esm/src/components/LXP/contentSwitcher/contentSwitcherStyle.js +94 -0
- package/dist/esm/src/components/LXP/contentSwitcher/index.js +10 -0
- package/dist/esm/src/components/LXP/contentThumbnails/contentThumbnailsStyle.js +184 -0
- package/dist/esm/src/components/LXP/contentThumbnails/index.js +77 -0
- package/dist/esm/src/components/LXP/contentThumbnails/vectorDown.js +13 -0
- package/dist/esm/src/components/LXP/contentThumbnails/vectorUp.js +13 -0
- package/dist/esm/src/components/LXP/fileUpload/fileUploadStyles.js +88 -0
- package/dist/esm/src/components/LXP/fileUpload/index.js +21 -0
- package/dist/esm/src/components/LXP/headerContent/headerContent.js +218 -0
- package/dist/esm/src/components/LXP/headerContent/index.js +45 -0
- package/dist/esm/src/components/LXP/login/index.js +157 -0
- package/dist/esm/src/components/LXP/login/loginStyle.js +271 -0
- package/dist/esm/src/components/LXP/manageLerningCicles/index.js +40 -0
- package/dist/esm/src/components/LXP/manageLerningCicles/manageLearningCicles.Style.js +84 -0
- package/dist/esm/src/components/LXP/modalNewFeatures/ModalNewFeatures.style.js +204 -0
- package/dist/esm/src/components/LXP/modalNewFeatures/index.js +41 -0
- package/dist/esm/src/components/LXP/participantThumbnails/index.js +20 -0
- package/dist/esm/src/components/LXP/participantThumbnails/participantThumbnails.js +94 -0
- package/dist/esm/src/components/LXP/participantThumbnailsList/index.js +35 -0
- package/dist/esm/src/components/LXP/popOver/index.js +68 -0
- package/dist/esm/src/components/LXP/popOver/popOverStyle.js +130 -0
- package/dist/esm/src/components/LXP/popOverLXP-antigo/index.js +23 -0
- package/dist/esm/src/components/LXP/popOverLXP-antigo/popOverLXPStyles.js +123 -0
- package/dist/esm/src/components/LXP/progressBar/index.js +11 -0
- package/dist/esm/src/components/LXP/progressBar/progressStyle.js +32 -0
- package/dist/esm/src/components/LXP/searchResults/index.js +15 -0
- package/dist/esm/src/components/LXP/searchResults/searchResultsStyles.js +63 -0
- package/dist/esm/src/components/LXP/selectLXP/SelectLXP.js +128 -0
- package/dist/esm/src/components/LXP/selectLXP/SelectLXPContext.js +6 -0
- package/dist/esm/src/components/LXP/selectLXP/SelectLXPItem.js +40 -0
- package/dist/esm/src/components/LXP/selectLXP/index.js +9 -0
- package/dist/esm/src/components/LXP/star-metric/index.js +13 -0
- package/dist/esm/src/components/LXP/star-metric/starMetricStyles.js +13 -0
- package/dist/esm/src/components/LXP/thumbnails/headerVectorElipses.js +13 -0
- package/dist/esm/src/components/LXP/thumbnails/loadingThumbnails.js +9 -0
- package/dist/esm/src/components/LXP/thumbnails/thumbnails.js +119 -0
- package/dist/esm/src/components/LXP/thumbnails/thumbnailsDraggable.js +13 -0
- package/dist/esm/src/components/LXP/thumbnails/thumbnailsStyle.js +188 -0
- package/dist/esm/src/components/LXP/thumbnails/vectorCross.js +13 -0
- package/dist/esm/src/components/LXP/thumbnails/vectorEllipse.js +13 -0
- package/dist/esm/src/components/LXP/tooltip/index.js +11 -0
- package/dist/esm/src/components/LXP/tooltip/tooltipStyle.js +131 -0
- package/dist/esm/src/components/LXP/video/index.js +10 -0
- package/dist/esm/src/components/LogoFRST/index.js +13 -0
- package/dist/esm/src/components/LogoFRST/logoFRST.module.css.js +7 -0
- package/dist/esm/src/components/ModalConfirme/index.js +10 -0
- package/dist/esm/src/components/ModalConfirme/styles.js +51 -0
- package/dist/esm/src/components/accordion-tabs/accordionTabsStyles.js +100 -0
- package/dist/esm/src/components/accordion-tabs/index.js +34 -0
- package/dist/esm/src/components/actioExperience/actioExperience.styles.js +163 -0
- package/dist/esm/src/components/actioExperience/icons.js +19 -0
- package/dist/esm/src/components/actioExperience/index.js +20 -0
- package/dist/esm/src/components/audio-player/audioPlayerStyles.js +329 -0
- package/dist/esm/src/components/audio-player/index.js +110 -0
- package/dist/esm/src/components/avatar/avatarStyles.js +24 -0
- package/dist/esm/src/components/avatar/index.js +17 -0
- package/dist/esm/src/components/brainstorming-votar/index.js +10 -0
- package/dist/esm/src/components/brainstorming-votar/votarStyles.js +85 -0
- package/dist/esm/src/components/buttons/buttonStyle.js +389 -0
- package/dist/esm/src/components/buttons/index.js +31 -0
- package/dist/esm/src/components/calendar/calendarStyle.js +185 -0
- package/dist/esm/src/components/calendar/index.js +60 -0
- package/dist/esm/src/components/card-trail/cardTrailStyle.js +29 -0
- package/dist/esm/src/components/card-trail/index.js +50 -0
- package/dist/esm/src/components/card-trail/moduleStyle.js +92 -0
- package/dist/esm/src/components/card-trail-carousel/index.js +15 -0
- package/dist/esm/src/components/cardLT/AvatarWithInfo/avatarWithInfo.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/AvatarWithInfo/index.js +16 -0
- package/dist/esm/src/components/cardLT/AvatarWithInfo/vector.js +13 -0
- package/dist/esm/src/components/cardLT/BannerProblem/BannerProblem.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/BannerProblem/index.js +312 -0
- package/dist/esm/src/components/cardLT/BannerProblem/styles.js +30 -0
- package/dist/esm/src/components/cardLT/MessageBox/MessageBox.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/MessageBox/icons/errorIcon.js +13 -0
- package/dist/esm/src/components/cardLT/MessageBox/icons/successIcon.js +13 -0
- package/dist/esm/src/components/cardLT/MessageBox/icons/warningIcon.js +13 -0
- package/dist/esm/src/components/cardLT/MessageBox/index.js +59 -0
- package/dist/esm/src/components/cardLT/Rating/Rating.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/Rating/index.js +26 -0
- package/dist/esm/src/components/cardLT/Rating/starIcon.js +13 -0
- package/dist/esm/src/components/cardLT/RatingCurtidas/RatingCurtidas.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/RatingCurtidas/index.js +15 -0
- package/dist/esm/src/components/cardLT/RocketButton/RocketButtonIcon.js +13 -0
- package/dist/esm/src/components/cardLT/RocketButton/index.js +26 -0
- package/dist/esm/src/components/cardLT/StepsMission/Planet.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/StepsMission/StepMission.js +108 -0
- package/dist/esm/src/components/cardLT/StepsMission/Steps.js +68 -0
- package/dist/esm/src/components/cardLT/TextIcon/TextIcon.module.css.js +7 -0
- package/dist/esm/src/components/cardLT/TextIcon/index.js +14 -0
- package/dist/esm/src/components/cards/base/index.js +8 -0
- package/dist/esm/src/components/cards/cardDefinicaoFase/cardDefinicaoFase.module.css.js +7 -0
- package/dist/esm/src/components/cards/cardDefinicaoFase/index.js +30 -0
- package/dist/esm/src/components/cards/cardFaseDesafios/index.js +30 -0
- package/dist/esm/src/components/cards/cardFaseDesafios/styles.js +160 -0
- package/dist/esm/src/components/cards/cardProblem/cardProblem.module.css.js +7 -0
- package/dist/esm/src/components/cards/cardProblem/index.js +144 -0
- package/dist/esm/src/components/cards/cardProblemGestor/cardProblemaGestor.module.css.js +7 -0
- package/dist/esm/src/components/cards/cardProblemGestor/index.js +26 -0
- package/dist/esm/src/components/cards/cardResultConquista/Icons/Aprendizado.png.js +3 -0
- package/dist/esm/src/components/cards/cardResultConquista/Icons/AprendizadoPressed.png.js +3 -0
- package/dist/esm/src/components/cards/cardResultConquista/Icons/Conquista.png.js +3 -0
- package/dist/esm/src/components/cards/cardResultConquista/Icons/ConquistaPressed.png.js +3 -0
- package/dist/esm/src/components/cards/cardResultConquista/cardResultConquista.module.css.js +7 -0
- package/dist/esm/src/components/cards/cardResultConquista/index.js +40 -0
- package/dist/esm/src/components/cards/user/index.js +85 -0
- package/dist/esm/src/components/challenge-cards/challengeCardStyles.js +246 -0
- package/dist/esm/src/components/challenge-cards/dropdownMenuStyle.js +85 -0
- package/dist/esm/src/components/challenge-cards/index.js +174 -0
- package/dist/esm/src/components/checkmark/checkmarkStyles.js +24 -0
- package/dist/esm/src/components/checkmark/index.js +32 -0
- package/dist/esm/src/components/comment-post/commentPostStyles.js +23 -0
- package/dist/esm/src/components/comment-post/index.js +16 -0
- package/dist/esm/src/components/commentary-box/commentaryBox.utils.js +24 -0
- package/dist/esm/src/components/commentary-box/commentaryBoxStyles.js +240 -0
- package/dist/esm/src/components/commentary-box/index.js +104 -0
- package/dist/esm/src/components/commentaryBoxV2/CommentaryBoxV2.styles.js +282 -0
- package/dist/esm/src/components/commentaryBoxV2/index.js +157 -0
- package/dist/esm/src/components/commentaryBoxV2/utilitiesComponents/inputEdit/index.js +45 -0
- package/dist/esm/src/components/commentaryBoxV2/utilitiesComponents/inputEdit/inputEdit.styles.js +54 -0
- package/dist/esm/src/components/conquistaCarrossel/index.js +26 -0
- package/dist/esm/src/components/counter-like/counterLikeStyles.js +26 -0
- package/dist/esm/src/components/counter-like/index.js +28 -0
- package/dist/esm/src/components/criar-ideia/criarIdeiaStyles.js +144 -0
- package/dist/esm/src/components/criar-ideia/index.js +58 -0
- package/dist/esm/src/components/criar-ideia/useAutosizeTextArea.js +13 -0
- package/dist/esm/src/components/demo/stepController/StepControllerStyle.js +47 -0
- package/dist/esm/src/components/demo/stepController/index.js +12 -0
- package/dist/esm/src/components/dropdown-profile-menu/dropdownProfileMenuStyle.js +162 -0
- package/dist/esm/src/components/dropdown-profile-menu/index.js +84 -0
- package/dist/esm/src/components/emoji-picker/emojiPickerStyles.js +61 -0
- package/dist/esm/src/components/emoji-picker/index.js +87 -0
- package/dist/esm/src/components/exclusive-class/exclusiveClassStyles.js +32 -0
- package/dist/esm/src/components/exclusive-class/index.js +13 -0
- package/dist/esm/src/components/expand-button/expandButtonStyle.js +47 -0
- package/dist/esm/src/components/expand-button/index.js +23 -0
- package/dist/esm/src/components/field-search-dropdown/fieldSearchStyle.js +139 -0
- package/dist/esm/src/components/field-search-dropdown/index.js +105 -0
- package/dist/esm/src/components/filter-accordion-checkbox/filterAccordionCheckbox.utils.js +7 -0
- package/dist/esm/src/components/filter-accordion-checkbox/index.js +135 -0
- package/dist/esm/src/components/filtro-galeria-desafio/index.js +59 -0
- package/dist/esm/src/components/filtro-galeria-desafio/styles/MultiSelectDemo.js +245 -0
- package/dist/esm/src/components/filtro-galeria-desafio/styles/icons/arrowCarrosselDown.png.js +3 -0
- package/dist/esm/src/components/filtro-galeria-desafio/styles/icons/arrow_carrossel_down.png.js +3 -0
- package/dist/esm/src/components/filtro-galeria-desafio/styles/primeflex.css.js +6 -0
- package/dist/esm/src/components/filtro-galeria-desafio/styles/primereact.css.js +6 -0
- package/dist/esm/src/components/filtro-galeria-desafio/styles/theme.css.js +6 -0
- package/dist/esm/src/components/form-elements/checkbox/checkboxStyle.js +36 -0
- package/dist/esm/src/components/form-elements/checkbox/index.js +16 -0
- package/dist/esm/src/components/form-elements/helperTextBox/helperTextBox.js +9 -0
- package/dist/esm/src/components/form-elements/helperTextBox/styles.js +20 -0
- package/dist/esm/src/components/form-elements/table/index.js +37 -0
- package/dist/esm/src/components/form-elements/table/parts/TableBody/index.js +22 -0
- package/dist/esm/src/components/form-elements/table/parts/TableBody/tableStyle.js +50 -0
- package/dist/esm/src/components/form-elements/table/parts/TableHead/index.js +11 -0
- package/dist/esm/src/components/form-elements/table/parts/TableHead/tableStyle.js +24 -0
- package/dist/esm/src/components/form-elements/table/tableStyle.js +49 -0
- package/dist/esm/src/components/form-elements/table-actions/index.js +82 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/CollaboratorAvatar/collaboratorAvatarStyle.js +12 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/CollaboratorAvatar/index.js +23 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/DateLimit/dateLimitStyle.js +28 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/DateLimit/index.js +8 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/EmptyState/emptyStateStyle.js +57 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/EmptyState/index.js +22 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/TagStatus/index.js +8 -0
- package/dist/esm/src/components/form-elements/table-actions/parts/TagStatus/tagStatusStyle.js +58 -0
- package/dist/esm/src/components/form-elements/table-actions/tableActionsStyle.js +110 -0
- package/dist/esm/src/components/form-elements/textarea/index.js +8 -0
- package/dist/esm/src/components/form-elements/textfield/index.js +42 -0
- package/dist/esm/src/components/form-elements/textfield/textFieldStyle.js +169 -0
- package/dist/esm/src/components/global-menu/globalMenuStyles.js +385 -0
- package/dist/esm/src/components/global-menu/index.js +181 -0
- package/dist/esm/src/components/header-improvement-idea/headerImprovementIdeaStyles.js +18 -0
- package/dist/esm/src/components/header-improvement-idea/index.js +24 -0
- package/dist/esm/src/components/header-user/headerUserStyles.js +50 -0
- package/dist/esm/src/components/header-user/index.js +13 -0
- package/dist/esm/src/components/headerChallenge/headerChallengeStyle.js +104 -0
- package/dist/esm/src/components/headerChallenge/index.js +9 -0
- package/dist/esm/src/components/hypothesisComponent/hypothesisComponent.style.js +220 -0
- package/dist/esm/src/components/hypothesisComponent/index.js +145 -0
- package/dist/esm/src/components/hypothesisComponent/types.js +8 -0
- package/dist/esm/src/components/input-comment/index.js +69 -0
- package/dist/esm/src/components/input-comment/inputCommentStyles.js +142 -0
- package/dist/esm/src/components/input-comment/mentions.js +18 -0
- package/dist/esm/src/components/input-comment/mentionsStyle.js +126 -0
- package/dist/esm/src/components/input-comment/useInputHook.js +375 -0
- package/dist/esm/src/components/input-comment/useMentions.js +39 -0
- package/dist/esm/src/components/input-comment-v2/index.js +81 -0
- package/dist/esm/src/components/input-comment-v2/inputCommentStyles.js +101 -0
- package/dist/esm/src/components/item-lateral-menu/index.js +34 -0
- package/dist/esm/src/components/item-lateral-menu/itemLateralMenuStyles.js +110 -0
- package/dist/esm/src/components/item-menu-global/index.js +11 -0
- package/dist/esm/src/components/item-menu-global/itemMenuGlobalStyles.js +74 -0
- package/dist/esm/src/components/lateral-menu/index.js +21 -0
- package/dist/esm/src/components/lateral-menu/lateralMenuStyles.js +65 -0
- package/dist/esm/src/components/learning-steps/index.js +23 -0
- package/dist/esm/src/components/learning-steps/learningStepsStyles.js +39 -0
- package/dist/esm/src/components/menu-more/index.js +31 -0
- package/dist/esm/src/components/menu-more/menuMoreStyles.js +136 -0
- package/dist/esm/src/components/mini-button/index.js +15 -0
- package/dist/esm/src/components/mini-button/miniButtonStyle.js +108 -0
- package/dist/esm/src/components/modal/modalBase/index.js +31 -0
- package/dist/esm/src/components/modal/modalBase/modalBase.module.css.js +7 -0
- package/dist/esm/src/components/modal/modalLXP/Modal.js +24 -0
- package/dist/esm/src/components/modal/modalLXP/modal.module.css.js +7 -0
- package/dist/esm/src/components/modal/modalLearningTech/index.js +17 -0
- package/dist/esm/src/components/modal/modalLearningTech/modalLearningTech.module.css.js +7 -0
- package/dist/esm/src/components/modal/modalShowUsers/index.js +11 -0
- package/dist/esm/src/components/modal/modalShowUsers/styles.js +122 -0
- package/dist/esm/src/components/modal/modalVideo/index.js +56 -0
- package/dist/esm/src/components/modal/modalVideo/modalVideo.module.css.js +7 -0
- package/dist/esm/src/components/modal/modalWelcome/index.js +43 -0
- package/dist/esm/src/components/modal/modalWelcome/styles.js +38 -0
- package/dist/esm/src/components/modal/statusProblema/index.js +33 -0
- package/dist/esm/src/components/modal/statusProblema/problemaFRST.png.js +3 -0
- package/dist/esm/src/components/modal/statusProblema/statusProblema.module.css.js +7 -0
- package/dist/esm/src/components/quantidadeDesafios/index.js +73 -0
- package/dist/esm/src/components/quantidadeDesafios/quantidadeDesafios.js +95 -0
- package/dist/esm/src/components/quantidadeDesafios/stats.js +8 -0
- package/dist/esm/src/components/quantidadeDesafios/statsWithResult.js +8 -0
- package/dist/esm/src/components/scroll-container/index.js +90 -0
- package/dist/esm/src/components/scroll-container/scrollContainer.utils.js +7 -0
- package/dist/esm/src/components/scroll-container/scrollContainerStyles.js +85 -0
- package/dist/esm/src/components/search-field/index.js +19 -0
- package/dist/esm/src/components/search-field/searchFieldStyles.js +87 -0
- package/dist/esm/src/components/show-more/index.js +20 -0
- package/dist/esm/src/components/show-more/showMoreStyles.js +26 -0
- package/dist/esm/src/components/speech-bubble/index.js +11 -0
- package/dist/esm/src/components/speech-bubble/speechBubbleStyles.js +100 -0
- package/dist/esm/src/components/step-card/index.js +13 -0
- package/dist/esm/src/components/step-card/stepCardStyles.js +90 -0
- package/dist/esm/src/components/tag/index.js +22 -0
- package/dist/esm/src/components/totalizer-card/index.js +16 -0
- package/dist/esm/src/components/totalizer-card/totalizerCardStyles.js +84 -0
- package/dist/esm/src/components/users-challenge/index.js +13 -0
- package/dist/esm/src/components/users-challenge/styles.js +125 -0
- package/dist/esm/src/components/users-challenge/variant-feed/index.js +34 -0
- package/dist/esm/src/components/users-challenge/variant-feed/styles.js +125 -0
- package/dist/esm/src/components/users-challenge/variant-form/index.js +23 -0
- package/dist/esm/src/components/users-challenge/variant-form/styles.js +125 -0
- package/dist/esm/src/components/users-challenge/variant-lxp/index.js +21 -0
- package/dist/esm/src/components/users-challenge/variant-lxp/styles.js +122 -0
- package/dist/esm/src/components/users-challenge/variant-vitrine/index.js +34 -0
- package/dist/esm/src/components/users-challenge/variant-vitrine/styles.js +123 -0
- package/dist/esm/src/shared/global.css.js +6 -0
- package/dist/esm/src/shared/globalComponentsStyle.js +83 -0
- package/dist/esm/src/shared/icons.js +531 -0
- package/dist/esm/src/theme/index.js +7 -0
- package/dist/esm/src/theme/tokens.js +235 -0
- package/dist/esm/src/utilityFunctions/abbreviateMiddleSurnames.js +23 -0
- package/dist/esm/src/utilityFunctions/buildStringWithHTML.js +10 -0
- package/dist/esm/src/utilityFunctions/createUUID.js +11 -0
- package/dist/index.js +15175 -15175
- package/dist/src/components/mini-button/index.d.ts +1 -1
- package/dist/src/components/mini-button/index.d.ts.map +1 -1
- package/package.json +120 -116
- package/public/customIcons/CheckIcon.tsx +16 -16
- package/public/customIcons/CircledAlert.tsx +21 -21
- package/public/customIcons/CircledCheck.tsx +20 -20
- package/public/customIcons/CloseIcon.tsx +23 -23
- package/public/customIcons/DefaultProfile.tsx +15 -15
- package/public/customIcons/ExcludeVoteIcon.tsx +40 -40
- package/public/customIcons/FrstLogoChallengeIcon.tsx +20 -20
- package/public/customIcons/FrstLogoIcon.tsx +8 -8
- package/public/customIcons/LanguageIcon.tsx +24 -24
- package/public/customIcons/SmallTrash.tsx +20 -20
- package/public/customIcons/SwitchVoteIcon.tsx +22 -22
- package/public/customIcons/TagAlert.tsx +10 -10
- package/public/customIcons/VoteCurrentIcon.tsx +22 -22
- package/public/customIcons/VoteIcon.tsx +41 -41
- package/public/customIcons/WarningIcon.tsx +21 -21
- package/public/customIcons/index.ts +15 -15
- package/public/customIcons/newVoteIcon.tsx +36 -36
- package/public/index.html +43 -43
- package/public/locales/en-US.json +33 -33
- package/public/locales/es.json +34 -34
- package/public/locales/pt-BR.json +41 -41
- package/public/manifest.json +15 -15
- package/public/robots.txt +3 -3
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { DesignTokens } from '../../theme/tokens.js';
|
|
3
|
+
|
|
4
|
+
const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onContentUnformat, onChange, value, replyMentionedUser, initialText, configColor }) => {
|
|
5
|
+
const [showMention, setShowMention] = useState(false);
|
|
6
|
+
const [inputSearch, setInputSearch] = useState('');
|
|
7
|
+
const divInputRef = useRef(null);
|
|
8
|
+
const divPlaceholder = useRef(null);
|
|
9
|
+
const isMounted = useRef(true);
|
|
10
|
+
const mentionTopPosition = `${(divInputRef.current?.clientHeight ?? 15) + 20}px`;
|
|
11
|
+
const [textLength, setTextLength] = useState(0);
|
|
12
|
+
const [isPlaceholder, setPlaceholder] = useState(false);
|
|
13
|
+
const [styleLimitExceeded, setStyleLimitExceeded] = useState(false);
|
|
14
|
+
const [mentionedIds, setMentionedIds] = useState([]);
|
|
15
|
+
const [showPicker, setShowPicker] = useState(false);
|
|
16
|
+
const createNewRangeAndMoveCursorToTheEnd = (selection, spaceNode) => {
|
|
17
|
+
// Create a new range for setting the cursor position
|
|
18
|
+
const newRange = document.createRange();
|
|
19
|
+
// Move the cursor to the end of the spaceNode
|
|
20
|
+
newRange.setStartAfter(spaceNode);
|
|
21
|
+
newRange.collapse(true);
|
|
22
|
+
// Update the selection
|
|
23
|
+
selection.removeAllRanges();
|
|
24
|
+
selection.addRange(newRange);
|
|
25
|
+
};
|
|
26
|
+
const addMentionToRangeAndSpaceNode = (range, spaceNode, mentionAnchorElement) => {
|
|
27
|
+
if (range.startOffset > 0 && range.startContainer.textContent.charAt(range.startOffset - 1) === '@') {
|
|
28
|
+
range.setStart(range.startContainer, range.startOffset - 1);
|
|
29
|
+
range.deleteContents();
|
|
30
|
+
}
|
|
31
|
+
// append the child to the current cursor position within the paragraph
|
|
32
|
+
range.collapse(false); // set the cursor to the end of the paragraph
|
|
33
|
+
range.insertNode(spaceNode);
|
|
34
|
+
range.insertNode(mentionAnchorElement);
|
|
35
|
+
};
|
|
36
|
+
const createMentionedUser = (user) => {
|
|
37
|
+
// Create a new anchor element
|
|
38
|
+
const mentionAnchorElement = document.createElement('a');
|
|
39
|
+
mentionAnchorElement.appendChild(document.createTextNode(`${user.name}`));
|
|
40
|
+
mentionAnchorElement.style.fontWeight = 'bold';
|
|
41
|
+
mentionAnchorElement.style.color = configColor || DesignTokens.colors.primary1;
|
|
42
|
+
mentionAnchorElement.setAttribute('data-mention-id', user.user_uuid);
|
|
43
|
+
mentionAnchorElement.setAttribute('contenteditable', 'false');
|
|
44
|
+
mentionAnchorElement.setAttribute('draggable', 'false');
|
|
45
|
+
mentionAnchorElement.setAttribute('href', `/profile/${user.user_uuid}`);
|
|
46
|
+
mentionAnchorElement.suppressContentEditableWarning = true;
|
|
47
|
+
return mentionAnchorElement;
|
|
48
|
+
};
|
|
49
|
+
const handleMentionUser = (user) => {
|
|
50
|
+
if (user?.name && divInputRef.current) {
|
|
51
|
+
// Set the cursor to the last saved position
|
|
52
|
+
const selection = window.getSelection();
|
|
53
|
+
if (selection && selection.rangeCount > 0) {
|
|
54
|
+
const range = selection.getRangeAt(0);
|
|
55
|
+
if (range.startContainer.textContent === null)
|
|
56
|
+
return;
|
|
57
|
+
if (range.startOffset === 0) {
|
|
58
|
+
setShowMention(false);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let symbolFound = false;
|
|
62
|
+
while (!symbolFound) {
|
|
63
|
+
if (range.startContainer.textContent.charAt(range.startOffset - 1) !== '@') {
|
|
64
|
+
range.setStart(range.startContainer, range.startOffset - 1);
|
|
65
|
+
range.deleteContents();
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
symbolFound = true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const mentionAnchorElement = createMentionedUser(user);
|
|
72
|
+
const spaceNode = document.createTextNode('\u00A0'); // Unicode for non-breaking space
|
|
73
|
+
addMentionToRangeAndSpaceNode(range, spaceNode, mentionAnchorElement);
|
|
74
|
+
createNewRangeAndMoveCursorToTheEnd(selection, spaceNode);
|
|
75
|
+
}
|
|
76
|
+
countChars();
|
|
77
|
+
createFormatAndTextContentToSaveComment();
|
|
78
|
+
resizeDiv();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
//create a method that increase the size of the div as the scroll height increases
|
|
82
|
+
const resizeDiv = () => {
|
|
83
|
+
if (divInputRef.current) {
|
|
84
|
+
divInputRef.current.style.height = 'auto';
|
|
85
|
+
divInputRef.current.style.height = divInputRef.current.scrollHeight + 'px';
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const addOrDeleteMentionedUser = () => {
|
|
89
|
+
// get all mentioned users
|
|
90
|
+
const mentionedUsers = getAllMentions();
|
|
91
|
+
const newMentionsIds = mentionedIds?.length > 0 ? mentionedUsers.filter((value) => !mentionedIds.includes(value)) : mentionedUsers;
|
|
92
|
+
onSendMentions(newMentionsIds);
|
|
93
|
+
};
|
|
94
|
+
const createFormatAndTextContentToSaveComment = () => {
|
|
95
|
+
// get the content string of each node
|
|
96
|
+
let plainContent = '';
|
|
97
|
+
if (divInputRef.current) {
|
|
98
|
+
divInputRef.current.childNodes.forEach((child) => {
|
|
99
|
+
if (child.textContent) {
|
|
100
|
+
plainContent += child.textContent;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
// get the full html content of the div
|
|
105
|
+
const htmlContent = divInputRef.current?.innerHTML || '';
|
|
106
|
+
onContentFormat(htmlContent);
|
|
107
|
+
onContentUnformat(plainContent);
|
|
108
|
+
addOrDeleteMentionedUser();
|
|
109
|
+
};
|
|
110
|
+
const [spaceCount, setSpaceCount] = useState(0);
|
|
111
|
+
const handleInput = (event) => {
|
|
112
|
+
const selection = window.getSelection();
|
|
113
|
+
let inputSearch = '';
|
|
114
|
+
let hasSpaceBeForeKey = false;
|
|
115
|
+
let hasKeyPresent = false;
|
|
116
|
+
let textBeforeCursor = '';
|
|
117
|
+
let textBeforeKey = '';
|
|
118
|
+
if (event.key === ' ') {
|
|
119
|
+
setSpaceCount((prevCount) => prevCount + 1);
|
|
120
|
+
if (spaceCount === 1) {
|
|
121
|
+
setShowMention(false);
|
|
122
|
+
setSpaceCount(0);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
setSpaceCount(0);
|
|
128
|
+
}
|
|
129
|
+
if (selection && selection.rangeCount > 0) {
|
|
130
|
+
const range = selection.getRangeAt(0);
|
|
131
|
+
if (range.startContainer.textContent === null)
|
|
132
|
+
return;
|
|
133
|
+
// Get the text before the cursor
|
|
134
|
+
const completeText = range.startContainer.textContent;
|
|
135
|
+
// Find the last index of "@" in the text before the cursor
|
|
136
|
+
const atIndex = completeText.lastIndexOf('@');
|
|
137
|
+
textBeforeCursor = range.startContainer.textContent.substring(atIndex, range.startOffset);
|
|
138
|
+
hasSpaceBeForeKey = completeText.substring(atIndex - 1, atIndex).trim() === '';
|
|
139
|
+
textBeforeKey = completeText.substring(atIndex - 1, atIndex).trim();
|
|
140
|
+
if (hasSpaceBeForeKey || (textBeforeCursor === '@' && textBeforeKey.length === 0)) {
|
|
141
|
+
if (atIndex !== -1) {
|
|
142
|
+
// Get the characters after the last "@"
|
|
143
|
+
const afterAt = completeText.substring(atIndex);
|
|
144
|
+
if (afterAt.length > 1 || event.key === '@' || textBeforeCursor === '@') {
|
|
145
|
+
hasKeyPresent = true;
|
|
146
|
+
}
|
|
147
|
+
inputSearch = afterAt.replace('@', '');
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
inputSearch = '';
|
|
151
|
+
setShowMention(false);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if ((hasSpaceBeForeKey && hasKeyPresent) || (textBeforeCursor === '@' && textBeforeKey.length === 0)) {
|
|
156
|
+
setInputSearch(inputSearch);
|
|
157
|
+
!!onChange && onChange(inputSearch);
|
|
158
|
+
if (event.key === '@' || (textBeforeCursor === '@' && textBeforeKey.length === 0)) {
|
|
159
|
+
setShowMention(true);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
countChars();
|
|
163
|
+
createFormatAndTextContentToSaveComment();
|
|
164
|
+
};
|
|
165
|
+
const countChars = () => {
|
|
166
|
+
// create a function that loop through my divref and count each chars inside of it and it´s children
|
|
167
|
+
let count = 0;
|
|
168
|
+
if (divInputRef.current) {
|
|
169
|
+
divInputRef.current.childNodes.forEach((child) => {
|
|
170
|
+
if (child.textContent) {
|
|
171
|
+
count += child.textContent.length;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
setTextLength(count);
|
|
176
|
+
return count;
|
|
177
|
+
};
|
|
178
|
+
const areChildrenEmpty = () => {
|
|
179
|
+
// return if divInputRef has child empty
|
|
180
|
+
//if divInputRef is not focused
|
|
181
|
+
let isEmpty = false;
|
|
182
|
+
const isFocused = divInputRef.current === document.activeElement;
|
|
183
|
+
if (divInputRef.current && !isFocused) {
|
|
184
|
+
if (divInputRef.current.childNodes?.length <= 0)
|
|
185
|
+
isEmpty = true;
|
|
186
|
+
let isAnyChildWithTextValue = false;
|
|
187
|
+
divInputRef.current.childNodes.forEach((child) => {
|
|
188
|
+
if (isAnyChildWithTextValue) {
|
|
189
|
+
isEmpty = false;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (child.textContent.trim().length <= 0) {
|
|
193
|
+
isEmpty = true;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// in case we have one item not empty we wont show the placeholder
|
|
197
|
+
isAnyChildWithTextValue = true;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
return isEmpty;
|
|
202
|
+
};
|
|
203
|
+
const handlePlaceholderInputText = (isPlaceHolderFocus = false) => {
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
if (!isMounted.current)
|
|
206
|
+
return;
|
|
207
|
+
// Check if the click was on the emoji button or picker
|
|
208
|
+
const target = document.activeElement;
|
|
209
|
+
const isEmojiButton = target?.closest('.MuiIconButton-root');
|
|
210
|
+
const isEmojiPicker = target?.closest('.EmojiPickerReact');
|
|
211
|
+
const isEmojiWrapper = target?.closest('.emoji-wrapper');
|
|
212
|
+
if (isEmojiButton || isEmojiPicker || isEmojiWrapper) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (document.activeElement?.id === 'input-comment-component')
|
|
216
|
+
return;
|
|
217
|
+
// if divInputRef has any element hide the placeholder
|
|
218
|
+
if (isPlaceHolderFocus) {
|
|
219
|
+
divPlaceholder.current?.style.setProperty('display', 'none');
|
|
220
|
+
divInputRef.current?.style.setProperty('display', 'block');
|
|
221
|
+
divInputRef.current?.style.setProperty('height', '19px');
|
|
222
|
+
divInputRef.current?.focus();
|
|
223
|
+
setPlaceholder(false);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
if (areChildrenEmpty()) {
|
|
227
|
+
resizeDiv();
|
|
228
|
+
divPlaceholder.current?.style.setProperty('display', 'block');
|
|
229
|
+
divInputRef.current?.style.setProperty('display', 'none');
|
|
230
|
+
setPlaceholder(true);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
divPlaceholder.current?.style.setProperty('display', 'none');
|
|
234
|
+
divInputRef.current?.style.setProperty('display', 'block');
|
|
235
|
+
setPlaceholder(false);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}, 0);
|
|
239
|
+
};
|
|
240
|
+
const getAllMentions = () => {
|
|
241
|
+
const mentionedUsers = divInputRef.current?.querySelectorAll('a[data-mention-id]') || [];
|
|
242
|
+
const mentionedUsersIdList = [];
|
|
243
|
+
mentionedUsers.forEach((user) => {
|
|
244
|
+
const mentionId = user.getAttribute('data-mention-id');
|
|
245
|
+
if (mentionId) {
|
|
246
|
+
mentionedUsersIdList.push(mentionId);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return mentionedUsersIdList;
|
|
250
|
+
};
|
|
251
|
+
const handleEmojiSelected = (emojiData, event) => {
|
|
252
|
+
if (divInputRef.current) {
|
|
253
|
+
divInputRef.current.appendChild(document.createTextNode(emojiData.emoji));
|
|
254
|
+
// Update input state
|
|
255
|
+
countChars();
|
|
256
|
+
createFormatAndTextContentToSaveComment();
|
|
257
|
+
resizeDiv();
|
|
258
|
+
setShowPicker(false);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
useEffect(() => {
|
|
262
|
+
if (divInputRef.current && initialText) {
|
|
263
|
+
divInputRef.current.innerHTML = initialText;
|
|
264
|
+
countChars();
|
|
265
|
+
handlePlaceholderInputText();
|
|
266
|
+
resizeDiv();
|
|
267
|
+
const regex = /data-mention-id="([^"]+)"/g;
|
|
268
|
+
const matches = [...initialText.matchAll(regex)];
|
|
269
|
+
const ids = matches?.map((match) => match[1]);
|
|
270
|
+
setMentionedIds(ids);
|
|
271
|
+
}
|
|
272
|
+
divInputRef.current?.addEventListener('input', resizeDiv);
|
|
273
|
+
return () => {
|
|
274
|
+
divInputRef.current?.removeEventListener('input', resizeDiv);
|
|
275
|
+
};
|
|
276
|
+
}, []);
|
|
277
|
+
useEffect(() => {
|
|
278
|
+
if (!replyMentionedUser || !divInputRef?.current) {
|
|
279
|
+
handlePlaceholderInputText();
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
divInputRef.current?.focus();
|
|
283
|
+
const selection = window.getSelection();
|
|
284
|
+
if (selection && selection.rangeCount > 0) {
|
|
285
|
+
const range = selection.getRangeAt(0);
|
|
286
|
+
if (range.startContainer.textContent === null)
|
|
287
|
+
return;
|
|
288
|
+
const mentionedUser = createMentionedUser(replyMentionedUser);
|
|
289
|
+
const spaceNode = document.createTextNode('\u00A0'); // Unicode for non-breaking space
|
|
290
|
+
addMentionToRangeAndSpaceNode(range, spaceNode, mentionedUser);
|
|
291
|
+
createNewRangeAndMoveCursorToTheEnd(selection, spaceNode);
|
|
292
|
+
handlePlaceholderInputText();
|
|
293
|
+
}
|
|
294
|
+
}, [replyMentionedUser]);
|
|
295
|
+
useEffect(() => {
|
|
296
|
+
setStyleLimitExceeded(textLength > limit);
|
|
297
|
+
}, [textLength]);
|
|
298
|
+
useEffect(() => {
|
|
299
|
+
isMounted.current = true;
|
|
300
|
+
return () => { isMounted.current = false; };
|
|
301
|
+
}, []);
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
if (!divInputRef.current || !divPlaceholder.current)
|
|
304
|
+
return;
|
|
305
|
+
const onDocEvent = () => handlePlaceholderInputText();
|
|
306
|
+
const onPlaceholderEvent = () => handlePlaceholderInputText(true);
|
|
307
|
+
const onArrowKey = (event) => {
|
|
308
|
+
if (event.key === 'ArrowUp' ||
|
|
309
|
+
event.key === 'ArrowDown' ||
|
|
310
|
+
event.key === 'ArrowLeft' ||
|
|
311
|
+
event.key === 'ArrowRight' ||
|
|
312
|
+
event.key === 'Enter') {
|
|
313
|
+
setShowMention(false);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
document.addEventListener('mousedown', onDocEvent);
|
|
317
|
+
document.addEventListener('focus', onDocEvent);
|
|
318
|
+
document.addEventListener('blur', onDocEvent);
|
|
319
|
+
const placeholderEl = divPlaceholder.current;
|
|
320
|
+
placeholderEl.addEventListener('mousedown', onPlaceholderEvent);
|
|
321
|
+
placeholderEl.addEventListener('focus', onPlaceholderEvent);
|
|
322
|
+
placeholderEl.addEventListener('blur', onPlaceholderEvent);
|
|
323
|
+
const inputEl = divInputRef.current;
|
|
324
|
+
inputEl.addEventListener('mousedown', onDocEvent);
|
|
325
|
+
inputEl.addEventListener('focus', onDocEvent);
|
|
326
|
+
inputEl.addEventListener('blur', onDocEvent);
|
|
327
|
+
inputEl.addEventListener('keyup', onArrowKey);
|
|
328
|
+
return () => {
|
|
329
|
+
document.removeEventListener('mousedown', onDocEvent);
|
|
330
|
+
document.removeEventListener('focus', onDocEvent);
|
|
331
|
+
document.removeEventListener('blur', onDocEvent);
|
|
332
|
+
placeholderEl.removeEventListener('mousedown', onPlaceholderEvent);
|
|
333
|
+
placeholderEl.removeEventListener('focus', onPlaceholderEvent);
|
|
334
|
+
placeholderEl.removeEventListener('blur', onPlaceholderEvent);
|
|
335
|
+
inputEl.removeEventListener('mousedown', onDocEvent);
|
|
336
|
+
inputEl.removeEventListener('focus', onDocEvent);
|
|
337
|
+
inputEl.removeEventListener('blur', onDocEvent);
|
|
338
|
+
inputEl.removeEventListener('keyup', onArrowKey);
|
|
339
|
+
};
|
|
340
|
+
}, []);
|
|
341
|
+
useEffect(() => {
|
|
342
|
+
if (replyMentionedUser)
|
|
343
|
+
return;
|
|
344
|
+
// check if the cursor is inside the divInputRef
|
|
345
|
+
const isFocused = divInputRef.current === document.activeElement;
|
|
346
|
+
// if the cursor is not inside the divInputRef show the placeholder
|
|
347
|
+
if (value?.length <= 0 && document.activeElement?.id !== 'input-comment-component' && !isFocused) {
|
|
348
|
+
divPlaceholder.current?.style.setProperty('display', 'block');
|
|
349
|
+
divInputRef.current.style.setProperty('display', 'none');
|
|
350
|
+
divInputRef.current.innerHTML = '<p><br /></p>';
|
|
351
|
+
setPlaceholder(true);
|
|
352
|
+
countChars();
|
|
353
|
+
}
|
|
354
|
+
}, [value]);
|
|
355
|
+
return {
|
|
356
|
+
handleInput,
|
|
357
|
+
handlePlaceholderInputText,
|
|
358
|
+
showMention,
|
|
359
|
+
setShowMention,
|
|
360
|
+
inputSearch,
|
|
361
|
+
setInputSearch,
|
|
362
|
+
divInputRef,
|
|
363
|
+
mentionTopPosition,
|
|
364
|
+
handleMentionUser,
|
|
365
|
+
textLength,
|
|
366
|
+
isPlaceholder,
|
|
367
|
+
styleLimitExceeded,
|
|
368
|
+
divPlaceholder,
|
|
369
|
+
handleEmojiSelected,
|
|
370
|
+
showPicker,
|
|
371
|
+
setShowPicker
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
export { useInputHook };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const useMentions = (mention) => {
|
|
4
|
+
const mentionListRef = useRef(null);
|
|
5
|
+
const { onSelect } = mention;
|
|
6
|
+
const [selectedUser, setSelectedUser] = useState();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!mentionListRef.current)
|
|
9
|
+
return;
|
|
10
|
+
//keydown should change item focus
|
|
11
|
+
mentionListRef.current.addEventListener('keydown', (e) => {
|
|
12
|
+
const activeElement = document.activeElement;
|
|
13
|
+
if (e.key === 'ArrowDown') {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
if (activeElement.nextSibling) {
|
|
16
|
+
activeElement.nextSibling.focus();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
else if (e.key === 'ArrowUp') {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
if (activeElement.previousSibling) {
|
|
22
|
+
activeElement.previousSibling.focus();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}, []);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!selectedUser)
|
|
29
|
+
return;
|
|
30
|
+
onSelect(selectedUser);
|
|
31
|
+
}, [selectedUser]);
|
|
32
|
+
return {
|
|
33
|
+
selectedUser,
|
|
34
|
+
setSelectedUser,
|
|
35
|
+
mentionListRef
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { useMentions };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import '../../shared/global.css.js';
|
|
4
|
+
import { ThemeProvider } from 'styled-components';
|
|
5
|
+
import { FRSTTheme } from '../../theme/index.js';
|
|
6
|
+
import { InputWrapper, InputText, HelperText } from './inputCommentStyles.js';
|
|
7
|
+
import EmojiPicker from '../emoji-picker/index.js';
|
|
8
|
+
|
|
9
|
+
function InputComment({ placeholder, value, onChange, remain, limit, hasEmoji, showCharacterCounter, IDInput, styles, disabled, emojiWindowlanguage }) {
|
|
10
|
+
const [focus, setFocus] = useState(false);
|
|
11
|
+
// Emoji Window States
|
|
12
|
+
const refInput = useRef(null);
|
|
13
|
+
const [isOpenPicker, setIsOpenPicker] = useState();
|
|
14
|
+
// TextArea states
|
|
15
|
+
const [stringValueTextArea, setStringValueTextArea] = useState(value);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
resizeTextArea(refInput);
|
|
18
|
+
onChange(stringValueTextArea);
|
|
19
|
+
}, [stringValueTextArea]);
|
|
20
|
+
const onEmojiClick = (emojiObject) => {
|
|
21
|
+
if (!stringValueTextArea || stringValueTextArea?.length < limit) {
|
|
22
|
+
let lastPositionStart = refInput.current.selectionStart;
|
|
23
|
+
let lastPositionEnd = refInput.current.selectionEnd;
|
|
24
|
+
let newStringWithEmoji = handleStringToIncluedEmoji([lastPositionStart, lastPositionEnd], emojiObject.native, refInput.current.innerHTML);
|
|
25
|
+
setStringValueTextArea(newStringWithEmoji + '');
|
|
26
|
+
repositionCursorAfterNewEmojiInTextArea([lastPositionStart, lastPositionEnd], emojiObject?.native?.length);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
return (jsx(ThemeProvider, { theme: FRSTTheme, children: jsxs("div", { style: { ...styles }, children: [jsxs(InputWrapper, { focus: focus, children: [jsx(InputText, { ref: refInput, onFocus: () => setFocus(true), onBlur: () => {
|
|
30
|
+
setFocus(false);
|
|
31
|
+
}, onChange: (e) => setStringValueTextArea(e.target.value), value: stringValueTextArea, placeholder: placeholder, maxLength: limit, disabled: disabled }), hasEmoji &&
|
|
32
|
+
jsx(EmojiPicker, { isOpenPicker: isOpenPicker, setIsOpenPicker: setIsOpenPicker, onEmojiSelect: (emoji) => onEmojiClick(emoji), configPicker: {
|
|
33
|
+
title: 'FRST FALCONI',
|
|
34
|
+
perLine: 10,
|
|
35
|
+
sheetSize: 8,
|
|
36
|
+
language: 'pt'
|
|
37
|
+
}, styles: {} })] }), showCharacterCounter &&
|
|
38
|
+
jsxs(HelperText, { children: [limit - remain, "/", limit] })] }) }));
|
|
39
|
+
function resizeTextArea(refInput) {
|
|
40
|
+
const txResize = (tx) => {
|
|
41
|
+
tx.style.height = '20px';
|
|
42
|
+
tx.style.height = tx.scrollHeight + 'px';
|
|
43
|
+
// setHeightPositionWindowEmoji(tx.scrollHeight - 350 + 'px')
|
|
44
|
+
};
|
|
45
|
+
{
|
|
46
|
+
refInput.current && refInput.current.style && txResize(refInput.current);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function handleStringToIncluedEmoji(pos, emojiObject, stringValueTextArea) {
|
|
50
|
+
let finalString = '';
|
|
51
|
+
if (stringValueTextArea) {
|
|
52
|
+
if (pos[0] == pos[1]) {
|
|
53
|
+
finalString = stringValueTextArea.substr(0, pos[0]) + emojiObject + stringValueTextArea.substr(pos[1]);
|
|
54
|
+
}
|
|
55
|
+
else if (pos[0] < pos[1]) {
|
|
56
|
+
finalString = stringValueTextArea.substr(0, pos[0]) + emojiObject + stringValueTextArea.substr(pos[1], stringValueTextArea.length);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
finalString = stringValueTextArea + emojiObject;
|
|
60
|
+
}
|
|
61
|
+
return finalString;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return emojiObject;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function repositionCursorAfterNewEmojiInTextArea(pos, lenghtEmoji) {
|
|
68
|
+
let newPos = 0;
|
|
69
|
+
console.log('lenghtEmoji ', lenghtEmoji);
|
|
70
|
+
console.log('pos ', pos);
|
|
71
|
+
if (pos[0] != pos[1]) { // Cursor in multiple chars selected
|
|
72
|
+
newPos = pos[0] + (lenghtEmoji ? lenghtEmoji : 0);
|
|
73
|
+
}
|
|
74
|
+
else { // Cursor text in specific point
|
|
75
|
+
newPos = pos[1] + (lenghtEmoji ? lenghtEmoji : 0);
|
|
76
|
+
}
|
|
77
|
+
refInput.current.setSelectionRange(newPos, newPos);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { InputComment as default };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const InputWrapper = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items:flex-end;
|
|
6
|
+
width: 100%;
|
|
7
|
+
min-height: 48px;
|
|
8
|
+
background-color: ${({ theme }) => theme.colors.shadeWhite};
|
|
9
|
+
|
|
10
|
+
border: 1px solid ${({ theme }) => theme.colors.neutralsGrey4};
|
|
11
|
+
border-radius: 24px;
|
|
12
|
+
|
|
13
|
+
transition: all 0.2s ease-in-out;
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
border: 1px solid ${({ theme }) => theme.colors.shadeBlack};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
${({ focus, theme }) => focus &&
|
|
20
|
+
`border: 1px solid` + theme.colors.primary1 + " !important;"}
|
|
21
|
+
`;
|
|
22
|
+
const InputText = styled.textarea `
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: ${({ height }) => height || '20px'};
|
|
28
|
+
outline: 0;
|
|
29
|
+
|
|
30
|
+
font-family: 'Work Sans';
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: normal;
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
line-height: 20px;
|
|
35
|
+
letter-spacing: -0.02em;
|
|
36
|
+
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
resize: none;
|
|
39
|
+
|
|
40
|
+
padding: 0;
|
|
41
|
+
margin: 14px;
|
|
42
|
+
border: none;
|
|
43
|
+
`;
|
|
44
|
+
styled.div `
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
align-items: center;
|
|
48
|
+
|
|
49
|
+
width: 40px;
|
|
50
|
+
height: 40px;
|
|
51
|
+
|
|
52
|
+
min-width: 40px;
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
margin: 4px;
|
|
56
|
+
&:hover {
|
|
57
|
+
background-color: ${({ theme }) => theme.colors.neutralsGrey6};
|
|
58
|
+
}
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
transition: all 0.2s ease-in-out;
|
|
61
|
+
`;
|
|
62
|
+
const HelperText = styled.span `
|
|
63
|
+
display: flex;
|
|
64
|
+
position: absolute;
|
|
65
|
+
align-items: center;
|
|
66
|
+
|
|
67
|
+
font-family: 'Work Sans';
|
|
68
|
+
font-style: normal;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
line-height: 14px;
|
|
72
|
+
|
|
73
|
+
letter-spacing: -0.02em;
|
|
74
|
+
|
|
75
|
+
color: ${({ theme }) => theme.colors.neutralsGrey2};
|
|
76
|
+
|
|
77
|
+
margin-top: 8px;
|
|
78
|
+
margin-left: 13px;
|
|
79
|
+
`;
|
|
80
|
+
styled.div `
|
|
81
|
+
width: 375px;
|
|
82
|
+
height: 332px;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
display:${({ visible }) => visible ? 'flex' : 'none'};
|
|
85
|
+
justify-content: center;
|
|
86
|
+
top: -330px;
|
|
87
|
+
right: 0px;
|
|
88
|
+
background-color: ${({ theme }) => theme.colors.shadeWhite};
|
|
89
|
+
border: 1px solid ${({ theme }) => theme.colors.neutralsGrey4};
|
|
90
|
+
position: absolute;
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
& > div:nth-child(1) > em-emoji-picker:nth-child(1) {
|
|
94
|
+
padding: 10px;
|
|
95
|
+
padding-top: 5px;
|
|
96
|
+
height: 332px;
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
// transform: scale(0.845);
|
|
100
|
+
|
|
101
|
+
export { HelperText, InputText, InputWrapper };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import '../../shared/global.css.js';
|
|
4
|
+
import { ThemeProvider } from 'styled-components';
|
|
5
|
+
import { FRSTTheme } from '../../theme/index.js';
|
|
6
|
+
import { WrapperCompound, WrapperItem, WrapperComponent, WrapperMainLabel, WrapperButton, WrapperIconDrop, WrapperSubItems, SubItem } from './itemLateralMenuStyles.js';
|
|
7
|
+
import Button from '../buttons/index.js';
|
|
8
|
+
import { DropdownIconLine } from '../../shared/icons.js';
|
|
9
|
+
|
|
10
|
+
function LateralMenu({ label, onClick, button, beginComponent, activeBeginIcon, selected, subItems, hiddenIconDropArrow, style }) {
|
|
11
|
+
const [isActive, setIsActive] = useState(selected);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setIsActive(selected);
|
|
14
|
+
}, [selected]);
|
|
15
|
+
const getSizeCompound = () => {
|
|
16
|
+
if (!subItems.length)
|
|
17
|
+
return '40px';
|
|
18
|
+
let size = (subItems.length + 1) * 42;
|
|
19
|
+
return size + 'px';
|
|
20
|
+
};
|
|
21
|
+
return (jsx(ThemeProvider, { theme: FRSTTheme, children: subItems && subItems.length > 0 ?
|
|
22
|
+
jsxs(WrapperCompound, { isOpen: isActive, style: { ...style, maxHeight: isActive ? getSizeCompound() : '40px' }, children: [jsxs(WrapperItem, { active: isActive, onClick: (e) => setIsActive(!isActive), style: { ...style, margin: 0, padding: 0, justifyContent: 'space-between' }, children: [jsxs(WrapperItem, { style: { background: 'transparent', width: '100%' }, children: [beginComponent &&
|
|
23
|
+
jsx(WrapperComponent, { active: isActive, children: isActive ? activeBeginIcon ? activeBeginIcon : beginComponent : beginComponent }), jsx(WrapperMainLabel, { active: isActive, style: { marginLeft: beginComponent ? '8px' : '0px' }, children: label })] }), button && button?.label &&
|
|
24
|
+
jsx(WrapperButton, { children: jsx(Button, { label: button.label, handleClick: (e) => button.onClick(e), variant: button?.variant ? button.variant : 'primary' }) }), !hiddenIconDropArrow &&
|
|
25
|
+
jsx(WrapperIconDrop, { isOpen: isActive, children: jsx(DropdownIconLine, { fill: '#000' }) })] }), jsx(WrapperSubItems, { isOpen: isActive, children: subItems.map((item, index) => {
|
|
26
|
+
return jsx(SubItem, { onClick: () => item.onClick(item.id), children: item.label }, index);
|
|
27
|
+
}) })] })
|
|
28
|
+
:
|
|
29
|
+
jsxs(WrapperItem, { active: isActive, style: { ...style, margin: 0, padding: 0, justifyContent: 'space-between' }, children: [jsxs(WrapperItem, { style: { background: 'transparent', width: '100%' }, onClick: (e) => onClick(e), children: [beginComponent &&
|
|
30
|
+
jsx(WrapperComponent, { active: isActive, children: isActive ? activeBeginIcon ? activeBeginIcon : beginComponent : beginComponent }), jsx(WrapperMainLabel, { active: isActive, style: { marginLeft: beginComponent ? '8px' : '0px' }, children: label })] }), button && button?.label &&
|
|
31
|
+
jsx(WrapperButton, { children: jsx(Button, { label: button.label, handleClick: (e) => button.onClick(e), variant: button?.variant ? button.variant : 'primary' }) })] }) }));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { LateralMenu as default };
|