@soul-refiner/design-system 0.2.33 → 0.2.35
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.
|
@@ -7,39 +7,40 @@ export interface HeadingProps extends CommonProps {
|
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
$fontSize?: 16 | 18 | 20 | 24 | 28 | 32 | 36 | 40 | 48;
|
|
9
9
|
$lineHeight?: 64 | 60 | 54 | 48 | 36 | 28 | 26;
|
|
10
|
+
$sx?: string;
|
|
10
11
|
}
|
|
11
12
|
export declare const H: {
|
|
12
|
-
(args: HeadingProps): React.JSX.Element;
|
|
13
|
+
({ sx, ...args }: HeadingProps): React.JSX.Element;
|
|
13
14
|
One: {
|
|
14
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
15
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
15
16
|
displayName: string;
|
|
16
17
|
};
|
|
17
18
|
Two: {
|
|
18
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
19
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
19
20
|
displayName: string;
|
|
20
21
|
};
|
|
21
22
|
Three: {
|
|
22
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
23
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
23
24
|
displayName: string;
|
|
24
25
|
};
|
|
25
26
|
Four: {
|
|
26
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
27
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
27
28
|
displayName: string;
|
|
28
29
|
};
|
|
29
30
|
Five: {
|
|
30
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
31
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
31
32
|
displayName: string;
|
|
32
33
|
};
|
|
33
34
|
Six: {
|
|
34
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
35
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
35
36
|
displayName: string;
|
|
36
37
|
};
|
|
37
38
|
Seven: {
|
|
38
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
39
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
39
40
|
displayName: string;
|
|
40
41
|
};
|
|
41
42
|
Eight: {
|
|
42
|
-
({ ...rest }: CommonProps): React.JSX.Element;
|
|
43
|
+
({ sx, ...rest }: CommonProps): React.JSX.Element;
|
|
43
44
|
displayName: string;
|
|
44
45
|
};
|
|
45
46
|
};
|
|
@@ -6,29 +6,30 @@ const StyledH = styled(Typography) `
|
|
|
6
6
|
font-size: ${({ $fontSize }) => $fontSize + 'px'};
|
|
7
7
|
line-height: ${({ $lineHeight }) => $lineHeight + 'px'};
|
|
8
8
|
text-align: ${({ $textAlign }) => $textAlign || 'left'};
|
|
9
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
9
10
|
`;
|
|
10
|
-
export const H = (args) => React.createElement(StyledH, { ...args });
|
|
11
|
-
const One = ({ ...rest }) => (React.createElement(StyledH, { as: 'h1', "$fontSize": 48, "$lineHeight": 64, ...rest }));
|
|
11
|
+
export const H = ({ sx, ...args }) => (React.createElement(StyledH, { "$sx": sx, ...args }));
|
|
12
|
+
const One = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h1', "$fontSize": 48, "$lineHeight": 64, "$sx": sx, ...rest }));
|
|
12
13
|
One.displayName = 'H.One';
|
|
13
14
|
H.One = One;
|
|
14
|
-
const Two = ({ ...rest }) => (React.createElement(StyledH, { as: 'h2', "$fontSize": 40, "$lineHeight": 60, ...rest }));
|
|
15
|
+
const Two = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h2', "$fontSize": 40, "$lineHeight": 60, "$sx": sx, ...rest }));
|
|
15
16
|
Two.displayName = 'H.Two';
|
|
16
17
|
H.Two = Two;
|
|
17
|
-
const Three = ({ ...rest }) => (React.createElement(StyledH, { as: 'h3', "$fontSize": 36, "$lineHeight": 54, ...rest }));
|
|
18
|
+
const Three = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h3', "$fontSize": 36, "$lineHeight": 54, "$sx": sx, ...rest }));
|
|
18
19
|
Three.displayName = 'H.Three';
|
|
19
20
|
H.Three = Three;
|
|
20
|
-
const Four = ({ ...rest }) => (React.createElement(StyledH, { as: 'h4', "$fontSize": 32, "$lineHeight": 48, ...rest }));
|
|
21
|
+
const Four = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h4', "$fontSize": 32, "$lineHeight": 48, "$sx": sx, ...rest }));
|
|
21
22
|
Four.displayName = 'H.Four';
|
|
22
23
|
H.Four = Four;
|
|
23
|
-
const Five = ({ ...rest }) => (React.createElement(StyledH, { as: 'h5', "$fontSize": 28, "$lineHeight": 36, ...rest }));
|
|
24
|
+
const Five = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h5', "$fontSize": 28, "$lineHeight": 36, "$sx": sx, ...rest }));
|
|
24
25
|
Five.displayName = 'H.Five';
|
|
25
26
|
H.Five = Five;
|
|
26
|
-
const Six = ({ ...rest }) => (React.createElement(StyledH, { as: 'h6', "$fontSize": 24, "$lineHeight": 36, ...rest }));
|
|
27
|
+
const Six = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h6', "$fontSize": 24, "$lineHeight": 36, "$sx": sx, ...rest }));
|
|
27
28
|
Six.displayName = 'H.Six';
|
|
28
29
|
H.Six = Six;
|
|
29
|
-
const Seven = ({ ...rest }) => (React.createElement(StyledH, { as: 'h6', "$fontSize": 20, "$lineHeight": 28, ...rest }));
|
|
30
|
+
const Seven = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h6', "$fontSize": 20, "$lineHeight": 28, "$sx": sx, ...rest }));
|
|
30
31
|
Seven.displayName = 'H.Seven';
|
|
31
32
|
H.Seven = Seven;
|
|
32
|
-
const Eight = ({ ...rest }) => (React.createElement(StyledH, { as: 'h6', "$fontSize": 18, "$lineHeight": 26, ...rest }));
|
|
33
|
+
const Eight = ({ sx, ...rest }) => (React.createElement(StyledH, { as: 'h6', "$fontSize": 18, "$lineHeight": 26, "$sx": sx, ...rest }));
|
|
33
34
|
Eight.displayName = 'H.Eight';
|
|
34
35
|
H.Eight = Eight;
|
|
@@ -7,7 +7,9 @@ export interface PostProps extends React.PropsWithChildren {
|
|
|
7
7
|
authorImage: string;
|
|
8
8
|
content: string;
|
|
9
9
|
createdDate: string;
|
|
10
|
+
hasComments?: boolean;
|
|
11
|
+
id?: string;
|
|
10
12
|
images?: string[];
|
|
11
13
|
onComment: (comment: string) => void;
|
|
12
14
|
}
|
|
13
|
-
export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, images, onComment, }: PostProps) => React.JSX.Element;
|
|
15
|
+
export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, hasComments, images, onComment, }: PostProps) => React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { Avatar, H, P, TextInput } from '../../';
|
|
5
5
|
import { abbrTimeBeforeDate } from './helpers';
|
|
6
|
-
export const Post = ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, images, onComment, }) => {
|
|
6
|
+
export const Post = ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, hasComments, images, onComment, }) => {
|
|
7
7
|
const id = React.useId();
|
|
8
8
|
const [comment, setComment] = React.useState('');
|
|
9
9
|
const _actions = React.Children.toArray(actions);
|
|
@@ -18,7 +18,7 @@ export const Post = ({ actions, author, authorActive, authorHref, authorImage, c
|
|
|
18
18
|
setComment('');
|
|
19
19
|
};
|
|
20
20
|
const subtitle = abbrTimeBeforeDate(new Date(createdDate));
|
|
21
|
-
return (React.createElement(Wrapper,
|
|
21
|
+
return (React.createElement(Wrapper, { id: id },
|
|
22
22
|
React.createElement(Header, null,
|
|
23
23
|
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" })),
|
|
24
24
|
React.createElement(P, { "$sx": "padding: 24px;" }, content),
|
|
@@ -28,11 +28,11 @@ export const Post = ({ actions, author, authorActive, authorHref, authorImage, c
|
|
|
28
28
|
images.length > 4 && (React.createElement(H, { as: "p", className: "more-than", "$color": "grey-10", "$fontSize": 28, "$lineHeight": 36, "$semiBold": true },
|
|
29
29
|
"+",
|
|
30
30
|
images.length - 4)))),
|
|
31
|
-
!!_comments.length && React.createElement(CommentWrapper, null, _comments),
|
|
31
|
+
hasComments && !!_comments.length && (React.createElement(CommentWrapper, null, _comments)),
|
|
32
32
|
!!_actions.length && React.createElement(ActionsWrapper, null, _actions),
|
|
33
|
-
React.createElement(CommentInputWrapper, { onSubmit: handleCommentSubmit },
|
|
33
|
+
hasComments && (React.createElement(CommentInputWrapper, { onSubmit: handleCommentSubmit },
|
|
34
34
|
React.createElement(Avatar, { href: authorHref, image: authorImage, size: 40 }),
|
|
35
|
-
React.createElement(TextInput, { bg: "var(--color-grey-10)", placeholder: "Write a comment", onChange: handleCommentChange, value: comment }))));
|
|
35
|
+
React.createElement(TextInput, { bg: "var(--color-grey-10)", placeholder: "Write a comment", onChange: handleCommentChange, value: comment })))));
|
|
36
36
|
};
|
|
37
37
|
const Wrapper = styled.div `
|
|
38
38
|
max-width: 700px;
|