norma-library 0.4.7 → 0.4.9
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/ChatMessage.d.ts +3 -0
- package/dist/esm/components/ChatMessage.js +63 -0
- package/dist/esm/components/ChatMessage.js.map +1 -0
- package/dist/esm/components/DataGrid/base/dropdown.d.ts +4 -0
- package/dist/esm/components/DataGrid/base/dropdown.js +126 -0
- package/dist/esm/components/DataGrid/base/dropdown.js.map +1 -0
- package/dist/esm/components/DataGrid/base/number-filter.d.ts +4 -0
- package/dist/esm/components/DataGrid/base/number-filter.js +30 -0
- package/dist/esm/components/DataGrid/base/number-filter.js.map +1 -0
- package/dist/esm/components/DataGrid/base/sorting.d.ts +5 -0
- package/dist/esm/components/DataGrid/base/sorting.js +15 -0
- package/dist/esm/components/DataGrid/base/sorting.js.map +1 -0
- package/dist/esm/components/DataGrid/icons.d.ts +4 -0
- package/dist/esm/components/DataGrid/icons.js +15 -0
- package/dist/esm/components/DataGrid/icons.js.map +1 -0
- package/dist/esm/components/DataGrid/index.d.ts +5 -0
- package/dist/esm/components/DataGrid/index.js +146 -0
- package/dist/esm/components/DataGrid/index.js.map +1 -0
- package/dist/esm/components/DataGrid/shared.d.ts +20 -0
- package/dist/esm/components/DataGrid/shared.js +141 -0
- package/dist/esm/components/DataGrid/shared.js.map +1 -0
- package/dist/esm/components/DataGrid/styled.d.ts +10 -0
- package/dist/esm/components/DataGrid/styled.js +73 -0
- package/dist/esm/components/DataGrid/styled.js.map +1 -0
- package/dist/esm/components/Icons.js +1 -1
- package/dist/esm/components/ProgressBar.d.ts +0 -3
- package/dist/esm/components/ProgressBar.js +1 -1
- package/dist/esm/components/ProgressBar.js.map +1 -1
- package/dist/esm/components/TimeLine.d.ts +3 -0
- package/dist/esm/components/TimeLine.js +59 -0
- package/dist/esm/components/TimeLine.js.map +1 -0
- package/dist/esm/components/index.d.ts +3 -0
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/helpers/colors.d.ts +3 -1
- package/dist/esm/helpers/colors.js +39 -10
- package/dist/esm/helpers/colors.js.map +1 -1
- package/dist/esm/interfaces/ChatMessage.d.ts +12 -0
- package/dist/esm/interfaces/ChatMessage.js +2 -0
- package/dist/esm/interfaces/ChatMessage.js.map +1 -0
- package/dist/esm/interfaces/DataGrid.d.ts +40 -0
- package/dist/esm/interfaces/DataGrid.js +2 -0
- package/dist/esm/interfaces/DataGrid.js.map +1 -0
- package/dist/esm/interfaces/TimeLine.d.ts +11 -0
- package/dist/esm/interfaces/TimeLine.js +2 -0
- package/dist/esm/interfaces/TimeLine.js.map +1 -0
- package/dist/esm/interfaces/index.d.ts +4 -1
- package/dist/esm/interfaces/index.js +4 -1
- package/dist/esm/interfaces/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +12 -2
- package/dist/esm/types/index.js.map +1 -1
- package/norma-library.tar +0 -0
- package/package.json +3 -2
- package/src/components/ChatMessage.tsx +89 -0
- package/src/components/DataGrid/allData.json +2918 -0
- package/src/components/DataGrid/base/dropdown.tsx +235 -0
- package/src/components/DataGrid/base/number-filter.tsx +43 -0
- package/src/components/DataGrid/base/sorting.tsx +35 -0
- package/src/components/DataGrid/icons.tsx +61 -0
- package/src/components/DataGrid/index.tsx +319 -0
- package/src/components/DataGrid/shared.ts +179 -0
- package/src/components/DataGrid/styled.ts +102 -0
- package/src/components/DataGrid/styles/dropdown.module.css +86 -0
- package/src/components/DataGrid/styles/number-filter.module.css +16 -0
- package/src/components/DataGrid/styles/styles.module.css +107 -0
- package/src/components/Icons.tsx +1 -1
- package/src/components/ProgressBar.tsx +2 -1
- package/src/components/TimeLine.tsx +103 -0
- package/src/components/index.ts +3 -0
- package/src/helpers/colors.ts +44 -10
- package/src/interfaces/ChatMessage.ts +12 -0
- package/src/interfaces/DataGrid.ts +51 -0
- package/src/interfaces/TimeLine.ts +16 -0
- package/src/interfaces/index.ts +4 -1
- package/src/sample-data.json +178 -0
- package/src/stories/ChatMessage.stories.tsx +85 -0
- package/src/stories/DataGrid.stories.tsx +28 -0
- package/src/stories/TimeLine.stories.tsx +43 -0
- package/src/types/index.ts +26 -1
|
@@ -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,
|
|
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,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
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";
|
|
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, TableProps as MuiTableProps } 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,15 @@ 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">;
|
|
41
|
+
export type MuiDataGridBaseProps = Omit<MuiTableProps, "sx">;
|
|
39
42
|
export type MuiAvatarBaseProps = Omit<MuiAvatarProps, "sx" | "src" | "children" | "variant" | "sizes">;
|
|
43
|
+
export type MuiTimeLineBaseProps = Omit<MuiTimeLineProps, "sx" | "position" | "children" | "ref">;
|
|
40
44
|
export type MuiBadgeBaseProps = Omit<MuiBadgeProps, "sx" | "color" | "children" | "invisible" | "variant" | "className" | "badgeContent">;
|
|
41
45
|
export type IconScale = "xsmall" | "small" | "medium" | "large" | "xlarge" | "2xlarge" | "3xlarge";
|
|
42
46
|
export type IconColors = "inherit" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | "white" | "black";
|
|
@@ -73,6 +77,12 @@ export type DataSelect = {
|
|
|
73
77
|
label: string;
|
|
74
78
|
value: string | number;
|
|
75
79
|
};
|
|
80
|
+
export type DataTimeLine = {
|
|
81
|
+
id?: string;
|
|
82
|
+
title: string;
|
|
83
|
+
data: string;
|
|
84
|
+
by: string;
|
|
85
|
+
};
|
|
76
86
|
export type RenderProps<E extends HTMLElement = HTMLElement> = {
|
|
77
87
|
focusRef?: React.MutableRefObject<E | null>;
|
|
78
88
|
id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAsMA,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/norma-library.tar
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "norma-library",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
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",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"@emotion/react": "^11.11.1",
|
|
43
44
|
"@emotion/styled": "^11.11.0",
|
|
44
45
|
"@material-tailwind/react": "^2.1.1",
|
|
45
|
-
"@mui/icons-material": "^5.14.
|
|
46
|
+
"@mui/icons-material": "^5.14.9",
|
|
46
47
|
"@mui/material": "^5.14.8",
|
|
47
48
|
"@mui/x-date-pickers": "^6.14.0",
|
|
48
49
|
"dayjs": "^1.11.9",
|
|
@@ -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
|
+
};
|