frst-components 0.22.6 → 0.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -2948,6 +2948,26 @@ const CircledAlert = ({ fill = '#F18624', width = '22', height = '22' }) => {
|
|
|
2948
2948
|
return (jsxRuntime.jsxs("svg", { width: width, height: height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { width: width, height: height, rx: "11", fill: fill }), jsxRuntime.jsx("path", { d: "M9.952 9H11.772V16H9.952V9ZM9.686 7.026C9.686 6.75533 9.784 6.52667 9.98 6.34C10.1853 6.144 10.4653 6.046 10.82 6.046C11.1747 6.046 11.4593 6.144 11.674 6.34C11.898 6.52667 12.01 6.75533 12.01 7.026C12.01 7.29667 11.898 7.52533 11.674 7.712C11.4593 7.88933 11.1747 7.978 10.82 7.978C10.4653 7.978 10.1853 7.88933 9.98 7.712C9.784 7.52533 9.686 7.29667 9.686 7.026Z", fill: "#F8FAFC" })] }));
|
|
2949
2949
|
};
|
|
2950
2950
|
|
|
2951
|
+
const fadeInRight = styled.keyframes `
|
|
2952
|
+
0% {
|
|
2953
|
+
opacity: 0;
|
|
2954
|
+
transform: translateX(50%);
|
|
2955
|
+
}
|
|
2956
|
+
100% {
|
|
2957
|
+
opacity: 1;
|
|
2958
|
+
transform: translateX(0);
|
|
2959
|
+
}
|
|
2960
|
+
`;
|
|
2961
|
+
styled.keyframes `
|
|
2962
|
+
from {
|
|
2963
|
+
opacity: 1;
|
|
2964
|
+
transform: translateX(0);
|
|
2965
|
+
}
|
|
2966
|
+
to {
|
|
2967
|
+
opacity: 0;
|
|
2968
|
+
transform: translateX(20px);
|
|
2969
|
+
}
|
|
2970
|
+
`;
|
|
2951
2971
|
const ToastWrapper = styled__default["default"].div `
|
|
2952
2972
|
display: flex;
|
|
2953
2973
|
align-items: center;
|
|
@@ -2964,8 +2984,8 @@ const ToastWrapper = styled__default["default"].div `
|
|
|
2964
2984
|
position: fixed;
|
|
2965
2985
|
top: 100px;
|
|
2966
2986
|
right: 40px;
|
|
2967
|
-
|
|
2968
|
-
|
|
2987
|
+
z-index: 10000;
|
|
2988
|
+
animation: ${fadeInRight} 0.5s ease-in-out;
|
|
2969
2989
|
`;
|
|
2970
2990
|
const Icon = styled__default["default"].span `
|
|
2971
2991
|
margin-right: 10px;
|
|
@@ -2994,6 +3014,7 @@ const Text$3 = styled__default["default"].p `
|
|
|
2994
3014
|
`;
|
|
2995
3015
|
|
|
2996
3016
|
const Toast = ({ type = 'success', message, onClose, showBySeconds = 5, styles }) => {
|
|
3017
|
+
const [isToastOpen, setIsToastOpen] = React.useState(true);
|
|
2997
3018
|
React.useEffect(() => {
|
|
2998
3019
|
const timer = setTimeout(() => {
|
|
2999
3020
|
onClose();
|
|
@@ -3014,7 +3035,7 @@ const Toast = ({ type = 'success', message, onClose, showBySeconds = 5, styles }
|
|
|
3014
3035
|
default:
|
|
3015
3036
|
iconComponent = jsxRuntime.jsx(CircledAlert, { width: '22', height: '22' });
|
|
3016
3037
|
}
|
|
3017
|
-
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs(ToastWrapper, { style: { ...styles }, children: [jsxRuntime.jsx(Icon, { children: iconComponent }), jsxRuntime.jsx(Text$3, { children: message }), jsxRuntime.jsx(CloseButton$1, { onClick: onClose, children: jsxRuntime.jsx(CloseIcon, { width: '14', height: '14' }) })] }) }));
|
|
3038
|
+
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs(ToastWrapper, { visible: isToastOpen, style: { ...styles }, children: [jsxRuntime.jsx(Icon, { children: iconComponent }), jsxRuntime.jsx(Text$3, { children: message }), jsxRuntime.jsx(CloseButton$1, { onClick: onClose, children: jsxRuntime.jsx(CloseIcon, { width: '14', height: '14' }) })] }) }));
|
|
3018
3039
|
};
|
|
3019
3040
|
|
|
3020
3041
|
const ButtonGroupWrapper = styled__default["default"].div `
|
|
@@ -3650,6 +3671,7 @@ const Container$j = styled__default["default"].div `
|
|
|
3650
3671
|
width: ${({ width }) => (width ? `${width}px` : '100%')};
|
|
3651
3672
|
height: ${({ height }) => (height ? height : 195)}px;
|
|
3652
3673
|
overflow-y: auto;
|
|
3674
|
+
overflow-x: hidden;
|
|
3653
3675
|
z-index: 100;
|
|
3654
3676
|
border-radius: 8px;
|
|
3655
3677
|
box-shadow: 4px 8px 10px 0 #BDBDBD;
|
|
@@ -3751,18 +3773,12 @@ const CompanyName = styled__default["default"].span `
|
|
|
3751
3773
|
white-space: nowrap;
|
|
3752
3774
|
overflow: hidden;
|
|
3753
3775
|
text-overflow: ellipsis;
|
|
3776
|
+
max-width: 50%;
|
|
3777
|
+
min-width: 0;
|
|
3754
3778
|
|
|
3755
|
-
|
|
3756
|
-
@media (min-width: 1024px) {
|
|
3757
|
-
width: 58%
|
|
3758
|
-
}
|
|
3759
|
-
@media (min-width: 1440px) {
|
|
3760
|
-
/* Styles for screens with a minimum width of 768px */
|
|
3761
|
-
width: 48%;
|
|
3762
|
-
}
|
|
3763
|
-
@media (min-width: 1750px) {
|
|
3779
|
+
@media (min-width: 1900px) {
|
|
3764
3780
|
/* Styles for screens with a minimum width of 768px */
|
|
3765
|
-
width: 90%;
|
|
3781
|
+
max-width: 90%;
|
|
3766
3782
|
}
|
|
3767
3783
|
|
|
3768
3784
|
`;
|
|
@@ -4877,7 +4893,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
4877
4893
|
const [users, setUsers] = React.useState([]);
|
|
4878
4894
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
4879
4895
|
const inputRef = React.useRef(null);
|
|
4880
|
-
|
|
4896
|
+
const user = {
|
|
4881
4897
|
user_uuid: replyMentionedUser.uuid,
|
|
4882
4898
|
name: replyMentionedUser.name,
|
|
4883
4899
|
profile: {
|
|
@@ -4885,7 +4901,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
4885
4901
|
company_name: replyMentionedUser.company_name,
|
|
4886
4902
|
role_name: replyMentionedUser.role_name
|
|
4887
4903
|
}
|
|
4888
|
-
}
|
|
4904
|
+
};
|
|
4889
4905
|
const [userMentionedOnReplied, setUserMentionedOnReply] = React.useState(false);
|
|
4890
4906
|
const handleClickOutside = (event) => {
|
|
4891
4907
|
if (inputRef.current && !inputRef.current.contains(event.target) && comment.length === 0) {
|
|
@@ -4926,9 +4942,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
|
|
|
4926
4942
|
};
|
|
4927
4943
|
return (jsxRuntime.jsxs(Container$g, { style: { ...styles }, children: [jsxRuntime.jsx(Avatar, { src: imgProfile, size: "32px", style: { marginTop: '16px', marginRight: '8px' } }), jsxRuntime.jsxs(InputContainer, { ref: inputRef, style: { width: '100%', marginTop: '16px' }, children: [jsxRuntime.jsx(InputComment$1, { styles: { width: '100%' }, className: "userComment", onChange: (e) => {
|
|
4928
4944
|
handleSearchUsers(e);
|
|
4929
|
-
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users,
|
|
4930
|
-
//replyMentionedUser={!userMentionedOnReplied && user}
|
|
4931
|
-
group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || comment.length > limitInput || isLoading, label: publishButtonText, onClick: () => handlePublish(), variant: "primary", styles: { marginLeft: 'auto', marginTop: '14px' } }), isLoading && jsxRuntime.jsx(Loading, {})] })] }));
|
|
4945
|
+
}, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users, replyMentionedUser: !userMentionedOnReplied && user, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }), jsxRuntime.jsx(MiniButton, { disabled: comment.length <= 0 || comment.length > limitInput || isLoading, label: publishButtonText, onClick: () => handlePublish(), variant: "primary", styles: { marginLeft: 'auto', marginTop: '14px' } }), isLoading && jsxRuntime.jsx(Loading, {})] })] }));
|
|
4932
4946
|
};
|
|
4933
4947
|
|
|
4934
4948
|
const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onClickPublishButton, showReplysButtonText, publishButtonText, limitInputs, answerButtonText, loggedInUser, group_uuid, getSearchUsers, showMoreButtonText, showLessButtonText, styles, relationToPhaseText, limitMessageExceeded, size = 5, showMoreReplysButtonText, isGoalOwner, editText, deleteText, onClickDelete }) => {
|
|
@@ -4960,7 +4974,7 @@ const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onCli
|
|
|
4960
4974
|
setShowInputByIdReply([...showInputByIdReply, idReply]);
|
|
4961
4975
|
};
|
|
4962
4976
|
const isMainCommentUser = mainComment.user?.uuid === loggedInUser?.id;
|
|
4963
|
-
return (jsxRuntime.jsx(Container$h, { style: styles, children: jsxRuntime.jsxs(CommentarysContainer, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { hasActionToClickOnAvatar: false, imgProfile: mainComment.user?.avatar, itsLiked: false, userId: mainComment.user?.uuid, userName: mainComment.user?.name, userOffice: mainComment.user?.role_name, userCompany: mainComment.user?.company_name, commentId: mainComment.id, commentText: mainComment.text, howLongAgo: mainComment.howLongAgo, showMoreText: showMoreButtonText, showLessText: showLessButtonText, answerButtonText: answerButtonText, actionAnswer: handleCommentReply, actionDeleteComment: onClickDelete, relationToPhaseText: relationToPhaseText, commentTextWithMention: mainComment.mentionText, isMainComment: true, isAuthor: isMainCommentUser, isOwnerPost: isGoalOwner, deleteText: deleteText, editText: editText, showOptions: isMainCommentUser || isGoalOwner, commentUuid: mainComment.uuid }), listReplyComments.length > visibleReplies && (jsxRuntime.jsx(ViewReplysButtonContainer, { children: jsxRuntime.jsx("span", { onClick: handleLoadMoreReplies, children: showReplysOnClickCounter === 0 ? showReplysButtonText : showMoreReplysButtonText }) })), showReplyInput && (jsxRuntime.jsx(InputReply, { styles: { marginLeft: '60px' }, imgProfile: loggedInUser?.avatar, idInput: `idInput-${mainComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, getSearchUsers: getSearchUsers, replyMentionedUser: mainComment.user, parentId: Number(mainComment.id), handleHiddenInput: handleHiddenInput, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }))] }), showAnswers && visibleReplies && (jsxRuntime.jsx(RepplysContainer, { style: { marginTop: '24px' }, children: listReplyComments.slice(0, visibleReplies).map((replyComment) => (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxReply, { commentData: replyComment, answerButtonText: '', showMoreButtonText: showMoreButtonText, showLessButtonText: showLessButtonText, onClickAnswerButton: handleCommentReplyReply, isAuthor: replyComment.user?.uuid === loggedInUser?.id, isOwnerPost: (mainComment.user?.uuid === loggedInUser?.id) || isGoalOwner, deleteText: deleteText, editText: editText, onClickDelete: onClickDelete }), showInputByIdReply.includes(replyComment.id) && (jsxRuntime.jsx(InputReply, { imgProfile: loggedInUser?.avatar, styles: { width: '100%' }, idInput: `idInput-${replyComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, replyMentionedUser: replyComment.user, getSearchUsers: getSearchUsers, parentId: Number(mainComment.id), handleHiddenInput: (replyId = replyComment.id) => handleHiddenInputReply(replyId), group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }))] }, replyComment.id))) }))] }) }));
|
|
4977
|
+
return (jsxRuntime.jsx(Container$h, { style: styles, children: jsxRuntime.jsxs(CommentarysContainer, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(CommentaryBoxV2, { hasActionToClickOnAvatar: false, imgProfile: mainComment.user?.avatar, itsLiked: false, userId: mainComment.user?.uuid, userName: mainComment.user?.name, userOffice: mainComment.user?.role_name, userCompany: mainComment.user?.company_name, commentId: mainComment.id, commentText: mainComment.text, howLongAgo: mainComment.howLongAgo, showMoreText: showMoreButtonText, showLessText: showLessButtonText, answerButtonText: answerButtonText, actionAnswer: handleCommentReply, actionDeleteComment: onClickDelete, relationToPhaseText: relationToPhaseText, commentTextWithMention: mainComment.mentionText, isMainComment: true, isAuthor: isMainCommentUser, isOwnerPost: isGoalOwner, deleteText: deleteText, editText: editText, showOptions: isMainCommentUser || isGoalOwner, commentUuid: mainComment.uuid }), listReplyComments.length > visibleReplies && (jsxRuntime.jsx(ViewReplysButtonContainer, { children: jsxRuntime.jsx("span", { onClick: handleLoadMoreReplies, children: showReplysOnClickCounter === 0 ? showReplysButtonText : showMoreReplysButtonText }) })), showReplyInput && (jsxRuntime.jsx(InputReply, { styles: { marginLeft: '60px' }, imgProfile: loggedInUser?.avatar, idInput: `idInput-${mainComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, getSearchUsers: getSearchUsers, replyMentionedUser: mainComment.user, parentId: Number(mainComment.id), handleHiddenInput: handleHiddenInput, group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }))] }), showAnswers && visibleReplies && (jsxRuntime.jsx(RepplysContainer, { style: { marginTop: '24px' }, children: listReplyComments.slice(0, visibleReplies).map((replyComment) => (jsxRuntime.jsxs("div", { style: { marginTop: "6px" }, children: [jsxRuntime.jsx(CommentaryBoxReply, { commentData: replyComment, answerButtonText: '', showMoreButtonText: showMoreButtonText, showLessButtonText: showLessButtonText, onClickAnswerButton: handleCommentReplyReply, isAuthor: replyComment.user?.uuid === loggedInUser?.id, isOwnerPost: (mainComment.user?.uuid === loggedInUser?.id) || isGoalOwner, deleteText: deleteText, editText: editText, onClickDelete: onClickDelete }), showInputByIdReply.includes(replyComment.id) && (jsxRuntime.jsx(InputReply, { imgProfile: loggedInUser?.avatar, styles: { width: '100%' }, idInput: `idInput-${replyComment.id}`, placeHolderText: placeHolderText, publishButtonText: publishButtonText, limitInput: limitInputs, onClickPublishButton: onClickPublishButton, replyMentionedUser: replyComment.user, getSearchUsers: getSearchUsers, parentId: Number(mainComment.id), handleHiddenInput: (replyId = replyComment.id) => handleHiddenInputReply(replyId), group_uuid: group_uuid, limitMessageExceeded: limitMessageExceeded }))] }, replyComment.id))) }))] }) }));
|
|
4964
4978
|
};
|
|
4965
4979
|
|
|
4966
4980
|
const ButtonCheckmark = styled__default["default"].div `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/toast/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AAGxC,eAAO,MAAM,KAAK,sDAAuE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/toast/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AAGxC,eAAO,MAAM,KAAK,sDAAuE,UAAU,gBAkClG,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface AnimationToastProps {
|
|
2
|
+
visible?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare const ToastWrapper: import("styled-components").StyledComponent<"div", any, AnimationToastProps, never>;
|
|
2
5
|
export declare const Icon: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
3
6
|
export declare const CloseButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
4
7
|
export declare const Text: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/toast/toast.styles.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"toast.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/toast/toast.styles.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAyBD,eAAO,MAAM,YAAY,qFAkBxB,CAAA;AAED,eAAO,MAAM,IAAI,qEAGhB,CAAA;AAED,eAAO,MAAM,WAAW,uEASvB,CAAA;AACD,eAAO,MAAM,IAAI,kEAUhB,CAAA"}
|