@soul-refiner/design-system 0.2.20 → 0.2.22

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.
@@ -11,7 +11,7 @@ export const ActionCard = ({ actions, content, href, image, logo, subtitle, sx,
11
11
  React.createElement(LogoWrapper, null, logo),
12
12
  React.createElement(H, { as: "span", "$mediumBold": true, "$color": "grey-2", "$fontSize": 18, "$lineHeight": 26 }, title),
13
13
  React.createElement(P, { as: "span", "$color": "grey-4", "$fontSize": 12, "$lineHeight": 16 }, subtitle),
14
- React.createElement(P, { as: "span", "$color": "grey-3", "$fontSize": 14, "$lineHeight": 20, "$textAlign": "center", sx: "margin-top: 12px;" }, content),
14
+ React.createElement(P, { as: "span", "$color": "grey-3", "$fontSize": 14, "$lineHeight": 20, "$textAlign": "center", "$textClampLines": 3, sx: "margin-top: 12px;" }, content),
15
15
  React.createElement(Box, { "$display": "flex", "$dir": "row", "$gap": 8, sx: "margin-top: 8px; width: 100%;" }, React.Children.toArray(actions))))));
16
16
  };
17
17
  const Wrapper = styled.div `
@@ -29,10 +29,17 @@ const Action = styled.figure `
29
29
  flex-flow: column nowrap;
30
30
  justify-content: flex-end;
31
31
  box-shadow: var(--elevation-1);
32
+ border: 1px solid transparent;
33
+ box-sizing: border-box;
34
+
35
+ &:hover {
36
+ border-color: var(--color-primary-blue-3);
37
+ }
32
38
 
33
39
  & > img {
34
40
  aspect-ratio: 310 / 160;
35
41
  border-radius: 16px 16px 0px 0px;
42
+ object-fit: cover;
36
43
  }
37
44
 
38
45
  ${({ $sx }) => ($sx ? $sx : '')};
@@ -42,8 +49,8 @@ const Figcaption = styled.figcaption `
42
49
  display: flex;
43
50
  align-items: center;
44
51
  flex-flow: column nowrap;
45
- aspect-ratio: 310 / 198;
46
- padding: 56px 16px 16px;
52
+ aspect-ratio: 310 / 214;
53
+ padding: 36px 16px 16px;
47
54
  box-sizing: border-box;
48
55
  background-color: var(--color-white);
49
56
  border-radius: 0px 0px 15px 15px;
@@ -3,7 +3,7 @@ import { TElement } from '@udecode/plate';
3
3
  export interface EditorProps {
4
4
  communityName: string;
5
5
  editable: boolean;
6
- handleUploadImage: (dataURL: File) => Promise<string>;
6
+ handleUploadImage: (files: FileList) => Promise<string>;
7
7
  onChange: (newNodes: TElement[]) => void;
8
8
  }
9
9
  export declare const Editor: ({ editable, handleUploadImage, onChange, }: EditorProps) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface EditorBarProps {
3
- handleUploadImage: (dataURL: File) => Promise<string>;
3
+ handleUploadImage: (files: FileList) => Promise<string>;
4
4
  }
5
5
  export declare const EditorBar: ({ handleUploadImage }: EditorBarProps) => React.JSX.Element;
6
6
  export declare const MenuButton: import("styled-components").IStyledComponent<"web", "button", {
@@ -59,20 +59,20 @@ export const EditorBar = ({ handleUploadImage }) => {
59
59
  },
60
60
  ]);
61
61
  };
62
- const handleImageChange = async (event) => {
63
- const file = event.target?.files?.[0];
64
- if (!file)
62
+ const handleImageChange = async () => {
63
+ const files = imageRef.current?.files;
64
+ if (!files)
65
65
  return;
66
- const imageurl = await handleUploadImage(file);
66
+ const imageurl = await handleUploadImage(files);
67
67
  if (imageurl) {
68
68
  insertImage(editorRef, imageurl);
69
69
  }
70
70
  };
71
71
  const handleRedo = () => editorRef.redo();
72
72
  const handleUndo = () => editorRef.undo();
73
- const handleVideoChange = async (event) => {
74
- const file = event.target?.files?.[0];
75
- if (!file)
73
+ const handleVideoChange = async () => {
74
+ const files = videoRef.current?.files;
75
+ if (!files)
76
76
  return;
77
77
  /**
78
78
  * TODO: Insert video component
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export interface EditorBarProps {
3
- handleUploadImage: (dataURL: File) => Promise<string>;
3
+ handleUploadImage: (files: FileList) => Promise<string>;
4
4
  }
5
5
  export declare const EditorBar: ({ handleUploadImage }: EditorBarProps) => React.JSX.Element;
6
6
  export declare const MenuButton: import("styled-components").IStyledComponent<"web", "button", {
@@ -23,11 +23,11 @@ export const EditorBar = ({ handleUploadImage }) => {
23
23
  nodeType: ELEMENT_UL,
24
24
  });
25
25
  const { props: { pressed: currUnorderedList, onClick: handleUnorderedList }, } = useListToolbarButton(unorderedListState);
26
- const handleImageChange = async (event) => {
27
- const file = event.target?.files?.[0];
28
- if (!file)
26
+ const handleImageChange = async () => {
27
+ const files = imageRef.current?.files;
28
+ if (!files)
29
29
  return;
30
- const imageurl = await handleUploadImage(file);
30
+ const imageurl = await handleUploadImage(files);
31
31
  if (imageurl) {
32
32
  insertImage(editorRef, imageurl);
33
33
  }
@@ -3,7 +3,7 @@ import { TElement } from '@udecode/plate';
3
3
  export interface SimpleEditorProps {
4
4
  communityName: string;
5
5
  editable: boolean;
6
- handleUploadImage: (dataURL: File) => Promise<string>;
6
+ handleUploadImage: (files: FileList) => Promise<string>;
7
7
  onChange: (newNodes: TElement[]) => void;
8
8
  placeholder?: string;
9
9
  }
@@ -27,6 +27,8 @@ export const SimpleEditor = ({ editable, handleUploadImage, onChange, placeholde
27
27
  };
28
28
  const InnerWrapper = styled.div `
29
29
  padding: 24px;
30
+ min-height: 224px;
31
+ box-sizing: border-box;
30
32
  `;
31
33
  const Wrapper = styled.div `
32
34
  position: relative;
@@ -7,13 +7,6 @@ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, i
7
7
  const id = React.useId();
8
8
  const isMultiple = multiple;
9
9
  const [multipleValueToAdd, setMultipleValueToAdd] = React.useState('');
10
- /**
11
- * @todo make multiple wrapper a form
12
- * on enter set multiple change and clear local value
13
- * use local value to be text box
14
- * have text box be flex shrink competing with chips
15
- *
16
- */
17
10
  const handleMultipleValueToAdd = (event) => {
18
11
  setMultipleValueToAdd(event.target.value);
19
12
  };
@@ -29,6 +22,10 @@ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, i
29
22
  onMultipleChange(value.slice(0, value.length - 1));
30
23
  }
31
24
  };
25
+ /**
26
+ * when a user presses enter (submit) add the input to the values
27
+ * but don't add the same value twice
28
+ */
32
29
  const handleMultipleAdd = (event) => {
33
30
  event.stopPropagation();
34
31
  event.preventDefault();
@@ -38,6 +35,9 @@ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, i
38
35
  }
39
36
  setMultipleValueToAdd('');
40
37
  };
38
+ /**
39
+ * when the user clicks on the chip to remove it, remove it from the value
40
+ */
41
41
  const handleMultipleItemRemoval = (removalItem) => {
42
42
  onMultipleChange &&
43
43
  onMultipleChange(value.filter((item) => item !== removalItem));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soul-refiner/design-system",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "publishConfig": {