norma-library 0.4.7 → 0.4.8

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 (40) hide show
  1. package/dist/esm/components/ChatMessage.d.ts +3 -0
  2. package/dist/esm/components/ChatMessage.js +63 -0
  3. package/dist/esm/components/ChatMessage.js.map +1 -0
  4. package/dist/esm/components/Icons.js +1 -1
  5. package/dist/esm/components/ProgressBar.d.ts +0 -3
  6. package/dist/esm/components/ProgressBar.js +1 -1
  7. package/dist/esm/components/ProgressBar.js.map +1 -1
  8. package/dist/esm/components/TimeLine.d.ts +3 -0
  9. package/dist/esm/components/TimeLine.js +59 -0
  10. package/dist/esm/components/TimeLine.js.map +1 -0
  11. package/dist/esm/components/index.d.ts +2 -0
  12. package/dist/esm/components/index.js +2 -0
  13. package/dist/esm/components/index.js.map +1 -1
  14. package/dist/esm/helpers/colors.d.ts +3 -1
  15. package/dist/esm/helpers/colors.js +39 -10
  16. package/dist/esm/helpers/colors.js.map +1 -1
  17. package/dist/esm/interfaces/ChatMessage.d.ts +12 -0
  18. package/dist/esm/interfaces/ChatMessage.js +2 -0
  19. package/dist/esm/interfaces/ChatMessage.js.map +1 -0
  20. package/dist/esm/interfaces/TimeLine.d.ts +11 -0
  21. package/dist/esm/interfaces/TimeLine.js +2 -0
  22. package/dist/esm/interfaces/TimeLine.js.map +1 -0
  23. package/dist/esm/interfaces/index.d.ts +3 -1
  24. package/dist/esm/interfaces/index.js +3 -1
  25. package/dist/esm/interfaces/index.js.map +1 -1
  26. package/dist/esm/types/index.d.ts +10 -1
  27. package/dist/esm/types/index.js.map +1 -1
  28. package/package.json +2 -1
  29. package/src/components/ChatMessage.tsx +89 -0
  30. package/src/components/Icons.tsx +1 -1
  31. package/src/components/ProgressBar.tsx +2 -1
  32. package/src/components/TimeLine.tsx +103 -0
  33. package/src/components/index.ts +2 -0
  34. package/src/helpers/colors.ts +44 -10
  35. package/src/interfaces/ChatMessage.ts +12 -0
  36. package/src/interfaces/TimeLine.ts +16 -0
  37. package/src/interfaces/index.ts +3 -1
  38. package/src/stories/ChatMessage.stories.tsx +85 -0
  39. package/src/stories/TimeLine.stories.tsx +43 -0
  40. package/src/types/index.ts +23 -1
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ChatMessageProps } from "@/interfaces";
3
+ export declare const ChatMessage: React.FC<ChatMessageProps>;
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { Box, Typography } from "@mui/material";
3
+ import { styled } from "@mui/material/styles";
4
+ var Item = styled(Box)(function (_a) {
5
+ var orient = _a.orient;
6
+ return ({
7
+ borderColor: "#ccc",
8
+ display: "flex",
9
+ position: "relative",
10
+ width: "100%",
11
+ justifyContent: orient === "replay" ? "flex-end" : "flex-start",
12
+ marginBottom: "10px",
13
+ alignItems: "center",
14
+ });
15
+ });
16
+ var ContainerStyled = styled(Box)({
17
+ display: "flex",
18
+ flexDirection: "column",
19
+ alignItems: "center",
20
+ minWidth: "640px",
21
+ backgroundColor: "#F0F0F0",
22
+ padding: "10px",
23
+ });
24
+ var BoxStyled = styled(Box)(function (_a) {
25
+ var orient = _a.orient;
26
+ return ({
27
+ width: "70%",
28
+ backgroundColor: orient === "replay" ? "#E18B50" : "#FFF",
29
+ color: orient === "replay" ? "#FFF" : "#4D4F5C",
30
+ borderTopLeftRadius: 30,
31
+ borderTopRightRadius: 30,
32
+ borderBottomLeftRadius: orient === "me" ? 2 : 30,
33
+ borderBottomRightRadius: orient === "me" ? 30 : 2,
34
+ marginLeft: orient === "replay" ? "10px" : 0,
35
+ marginRight: orient === "me" ? "10px" : 0,
36
+ padding: 20,
37
+ });
38
+ });
39
+ export var ChatMessage = function (_a) {
40
+ var data = _a.data;
41
+ return (React.createElement(ContainerStyled, null, data.map(function (item, key) { return (React.createElement(Item, { key: key, orient: item.send },
42
+ item.emotion && item.send === "replay" && React.createElement(React.Fragment, null, item.emotion),
43
+ React.createElement(BoxStyled, { orient: item.send },
44
+ React.createElement(Typography, { variant: "subtitle2", style: {
45
+ marginBottom: "5px",
46
+ font: "normal normal 600 16px/20px Source Sans Pro",
47
+ } }, item.name),
48
+ React.createElement(Typography, { variant: "body1", style: {
49
+ font: "normal normal normal 16px/20px Source Sans Pro",
50
+ } }, item.message),
51
+ React.createElement(Typography, { variant: "caption", style: {
52
+ position: "absolute",
53
+ bottom: "-18px",
54
+ left: item.send === "me" ? 0 : "auto",
55
+ right: item.send === "me" ? "auto" : 0,
56
+ font: "normal normal normal 11px/13px Source Sans Pro",
57
+ opacity: 0.5,
58
+ color: "#4D4F5C",
59
+ } }, item.time)),
60
+ item.emotion && item.send === "me" && React.createElement(React.Fragment, null, item.emotion),
61
+ item.emotionReplay && item.send === "me" && (React.createElement(React.Fragment, null, item.emotionReplay)))); })));
62
+ };
63
+ //# sourceMappingURL=ChatMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessage.js","sourceRoot":"","sources":["../../../src/components/ChatMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,IAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAErB,UAAC,EAAU;QAAR,MAAM,YAAA;IAAO,OAAA,CAAC;QAClB,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;QACb,cAAc,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;QAC/D,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,QAAQ;KACrB,CAAC;AARiB,CAQjB,CAAC,CAAC;AAEJ,IAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM;IACf,aAA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CAAI;QAC9D,oBAAC,SAAS,IAAC,MAAM,EAAE,IAAI,CAAC,IAAI;YAC1B,oBAAC,UAAU,IACT,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE;oBACL,YAAY,EAAE,KAAK;oBACnB,IAAI,EAAE,6CAA6C;iBACpD,IAEA,IAAI,CAAC,IAAI,CACC;YACb,oBAAC,UAAU,IACT,OAAO,EAAC,OAAO,EACf,KAAK,EAAE;oBACL,IAAI,EAAE,gDAAgD;iBACvD,IAEA,IAAI,CAAC,OAAO,CACF;YACb,oBAAC,UAAU,IACT,OAAO,EAAC,SAAS,EACjB,KAAK,EAAE;oBACL,QAAQ,EAAE,UAAU;oBACpB,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;oBACrC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtC,IAAI,EAAE,gDAAgD;oBACtD,OAAO,EAAE,GAAG;oBACZ,KAAK,EAAE,SAAS;iBACjB,IAEA,IAAI,CAAC,IAAI,CACC,CACH;QACX,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,0CAAG,IAAI,CAAC,OAAO,CAAI;QACzD,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,CAC3C,0CAAG,IAAI,CAAC,aAAa,CAAI,CAC1B,CACI,CACR,EAzCwB,CAyCxB,CAAC,CACc,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -43,7 +43,7 @@ export var Icons = function (_a) {
43
43
  var fill = colors[color];
44
44
  var stroke = colors[color];
45
45
  var Svg = styled.svg(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n shape-rendering: inherit;\n vertical-align: middle;\n fill: ", ";\n path {\n stroke: ", ";\n }\n circle {\n stroke: ", ";\n }\n rect {\n stroke: ", ";\n }\n "], ["\n display: inline-block;\n shape-rendering: inherit;\n vertical-align: middle;\n fill: ", ";\n path {\n stroke: ", ";\n }\n circle {\n stroke: ", ";\n }\n rect {\n stroke: ", ";\n }\n "])), fill, stroke, stroke, stroke);
46
- return (React.createElement(Svg, __assign({ viewBox: "0 0 64 64", width: "".concat(width, "px"), height: "".concat(height, "px") }, props), useSymbol ? (React.createElement("use", { xlinkHref: "#icon--".concat(icon), fill: fill, stroke: stroke })) : (React.cloneElement(iconsSVG[icon], { fill: fill, stroke: stroke }))));
46
+ return (React.createElement(Svg, __assign({ viewBox: "0 0 56 56", width: "".concat(width, "px"), height: "".concat(height, "px") }, props), useSymbol ? (React.createElement("use", { xlinkHref: "#icon--".concat(icon), fill: fill, stroke: stroke })) : (React.cloneElement(iconsSVG[icon], { fill: fill, stroke: stroke }))));
47
47
  };
48
48
  var templateObject_1;
49
49
  //# sourceMappingURL=Icons.js.map
@@ -1,6 +1,3 @@
1
1
  import React from "react";
2
2
  import { ProgressBarBaseProps } from "../interfaces";
3
- export declare const ProgressBarLabelStyled: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
4
- ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
5
- }, "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>, {}, {}>;
6
3
  export declare const ProgressBar: ({ value, label, variant, total, ...props }: ProgressBarBaseProps) => React.JSX.Element;
@@ -10,7 +10,7 @@ var ProgressBarStyled = styled(MuiProgressBar)({
10
10
  position: "relative",
11
11
  backgroundColor: "&.".concat(linearProgressClasses.determinate, " {\n background-color: #e0e0e0,\n }"),
12
12
  });
13
- export 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
+ 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"])));
14
14
  export var ProgressBar = function (_a) {
15
15
  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"]);
16
16
  var prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../../src/components/ProgressBar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EACL,cAAc,IAAI,cAAc,EAChC,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,IAAM,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IAC/C,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,YAAK,qBAAqB,CAAC,WAAW,4CAErD;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,IAAM,sBAAsB,GAAG,MAAM,CAAC,UAAU,CAAC,gRAAA,6MAQvD,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,EAML;IALrB,IAAA,aAAS,EAAT,KAAK,mBAAG,CAAC,KAAA,EACT,KAAK,WAAA,EACL,eAAuB,EAAvB,OAAO,mBAAG,aAAa,KAAA,EACvB,KAAK,WAAA,EACF,KAAK,cALkB,sCAM3B,CADS;IAER,IAAM,eAAe,GAAG,aAAa,CAAC,8BAA8B,CAAC,CAAC;IACtE,IAAM,UAAU,GAAG,KAAK,IAAI,KAAK,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C<TimeLineBaseProps>;
@@ -0,0 +1,59 @@
1
+ var _a;
2
+ import { __assign, __rest } from "tslib";
3
+ import React, { useMemo } from "react";
4
+ import { ThemeProvider, useMediaQuery, Typography } from "@mui/material";
5
+ import { Timeline as MuiTimeLine, TimelineItem, timelineItemClasses, TimelineSeparator, TimelineConnector, TimelineContent, TimelineDot, } from "@mui/lab";
6
+ import { styled } from "@mui/material/styles";
7
+ import { palette, lightenRGB, themes } from "../helpers";
8
+ var colorMap = {
9
+ inherit: palette.inherit,
10
+ primary: palette.primary,
11
+ secondary: palette.secondary,
12
+ error: palette.error,
13
+ warning: palette.warning,
14
+ info: palette.info,
15
+ success: palette.success,
16
+ };
17
+ var sampleData = [
18
+ {
19
+ title: "imported register",
20
+ data: "01/04/2023 at 07h00",
21
+ by: "By IEM",
22
+ },
23
+ {
24
+ title: "80% score applied on register",
25
+ data: "01/04/2023 at 07h05",
26
+ by: "By IEM",
27
+ },
28
+ {
29
+ title: "Registers transfered to campaign ID 10",
30
+ data: "",
31
+ by: "",
32
+ },
33
+ ];
34
+ var TimeLineStyled = styled(MuiTimeLine)((_a = {},
35
+ _a["& .".concat(timelineItemClasses.root, ":before")] = {
36
+ flex: 0,
37
+ padding: 0,
38
+ },
39
+ _a));
40
+ export var TimeLine = function (_a) {
41
+ var _b = _a.data, data = _b === void 0 ? sampleData : _b, _c = _a.color, color = _c === void 0 ? "primary" : _c, _d = _a.position, position = _d === void 0 ? "left" : _d, props = __rest(_a, ["data", "color", "position"]);
42
+ var prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
43
+ var theme = useMemo(function () { return (prefersDarkMode ? themes.light : themes.light); }, [prefersDarkMode]);
44
+ var renderList = data.map(function (item, key) { return (React.createElement(TimelineItem, { key: key },
45
+ React.createElement(TimelineSeparator, null,
46
+ React.createElement(TimelineDot, { sx: {
47
+ bgcolor: colorMap[color],
48
+ p: "6px",
49
+ border: "4px solid ".concat(lightenRGB(colorMap[color], 50)),
50
+ } }),
51
+ key !== data.length - 1 && (React.createElement(TimelineConnector, { sx: { bgcolor: colorMap[color], pt: "55px", pl: "3px" } }))),
52
+ React.createElement(TimelineContent, null,
53
+ item.title,
54
+ React.createElement(Typography, { sx: { m: "auto 0" }, variant: "body2", color: "text.secondary" }, item.data),
55
+ React.createElement(Typography, { sx: { m: "auto 0", color: colorMap[color] }, variant: "body2" }, item.by)))); });
56
+ return (React.createElement(ThemeProvider, { theme: theme },
57
+ React.createElement(TimeLineStyled, __assign({}, props), renderList)));
58
+ };
59
+ //# sourceMappingURL=TimeLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeLine.js","sourceRoot":"","sources":["../../../src/components/TimeLine.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,WAAW,GACZ,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzD,IAAM,QAAQ,GAAiC;IAC7C,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;IACpB,OAAO,EAAE,OAAO,CAAC,OAAO;IACxB,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,EAAE,OAAO,CAAC,OAAO;CACzB,CAAC;AAEF,IAAM,UAAU,GAAwB;IACtC;QACE,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,EA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CAAC,IAAI,CAC1B,oBAAC,iBAAiB,IAChB,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GACvD,CACH,CACiB;QACpB,oBAAC,eAAe;YACb,IAAI,CAAC,KAAK;YACX,oBAAC,UAAU,IAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,gBAAgB,IACpE,IAAI,CAAC,IAAI,CACC;YACb,oBAAC,UAAU,IACT,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAC3C,OAAO,EAAC,OAAO,IAEd,IAAI,CAAC,EAAE,CACG,CACG,CACL,CAChB,EA7B0C,CA6B1C,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK;QACzB,oBAAC,cAAc,eAAK,KAAK,GAAG,UAAU,CAAkB,CAC1C,CACjB,CAAC;AACJ,CAAC,CAAC"}
@@ -17,4 +17,6 @@ export * from "./Select";
17
17
  export * from "./Tabs";
18
18
  export * from "./Tag";
19
19
  export * from "./TextField";
20
+ export * from "./TimeLine";
20
21
  export * from "./TimePicker";
22
+ export * from "./ChatMessage";
@@ -17,5 +17,7 @@ export * from "./Select";
17
17
  export * from "./Tabs";
18
18
  export * from "./Tag";
19
19
  export * from "./TextField";
20
+ export * from "./TimeLine";
20
21
  export * from "./TimePicker";
22
+ export * from "./ChatMessage";
21
23
  //# sourceMappingURL=index.js.map
@@ -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,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,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,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,eAAe,CAAC"}
@@ -169,4 +169,6 @@ export declare const themes: {
169
169
  };
170
170
  type PaletteKey = keyof typeof getPalette;
171
171
  declare const getColor: (key: PaletteKey) => string;
172
- export { getColor };
172
+ declare const extractRGB: (rgbString: string) => string | null;
173
+ declare const lightenRGB: (rgbString: string, amount?: number) => string | null;
174
+ export { getColor, extractRGB, lightenRGB };
@@ -2,19 +2,19 @@ import { __assign } from "tslib";
2
2
  import { createTheme } from "@mui/material/styles";
3
3
  export var getPalette = function () {
4
4
  return {
5
- primary: "#FF7F11",
5
+ primary: "rgb(219, 102, 25)",
6
6
  primaryLight: "#FFDB9F",
7
7
  primaryMedium: "#FFA84C",
8
8
  primaryDark: "#B74608",
9
- inherit: "#000000",
10
- secondary: "#43BBF2",
11
- error: "#D63643",
12
- warning: "#FFC300",
13
- info: "#71D5F7",
14
- success: "#6BC235",
9
+ inherit: "rgb(102, 102, 102)",
10
+ secondary: "rgb(67, 187, 242)",
11
+ error: "rgb(214, 54, 67)",
12
+ warning: "rgb(255, 195, 0)",
13
+ info: "rgb(113, 213, 247)",
14
+ success: "rgb(107, 194, 53)",
15
15
  white: "#ffffff",
16
- black: "#666666",
17
- helper: "#5A2A79",
16
+ black: "rgb(0, 0, 0)",
17
+ helper: "rgb(90, 42, 121)",
18
18
  secondaryLight: "#D9FCFE",
19
19
  secondaryMedium: "#71D5F7",
20
20
  secondaryDark: "#154F8C",
@@ -152,5 +152,34 @@ var getColor = function (key) {
152
152
  return "#CCC";
153
153
  }
154
154
  };
155
- export { getColor };
155
+ var extractRGB = function (rgbString) {
156
+ if (typeof rgbString === "string") {
157
+ var match = rgbString.match(/\((\d+), (\d+), (\d+)\)/);
158
+ if (match) {
159
+ var r = match[1];
160
+ var g = match[2];
161
+ var b = match[3];
162
+ return "".concat(r, ",").concat(g, ",").concat(b);
163
+ }
164
+ }
165
+ return null;
166
+ };
167
+ var lightenRGB = function (rgbString, amount) {
168
+ if (amount === void 0) { amount = 20; }
169
+ console.log("RGB ==> ", rgbString);
170
+ if (typeof rgbString === "string") {
171
+ var match = rgbString.match(/\((\d+), (\d+), (\d+)\)/);
172
+ if (match) {
173
+ var r = parseInt(match[1]);
174
+ var g = parseInt(match[2]);
175
+ var b = parseInt(match[3]);
176
+ var newR = Math.min(255, r + amount);
177
+ var newG = Math.min(255, g + amount);
178
+ var newB = Math.min(255, b + amount);
179
+ return "rgb(".concat(newR, ",").concat(newG, ",").concat(newB, ")");
180
+ }
181
+ }
182
+ return null;
183
+ };
184
+ export { getColor, extractRGB, lightenRGB };
156
185
  //# sourceMappingURL=colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../src/helpers/colors.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,CAAC,IAAM,UAAU,GAAG;IACxB,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,SAAS;QACxB,WAAW,EAAE,SAAS;QAEtB,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,SAAS;QAChB,MAAM,EAAE,SAAS;QACjB,cAAc,EAAE,SAAS;QACzB,eAAe,EAAE,SAAS;QAC1B,aAAa,EAAE,SAAS;QACxB,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,SAAS;QACxB,WAAW,EAAE,SAAS;QACtB,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,SAAS;QACxB,WAAW,EAAE,SAAS;QACtB,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,SAAS;QACxB,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,SAAS;QACtB,YAAY,EAAE,SAAS;QACvB,UAAU,EAAE,SAAS;KACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAEpC,MAAM,CAAC,IAAM,UAAU,GAAG;I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,OAAO,UAAG,CAAC,cAAI,CAAC,cAAI,CAAC,CAAE,CAAC;SACzB;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,IAAM,UAAU,GAAG,UAAC,SAAiB,EAAE,MAAW;IAAX,uBAAA,EAAA,WAAW;IAChD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACnC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;QACjC,IAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAEzD,IAAI,KAAK,EAAE;YACT,IAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;YACvC,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;YACvC,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;YAEvC,OAAO,cAAO,IAAI,cAAI,IAAI,cAAI,IAAI,MAAG,CAAC;SACvC;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export interface ChatProps {
3
+ name: string;
4
+ message: string;
5
+ emotion?: React.ReactNode;
6
+ emotionReplay?: React.ReactNode;
7
+ time: string;
8
+ send: "me" | "replay";
9
+ }
10
+ export interface ChatMessageProps {
11
+ data: ChatProps[];
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChatMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatMessage.js","sourceRoot":"","sources":["../../../src/interfaces/ChatMessage.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { SxProps } from "@mui/material";
3
+ import { Theme } from "@emotion/react";
4
+ import { ColorVariant, DataTimeLine, MuiTimeLineBaseProps, PositionVariant } from "../types";
5
+ export interface TimeLineBaseProps extends MuiTimeLineBaseProps {
6
+ position?: PositionVariant;
7
+ children?: React.ReactNode;
8
+ sx?: SxProps<Theme>;
9
+ color: ColorVariant;
10
+ data: DataTimeLine[];
11
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TimeLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeLine.js","sourceRoot":"","sources":["../../../src/interfaces/TimeLine.ts"],"names":[],"mappings":""}
@@ -12,9 +12,11 @@ export * from "./Modal";
12
12
  export * from "./Paper";
13
13
  export * from "./ProgressBar";
14
14
  export * from "./RadioGroup";
15
- export * from "./RadioGroup";
16
15
  export * from "./RangerSlider";
17
16
  export * from "./Select";
18
17
  export * from "./Tabs";
19
18
  export * from "./Tag";
20
19
  export * from "./TextField";
20
+ export * from "./TimeLine";
21
+ export * from "./TimePicker";
22
+ export * from "./ChatMessage";
@@ -12,10 +12,12 @@ export * from "./Modal";
12
12
  export * from "./Paper";
13
13
  export * from "./ProgressBar";
14
14
  export * from "./RadioGroup";
15
- export * from "./RadioGroup";
16
15
  export * from "./RangerSlider";
17
16
  export * from "./Select";
18
17
  export * from "./Tabs";
19
18
  export * from "./Tag";
20
19
  export * from "./TextField";
20
+ export * from "./TimeLine";
21
+ export * from "./TimePicker";
22
+ export * from "./ChatMessage";
21
23
  //# 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,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,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,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,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,eAAe,CAAC"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { AvatarProps as MuiAvatarProps, ButtonProps as MuiButtonProps, BadgeProps as MuiBadgeProps, IconButtonProps as MuiIconButtonProps, TextFieldProps as MuiTextFieldProps, CheckboxProps as MuiCheckBoxProps, MenuProps as MuiDropDownProps, ChipProps as MuiChipProps, LinearProgressProps as MuiLinearProgressProps, SliderProps as MuiSliderProps, AccordionProps as MuiAccordionProps, TabsProps as MuiTabsProps, SelectProps as MuiSelectProps, PaperProps as MuiPaperProps, SvgIconProps, ModalProps, CardProps as MuiCardProps } from "@mui/material";
3
+ import { TimelineProps as MuiTimeLineProps } from "@mui/lab";
3
4
  import { SwitchBaseProps as MuiSwitchBaseProps } from "@mui/material/internal/SwitchBase";
4
5
  import { iconsSVG } from "../components/Svgs";
5
6
  export type ColorVariant = "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning";
@@ -19,6 +20,7 @@ export type TextFieldVariant = "standard" | "outlined" | "filled";
19
20
  export type TextFieldSizeVariant = "small" | "medium";
20
21
  export type DirectionVariant = "vertical" | "horizontal";
21
22
  export type PaperVariant = "elevation" | "outlined";
23
+ export type PositionVariant = "left" | "right" | "alternate" | "alternate-reverse";
22
24
  export type MuiTextFieldBaseProps = Omit<MuiTextFieldProps, "onChange" | "onBlur" | "onFocus" | "defaultValue" | "size" | "value" | "id" | "fullWidth" | "helperText" | "type" | "InputProps" | "InputLabelProps" | "autoComplete" | "label" | "helperText" | "InputLabelProps" | "margin" | "maxRows" | "minRows" | "multiline" | "name" | "placeholder" | "rows" | "select" | "SelectProps" | "sx" | "autoFocus" | "error" | "classes" | "children" | "color" | "variant">;
23
25
  export interface CheckboxPropsSizeOverrides {
24
26
  }
@@ -30,13 +32,14 @@ export type MuiCardBaseProps = Omit<MuiCardProps, "sx">;
30
32
  export type MuiDropDownBaseProps = Omit<MuiDropDownProps, "sx" | "variant">;
31
33
  export type MuiTagBaseProps = Omit<MuiChipProps, "sx" | "color">;
32
34
  export type MuiRangerSliderBaseProps = Omit<MuiSliderProps, "sx" | "color">;
33
- export type MuiProgressBarBaseProps = Omit<MuiLinearProgressProps, "sx">;
35
+ export type MuiProgressBarBaseProps = Omit<MuiLinearProgressProps, "sx" | "ref">;
34
36
  export type MuiTabsBaseProps = Omit<MuiTabsProps, "sx" | "children" | "onChange" | "variant" | "value">;
35
37
  export type MuiAccordionBaseProps = Omit<MuiAccordionProps, "sx" | "children" | "defaultExpanded" | "onChange">;
36
38
  export type MuiSelectBaseProps = Omit<MuiSelectProps, "sx" | "value" | "onClose" | "onOpen" | "input" | "label">;
37
39
  export type MuiPaperBaseProps = Omit<MuiPaperProps, "sx">;
38
40
  export type MuiDatePickerBaseProps = Omit<MuiTextFieldProps, "sx">;
39
41
  export type MuiAvatarBaseProps = Omit<MuiAvatarProps, "sx" | "src" | "children" | "variant" | "sizes">;
42
+ export type MuiTimeLineBaseProps = Omit<MuiTimeLineProps, "sx" | "position" | "children" | "ref">;
40
43
  export type MuiBadgeBaseProps = Omit<MuiBadgeProps, "sx" | "color" | "children" | "invisible" | "variant" | "className" | "badgeContent">;
41
44
  export type IconScale = "xsmall" | "small" | "medium" | "large" | "xlarge" | "2xlarge" | "3xlarge";
42
45
  export type IconColors = "inherit" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | "white" | "black";
@@ -73,6 +76,12 @@ export type DataSelect = {
73
76
  label: string;
74
77
  value: string | number;
75
78
  };
79
+ export type DataTimeLine = {
80
+ id?: string;
81
+ title: string;
82
+ data: string;
83
+ by: string;
84
+ };
76
85
  export type RenderProps<E extends HTMLElement = HTMLElement> = {
77
86
  focusRef?: React.MutableRefObject<E | null>;
78
87
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAoLA,MAAM,CAAC,IAAM,SAAS,GAA8B;IAClD,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;CACd,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAmMA,MAAM,CAAC,IAAM,SAAS,GAA8B;IAClD,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;CACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "norma-library",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "private": false,
5
5
  "description": "Norma Library. A React UI kit.",
6
6
  "scripts": {
@@ -18,6 +18,7 @@
18
18
  "@babel/preset-env": "^7.22.15",
19
19
  "@babel/preset-react": "^7.22.15",
20
20
  "@babel/preset-typescript": "^7.22.15",
21
+ "@mui/lab": "^5.0.0-alpha.145",
21
22
  "@storybook/addon-essentials": "^7.5.0-alpha.1",
22
23
  "@storybook/addon-interactions": "^7.5.0-alpha.1",
23
24
  "@storybook/addon-links": "^7.5.0-alpha.1",
@@ -0,0 +1,89 @@
1
+ import React from "react";
2
+ import { Box, Typography } from "@mui/material";
3
+ import { styled } from "@mui/material/styles";
4
+ import { ChatMessageProps } from "@/interfaces";
5
+
6
+ const Item = styled(Box)<{
7
+ orient?: string;
8
+ }>(({ orient }) => ({
9
+ borderColor: "#ccc",
10
+ display: "flex",
11
+ position: "relative",
12
+ width: "100%",
13
+ justifyContent: orient === "replay" ? "flex-end" : "flex-start",
14
+ marginBottom: "10px",
15
+ alignItems: "center",
16
+ }));
17
+
18
+ const ContainerStyled = styled(Box)({
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ alignItems: "center",
22
+ minWidth: "640px",
23
+ backgroundColor: "#F0F0F0",
24
+ padding: "10px",
25
+ });
26
+
27
+ const BoxStyled = styled(Box)<{
28
+ orient?: string;
29
+ }>(({ orient }) => ({
30
+ width: "70%",
31
+ backgroundColor: orient === "replay" ? "#E18B50" : "#FFF",
32
+ color: orient === "replay" ? "#FFF" : "#4D4F5C",
33
+ borderTopLeftRadius: 30,
34
+ borderTopRightRadius: 30,
35
+ borderBottomLeftRadius: orient === "me" ? 2 : 30,
36
+ borderBottomRightRadius: orient === "me" ? 30 : 2,
37
+ marginLeft: orient === "replay" ? "10px" : 0,
38
+ marginRight: orient === "me" ? "10px" : 0,
39
+ padding: 20,
40
+ }));
41
+
42
+ export const ChatMessage: React.FC<ChatMessageProps> = ({ data }) => {
43
+ return (
44
+ <ContainerStyled>
45
+ {data.map((item, key) => (
46
+ <Item key={key} orient={item.send}>
47
+ {item.emotion && item.send === "replay" && <>{item.emotion}</>}
48
+ <BoxStyled orient={item.send}>
49
+ <Typography
50
+ variant="subtitle2"
51
+ style={{
52
+ marginBottom: "5px",
53
+ font: "normal normal 600 16px/20px Source Sans Pro",
54
+ }}
55
+ >
56
+ {item.name}
57
+ </Typography>
58
+ <Typography
59
+ variant="body1"
60
+ style={{
61
+ font: "normal normal normal 16px/20px Source Sans Pro",
62
+ }}
63
+ >
64
+ {item.message}
65
+ </Typography>
66
+ <Typography
67
+ variant="caption"
68
+ style={{
69
+ position: "absolute",
70
+ bottom: "-18px",
71
+ left: item.send === "me" ? 0 : "auto",
72
+ right: item.send === "me" ? "auto" : 0,
73
+ font: "normal normal normal 11px/13px Source Sans Pro",
74
+ opacity: 0.5,
75
+ color: "#4D4F5C",
76
+ }}
77
+ >
78
+ {item.time}
79
+ </Typography>
80
+ </BoxStyled>
81
+ {item.emotion && item.send === "me" && <>{item.emotion}</>}
82
+ {item.emotionReplay && item.send === "me" && (
83
+ <>{item.emotionReplay}</>
84
+ )}
85
+ </Item>
86
+ ))}
87
+ </ContainerStyled>
88
+ );
89
+ };
@@ -72,7 +72,7 @@ export const Icons: FunctionComponent<IconsProps> = ({
72
72
 
73
73
  return (
74
74
  <Svg
75
- viewBox="0 0 64 64"
75
+ viewBox="0 0 56 56"
76
76
  width={`${width}px`}
77
77
  height={`${height}px`}
78
78
  {...props}
@@ -6,6 +6,7 @@ import {
6
6
  useMediaQuery,
7
7
  Typography,
8
8
  } from "@mui/material";
9
+
9
10
  import { ProgressBarBaseProps } from "../interfaces";
10
11
  import { themes } from "../helpers";
11
12
  import { styled } from "@mui/material/styles";
@@ -20,7 +21,7 @@ const ProgressBarStyled = styled(MuiProgressBar)({
20
21
  }`,
21
22
  });
22
23
 
23
- export const ProgressBarLabelStyled = styled(Typography)`
24
+ const ProgressBarLabelStyled = styled(Typography)`
24
25
  display: flex;
25
26
  justify-content: space-between;
26
27
  align-items: center;
@@ -0,0 +1,103 @@
1
+ import React, { useMemo } from "react";
2
+ import { ThemeProvider, useMediaQuery, Typography } from "@mui/material";
3
+
4
+ import {
5
+ Timeline as MuiTimeLine,
6
+ TimelineItem,
7
+ timelineItemClasses,
8
+ TimelineSeparator,
9
+ TimelineConnector,
10
+ TimelineContent,
11
+ TimelineDot,
12
+ } from "@mui/lab";
13
+
14
+ import { TimeLineBaseProps } from "@/interfaces/TimeLine";
15
+
16
+ import { styled } from "@mui/material/styles";
17
+ import { palette, lightenRGB, themes } from "../helpers";
18
+ import { ColorVariant, DataTimeLine } from "@/types";
19
+
20
+ const colorMap: Record<ColorVariant, string> = {
21
+ inherit: palette.inherit,
22
+ primary: palette.primary,
23
+ secondary: palette.secondary,
24
+ error: palette.error,
25
+ warning: palette.warning,
26
+ info: palette.info,
27
+ success: palette.success,
28
+ };
29
+
30
+ const sampleData: Array<DataTimeLine> = [
31
+ {
32
+ title: "imported register",
33
+ data: "01/04/2023 at 07h00",
34
+ by: "By IEM",
35
+ },
36
+ {
37
+ title: "80% score applied on register",
38
+ data: "01/04/2023 at 07h05",
39
+ by: "By IEM",
40
+ },
41
+ {
42
+ title: "Registers transfered to campaign ID 10",
43
+ data: "",
44
+ by: "",
45
+ },
46
+ ];
47
+
48
+ const TimeLineStyled = styled(MuiTimeLine)({
49
+ [`& .${timelineItemClasses.root}:before`]: {
50
+ flex: 0,
51
+ padding: 0,
52
+ },
53
+ });
54
+
55
+ export const TimeLine: React.FC<TimeLineBaseProps> = ({
56
+ data = sampleData,
57
+ color = "primary",
58
+ position = "left",
59
+ ...props
60
+ }) => {
61
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
62
+ const theme = useMemo(
63
+ () => (prefersDarkMode ? themes.light : themes.light),
64
+ [prefersDarkMode]
65
+ );
66
+
67
+ const renderList = data.map((item, key) => (
68
+ <TimelineItem key={key}>
69
+ <TimelineSeparator>
70
+ <TimelineDot
71
+ sx={{
72
+ bgcolor: colorMap[color],
73
+ p: "6px",
74
+ border: `4px solid ${lightenRGB(colorMap[color], 50)}`,
75
+ }}
76
+ />
77
+ {key !== data.length - 1 && (
78
+ <TimelineConnector
79
+ sx={{ bgcolor: colorMap[color], pt: "55px", pl: "3px" }}
80
+ />
81
+ )}
82
+ </TimelineSeparator>
83
+ <TimelineContent>
84
+ {item.title}
85
+ <Typography sx={{ m: "auto 0" }} variant="body2" color="text.secondary">
86
+ {item.data}
87
+ </Typography>
88
+ <Typography
89
+ sx={{ m: "auto 0", color: colorMap[color] }}
90
+ variant="body2"
91
+ >
92
+ {item.by}
93
+ </Typography>
94
+ </TimelineContent>
95
+ </TimelineItem>
96
+ ));
97
+
98
+ return (
99
+ <ThemeProvider theme={theme}>
100
+ <TimeLineStyled {...props}>{renderList}</TimeLineStyled>
101
+ </ThemeProvider>
102
+ );
103
+ };
@@ -17,4 +17,6 @@ export * from "./Select";
17
17
  export * from "./Tabs";
18
18
  export * from "./Tag";
19
19
  export * from "./TextField";
20
+ export * from "./TimeLine";
20
21
  export * from "./TimePicker";
22
+ export * from "./ChatMessage";
@@ -2,20 +2,20 @@ import { createTheme } from "@mui/material/styles";
2
2
 
3
3
  export const getPalette = () => {
4
4
  return {
5
- primary: "#FF7F11",
5
+ primary: "rgb(219, 102, 25)",
6
6
  primaryLight: "#FFDB9F",
7
7
  primaryMedium: "#FFA84C",
8
8
  primaryDark: "#B74608",
9
9
 
10
- inherit: "#000000",
11
- secondary: "#43BBF2",
12
- error: "#D63643",
13
- warning: "#FFC300",
14
- info: "#71D5F7",
15
- success: "#6BC235",
10
+ inherit: "rgb(102, 102, 102)",
11
+ secondary: "rgb(67, 187, 242)",
12
+ error: "rgb(214, 54, 67)",
13
+ warning: "rgb(255, 195, 0)",
14
+ info: "rgb(113, 213, 247)",
15
+ success: "rgb(107, 194, 53)",
16
16
  white: "#ffffff",
17
- black: "#666666",
18
- helper: "#5A2A79",
17
+ black: "rgb(0, 0, 0)",
18
+ helper: "rgb(90, 42, 121)",
19
19
  secondaryLight: "#D9FCFE",
20
20
  secondaryMedium: "#71D5F7",
21
21
  secondaryDark: "#154F8C",
@@ -170,4 +170,38 @@ const getColor = (key: PaletteKey) => {
170
170
  }
171
171
  };
172
172
 
173
- export { getColor };
173
+ const extractRGB = (rgbString: string) => {
174
+ if (typeof rgbString === "string") {
175
+ const match = rgbString.match(/\((\d+), (\d+), (\d+)\)/);
176
+
177
+ if (match) {
178
+ const r = match[1];
179
+ const g = match[2];
180
+ const b = match[3];
181
+ return `${r},${g},${b}`;
182
+ }
183
+ }
184
+ return null;
185
+ };
186
+
187
+ const lightenRGB = (rgbString: string, amount = 20) => {
188
+ console.log("RGB ==> ", rgbString);
189
+ if (typeof rgbString === "string") {
190
+ const match = rgbString.match(/\((\d+), (\d+), (\d+)\)/);
191
+
192
+ if (match) {
193
+ const r = parseInt(match[1]);
194
+ const g = parseInt(match[2]);
195
+ const b = parseInt(match[3]);
196
+
197
+ const newR = Math.min(255, r + amount);
198
+ const newG = Math.min(255, g + amount);
199
+ const newB = Math.min(255, b + amount);
200
+
201
+ return `rgb(${newR},${newG},${newB})`;
202
+ }
203
+ }
204
+ return null;
205
+ };
206
+
207
+ export { getColor, extractRGB, lightenRGB };
@@ -0,0 +1,12 @@
1
+ export interface ChatProps {
2
+ name: string;
3
+ message: string;
4
+ emotion?: React.ReactNode;
5
+ emotionReplay?: React.ReactNode;
6
+ time: string;
7
+ send: "me" | "replay";
8
+ }
9
+
10
+ export interface ChatMessageProps {
11
+ data: ChatProps[];
12
+ }
@@ -0,0 +1,16 @@
1
+ import { SxProps } from "@mui/material";
2
+ import { Theme } from "@emotion/react";
3
+ import {
4
+ ColorVariant,
5
+ DataTimeLine,
6
+ MuiTimeLineBaseProps,
7
+ PositionVariant,
8
+ } from "../types";
9
+
10
+ export interface TimeLineBaseProps extends MuiTimeLineBaseProps {
11
+ position?: PositionVariant;
12
+ children?: React.ReactNode;
13
+ sx?: SxProps<Theme>;
14
+ color: ColorVariant;
15
+ data: DataTimeLine[];
16
+ }
@@ -12,9 +12,11 @@ export * from "./Modal";
12
12
  export * from "./Paper";
13
13
  export * from "./ProgressBar";
14
14
  export * from "./RadioGroup";
15
- export * from "./RadioGroup";
16
15
  export * from "./RangerSlider";
17
16
  export * from "./Select";
18
17
  export * from "./Tabs";
19
18
  export * from "./Tag";
20
19
  export * from "./TextField";
20
+ export * from "./TimeLine";
21
+ export * from "./TimePicker";
22
+ export * from "./ChatMessage";
@@ -0,0 +1,85 @@
1
+ import React from "react";
2
+
3
+ import type { Meta } from "@storybook/react";
4
+ import { ChatMessage, Icons, Avatar } from "../components";
5
+
6
+ const meta = {
7
+ title: "Display/ChatMessage",
8
+ component: ChatMessage,
9
+ parameters: {
10
+ layout: "centered",
11
+ },
12
+ tags: ["autodocs"],
13
+ argTypes: {},
14
+ } satisfies Meta<typeof ChatMessage>;
15
+
16
+ export default meta;
17
+
18
+ const chat = [
19
+ {
20
+ send: "me",
21
+ name: "Alice",
22
+ message:
23
+ "Olá, tudo bem? Meu nome é Alice e falo em nome do banco Bradesco. Eu gostaria de falar com Bob",
24
+ time: "09:50",
25
+ emotion: (
26
+ <Avatar
27
+ sx={{
28
+ backgroundColor: "#FFF",
29
+ border: "1px solid rgb(255, 195, 0)",
30
+ m: "5px",
31
+ }}
32
+ >
33
+ <Icons icon="faceNeutral" scale="large" color="warning" />
34
+ </Avatar>
35
+ ),
36
+ emotionReplay: (
37
+ <Avatar
38
+ sx={{
39
+ backgroundColor: "#FFF",
40
+ border: "1px solid rgb(219, 102, 25)",
41
+ m: "5px",
42
+ }}
43
+ >
44
+ <Icons icon="faceHappy" scale="large" color="primary" />
45
+ </Avatar>
46
+ ),
47
+ },
48
+ {
49
+ send: "replay",
50
+ name: "Bob",
51
+ message: "Oi, estou bem, obrigado! E você?",
52
+ time: "10:05",
53
+ },
54
+ {
55
+ send: "me",
56
+ name: "Alice",
57
+ message: "Estou ótima, obrigada por perguntar!",
58
+ time: "10:10",
59
+ },
60
+ {
61
+ send: "replay",
62
+ name: "Bob",
63
+ message: "Que bom ouvir isso!",
64
+ time: "10:15",
65
+ emotion: (
66
+ <Avatar
67
+ sx={{
68
+ backgroundColor: "#FFF",
69
+ border: "1px solid rgb(219, 102, 25)",
70
+ m: "5px",
71
+ }}
72
+ >
73
+ <Icons icon="faceHappy" scale="large" color="primary" />
74
+ </Avatar>
75
+ ),
76
+ },
77
+ ];
78
+
79
+ export const ChatMessageBasic = () => {
80
+ return (
81
+ <>
82
+ <ChatMessage data={chat} />
83
+ </>
84
+ );
85
+ };
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+
3
+ import type { Meta } from "@storybook/react";
4
+ import { TimeLine } from "../components";
5
+ import { Stack } from "@mui/material";
6
+
7
+ const meta = {
8
+ title: "Display/TimeLine",
9
+ component: TimeLine,
10
+ parameters: {
11
+ layout: "centered",
12
+ },
13
+ tags: ["autodocs"],
14
+ argTypes: {},
15
+ } satisfies Meta<typeof TimeLine>;
16
+
17
+ export default meta;
18
+
19
+ export const TimeLineBasic = () => {
20
+ return (
21
+ <>
22
+ <TimeLine />
23
+ </>
24
+ );
25
+ };
26
+
27
+ export const TimeLineColors = () => {
28
+ return (
29
+ <Stack direction="row" spacing={2}>
30
+ {[
31
+ "primary",
32
+ "secondary",
33
+ "inherit",
34
+ "error",
35
+ "info",
36
+ "success",
37
+ "warning",
38
+ ].map((color, key) => (
39
+ <TimeLine color={color} key={key} />
40
+ ))}
41
+ </Stack>
42
+ );
43
+ };
@@ -18,6 +18,8 @@ import {
18
18
  CardProps as MuiCardProps,
19
19
  } from "@mui/material";
20
20
 
21
+ import { TimelineProps as MuiTimeLineProps } from "@mui/lab";
22
+
21
23
  import { SwitchBaseProps as MuiSwitchBaseProps } from "@mui/material/internal/SwitchBase";
22
24
 
23
25
  import { iconsSVG } from "../components/Svgs";
@@ -75,6 +77,11 @@ export type TextFieldVariant = "standard" | "outlined" | "filled";
75
77
  export type TextFieldSizeVariant = "small" | "medium";
76
78
  export type DirectionVariant = "vertical" | "horizontal";
77
79
  export type PaperVariant = "elevation" | "outlined";
80
+ export type PositionVariant =
81
+ | "left"
82
+ | "right"
83
+ | "alternate"
84
+ | "alternate-reverse";
78
85
 
79
86
  export type MuiTextFieldBaseProps = Omit<
80
87
  MuiTextFieldProps,
@@ -124,7 +131,10 @@ export type MuiCardBaseProps = Omit<MuiCardProps, "sx">;
124
131
  export type MuiDropDownBaseProps = Omit<MuiDropDownProps, "sx" | "variant">;
125
132
  export type MuiTagBaseProps = Omit<MuiChipProps, "sx" | "color">;
126
133
  export type MuiRangerSliderBaseProps = Omit<MuiSliderProps, "sx" | "color">;
127
- export type MuiProgressBarBaseProps = Omit<MuiLinearProgressProps, "sx">;
134
+ export type MuiProgressBarBaseProps = Omit<
135
+ MuiLinearProgressProps,
136
+ "sx" | "ref"
137
+ >;
128
138
  export type MuiTabsBaseProps = Omit<
129
139
  MuiTabsProps,
130
140
  "sx" | "children" | "onChange" | "variant" | "value"
@@ -147,6 +157,11 @@ export type MuiAvatarBaseProps = Omit<
147
157
  "sx" | "src" | "children" | "variant" | "sizes"
148
158
  >;
149
159
 
160
+ export type MuiTimeLineBaseProps = Omit<
161
+ MuiTimeLineProps,
162
+ "sx" | "position" | "children" | "ref"
163
+ >;
164
+
150
165
  export type MuiBadgeBaseProps = Omit<
151
166
  MuiBadgeProps,
152
167
  | "sx"
@@ -231,6 +246,13 @@ export type DataSelect = {
231
246
  value: string | number;
232
247
  };
233
248
 
249
+ export type DataTimeLine = {
250
+ id?: string;
251
+ title: string;
252
+ data: string;
253
+ by: string;
254
+ };
255
+
234
256
  export type RenderProps<E extends HTMLElement = HTMLElement> = {
235
257
  focusRef?: React.MutableRefObject<E | null>;
236
258
  id?: string;