@ayseaistudio/ui-components 3.4.0 → 3.5.0
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/ChatMessage/ChatMessage.d.ts +25 -0
- package/dist/ChatMessage/ChatMessage.js +16 -0
- package/dist/ChatMessage/index.d.ts +1 -0
- package/dist/ChatMessage/index.js +1 -0
- package/dist/ChatMessage/style.css +87 -0
- package/dist/ProfileSelector/style.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import "./style.css";
|
|
3
|
+
interface Props {
|
|
4
|
+
className?: any;
|
|
5
|
+
divClassName?: any;
|
|
6
|
+
text?: string;
|
|
7
|
+
frameClassName?: any;
|
|
8
|
+
avatarColor?: "grey" | "lime" | "mauve" | "zest" | "blue" | "green" | "galliano" | "orange" | "red";
|
|
9
|
+
timestamp?: string;
|
|
10
|
+
avatarLetter?: string;
|
|
11
|
+
highlighted?: boolean;
|
|
12
|
+
avatarPosition?: "left" | "right";
|
|
13
|
+
showAvatar?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ChatMessage: {
|
|
16
|
+
({ className, divClassName, text, frameClassName, avatarColor, timestamp, avatarLetter, highlighted, avatarPosition, showAvatar, }: Props): React.JSX.Element;
|
|
17
|
+
propTypes: {
|
|
18
|
+
hasDiv: PropTypes.Requireable<boolean>;
|
|
19
|
+
text: PropTypes.Requireable<string>;
|
|
20
|
+
avatarColor: PropTypes.Requireable<string>;
|
|
21
|
+
showAvatar: PropTypes.Requireable<boolean>;
|
|
22
|
+
avatarPosition: PropTypes.Requireable<string>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import "./style.css";
|
|
4
|
+
import { Avatar } from "../Avatar/Avatar";
|
|
5
|
+
import { Label } from "../Label/Label";
|
|
6
|
+
export const ChatMessage = ({ className, divClassName, text, frameClassName, avatarColor = "lime", timestamp, avatarLetter, highlighted, avatarPosition = "right", showAvatar = true, }) => {
|
|
7
|
+
const frameElement = (_jsxs("div", { className: `frame-22 ${frameClassName}`, children: [showAvatar && (_jsx(Avatar, { color: avatarColor, letter: avatarLetter, size: "medium", status: "default", version: "default" })), _jsx(Label, { bold: "off", className: "label-9", color: "black", size: "small", spacing: "off", stroke: "off", text: timestamp, version: "secondary" })] }));
|
|
8
|
+
return (_jsxs("div", { className: `chat-message-right ${highlighted ? "highlighted" : ""} ${className}`, children: [avatarPosition === "left" && frameElement, _jsx("div", { className: "message-baloon", children: _jsx("p", { className: `p ${divClassName}`, children: text }) }), avatarPosition === "right" && frameElement] }));
|
|
9
|
+
};
|
|
10
|
+
ChatMessage.propTypes = {
|
|
11
|
+
hasDiv: PropTypes.bool,
|
|
12
|
+
text: PropTypes.string,
|
|
13
|
+
avatarColor: PropTypes.string,
|
|
14
|
+
showAvatar: PropTypes.bool,
|
|
15
|
+
avatarPosition: PropTypes.oneOf(["left", "right"]),
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChatMessage } from "./ChatMessage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChatMessage } from "./ChatMessage";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
.chat-message-right {
|
|
2
|
+
align-items: flex-start;
|
|
3
|
+
background-color: #f7f7f7;
|
|
4
|
+
border: 1px solid;
|
|
5
|
+
border-color: #e7e7e7;
|
|
6
|
+
border-radius: 16px;
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: 8px;
|
|
9
|
+
max-width: 560px;
|
|
10
|
+
padding: 12px;
|
|
11
|
+
position: relative;
|
|
12
|
+
width: 80%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.chat-message-right.highlighted {
|
|
16
|
+
background-color: rgba(113, 163, 13, 0.05);
|
|
17
|
+
border-color: rgba(152, 211, 23, 1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.chat-message-right .message-baloon {
|
|
21
|
+
align-items: flex-start;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex: 1;
|
|
24
|
+
flex-grow: 1;
|
|
25
|
+
gap: 12px;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.chat-message-right .message {
|
|
30
|
+
align-items: flex-end;
|
|
31
|
+
align-self: stretch;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex: 1;
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
gap: 4px;
|
|
36
|
+
justify-content: flex-end;
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.chat-message-right .frame-21 {
|
|
41
|
+
align-items: flex-start;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex: 1;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
flex-grow: 1;
|
|
46
|
+
gap: 6px;
|
|
47
|
+
position: relative;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.chat-message-right .text-wrapper-3 {
|
|
51
|
+
align-self: stretch;
|
|
52
|
+
color: #3d3d3d;
|
|
53
|
+
font-family: var(--b1-bold-font-family);
|
|
54
|
+
font-size: var(--b1-bold-font-size);
|
|
55
|
+
font-style: var(--b1-bold-font-style);
|
|
56
|
+
font-weight: var(--b1-bold-font-weight);
|
|
57
|
+
letter-spacing: var(--b1-bold-letter-spacing);
|
|
58
|
+
line-height: var(--b1-bold-line-height);
|
|
59
|
+
margin-top: -1.00px;
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.chat-message-right .p {
|
|
64
|
+
align-self: stretch;
|
|
65
|
+
color: #3d3d3d;
|
|
66
|
+
font-family: var(--b1-medium-font-family);
|
|
67
|
+
font-size: var(--b1-medium-font-size);
|
|
68
|
+
font-style: var(--b1-medium-font-style);
|
|
69
|
+
font-weight: var(--b1-medium-font-weight);
|
|
70
|
+
letter-spacing: var(--b1-medium-letter-spacing);
|
|
71
|
+
line-height: var(--b1-medium-line-height);
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.chat-message-right .frame-22 {
|
|
76
|
+
align-items: flex-end;
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
flex: 0 0 auto;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
gap: 6px;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.chat-message-right .label-9 {
|
|
86
|
+
padding: 0px;
|
|
87
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { MultipleAvatar } from "./MultipleAvatar/MultipleAvatar";
|
|
|
22
22
|
export { Profile } from "./Profile/Profile";
|
|
23
23
|
export { ProfileSelector } from "./ProfileSelector/ProfileSelector";
|
|
24
24
|
export { ChatMessageLeft } from "./ChatMessageLeft/ChatMessageLeft";
|
|
25
|
-
export {
|
|
25
|
+
export { ChatMessage } from "./ChatMessage/ChatMessage";
|
|
26
26
|
export { LabelCheckbox } from "./LabelCheckbox/LabelCheckbox";
|
|
27
27
|
export { Player } from "./Player/Player";
|
|
28
28
|
export { Radio } from "./Radio/Radio";
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { MultipleAvatar } from "./MultipleAvatar/MultipleAvatar";
|
|
|
22
22
|
export { Profile } from "./Profile/Profile";
|
|
23
23
|
export { ProfileSelector } from "./ProfileSelector/ProfileSelector";
|
|
24
24
|
export { ChatMessageLeft } from "./ChatMessageLeft/ChatMessageLeft";
|
|
25
|
-
export {
|
|
25
|
+
export { ChatMessage } from "./ChatMessage/ChatMessage";
|
|
26
26
|
export { LabelCheckbox } from "./LabelCheckbox/LabelCheckbox";
|
|
27
27
|
export { Player } from "./Player/Player";
|
|
28
28
|
export { Radio } from "./Radio/Radio";
|