norma-library 0.5.805 → 0.5.807
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/esm/components/ChatMessageBalloon/ChatMessageBalloon.js +3 -2
- package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.js.map +1 -1
- package/dist/esm/components/Modal.js +2 -1
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/interfaces/ChatMessageBalloon.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ChatMessageBalloon/ChatMessageBalloon.tsx +2 -0
- package/src/components/Modal.tsx +1 -1
- package/src/interfaces/ChatMessageBalloon.ts +1 -0
- package/src/stories/ChatMessageBalloon.stories.tsx +44 -0
|
@@ -3,7 +3,7 @@ import React, { useMemo } from 'react';
|
|
|
3
3
|
import { Typography } from '@mui/material';
|
|
4
4
|
import * as S from './ChatMessageBalloon.style';
|
|
5
5
|
export var ChatMessageBalloon = function (_a) {
|
|
6
|
-
var label = _a.label, description = _a.description, date = _a.date, direction = _a.direction, children = _a.children, className = _a.className, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onRowMouseEnter = _a.onRowMouseEnter, onRowMouseLeave = _a.onRowMouseLeave, highlight = _a.highlight, rest = __rest(_a, ["label", "description", "date", "direction", "children", "className", "onMouseEnter", "onMouseLeave", "onRowMouseEnter", "onRowMouseLeave", "highlight"]);
|
|
6
|
+
var label = _a.label, description = _a.description, date = _a.date, direction = _a.direction, children = _a.children, className = _a.className, bottomChildren = _a.bottomChildren, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onRowMouseEnter = _a.onRowMouseEnter, onRowMouseLeave = _a.onRowMouseLeave, highlight = _a.highlight, rest = __rest(_a, ["label", "description", "date", "direction", "children", "className", "bottomChildren", "onMouseEnter", "onMouseLeave", "onRowMouseEnter", "onRowMouseLeave", "highlight"]);
|
|
7
7
|
var ballonClassNames = useMemo(function () {
|
|
8
8
|
var classNames = [];
|
|
9
9
|
if (!!onMouseEnter)
|
|
@@ -23,6 +23,7 @@ export var ChatMessageBalloon = function (_a) {
|
|
|
23
23
|
description),
|
|
24
24
|
React.createElement(S.ChatMessageChildrenStyle, { direction: direction }, children)),
|
|
25
25
|
React.createElement(S.ChatMessageBalloonRowStyle, { direction: direction },
|
|
26
|
-
React.createElement(S.ChatMessageDateStyle, { fontSize: "0.7rem" }, date)
|
|
26
|
+
React.createElement(S.ChatMessageDateStyle, { fontSize: "0.7rem" }, date),
|
|
27
|
+
bottomChildren)));
|
|
27
28
|
};
|
|
28
29
|
//# sourceMappingURL=ChatMessageBalloon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessageBalloon.js","sourceRoot":"","sources":["../../../../src/components/ChatMessageBalloon/ChatMessageBalloon.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAA;AAE/C,MAAM,CAAC,IAAM,kBAAkB,GAAsC,UAAC,
|
|
1
|
+
{"version":3,"file":"ChatMessageBalloon.js","sourceRoot":"","sources":["../../../../src/components/ChatMessageBalloon/ChatMessageBalloon.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAA;AAE/C,MAAM,CAAC,IAAM,kBAAkB,GAAsC,UAAC,EAcnE;IAbC,IAAA,KAAK,WAAA,EACL,WAAW,iBAAA,EACX,IAAI,UAAA,EACJ,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,cAAc,oBAAA,EACd,YAAY,kBAAA,EACZ,YAAY,kBAAA,EACZ,eAAe,q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() {
|
|
|
14
14
|
React.createElement("path", { clipRule: "evenodd", fillRule: "evenodd", d: "M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z" })));
|
|
15
15
|
}
|
|
16
16
|
export var Modal = function (_a) {
|
|
17
|
+
var _b;
|
|
17
18
|
var open = _a.open, children = _a.children, paperProps = _a.paperProps, props = __rest(_a, ["open", "children", "paperProps"]);
|
|
18
19
|
return (React.createElement(ModalStyled, __assign({ open: true }, props),
|
|
19
20
|
React.createElement(ModalContentStyled, __assign({}, paperProps),
|
|
@@ -22,7 +23,7 @@ export var Modal = function (_a) {
|
|
|
22
23
|
React.createElement(IconButton, { onClick: props.onClose, size: "small", color: "inherit", variant: "text", cursor: "pointer", sx: { padding: "0" } },
|
|
23
24
|
React.createElement(Close, null)))),
|
|
24
25
|
React.createElement(ModalContainerChildrenStyled, null, children),
|
|
25
|
-
props.action && (React.createElement(ModalFooterStyled, null, props.action.map(function (_a, key) {
|
|
26
|
+
!!((_b = props.action) === null || _b === void 0 ? void 0 : _b.length) && (React.createElement(ModalFooterStyled, null, props.action.map(function (_a, key) {
|
|
26
27
|
var color = _a.color, variant = _a.variant, action = _a.action, size = _a.size, label = _a.label, rest = __rest(_a, ["color", "variant", "action", "size", "label"]);
|
|
27
28
|
return (React.createElement(Button, __assign({ color: color, variant: variant, key: key, onClick: action, size: size }, rest), label));
|
|
28
29
|
}))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE1E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AG,EAAC;oBAElB,oBAAC,KAAK,OAAG,CACE,CACK,CACrB;YACD,oBAAC,4BAA4B,QAC1B,QAAQ,CACoB;YAC9B,CAAC,CAAC,CAAA,MAAA,KAAK,CAAC,MAAM,0CAAE,MAAM,CAAA,IAAK,CAC1B,oBAAC,iBAAiB,QACf,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,EAA8C,EAAE,GAAG;gBAAlD,IAAA,KAAK,WAAA,EAAE,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA,EAAK,IAAI,cAA7C,+CAA8C,CAAD;gBAAW,OAAA,CACzE,oBAAC,MAAM,aACL,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,IACN,IAAI,GAEP,KAAK,CACC,CACV,CAAA;aAAA,CAAC,CACgB,CACrB,CACkB,CACT,CACf,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "norma-library",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.807",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@ export const ChatMessageBalloon: React.FC<ChatMessageBalloonProps> = ({
|
|
|
10
10
|
direction,
|
|
11
11
|
children,
|
|
12
12
|
className,
|
|
13
|
+
bottomChildren,
|
|
13
14
|
onMouseEnter,
|
|
14
15
|
onMouseLeave,
|
|
15
16
|
onRowMouseEnter,
|
|
@@ -47,6 +48,7 @@ export const ChatMessageBalloon: React.FC<ChatMessageBalloonProps> = ({
|
|
|
47
48
|
</S.ChatMessageBalloonRowStyle>
|
|
48
49
|
<S.ChatMessageBalloonRowStyle direction={direction}>
|
|
49
50
|
<S.ChatMessageDateStyle fontSize={"0.7rem"}>{date}</S.ChatMessageDateStyle>
|
|
51
|
+
{bottomChildren}
|
|
50
52
|
</S.ChatMessageBalloonRowStyle>
|
|
51
53
|
</S.ChatMessageBalloonContainerStyle>
|
|
52
54
|
);
|
package/src/components/Modal.tsx
CHANGED
|
@@ -91,7 +91,7 @@ export const Modal = ({ open, children, paperProps, ...props }: ModalBaseProps)
|
|
|
91
91
|
<ModalContainerChildrenStyled>
|
|
92
92
|
{children}
|
|
93
93
|
</ModalContainerChildrenStyled>
|
|
94
|
-
{props.action
|
|
94
|
+
{!!props.action?.length && (
|
|
95
95
|
<ModalFooterStyled>
|
|
96
96
|
{props.action.map(({color, variant, action, size, label, ...rest}, key) => (
|
|
97
97
|
<Button
|
|
@@ -22,6 +22,7 @@ export const ChatMessageBalloonBasic = () => {
|
|
|
22
22
|
<div style={{backgroundColor: "#F0F0F0", boxSizing: "border-box", padding: "20px"}}>
|
|
23
23
|
<ChatMessageBalloon
|
|
24
24
|
onMouseEnter={ () => console.log('onMouseEnter') }
|
|
25
|
+
bottomChildren={<div>Bottom Children</div>}
|
|
25
26
|
label="Agente Marcos"
|
|
26
27
|
description={
|
|
27
28
|
<Typography
|
|
@@ -59,6 +60,49 @@ export const ChatMessageBalloonBasic = () => {
|
|
|
59
60
|
justifyContent: "center"
|
|
60
61
|
}}>{"2"}</span>
|
|
61
62
|
</ChatMessageBalloon>
|
|
63
|
+
|
|
64
|
+
<ChatMessageBalloon
|
|
65
|
+
onMouseEnter={ () => console.log('onMouseEnter') }
|
|
66
|
+
bottomChildren={<div>Bottom children</div>}
|
|
67
|
+
label="Agente Marcos"
|
|
68
|
+
description={
|
|
69
|
+
<Typography
|
|
70
|
+
variant="body1"
|
|
71
|
+
style={{
|
|
72
|
+
fontSize: "16px"
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
{"Olá, tudo bem? Meu nome é Ana e falo em nome do banco Bradesco. Eu gostaria de falar com Maria Conceição da Silva"}
|
|
76
|
+
</Typography>
|
|
77
|
+
}
|
|
78
|
+
date={"10:23"}
|
|
79
|
+
direction="O"
|
|
80
|
+
attachments={[]}
|
|
81
|
+
>
|
|
82
|
+
<span style={{
|
|
83
|
+
height: "38px",
|
|
84
|
+
width: "38px",
|
|
85
|
+
border: "1px solid #FF8348",
|
|
86
|
+
borderRadius: "38px",
|
|
87
|
+
backgroundColor: "#FFF",
|
|
88
|
+
display: "flex",
|
|
89
|
+
alignItems: "center",
|
|
90
|
+
justifyContent: "center",
|
|
91
|
+
marginRight: "10px"
|
|
92
|
+
}}>{"1"}</span>
|
|
93
|
+
<span style={{
|
|
94
|
+
height: "38px",
|
|
95
|
+
width: "38px",
|
|
96
|
+
border: "1px solid #FF8348",
|
|
97
|
+
borderRadius: "38px",
|
|
98
|
+
backgroundColor: "#FFF",
|
|
99
|
+
display: "flex",
|
|
100
|
+
alignItems: "center",
|
|
101
|
+
justifyContent: "center"
|
|
102
|
+
}}>{"2"}</span>
|
|
103
|
+
</ChatMessageBalloon>
|
|
62
104
|
</div>
|
|
105
|
+
|
|
106
|
+
|
|
63
107
|
);
|
|
64
108
|
};
|