frst-components 0.22.7 → 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
- animation: 0% { transform: scale(0) }
2968
- 100% { transform: scale(1) } 0.5s ease-in-out;
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 `
@@ -4872,7 +4893,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
4872
4893
  const [users, setUsers] = React.useState([]);
4873
4894
  const [isLoading, setIsLoading] = React.useState(false);
4874
4895
  const inputRef = React.useRef(null);
4875
- ({
4896
+ const user = {
4876
4897
  user_uuid: replyMentionedUser.uuid,
4877
4898
  name: replyMentionedUser.name,
4878
4899
  profile: {
@@ -4880,7 +4901,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
4880
4901
  company_name: replyMentionedUser.company_name,
4881
4902
  role_name: replyMentionedUser.role_name
4882
4903
  }
4883
- });
4904
+ };
4884
4905
  const [userMentionedOnReplied, setUserMentionedOnReply] = React.useState(false);
4885
4906
  const handleClickOutside = (event) => {
4886
4907
  if (inputRef.current && !inputRef.current.contains(event.target) && comment.length === 0) {
@@ -4921,9 +4942,7 @@ const InputReply = ({ placeHolderText, getSearchUsers, onClickPublishButton, par
4921
4942
  };
4922
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) => {
4923
4944
  handleSearchUsers(e);
4924
- }, value: comment, placeholder: placeHolderText, limit: limitInput, showCharacterCounter: true, onContentUnformat: (unformattedValue) => setCommentData(unformattedValue), onContentFormat: (formattedValue) => setCaptureFormattedValue(formattedValue), onSendMentions: (mentions) => setCaptureMentions(mentions), users: users,
4925
- //replyMentionedUser={!userMentionedOnReplied && user}
4926
- 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, {})] })] }));
4927
4946
  };
4928
4947
 
4929
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 }) => {
@@ -4955,7 +4974,7 @@ const ThreadComments = ({ mainComment, listReplyComments, placeHolderText, onCli
4955
4974
  setShowInputByIdReply([...showInputByIdReply, idReply]);
4956
4975
  };
4957
4976
  const isMainCommentUser = mainComment.user?.uuid === loggedInUser?.id;
4958
- 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))) }))] }) }));
4959
4978
  };
4960
4979
 
4961
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,gBAiClG,CAAA"}
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 declare const ToastWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
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,oEAkBxB,CAAA;AAED,eAAO,MAAM,IAAI,qEAGhB,CAAA;AAED,eAAO,MAAM,WAAW,uEASvB,CAAA;AACD,eAAO,MAAM,IAAI,kEAUhB,CAAA"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"mentionsStyle.d.ts","sourceRoot":"","sources":["../../../../src/components/input-comment/mentionsStyle.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;UAAsB,OAAO;SAAO,MAAM;YAAU,MAAM;aAAW,MAAM;SAkChG,CAAA;AAED,eAAO,MAAM,YAAY,sEAAiB,CAAA;AAE1C,eAAO,MAAM,WAAW,oEAKvB,CAAA;AAED,eAAO,MAAM,WAAW;aAAyB,OAAO;SAkBvD,CAAA;AAGD,eAAO,MAAM,aAAa,oEAIzB,CAAA;AAED,eAAO,MAAM,aAAa,oEAIzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,oEAQhC,CAAA;AAED,eAAO,MAAM,eAAe,qEAI3B,CAAA;AAED,eAAO,MAAM,wBAAwB,oEAOpC,CAAA;AAED,eAAO,MAAM,mBAAmB,qEAM/B,CAAA;AACD,eAAO,MAAM,MAAM,oEAQlB,CAAA;AACD,eAAO,MAAM,WAAW,qEAYvB,CAAA"}
1
+ {"version":3,"file":"mentionsStyle.d.ts","sourceRoot":"","sources":["../../../../src/components/input-comment/mentionsStyle.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;UAAsB,OAAO;SAAO,MAAM;YAAU,MAAM;aAAW,MAAM;SAiChG,CAAA;AAED,eAAO,MAAM,YAAY,sEAAiB,CAAA;AAE1C,eAAO,MAAM,WAAW,oEAKvB,CAAA;AAED,eAAO,MAAM,WAAW;aAAyB,OAAO;SAkBvD,CAAA;AAGD,eAAO,MAAM,aAAa,oEAIzB,CAAA;AAED,eAAO,MAAM,aAAa,oEAIzB,CAAC;AAEF,eAAO,MAAM,oBAAoB,oEAQhC,CAAA;AAED,eAAO,MAAM,eAAe,qEAI3B,CAAA;AAED,eAAO,MAAM,wBAAwB,oEAOpC,CAAA;AAED,eAAO,MAAM,mBAAmB,qEAM/B,CAAA;AACD,eAAO,MAAM,MAAM,oEAQlB,CAAA;AACD,eAAO,MAAM,WAAW,qEAkBvB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frst-components",
3
3
  "homepage": "http://FRST-Falconi.github.io/storybook.frstfalconi.com",
4
- "version": "0.22.07",
4
+ "version": "0.22.08",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",