norma-library 0.5.66 → 0.5.68

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.
@@ -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":"ChatMessageBalloon.style.js","sourceRoot":"","sources":["../../../../src/components/ChatMessageBalloon/ChatMessageBalloon.style.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,IAAM,gCAAgC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1D,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,IAAM,0BAA0B,GAAG,MAAM,CAAC,KAAK,CAAC,2LAAuB,+DAG1D,EAA4D,uDAK/E,KALmB,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,EAAjD,CAAiD,CAK/E,CAAA;AAED,MAAM,CAAC,IAAM,uBAAuB,GAAG,MAAM,CAAC,KAAK,CAAC,wPAAuB,wBACrD,EAAyD,sBAC5D,EAAkF,yCAE1F,EAAyD,wFAKnE,KARqB,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAA9C,CAA8C,EAC5D,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,EAAvE,CAAuE,EAE1F,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAA9C,CAA8C,CAKnE,CAAA;AAED,MAAM,CAAC,IAAM,oBAAoB,GAAG,MAAM,CAAC,UAAU,CAAC,0GAAA,uCAGrD,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,wBAAwB,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"}
@@ -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"}
@@ -14,7 +14,7 @@ import { Tabs } from './components/Tabs';
14
14
  import { Tag } from './components/Tag';
15
15
  import { TextField } from './components/TextField';
16
16
  import { DatePicker } from './components/DatePicker';
17
- import { DataGrid, ChatMessage } from './components';
17
+ import { DataGrid, ChatMessage, ChatMessageBalloon } from './components';
18
18
  import { NormaProvider } from './providers/NormaProvider';
19
19
  import { themes, getPalette } from './helpers';
20
- export { Accordion, Button, Card, ChatMessage, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, DataGrid, NormaProvider, themes, };
20
+ export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, DataGrid, NormaProvider, themes, };
package/dist/esm/index.js CHANGED
@@ -14,8 +14,8 @@ import { Tabs } from './components/Tabs';
14
14
  import { Tag } from './components/Tag';
15
15
  import { TextField } from './components/TextField';
16
16
  import { DatePicker } from './components/DatePicker';
17
- import { DataGrid, ChatMessage } from './components';
17
+ import { DataGrid, ChatMessage, ChatMessageBalloon } from './components';
18
18
  import { NormaProvider } from './providers/NormaProvider';
19
19
  import { themes, getPalette } from './helpers';
20
- export { Accordion, Button, Card, ChatMessage, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, DataGrid, NormaProvider, themes, };
20
+ export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, DataGrid, NormaProvider, themes, };
21
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,SAAS,EACT,QAAQ,EACR,aAAa,EACb,MAAM,GACP,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,SAAS,EACT,QAAQ,EACR,aAAa,EACb,MAAM,GACP,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"],"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/interfaces/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;AAC7B,cAAc,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "norma-library",
3
- "version": "0.5.66",
3
+ "version": "0.5.68",
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
+ };
@@ -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';
package/src/index.ts CHANGED
@@ -14,7 +14,7 @@ import { Tabs } from './components/Tabs';
14
14
  import { Tag } from './components/Tag';
15
15
  import { TextField } from './components/TextField';
16
16
  import { DatePicker } from './components/DatePicker';
17
- import { DataGrid, ChatMessage } from './components';
17
+ import { DataGrid, ChatMessage, ChatMessageBalloon } from './components';
18
18
  import { NormaProvider } from './providers/NormaProvider';
19
19
  import { themes, getPalette } from './helpers';
20
20
 
@@ -23,6 +23,7 @@ export {
23
23
  Button,
24
24
  Card,
25
25
  ChatMessage,
26
+ ChatMessageBalloon,
26
27
  CheckBox,
27
28
  DatePicker,
28
29
  getPalette,
@@ -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
+ };