@soul-refiner/design-system 0.2.100 → 0.2.102
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/components/actions/dropdown/dropdown.js +5 -1
- package/dist/components/surfaces/comment/comment.d.ts +2 -1
- package/dist/components/surfaces/comment/comment.js +2 -2
- package/dist/components/surfaces/post/post.d.ts +2 -1
- package/dist/components/surfaces/post/post.js +2 -2
- package/package.json +1 -1
|
@@ -106,7 +106,11 @@ const Dropdown = ({ checkbox, children, closeOnChange = true, closeOnBlur = true
|
|
|
106
106
|
: { isDropdownOpen: open, onClick: handleOpen }),
|
|
107
107
|
open && (React.createElement(Container, { "$hasArrow": hasArrow, "$offset": offset, "$openDirection": openDirection, ref: optionsRef, "$sx": containerSx, "$useFullWidth": useFullWidth },
|
|
108
108
|
React.createElement("div", { style: { display: 'flex' } },
|
|
109
|
-
React.createElement("div", { style: {
|
|
109
|
+
React.createElement("div", { style: {
|
|
110
|
+
display: 'flex',
|
|
111
|
+
flexDirection: 'column',
|
|
112
|
+
width: '100%',
|
|
113
|
+
} }, dropdownOptions),
|
|
110
114
|
!!additionalOptions?.length && (React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } }, additionalOptions.map((additionalOption) => (React.createElement(Option, { key: additionalOption.value, onClick: handleAdditionalChange, selected: additionalSelected === additionalOption.value, label: additionalOption.label, value: additionalOption.value }))))))))));
|
|
111
115
|
};
|
|
112
116
|
const Wrapper = styled.div `
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface CommentProps {
|
|
3
|
+
avatarTooltipContent?: React.ReactElement;
|
|
3
4
|
content: string;
|
|
4
5
|
createdDate: Date;
|
|
5
6
|
hasMoreReplies?: boolean;
|
|
@@ -15,4 +16,4 @@ export interface CommentProps {
|
|
|
15
16
|
userReactions?: string[];
|
|
16
17
|
userProfileUri: string;
|
|
17
18
|
}
|
|
18
|
-
export declare const Comment: ({ content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, reactionModal, reactions, replies, userImageUri, userName, userReactions, userProfileUri, }: CommentProps) => React.JSX.Element;
|
|
19
|
+
export declare const Comment: ({ avatarTooltipContent, content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, reactionModal, reactions, replies, userImageUri, userName, userReactions, userProfileUri, }: CommentProps) => React.JSX.Element;
|
|
@@ -10,7 +10,7 @@ import { Styles } from '../../../common';
|
|
|
10
10
|
import { ThumbsUp, Comment as CommentIcon } from '../../../icons';
|
|
11
11
|
import { abbrTimeBeforeDate } from './helpers';
|
|
12
12
|
const MAX_REACTIONS_SHOWN = 5;
|
|
13
|
-
export const Comment = ({ content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, reactionModal, reactions, replies, userImageUri, userName, userReactions, userProfileUri, }) => {
|
|
13
|
+
export const Comment = ({ avatarTooltipContent, content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, reactionModal, reactions, replies, userImageUri, userName, userReactions, userProfileUri, }) => {
|
|
14
14
|
const [showPicker, setShowPicker] = React.useState(false);
|
|
15
15
|
const [pickerTriggerLoc, setPickerTriggerLoc] = React.useState({
|
|
16
16
|
x: 0,
|
|
@@ -66,7 +66,7 @@ export const Comment = ({ content, createdDate, hasMoreReplies, id, onComment, o
|
|
|
66
66
|
React.createElement(ReplyIndicator, null)));
|
|
67
67
|
});
|
|
68
68
|
return (React.createElement(Wrapper, { id: id },
|
|
69
|
-
React.createElement(Avatar, { href: userProfileUri, image: userImageUri, size: 32 }),
|
|
69
|
+
React.createElement(Avatar, { href: userProfileUri, image: userImageUri, size: 32, tooltipContent: avatarTooltipContent }),
|
|
70
70
|
React.createElement(Box, { "$flex": 1, "$dir": "column" },
|
|
71
71
|
React.createElement(ContentWrapper, { "$hasReplies": hasReplies || !!hasMoreReplies },
|
|
72
72
|
React.createElement(CommentBox, null,
|
|
@@ -5,6 +5,7 @@ export interface PostProps extends React.PropsWithChildren {
|
|
|
5
5
|
authorActive?: boolean;
|
|
6
6
|
authorHref: string;
|
|
7
7
|
authorImage: string;
|
|
8
|
+
avatarTooltipContent?: React.ReactElement;
|
|
8
9
|
content: string;
|
|
9
10
|
createdDate: string;
|
|
10
11
|
dropdown?: React.ReactElement;
|
|
@@ -14,4 +15,4 @@ export interface PostProps extends React.PropsWithChildren {
|
|
|
14
15
|
isPaywalled?: boolean;
|
|
15
16
|
onJoin?: () => void;
|
|
16
17
|
}
|
|
17
|
-
export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, dropdown, hasComments, id, images, isPaywalled, onJoin, }: PostProps) => React.JSX.Element;
|
|
18
|
+
export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, avatarTooltipContent, children, content, createdDate, dropdown, hasComments, id, images, isPaywalled, onJoin, }: PostProps) => React.JSX.Element;
|
|
@@ -6,14 +6,14 @@ import { Button } from '../../actions/button';
|
|
|
6
6
|
import { Avatar } from '../../iconography/avatar';
|
|
7
7
|
import { Lock } from '../../../icons';
|
|
8
8
|
import { abbrTimeBeforeDate } from './helpers';
|
|
9
|
-
export const Post = ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, dropdown, hasComments, id, images, isPaywalled = false, onJoin, }) => {
|
|
9
|
+
export const Post = ({ actions, author, authorActive, authorHref, authorImage, avatarTooltipContent, children, content, createdDate, dropdown, hasComments, id, images, isPaywalled = false, onJoin, }) => {
|
|
10
10
|
const componentId = React.useId();
|
|
11
11
|
const _actions = React.Children.toArray(actions);
|
|
12
12
|
const _comments = React.Children.toArray(children);
|
|
13
13
|
const subtitle = abbrTimeBeforeDate(new Date(createdDate));
|
|
14
14
|
return (React.createElement(Wrapper, { id: id },
|
|
15
15
|
React.createElement(Header, null,
|
|
16
|
-
React.createElement(Avatar, { href: authorHref, image: authorImage, size: 64, status: authorActive ? 'online' : undefined, subtitle: React.createElement(P, { as: "span", sx: "vertical-align: top;", "$fontSize": 14, "$lineHeight": 20 }, subtitle), title: React.createElement(H, { as: "span", "$bold": true, "$fontSize": 18, "$lineHeight": 26 }, author), textPosition: "right" }),
|
|
16
|
+
React.createElement(Avatar, { href: authorHref, image: authorImage, size: 64, status: authorActive ? 'online' : undefined, subtitle: React.createElement(P, { as: "span", sx: "vertical-align: top;", "$fontSize": 14, "$lineHeight": 20 }, subtitle), title: React.createElement(H, { as: "span", "$bold": true, "$fontSize": 18, "$lineHeight": 26 }, author), textPosition: "right", tooltipContent: avatarTooltipContent }),
|
|
17
17
|
dropdown),
|
|
18
18
|
!!content?.length && (React.createElement("div", { style: { padding: 24 } },
|
|
19
19
|
React.createElement(P, { "$textClampLines": isPaywalled ? 2 : undefined }, content))),
|