frst-components 0.23.62 → 0.23.63
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 +14 -6
- package/dist/public/customIcons/SwitchVoteIcon.d.ts +8 -0
- package/dist/public/customIcons/SwitchVoteIcon.d.ts.map +1 -0
- package/dist/public/customIcons/index.d.ts +1 -0
- package/dist/public/customIcons/index.d.ts.map +1 -1
- package/dist/src/components/DS/hypotesisAndImpediment/Voting/index.d.ts +1 -1
- package/dist/src/components/DS/hypotesisAndImpediment/Voting/index.d.ts.map +1 -1
- package/dist/src/components/DS/hypotesisAndImpediment/index.d.ts +1 -1
- package/dist/src/components/DS/hypotesisAndImpediment/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/customIcons/SwitchVoteIcon.tsx +22 -0
- package/public/customIcons/index.ts +4 -3
package/dist/index.js
CHANGED
|
@@ -3057,6 +3057,10 @@ function CloseIcon() {
|
|
|
3057
3057
|
return (jsxRuntime.jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { width: "32", height: "32", rx: "16", fill: "#FFE0E0" }), jsxRuntime.jsx("path", { d: "M21.3332 10.6666L10.6665 21.3333", stroke: "#C00F00", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), jsxRuntime.jsx("path", { d: "M10.6665 10.6666L21.3332 21.3333", stroke: "#C00F00", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })] }));
|
|
3058
3058
|
}
|
|
3059
3059
|
|
|
3060
|
+
const SwitchVoteIcon = ({ style, width = '16', height = '17', stroke = '#444444' }) => {
|
|
3061
|
+
return (jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("path", { d: "M3.3335 4.36444V7.05746H5.87895", stroke: stroke, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M12.6665 11.5459V8.85284H10.1211", stroke: stroke, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M11.602 6.60864C11.3868 5.96536 11.0211 5.39023 10.5391 4.93691C10.057 4.4836 9.47421 4.16687 8.84513 4.01628C8.21606 3.86569 7.56118 3.88616 6.9416 4.07576C6.32202 4.26536 5.75793 4.61792 5.30198 5.10055L3.3335 7.05748M12.6668 8.85282L10.6983 10.8097C10.2424 11.2924 9.67831 11.6449 9.05873 11.8345C8.43915 12.0241 7.78427 12.0446 7.15519 11.894C6.52612 11.7434 5.94335 11.4267 5.46127 10.9734C4.97919 10.5201 4.61351 9.94493 4.39834 9.30166", stroke: stroke, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
3062
|
+
};
|
|
3063
|
+
|
|
3060
3064
|
const fadeInRight = styled.keyframes `
|
|
3061
3065
|
0% {
|
|
3062
3066
|
opacity: 0;
|
|
@@ -7833,14 +7837,15 @@ const VoterName = styled__default["default"].span `
|
|
|
7833
7837
|
color: #333;
|
|
7834
7838
|
`;
|
|
7835
7839
|
|
|
7836
|
-
const Voting = ({ type, voteText, onDeleteVote, votersList, onVote }) => {
|
|
7837
|
-
const [isVotted, setIsVotted] = React.useState(false);
|
|
7840
|
+
const Voting = ({ type, voteText, onDeleteVote, onChangeVote, votersList, onVote, voteHasAlreadyBeenRegistered, isVotedByUserLogged }) => {
|
|
7838
7841
|
const [isVotingListHover, setIsVotingListHover] = React.useState(false);
|
|
7839
7842
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
7840
7843
|
const handleDeleteVote = () => {
|
|
7841
|
-
setIsVotted(false);
|
|
7842
7844
|
onDeleteVote();
|
|
7843
7845
|
};
|
|
7846
|
+
const handleChangeVote = () => {
|
|
7847
|
+
onChangeVote();
|
|
7848
|
+
};
|
|
7844
7849
|
const handleHoverVoteList = () => {
|
|
7845
7850
|
setAnchorEl(null);
|
|
7846
7851
|
setIsVotingListHover(true);
|
|
@@ -7856,7 +7861,10 @@ const Voting = ({ type, voteText, onDeleteVote, votersList, onVote }) => {
|
|
|
7856
7861
|
const votersToDisplay = React.useMemo(() => {
|
|
7857
7862
|
return votersList?.slice(0, 2);
|
|
7858
7863
|
}, [votersList]);
|
|
7859
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children:
|
|
7864
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (isVotedByUserLogged || voteHasAlreadyBeenRegistered) ? (jsxRuntime.jsxs(ContainerVoting, { type: type, children: [(isVotedByUserLogged || voteHasAlreadyBeenRegistered) && (jsxRuntime.jsx(VotingList, { onClick: handleClickVotingList, children: votersToDisplay?.map(i => jsxRuntime.jsx(Avatar, { src: i.avatar, size: "24px", border: "1px solid #fff" })) })), jsxRuntime.jsx(material.Popper, { id: id, open: open, anchorEl: anchorEl, sx: { paddingTop: 1.5, paddingRight: 6.5 }, children: jsxRuntime.jsx(ContainerListUsers, { children: jsxRuntime.jsx(ContainerScroll, { children: votersList?.map((voter, index) => (jsxRuntime.jsxs(VoterItem, { children: [jsxRuntime.jsx(Avatar, { src: voter.avatar, size: "24px" }), jsxRuntime.jsx(VoterName, { children: voter.name })] }, index))) }) }) }), jsxRuntime.jsx(VotesCount, { onMouseEnter: handleHoverVoteList, onMouseLeave: handleLeaveVoteList, children: isVotingListHover ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [" ", isVotedByUserLogged ?
|
|
7865
|
+
jsxRuntime.jsxs("div", { onClick: handleDeleteVote, children: [jsxRuntime.jsx(ExcludeVoteIcon, {}), "Excluir voto"] })
|
|
7866
|
+
:
|
|
7867
|
+
jsxRuntime.jsxs("div", { onClick: handleChangeVote, children: [jsxRuntime.jsx(SwitchVoteIcon, {}), "Trocar voto"] })] })) : (jsxRuntime.jsxs("span", { children: [votersList?.length, " ", votersList?.length > 1 ? 'votos' : 'voto'] })) })] })) : (jsxRuntime.jsx(ContainerVoting, { type: type, children: jsxRuntime.jsxs(ContainerTitleVoting, { onClick: onVote, children: [jsxRuntime.jsx(NewVoteIcon, {}), jsxRuntime.jsx(TitleVoting, { children: voteText })] }) })) }));
|
|
7860
7868
|
};
|
|
7861
7869
|
|
|
7862
7870
|
const ContainerInput = styled__default["default"].div `
|
|
@@ -7905,7 +7913,7 @@ const EditHypotesisAndImpediment = ({ setEditDescription, editDescription, onSav
|
|
|
7905
7913
|
const HypothesisAndImpediment = ({ description, variant, type, avatar, id, index, authorGoalId, // id do dono do desafio
|
|
7906
7914
|
userLoggedId, authorName, // nome autor da hipotese ou do impedimento
|
|
7907
7915
|
handleViewProfile, authorId, // id do autor do impedimento ou da hipotese
|
|
7908
|
-
hasVoting, voteText, onDeleteVote, votersList, onDeleteHipotesisOrImpediment, onSaveEditHipotesisOrImpediment, hasEditHipotesisOrImpediment, onVote, onPrioritize, onDown, onUp, hasUpdownButtons, onClickAction, onAddActions, hasAddActions }) => {
|
|
7916
|
+
hasVoting, voteHasAlreadyBeenRegistered, isVotedByUserLogged, voteText, onDeleteVote, onChangeVote, votersList, onDeleteHipotesisOrImpediment, onSaveEditHipotesisOrImpediment, hasEditHipotesisOrImpediment, onVote, onPrioritize, onDown, onUp, hasUpdownButtons, onClickAction, onAddActions, hasAddActions }) => {
|
|
7909
7917
|
const [editDescription, setEditDescription] = React.useState(description);
|
|
7910
7918
|
const [isEditing, setIsEditing] = React.useState(false);
|
|
7911
7919
|
const isOwnerGoal = authorGoalId === authorId;
|
|
@@ -7955,7 +7963,7 @@ hasVoting, voteText, onDeleteVote, votersList, onDeleteHipotesisOrImpediment, on
|
|
|
7955
7963
|
left: '4px',
|
|
7956
7964
|
whiteSpace: 'nowrap',
|
|
7957
7965
|
boxShadow: ' 0px 0px 18px 0px rgba(34, 34, 34, 0.2)'
|
|
7958
|
-
}, children: jsxRuntime.jsx(Avatar, { src: avatar, size: isOwnerGoal ? '28px' : '24px', border: avatarBorder, style: { marginRight: '14px', cursor: 'pointer', marginLeft: '16px' }, onClick: () => handleViewProfile(authorId) }) }), jsxRuntime.jsx(Title$6, { children: title }), jsxRuntime.jsx(Separator, { type: type, variant: variant }), jsxRuntime.jsx(Description$4, { onClick: handleClickAction, children: editDescription }), hasVoting && (jsxRuntime.jsx(Voting, { voteText: voteText, type: type, onDeleteVote: onDeleteVote, votersList: votersList, onVote: () => onVote(id) })), validHasEditHipotesisOrImpediment && (jsxRuntime.jsx(MenuMore, { options: [
|
|
7966
|
+
}, children: jsxRuntime.jsx(Avatar, { src: avatar, size: isOwnerGoal ? '28px' : '24px', border: avatarBorder, style: { marginRight: '14px', cursor: 'pointer', marginLeft: '16px' }, onClick: () => handleViewProfile(authorId) }) }), jsxRuntime.jsx(Title$6, { children: title }), jsxRuntime.jsx(Separator, { type: type, variant: variant }), jsxRuntime.jsx(Description$4, { onClick: handleClickAction, children: editDescription }), hasVoting && (jsxRuntime.jsx(Voting, { voteText: voteText, type: type, onDeleteVote: onDeleteVote, votersList: votersList, onVote: () => onVote(id), onChangeVote: () => onChangeVote(id), isVotedByUserLogged: isVotedByUserLogged, voteHasAlreadyBeenRegistered: voteHasAlreadyBeenRegistered })), validHasEditHipotesisOrImpediment && (jsxRuntime.jsx(MenuMore, { options: [
|
|
7959
7967
|
hasUpdownButtons && userLoggedId === authorGoalId &&
|
|
7960
7968
|
({
|
|
7961
7969
|
startIcon: jsxRuntime.jsx(StarPrioritize, { width: '24px', height: '24px', stroke: type === 'prioritize' ? "#9C9C9C" : "#222222" }),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const SwitchVoteIcon: ({ style, width, height, stroke }: {
|
|
3
|
+
style?: CSSProperties | undefined;
|
|
4
|
+
width?: string;
|
|
5
|
+
height?: string;
|
|
6
|
+
stroke?: string;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=SwitchVoteIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchVoteIcon.d.ts","sourceRoot":"","sources":["../../../public/customIcons/SwitchVoteIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,eAAO,MAAM,cAAc;YAMjB,aAAa,GAAG,SAAS;YACzB,MAAM;aACL,MAAM;aACN,MAAM;iBAShB,CAAA"}
|
|
@@ -8,4 +8,5 @@ export { VoteCurrentIcon } from './VoteCurrentIcon';
|
|
|
8
8
|
export { NewVoteIcon } from './newVoteIcon';
|
|
9
9
|
export { CheckIcon } from './CheckIcon';
|
|
10
10
|
export { CloseIcon } from './CloseIcon';
|
|
11
|
+
export { SwitchVoteIcon } from './SwitchVoteIcon';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../public/customIcons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../public/customIcons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { VotingProps } from '../hypothesisAndImpediment';
|
|
3
|
-
export declare const Voting: ({ type, voteText, onDeleteVote, votersList, onVote }: VotingProps) => JSX.Element;
|
|
3
|
+
export declare const Voting: ({ type, voteText, onDeleteVote, onChangeVote, votersList, onVote, voteHasAlreadyBeenRegistered, isVotedByUserLogged }: VotingProps) => JSX.Element;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/DS/hypotesisAndImpediment/Voting/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAqB,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAM3E,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/DS/hypotesisAndImpediment/Voting/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAqB,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAM3E,eAAO,MAAM,MAAM,0HAA0H,WAAW,gBAyFvJ,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IHypothesisAndImpedimentComponent } from './hypothesisAndImpediment';
|
|
3
|
-
export declare const HypothesisAndImpediment: ({ description, variant, type, avatar, id, index, authorGoalId, userLoggedId, authorName, handleViewProfile, authorId, hasVoting, voteText, onDeleteVote, votersList, onDeleteHipotesisOrImpediment, onSaveEditHipotesisOrImpediment, hasEditHipotesisOrImpediment, onVote, onPrioritize, onDown, onUp, hasUpdownButtons, onClickAction, onAddActions, hasAddActions }: IHypothesisAndImpedimentComponent) => JSX.Element;
|
|
3
|
+
export declare const HypothesisAndImpediment: ({ description, variant, type, avatar, id, index, authorGoalId, userLoggedId, authorName, handleViewProfile, authorId, hasVoting, voteHasAlreadyBeenRegistered, isVotedByUserLogged, voteText, onDeleteVote, onChangeVote, votersList, onDeleteHipotesisOrImpediment, onSaveEditHipotesisOrImpediment, hasEditHipotesisOrImpediment, onVote, onPrioritize, onDown, onUp, hasUpdownButtons, onClickAction, onAddActions, hasAddActions }: IHypothesisAndImpedimentComponent) => JSX.Element;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/hypotesisAndImpediment/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAA;AAU7E,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/hypotesisAndImpediment/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAA;AAU7E,eAAO,MAAM,uBAAuB,2aA8BjC,iCAAiC,gBAsJnC,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { CSSProperties } from 'react'
|
|
3
|
+
|
|
4
|
+
export const SwitchVoteIcon = ({
|
|
5
|
+
style,
|
|
6
|
+
width = '16',
|
|
7
|
+
height = '17',
|
|
8
|
+
stroke = '#444444'
|
|
9
|
+
}: {
|
|
10
|
+
style?: CSSProperties | undefined
|
|
11
|
+
width?: string
|
|
12
|
+
height?: string
|
|
13
|
+
stroke?: string
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
+
<path d="M3.3335 4.36444V7.05746H5.87895" stroke={stroke} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
18
|
+
<path d="M12.6665 11.5459V8.85284H10.1211" stroke={stroke} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
19
|
+
<path d="M11.602 6.60864C11.3868 5.96536 11.0211 5.39023 10.5391 4.93691C10.057 4.4836 9.47421 4.16687 8.84513 4.01628C8.21606 3.86569 7.56118 3.88616 6.9416 4.07576C6.32202 4.26536 5.75793 4.61792 5.30198 5.10055L3.3335 7.05748M12.6668 8.85282L10.6983 10.8097C10.2424 11.2924 9.67831 11.6449 9.05873 11.8345C8.43915 12.0241 7.78427 12.0446 7.15519 11.894C6.52612 11.7434 5.94335 11.4267 5.46127 10.9734C4.97919 10.5201 4.61351 9.94493 4.39834 9.30166" stroke={stroke} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
20
|
+
</svg>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -5,6 +5,7 @@ export { CircledAlert } from './CircledAlert'
|
|
|
5
5
|
export { VoteIcon } from './VoteIcon';
|
|
6
6
|
export { ExcludeVoteIcon } from './ExcludeVoteIcon';
|
|
7
7
|
export { VoteCurrentIcon } from './VoteCurrentIcon';
|
|
8
|
-
export {NewVoteIcon} from './newVoteIcon'
|
|
9
|
-
export {CheckIcon} from './CheckIcon'
|
|
10
|
-
export {CloseIcon} from './CloseIcon'
|
|
8
|
+
export { NewVoteIcon } from './newVoteIcon'
|
|
9
|
+
export { CheckIcon } from './CheckIcon'
|
|
10
|
+
export { CloseIcon } from './CloseIcon'
|
|
11
|
+
export { SwitchVoteIcon } from './SwitchVoteIcon'
|