norma-library 0.5.65 → 0.5.67

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.
Files changed (26) hide show
  1. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.d.ts +3 -0
  2. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.js +19 -0
  3. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.js.map +1 -0
  4. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.style.d.ts +16 -0
  5. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.style.js +13 -0
  6. package/dist/esm/components/ChatMessageBalloon/ChatMessageBalloon.style.js.map +1 -0
  7. package/dist/esm/components/ProgressBar.d.ts +1 -1
  8. package/dist/esm/components/ProgressBar.js +2 -2
  9. package/dist/esm/components/ProgressBar.js.map +1 -1
  10. package/dist/esm/components/index.d.ts +1 -0
  11. package/dist/esm/components/index.js +1 -0
  12. package/dist/esm/components/index.js.map +1 -1
  13. package/dist/esm/interfaces/ChatMessageBalloon.d.ts +9 -0
  14. package/dist/esm/interfaces/ChatMessageBalloon.js +2 -0
  15. package/dist/esm/interfaces/ChatMessageBalloon.js.map +1 -0
  16. package/dist/esm/interfaces/index.d.ts +1 -0
  17. package/dist/esm/interfaces/index.js +1 -0
  18. package/dist/esm/interfaces/index.js.map +1 -1
  19. package/package.json +2 -1
  20. package/src/components/ChatMessageBalloon/ChatMessageBalloon.style.ts +42 -0
  21. package/src/components/ChatMessageBalloon/ChatMessageBalloon.tsx +33 -0
  22. package/src/components/ProgressBar.tsx +2 -2
  23. package/src/components/index.ts +1 -0
  24. package/src/interfaces/ChatMessageBalloon.ts +10 -0
  25. package/src/interfaces/index.ts +1 -0
  26. package/src/stories/ChatMessageBalloon.stories.tsx +63 -0
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { ChatMessageBalloonProps } from '@/interfaces';
3
+ export declare const ChatMessageBalloon: React.FC<ChatMessageBalloonProps>;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { Typography } from '@mui/material';
3
+ import * as S from './ChatMessageBalloon.style';
4
+ export var ChatMessageBalloon = function (_a) {
5
+ var label = _a.label, description = _a.description, date = _a.date, direction = _a.direction, children = _a.children;
6
+ return (React.createElement(S.ChatMessageBalloonContainerStyle, null,
7
+ React.createElement(S.ChatMessageBalloonRowStyle, { direction: direction },
8
+ React.createElement(S.ChatMessageBalloonStyle, { direction: direction },
9
+ React.createElement(Typography, { variant: "subtitle2", style: {
10
+ fontSize: "1rem",
11
+ fontWeight: "600",
12
+ marginBottom: '5px'
13
+ } }, label),
14
+ description),
15
+ React.createElement(S.ChatMessageChildrenStyle, { direction: direction }, children)),
16
+ React.createElement(S.ChatMessageBalloonRowStyle, { direction: direction },
17
+ React.createElement(S.ChatMessageDateStyle, { fontSize: "0.7rem" }, date))));
18
+ };
19
+ //# sourceMappingURL=ChatMessageBalloon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessageBalloon.js","sourceRoot":"","sources":["../../../../src/components/ChatMessageBalloon/ChatMessageBalloon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAA;AAG/C,MAAM,CAAC,IAAM,kBAAkB,GAAsC,UAAC,EAAiD;QAA/C,KAAK,WAAA,EAAE,WAAW,iBAAA,EAAE,IAAI,UAAA,EAAE,SAAS,eAAA,EAAE,QAAQ,cAAA;IACnH,OAAO,CACL,oBAAC,CAAC,CAAC,gCAAgC;QACjC,oBAAC,CAAC,CAAC,0BAA0B,IAAC,SAAS,EAAE,SAAS;YAChD,oBAAC,CAAC,CAAC,uBAAuB,IAAC,SAAS,EAAE,SAAS;gBAC7C,oBAAC,UAAU,IACT,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE;wBACL,QAAQ,EAAE,MAAM;wBAChB,UAAU,EAAE,KAAK;wBACjB,YAAY,EAAE,KAAK;qBACpB,IAEA,KAAK,CACK;gBACZ,WAAW,CACc;YAC5B,oBAAC,CAAC,CAAC,wBAAwB,IAAC,SAAS,EAAE,SAAS,IAC7C,QAAQ,CACkB,CACA;QAC/B,oBAAC,CAAC,CAAC,0BAA0B,IAAC,SAAS,EAAE,SAAS;YAChD,oBAAC,CAAC,CAAC,oBAAoB,IAAC,QAAQ,EAAE,QAAQ,IAAG,IAAI,CAA0B,CAC9C,CACI,CACtC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ export declare const ChatMessageBalloonContainerStyle: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const ChatMessageBalloonRowStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
6
+ direction: string;
7
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ export declare const ChatMessageBalloonStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
9
+ direction: string;
10
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const ChatMessageDateStyle: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
12
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
13
+ }, "p" | "style" | "className" | "classes" | "children" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
14
+ export declare const ChatMessageChildrenStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
15
+ direction: string;
16
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,13 @@
1
+ import { __makeTemplateObject } from "tslib";
2
+ import { Box, Typography } from '@mui/material';
3
+ import { styled } from '@mui/material/styles';
4
+ export var ChatMessageBalloonContainerStyle = styled(Box)({
5
+ display: 'flex',
6
+ flexDirection: "column",
7
+ });
8
+ export var ChatMessageBalloonRowStyle = styled('div')(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n margin-bottom: 8px;\n flex-direction: ", ";\n\n &:last-child {\n margin-bottom: 0px;\n }\n"], ["\n display: flex;\n margin-bottom: 8px;\n flex-direction: ", ";\n\n &:last-child {\n margin-bottom: 0px;\n }\n"])), function (props) { return (props.direction === "I") ? "row-reverse" : "row"; });
9
+ export var ChatMessageBalloonStyle = styled('div')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n color: ", ";\n display: flex;\n flex-direction: column;\n padding: 12px 24px;\n width: 60%;\n"], ["\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n color: ", ";\n display: flex;\n flex-direction: column;\n padding: 12px 24px;\n width: 60%;\n"])), function (props) { return (props.direction === "I") ? "#FFF" : "#E18B50"; }, function (props) { return (props.direction === "I") ? "20px 20px 0px 20px" : "20px 20px 20px 0px"; }, function (props) { return (props.direction === "I") ? "#4D4F5B" : "#FFF"; });
10
+ export var ChatMessageDateStyle = styled(Typography)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: #43425D;\n opacity: .5;\n"], ["\n color: #43425D;\n opacity: .5;\n"])));
11
+ export var ChatMessageChildrenStyle = styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n flex: 1;\n justify-content: ", ";\n padding: 8px;\n"], ["\n align-items: center;\n box-sizing: border-box;\n display: flex;\n flex: 1;\n justify-content: ", ";\n padding: 8px;\n"])), function (props) { return (props.direction === "I") ? "end" : "start"; });
12
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
13
+ //# sourceMappingURL=ChatMessageBalloon.style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessageBallo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BAAwB,GAAG,MAAM,CAAC,KAAK,CAAC,mMAAuB,wGAKvD,EAAsD,sBAE1E,KAFoB,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAA3C,CAA2C,CAE1E,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { ProgressBarBaseProps } from '../interfaces';
3
- export declare const ProgressBar: ({ value, label, variant, total, ...props }: ProgressBarBaseProps) => React.JSX.Element;
3
+ export declare const ProgressBar: ({ value, label, variant, total, className, ...props }: ProgressBarBaseProps) => React.JSX.Element;
@@ -11,9 +11,9 @@ var ProgressBarStyled = styled(MuiProgressBar)({
11
11
  });
12
12
  var ProgressBarLabelStyled = styled(Typography)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n position: relative;\n text-align: left;\n font: normal normal normal 16px/20px Source Sans Pro;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n position: relative;\n text-align: left;\n font: normal normal normal 16px/20px Source Sans Pro;\n"])));
13
13
  export var ProgressBar = function (_a) {
14
- var _b = _a.value, value = _b === void 0 ? 0 : _b, label = _a.label, _c = _a.variant, variant = _c === void 0 ? 'determinate' : _c, total = _a.total, props = __rest(_a, ["value", "label", "variant", "total"]);
14
+ var _b = _a.value, value = _b === void 0 ? 0 : _b, label = _a.label, _c = _a.variant, variant = _c === void 0 ? 'determinate' : _c, total = _a.total, className = _a.className, props = __rest(_a, ["value", "label", "variant", "total", "className"]);
15
15
  var percentage = value && total ? (value / total) * 100 : 0;
16
- return (React.createElement("div", { style: { minWidth: '100px' } },
16
+ return (React.createElement("div", { className: className, style: { minWidth: '100px' } },
17
17
  label && (React.createElement(ProgressBarLabelStyled, null,
18
18
  label,
19
19
  React.createElement("span", { style: { right: 0 } },
@@ -1 +1 @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ACgB,CAC1B;QACD,oBAAC,iBAAiB,aAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CACjE,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -4,6 +4,7 @@ export * from './Badge';
4
4
  export * from './Button';
5
5
  export * from './Card';
6
6
  export * from './ChatMessage';
7
+ export * from './ChatMessageBalloon/ChatMessageBalloon';
7
8
  export * from './CheckBox';
8
9
  export * from './DataGrid';
9
10
  export * from './DatePicker';
@@ -4,6 +4,7 @@ export * from './Badge';
4
4
  export * from './Button';
5
5
  export * from './Card';
6
6
  export * from './ChatMessage';
7
+ export * from './ChatMessageBalloon/ChatMessageBalloon';
7
8
  export * from './CheckBox';
8
9
  export * from './DataGrid';
9
10
  export * from './DatePicker';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from "react";
2
+ export interface ChatMessageBalloonProps {
3
+ label: string;
4
+ description: ReactNode;
5
+ date: string;
6
+ direction: "I" | "O";
7
+ attachments?: string[];
8
+ children?: ReactNode;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatMessageBalloon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessageBalloon.js","sourceRoot":"","sources":["../../../src/interfaces/ChatMessageBalloon.ts"],"names":[],"mappings":""}
@@ -21,3 +21,4 @@ export * from './Tag';
21
21
  export * from './TextField';
22
22
  export * from './TimeLine';
23
23
  export * from './TimePicker';
24
+ export * from './ChatMessageBalloon';
@@ -21,4 +21,5 @@ export * from './Tag';
21
21
  export * from './TextField';
22
22
  export * from './TimeLine';
23
23
  export * from './TimePicker';
24
+ export * from './ChatMessageBalloon';
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"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C7B,cAAc,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "norma-library",
3
- "version": "0.5.65",
3
+ "version": "0.5.67",
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": {
@@ -98,6 +98,7 @@
98
98
  "@mui/icons-material": "^5.14.9",
99
99
  "@mui/material": "^5.14.8",
100
100
  "@mui/x-date-pickers": "^6.14.0",
101
+ "@storybook/addon-mdx-gfm": "^7.5.2",
101
102
  "dayjs": "^1.11.9",
102
103
  "react-i18next": "^13.2.2",
103
104
  "react-scripts": "^5.0.1",
@@ -0,0 +1,42 @@
1
+ import { Box, Typography } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+
4
+ export const ChatMessageBalloonContainerStyle = styled(Box)({
5
+ display: 'flex',
6
+ flexDirection: "column",
7
+ });
8
+
9
+ export const ChatMessageBalloonRowStyle = styled('div')<{ direction: string }>`
10
+ display: flex;
11
+ margin-bottom: 8px;
12
+ flex-direction: ${(props) => (props.direction === "I") ? "row-reverse" : "row"};
13
+
14
+ &:last-child {
15
+ margin-bottom: 0px;
16
+ }
17
+ `
18
+
19
+ export const ChatMessageBalloonStyle = styled('div')<{ direction: string }>`
20
+ background-color: ${(props) => (props.direction === "I") ? "#FFF" : "#E18B50"};
21
+ border-radius: ${(props) => (props.direction === "I") ? "20px 20px 0px 20px" : "20px 20px 20px 0px"};
22
+ box-sizing: border-box;
23
+ color: ${(props) => (props.direction === "I") ? "#4D4F5B" : "#FFF"};
24
+ display: flex;
25
+ flex-direction: column;
26
+ padding: 12px 24px;
27
+ width: 60%;
28
+ `
29
+
30
+ export const ChatMessageDateStyle = styled(Typography)`
31
+ color: #43425D;
32
+ opacity: .5;
33
+ `
34
+
35
+ export const ChatMessageChildrenStyle = styled('div')<{ direction: string }>`
36
+ align-items: center;
37
+ box-sizing: border-box;
38
+ display: flex;
39
+ flex: 1;
40
+ justify-content: ${(props) => (props.direction === "I") ? "end" : "start"};
41
+ padding: 8px;
42
+ `;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { Typography } from '@mui/material';
3
+ import { ChatMessageBalloonProps } from '@/interfaces';
4
+ import * as S from './ChatMessageBalloon.style'
5
+
6
+
7
+ export const ChatMessageBalloon: React.FC<ChatMessageBalloonProps> = ({ label, description, date, direction, children }) => {
8
+ return (
9
+ <S.ChatMessageBalloonContainerStyle>
10
+ <S.ChatMessageBalloonRowStyle direction={direction}>
11
+ <S.ChatMessageBalloonStyle direction={direction}>
12
+ <Typography
13
+ variant="subtitle2"
14
+ style={{
15
+ fontSize: "1rem",
16
+ fontWeight: "600",
17
+ marginBottom: '5px'
18
+ }}
19
+ >
20
+ {label}
21
+ </Typography>
22
+ {description}
23
+ </S.ChatMessageBalloonStyle>
24
+ <S.ChatMessageChildrenStyle direction={direction}>
25
+ {children}
26
+ </S.ChatMessageChildrenStyle>
27
+ </S.ChatMessageBalloonRowStyle>
28
+ <S.ChatMessageBalloonRowStyle direction={direction}>
29
+ <S.ChatMessageDateStyle fontSize={"0.7rem"}>{date}</S.ChatMessageDateStyle>
30
+ </S.ChatMessageBalloonRowStyle>
31
+ </S.ChatMessageBalloonContainerStyle>
32
+ );
33
+ };
@@ -28,11 +28,11 @@ const ProgressBarLabelStyled = styled(Typography)`
28
28
  font: normal normal normal 16px/20px Source Sans Pro;
29
29
  `;
30
30
 
31
- export const ProgressBar = ({ value = 0, label, variant = 'determinate', total, ...props }: ProgressBarBaseProps) => {
31
+ export const ProgressBar = ({ value = 0, label, variant = 'determinate', total, className, ...props }: ProgressBarBaseProps) => {
32
32
  const percentage = value && total ? (value / total) * 100 : 0;
33
33
 
34
34
  return (
35
- <div style={{ minWidth: '100px' }}>
35
+ <div className={className} style={{ minWidth: '100px' }}>
36
36
  {label && (
37
37
  <ProgressBarLabelStyled>
38
38
  {label}
@@ -4,6 +4,7 @@ export * from './Badge';
4
4
  export * from './Button';
5
5
  export * from './Card';
6
6
  export * from './ChatMessage';
7
+ export * from './ChatMessageBalloon/ChatMessageBalloon';
7
8
  export * from './CheckBox';
8
9
  export * from './DataGrid';
9
10
  export * from './DatePicker';
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+
3
+ export interface ChatMessageBalloonProps {
4
+ label: string;
5
+ description: ReactNode;
6
+ date: string;
7
+ direction: "I" | "O";
8
+ attachments?: string[];
9
+ children?:ReactNode;
10
+ }
@@ -21,3 +21,4 @@ export * from './Tag';
21
21
  export * from './TextField';
22
22
  export * from './TimeLine';
23
23
  export * from './TimePicker';
24
+ export * from './ChatMessageBalloon';
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+
3
+ import type { Meta } from '@storybook/react';
4
+ import { ChatMessageBalloon } from '../components';
5
+ import { Typography } from '@mui/material';
6
+
7
+ const meta = {
8
+ title: 'Display/ChatMessageBalloon',
9
+ component: ChatMessageBalloon,
10
+ parameters: {
11
+ layout: 'centered',
12
+ },
13
+ tags: ['autodocs'],
14
+ argTypes: {},
15
+ } ;
16
+
17
+ export default meta;
18
+
19
+
20
+ export const ChatMessageBalloonBasic = () => {
21
+ return (
22
+ <div style={{backgroundColor: "#F0F0F0", boxSizing: "border-box", padding: "20px"}}>
23
+ <ChatMessageBalloon
24
+ label="Agente Marcos"
25
+ description={
26
+ <Typography
27
+ variant="body1"
28
+ style={{
29
+ fontSize: "16px"
30
+ }}
31
+ >
32
+ {"Olá, tudo bem? Meu nome é Ana e falo em nome do banco Bradesco. Eu gostaria de falar com Maria Conceição da Silva"}
33
+ </Typography>
34
+ }
35
+ date={"10:23"}
36
+ direction="I"
37
+ attachments={[]}
38
+ >
39
+ <span style={{
40
+ height: "38px",
41
+ width: "38px",
42
+ border: "1px solid #FF8348",
43
+ borderRadius: "38px",
44
+ backgroundColor: "#FFF",
45
+ display: "flex",
46
+ alignItems: "center",
47
+ justifyContent: "center",
48
+ marginRight: "10px"
49
+ }}>{"1"}</span>
50
+ <span style={{
51
+ height: "38px",
52
+ width: "38px",
53
+ border: "1px solid #FF8348",
54
+ borderRadius: "38px",
55
+ backgroundColor: "#FFF",
56
+ display: "flex",
57
+ alignItems: "center",
58
+ justifyContent: "center"
59
+ }}>{"2"}</span>
60
+ </ChatMessageBalloon>
61
+ </div>
62
+ );
63
+ };