@soul-refiner/design-system 0.2.32 → 0.2.33

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.
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface PostProps extends React.PropsWithChildren {
3
+ actions?: React.ReactNode;
3
4
  author: string;
4
5
  authorActive?: boolean;
5
6
  authorHref: string;
@@ -9,4 +10,4 @@ export interface PostProps extends React.PropsWithChildren {
9
10
  images?: string[];
10
11
  onComment: (comment: string) => void;
11
12
  }
12
- export declare const Post: ({ author, authorActive, authorHref, authorImage, children, content, createdDate, images, onComment, }: PostProps) => React.JSX.Element;
13
+ export declare const Post: ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, images, onComment, }: PostProps) => React.JSX.Element;
@@ -3,9 +3,10 @@ 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 = ({ author, authorActive, authorHref, authorImage, children, content, createdDate, images, onComment, }) => {
6
+ export const Post = ({ actions, author, authorActive, authorHref, authorImage, children, content, createdDate, images, onComment, }) => {
7
7
  const id = React.useId();
8
8
  const [comment, setComment] = React.useState('');
9
+ const _actions = React.Children.toArray(actions);
9
10
  const _comments = React.Children.toArray(children);
10
11
  const handleCommentChange = (event) => {
11
12
  setComment(event.target.value);
@@ -27,7 +28,8 @@ export const Post = ({ author, authorActive, authorHref, authorImage, children,
27
28
  images.length > 4 && (React.createElement(H, { as: "p", className: "more-than", "$color": "grey-10", "$fontSize": 28, "$lineHeight": 36, "$semiBold": true },
28
29
  "+",
29
30
  images.length - 4)))),
30
- !!_comments.length && React.createElement(CommentWrapper, null, children),
31
+ !!_comments.length && React.createElement(CommentWrapper, null, _comments),
32
+ !!_actions.length && React.createElement(ActionsWrapper, null, _actions),
31
33
  React.createElement(CommentInputWrapper, { onSubmit: handleCommentSubmit },
32
34
  React.createElement(Avatar, { href: authorHref, image: authorImage, size: 40 }),
33
35
  React.createElement(TextInput, { bg: "var(--color-grey-10)", placeholder: "Write a comment", onChange: handleCommentChange, value: comment }))));
@@ -96,6 +98,13 @@ const ImageWrapper = styled.div `
96
98
  flex: 1;
97
99
  min-width: min(227px, 80vw);
98
100
  `;
101
+ const ActionsWrapper = styled.div `
102
+ display: flex;
103
+ justify-content: space-around;
104
+ align-items: center;
105
+ padding: 24px;
106
+ border-bottom: 1px solid var(--color-grey-9);
107
+ `;
99
108
  const CommentWrapper = styled.div `
100
109
  padding: 24px;
101
110
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.32",
3
+ "version": "0.2.33",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -24,14 +24,14 @@
24
24
  }
25
25
  },
26
26
  "devDependencies": {
27
- "@storybook/addon-essentials": "^7.0.10",
28
- "@storybook/addon-interactions": "^7.0.10",
29
- "@storybook/addon-links": "^7.0.10",
30
- "@storybook/addons": "^7.0.10",
31
- "@storybook/blocks": "^7.0.10",
32
- "@storybook/react": "^7.0.10",
33
- "@storybook/react-vite": "^7.0.10",
34
- "@storybook/testing-library": "^0.0.14-next.2",
27
+ "@storybook/addon-essentials": "^7.2.1",
28
+ "@storybook/addon-interactions": "^7.2.1",
29
+ "@storybook/addon-links": "^7.2.1",
30
+ "@storybook/addons": "^7.2.1",
31
+ "@storybook/blocks": "^7.2.1",
32
+ "@storybook/react": "^7.2.1",
33
+ "@storybook/react-vite": "^7.2.1",
34
+ "@storybook/testing-library": "^0.2.0",
35
35
  "@types/styled-components": "^5.1.26",
36
36
  "@typescript-eslint/eslint-plugin": "^5.59.5",
37
37
  "@typescript-eslint/parser": "^5.59.5",
@@ -42,7 +42,7 @@
42
42
  "prettier": "^2.8.8",
43
43
  "pretty-quick": "^3.1.3",
44
44
  "prop-types": "^15.8.1",
45
- "storybook": "^7.0.10",
45
+ "storybook": "^7.2.1",
46
46
  "tsconfig-paths-webpack-plugin": "^4.0.1",
47
47
  "typescript": "^5.0.4",
48
48
  "vite": "^4.3.5",