frst-components 0.22.80 → 0.22.82
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 +19 -9
- package/dist/public/customIcons/ExcludeVoteIcon.d.ts +1 -2
- package/dist/public/customIcons/ExcludeVoteIcon.d.ts.map +1 -1
- package/dist/src/components/hypothesisComponent/hypothesisComponent.style.d.ts +1 -0
- package/dist/src/components/hypothesisComponent/hypothesisComponent.style.d.ts.map +1 -1
- package/dist/src/components/hypothesisComponent/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/customIcons/ExcludeVoteIcon.tsx +2 -12
package/dist/index.js
CHANGED
|
@@ -2983,8 +2983,8 @@ const VoteIcon = ({ style, width = '16', height = '17', stroke = '#444444' }) =>
|
|
|
2983
2983
|
return (jsxRuntime.jsxs("svg", { style: style, width: width, height: height, viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsxs("g", { clipPath: "url(#clip0_2067_11382)", children: [jsxRuntime.jsx("path", { d: "M7.9987 14.9192C11.6806 14.9192 14.6654 11.9345 14.6654 8.25257C14.6654 4.57068 11.6806 1.58591 7.9987 1.58591C4.3168 1.58591 1.33203 4.57068 1.33203 8.25257C1.33203 11.9345 4.3168 14.9192 7.9987 14.9192Z", stroke: stroke, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M11 8.25256L8 5.25256L5 8.25256", stroke: stroke, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M8 11.2526V5.25256", stroke: stroke, strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_2067_11382", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white", transform: "translate(0 0.252563)" }) }) })] }));
|
|
2984
2984
|
};
|
|
2985
2985
|
|
|
2986
|
-
const ExcludeVoteIcon = ({ style, width = '16', height = '17', stroke = '#444444'
|
|
2987
|
-
return (jsxRuntime.jsxs("svg", {
|
|
2986
|
+
const ExcludeVoteIcon = ({ style, width = '16', height = '17', stroke = '#444444' }) => {
|
|
2987
|
+
return (jsxRuntime.jsxs("svg", { style: style, width: width, height: height, viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("path", { d: "M8.00065 14.9381C11.6825 14.9381 14.6673 11.9533 14.6673 8.2714C14.6673 4.5895 11.6825 1.60474 8.00065 1.60474C4.31875 1.60474 1.33398 4.5895 1.33398 8.2714C1.33398 11.9533 4.31875 14.9381 8.00065 14.9381Z", stroke: stroke, "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" }), jsxRuntime.jsx("path", { d: "M10.6673 5.60474L5.33398 10.9381", stroke: stroke, "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" }), jsxRuntime.jsx("path", { d: "M5.33398 5.60474L10.6673 10.9381", stroke: stroke, "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" })] }));
|
|
2988
2988
|
};
|
|
2989
2989
|
|
|
2990
2990
|
const fadeInRight = styled.keyframes `
|
|
@@ -3152,6 +3152,7 @@ const VoteButtonContainer = styled__default["default"].span `
|
|
|
3152
3152
|
width: 100%;
|
|
3153
3153
|
background: #F9CD5E;
|
|
3154
3154
|
|
|
3155
|
+
|
|
3155
3156
|
${({ type }) => type === 'prioritize' && styled.css `
|
|
3156
3157
|
background: #DC9100;
|
|
3157
3158
|
`}
|
|
@@ -3162,6 +3163,10 @@ const VoteButtonContainer = styled__default["default"].span `
|
|
|
3162
3163
|
${({ type }) => type === 'suggested' && styled.css `
|
|
3163
3164
|
background: #A5C3F2;
|
|
3164
3165
|
`}
|
|
3166
|
+
|
|
3167
|
+
${({ modeDelete }) => modeDelete && styled.css `
|
|
3168
|
+
background: inherit;
|
|
3169
|
+
`}
|
|
3165
3170
|
border-radius:0 8px 8px 0;
|
|
3166
3171
|
padding: 0 16px 0 16px;
|
|
3167
3172
|
height: 100%;
|
|
@@ -3255,7 +3260,9 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3255
3260
|
};
|
|
3256
3261
|
const viewVotesRef = React.useRef(null);
|
|
3257
3262
|
const handleClickOutsideVote = (event) => {
|
|
3258
|
-
if (viewVotesRef?.current &&
|
|
3263
|
+
if (viewVotesRef?.current &&
|
|
3264
|
+
!viewVotesRef?.current?.contains(event?.target) &&
|
|
3265
|
+
!event.target.closest('.VoteListItem')) {
|
|
3259
3266
|
setShowVotesList(false);
|
|
3260
3267
|
}
|
|
3261
3268
|
};
|
|
@@ -3291,15 +3298,17 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3291
3298
|
};
|
|
3292
3299
|
return (jsxRuntime.jsx(MainContainer, { children: jsxRuntime.jsxs(Container$l, { type: type, id: id, children: [jsxRuntime.jsxs(SplitContainer, { children: [jsxRuntime.jsx(Title$6, { children: title }), jsxRuntime.jsx(Separator, { children: "|" }), jsxRuntime.jsx(Description$3, { children: description })] }), !canVote && canViewVote && hypothesisVotes.length > 0 && (jsxRuntime.jsxs("div", { style: { position: 'relative' }, children: [jsxRuntime.jsx(SplitContainer, { children: jsxRuntime.jsx(VoteMainContainer, { children: jsxRuntime.jsx(VoteButtonContainer, { ref: viewVotesRef, style: { cursor: canViewListVotes ? 'pointer' : 'default' }, type: type, onClick: canViewListVotes ? toggleVotes : null, children: jsxRuntime.jsxs(VoteCount, { children: [jsxRuntime.jsxs(VoteContent, { children: [hypothesisVotes?.slice(0, 3)?.map((vote, index) => {
|
|
3293
3300
|
return (jsxRuntime.jsx(ImageContent$1, { style: { zIndex: 14 - index }, children: jsxRuntime.jsx("img", { src: vote?.user?.avatar || 'https://cdn-images.frstfalconi.cloud/path582.svg' }) }, vote?.id));
|
|
3294
|
-
}), hypothesisVotes
|
|
3301
|
+
}), hypothesisVotes?.length > 3 && (jsxRuntime.jsx(ImageContent$1, { style: { background: '#444444' }, children: jsxRuntime.jsxs("p", { style: {
|
|
3295
3302
|
fontSize: hypothesisVotes?.length > 9 ? 10 : hypothesisVotes?.length > 99 ? 8 : 14
|
|
3296
|
-
}, children: ["+", hypothesisVotes?.length - 3] }) }))] }), hypothesisVotes?.length, " ", hypothesisVotes?.length > 1 ? votesPluralText : votesSingularText] }) }) }) }), jsxRuntime.jsx(VoteList, { hypothesisVotes: votes, showVotes: showVotesList, viewProfile: handleViewProfile })] })), canVote && (jsxRuntime.jsx(SplitContainer, { children: jsxRuntime.jsx(VoteMainContainer, { children: jsxRuntime.jsx(VoteButtonContainer, {
|
|
3303
|
+
}, children: ["+", hypothesisVotes?.length - 3] }) }))] }), hypothesisVotes?.length, " ", hypothesisVotes?.length > 1 ? votesPluralText : votesSingularText] }) }) }) }), jsxRuntime.jsx(VoteList, { hypothesisVotes: votes, showVotes: showVotesList, viewProfile: handleViewProfile })] })), canVote && (jsxRuntime.jsx(SplitContainer, { children: jsxRuntime.jsx(VoteMainContainer, { children: jsxRuntime.jsx(VoteButtonContainer, { type: type, modeDelete: isHover, onMouseEnter: () => seIsHover(true), onMouseLeave: () => seIsHover(false), children: hasVote ? (isHover ? (jsxRuntime.jsxs("div", { style: {
|
|
3297
3304
|
display: 'flex',
|
|
3298
3305
|
alignItems: 'center',
|
|
3299
|
-
gap: '4px'
|
|
3306
|
+
gap: '4px',
|
|
3307
|
+
width: 'auto',
|
|
3308
|
+
justifyContent: 'end'
|
|
3300
3309
|
}, onClick: () => handleDeleteVote(hypothesisVotes.find((vote) => vote.user_uuid === userLoggedId).id), children: [jsxRuntime.jsx(ExcludeVoteIcon, { width: "24", height: "24" }), jsxRuntime.jsx(VoteButton, { children: deleteVoteText })] })) : (jsxRuntime.jsxs(VoteCount, { children: [jsxRuntime.jsxs(VoteContent, { children: [hypothesisVotes?.slice(0, 3)?.map((vote, index) => {
|
|
3301
|
-
return (jsxRuntime.jsx(ImageContent$1, { style: { zIndex:
|
|
3302
|
-
}), hypothesisVotes.length > 3 && (jsxRuntime.jsx(ImageContent$1, { style: { background: '#444444' }, children: jsxRuntime.jsxs("p", { children: ["+", hypothesisVotes?.length - 3] }) }))] }), hypothesisVotes?.length, " ", hypothesisVotes?.length > 1 ? votesPluralText : votesSingularText] }))) : (jsxRuntime.jsxs("div", { style: {
|
|
3310
|
+
return (jsxRuntime.jsx(ImageContent$1, { style: { zIndex: 14 - index }, children: jsxRuntime.jsx("img", { src: vote?.user?.avatar || 'https://cdn-images.frstfalconi.cloud/path582.svg' }) }, vote?.id));
|
|
3311
|
+
}), hypothesisVotes.length > 3 && (jsxRuntime.jsx(ImageContent$1, { style: { background: '#444444' }, children: jsxRuntime.jsxs("p", { children: ["+", hypothesisVotes?.length - 3] }) }))] }), jsxRuntime.jsxs("p", { children: [hypothesisVotes?.length, " ", hypothesisVotes?.length > 1 ? votesPluralText : votesSingularText] })] }))) : (jsxRuntime.jsxs("div", { style: {
|
|
3303
3312
|
display: 'flex',
|
|
3304
3313
|
alignItems: 'center',
|
|
3305
3314
|
justifyContent: 'space-around',
|
|
@@ -3308,7 +3317,8 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3308
3317
|
}, onClick: () => handleVote(id), children: [jsxRuntime.jsx(VoteIcon, { width: "24", height: "24", style: { marginLeft: '4px', marginRight: '4px' } }), jsxRuntime.jsx(VoteButton, { children: voteText })] })) }) }) }))] }) }));
|
|
3309
3318
|
};
|
|
3310
3319
|
const VoteList = ({ hypothesisVotes, showVotes, viewProfile }) => {
|
|
3311
|
-
|
|
3320
|
+
const sortedVotes = [...hypothesisVotes].sort((a, b) => a.user.name.localeCompare(b.user.name));
|
|
3321
|
+
return (jsxRuntime.jsx(VoteListContainer, { showVotes: showVotes, children: sortedVotes?.map((vote, index) => (jsxRuntime.jsxs(VoteListItem, { className: "VoteListItem", lastVote: hypothesisVotes?.length === index + 1, onClick: () => viewProfile(vote?.user?.uuid), children: [jsxRuntime.jsx(Avatar, { src: vote?.user?.avatar, size: '24px', alt: vote?.user?.name, style: { marginLeft: '6px', cursor: 'pointer' } }), jsxRuntime.jsx("p", { children: vote?.user?.name })] }, vote?.id))) }));
|
|
3312
3322
|
};
|
|
3313
3323
|
|
|
3314
3324
|
const ButtonGroupWrapper = styled__default["default"].div `
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
-
export declare const ExcludeVoteIcon: ({ style, width, height, stroke
|
|
2
|
+
export declare const ExcludeVoteIcon: ({ style, width, height, stroke }: {
|
|
3
3
|
style?: CSSProperties | undefined;
|
|
4
4
|
width?: string;
|
|
5
5
|
height?: string;
|
|
6
6
|
stroke?: string;
|
|
7
|
-
onMouseOver?: () => void;
|
|
8
7
|
}) => JSX.Element;
|
|
9
8
|
//# sourceMappingURL=ExcludeVoteIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExcludeVoteIcon.d.ts","sourceRoot":"","sources":["../../../public/customIcons/ExcludeVoteIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,eAAO,MAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"ExcludeVoteIcon.d.ts","sourceRoot":"","sources":["../../../public/customIcons/ExcludeVoteIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,eAAO,MAAM,eAAe;YAMlB,aAAa,GAAG,SAAS;YACzB,MAAM;aACL,MAAM;aACN,MAAM;iBA2BhB,CAAA"}
|
|
@@ -16,6 +16,7 @@ export declare const VoteAvatarsContainer: import("styled-components").StyledCom
|
|
|
16
16
|
export declare const VoteAvatar: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
17
|
export declare const VoteButtonContainer: import("styled-components").StyledComponent<"span", any, {
|
|
18
18
|
type?: string;
|
|
19
|
+
modeDelete?: boolean;
|
|
19
20
|
}, never>;
|
|
20
21
|
export declare const VoteCount: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
21
22
|
export declare const VoteButton: import("styled-components").StyledComponent<"p", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hypothesisComponent.style.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/hypothesisComponent.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,oEAKzB,CAAA;AACD,eAAO,MAAM,SAAS;UAAsB,MAAM;SAsBjD,CAAC;AAEF,eAAO,MAAM,KAAK,qEAGjB,CAAC;AAEF,eAAO,MAAM,KAAK,qEAEjB,CAAC;AAEF,eAAO,MAAM,SAAS,oEAGrB,CAAC;AAEF,eAAO,MAAM,WAAW,qEAIvB,CAAC;AACF,eAAO,MAAM,cAAc;aAAyB,MAAM;SAKzD,CAAA;AACD,eAAO,MAAM,iBAAiB;aAAyB,MAAM;SAO5D,CAAA;AACD,eAAO,MAAM,oBAAoB,oEAKhC,CAAA;AAED,eAAO,MAAM,UAAU,oEAEtB,CAAA;AAED,eAAO,MAAM,mBAAmB;WAAwB,MAAM;
|
|
1
|
+
{"version":3,"file":"hypothesisComponent.style.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/hypothesisComponent.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,oEAKzB,CAAA;AACD,eAAO,MAAM,SAAS;UAAsB,MAAM;SAsBjD,CAAC;AAEF,eAAO,MAAM,KAAK,qEAGjB,CAAC;AAEF,eAAO,MAAM,KAAK,qEAEjB,CAAC;AAEF,eAAO,MAAM,SAAS,oEAGrB,CAAC;AAEF,eAAO,MAAM,WAAW,qEAIvB,CAAC;AACF,eAAO,MAAM,cAAc;aAAyB,MAAM;SAKzD,CAAA;AACD,eAAO,MAAM,iBAAiB;aAAyB,MAAM;SAO5D,CAAA;AACD,eAAO,MAAM,oBAAoB,oEAKhC,CAAA;AAED,eAAO,MAAM,UAAU,oEAEtB,CAAA;AAED,eAAO,MAAM,mBAAmB;WAAwB,MAAM;iBAAe,OAAO;SA4BnF,CAAA;AACD,eAAO,MAAM,SAAS,qEAOrB,CAAA;AACD,eAAO,MAAM,UAAU,kEActB,CAAA;AACD,eAAO,MAAM,WAAW,oEASvB,CAAA;AACD,eAAO,MAAM,YAAY,oEAexB,CAAA;AAED,eAAO,MAAM,iBAAiB;gBAA4B,OAAO;SAiBhE,CAAA;AAED,eAAO,MAAM,YAAY;eAA2B,OAAO;SAO1D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,eAAO,MAAM,mBAAmB;iBAkBjB,MAAM;UACb,MAAM;QACR,MAAM;WACH,MAAM;WACN,IAAI,EAAE;kBACC,MAAM;2BACG,MAAM,KAAK,GAAG;0BACf,MAAM,KAAK,GAAG;iCACP,MAAM,KAAK,GAAG;cACjC,OAAO;uBACE,OAAO;kBACZ,OAAO;wBACD,MAAM;sBACR,MAAM;eACb,MAAM;qBACA,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,eAAO,MAAM,mBAAmB;iBAkBjB,MAAM;UACb,MAAM;QACR,MAAM;WACH,MAAM;WACN,IAAI,EAAE;kBACC,MAAM;2BACG,MAAM,KAAK,GAAG;0BACf,MAAM,KAAK,GAAG;iCACP,MAAM,KAAK,GAAG;cACjC,OAAO;uBACE,OAAO;kBACZ,OAAO;wBACD,MAAM;sBACR,MAAM;eACb,MAAM;qBACA,MAAM;iBA2KxB,CAAA"}
|
package/package.json
CHANGED
|
@@ -5,25 +5,15 @@ export const ExcludeVoteIcon = ({
|
|
|
5
5
|
style,
|
|
6
6
|
width = '16',
|
|
7
7
|
height = '17',
|
|
8
|
-
stroke = '#444444'
|
|
9
|
-
onMouseOver
|
|
8
|
+
stroke = '#444444'
|
|
10
9
|
}: {
|
|
11
10
|
style?: CSSProperties | undefined
|
|
12
11
|
width?: string
|
|
13
12
|
height?: string
|
|
14
13
|
stroke?: string
|
|
15
|
-
onMouseOver?: () => void
|
|
16
14
|
}) => {
|
|
17
15
|
return (
|
|
18
|
-
<svg
|
|
19
|
-
onMouseOver={onMouseOver}
|
|
20
|
-
style={style}
|
|
21
|
-
width={width}
|
|
22
|
-
height={height}
|
|
23
|
-
viewBox="0 0 16 17"
|
|
24
|
-
fill="none"
|
|
25
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
-
>
|
|
16
|
+
<svg style={style} width={width} height={height} viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
27
17
|
<path
|
|
28
18
|
d="M8.00065 14.9381C11.6825 14.9381 14.6673 11.9533 14.6673 8.2714C14.6673 4.5895 11.6825 1.60474 8.00065 1.60474C4.31875 1.60474 1.33398 4.5895 1.33398 8.2714C1.33398 11.9533 4.31875 14.9381 8.00065 14.9381Z"
|
|
29
19
|
stroke={stroke}
|