norma-library 0.5.142 → 0.5.144

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,10 @@
1
+ import React from 'react';
2
+ import { OnAction } from '@/types';
3
+ interface ModalStatusProps {
4
+ title: string;
5
+ text: string;
6
+ type: 'success' | 'info' | 'warning';
7
+ actions: OnAction[];
8
+ }
9
+ export declare const ModalStatus: (props: ModalStatusProps) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { WarningRounded, CheckCircleRounded, InfoRounded } from '@mui/icons-material';
3
+ import * as S from './StatusModal.style';
4
+ import { Button } from '../Button';
5
+ export var ModalStatus = function (props) {
6
+ var title = props.title, text = props.text, type = props.type, actions = props.actions;
7
+ var iconBgColor = {
8
+ warning: '#FFDB9F',
9
+ info: '#D9FCFE',
10
+ success: '#C9F5CB',
11
+ };
12
+ return (React.createElement(S.Container, null,
13
+ React.createElement(S.Modal, null,
14
+ React.createElement(S.ModalHeader, null,
15
+ React.createElement(S.ModalIcon, { "$bg": iconBgColor[type] },
16
+ type === 'warning' && React.createElement(WarningRounded, { sx: { fill: '#B74608' } }),
17
+ type === 'info' && React.createElement(InfoRounded, { sx: { fill: '#154F8C' } }),
18
+ type === 'success' && React.createElement(CheckCircleRounded, { sx: { fill: '#2E7D32' } })),
19
+ React.createElement(S.ModalTitle, null, title)),
20
+ React.createElement(S.ModalBody, null,
21
+ React.createElement(S.ModalText, null, text)),
22
+ React.createElement(S.ModalFooter, null, actions.map(function (action, key) {
23
+ return (React.createElement(Button, { key: key, color: action.color || 'primary', variant: action.variant || 'contained', disabled: action.disabled, onClick: action.action }, action.label));
24
+ })))));
25
+ };
26
+ //# sourceMappingURL=StatusModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusModal.js","sourceRoot":"","sources":["../../../../src/components/StatusModal/StatusModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAA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AG,EACR,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,SAAS,EAChC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW,EACtC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,MAAM,CAAC,MAAM,IAErB,MAAM,CAAC,KAAK,CACN,CACV,CAAC;YACJ,CAAC,CAAC,CACY,CACR,CACE,CACf,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const Modal: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
+ export declare const ModalHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
+ export declare const ModalIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
6
+ $bg: string;
7
+ }>> & string;
8
+ export declare const ModalTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
9
+ export declare const ModalBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
+ export declare const ModalText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
11
+ export declare const ModalFooter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -0,0 +1,12 @@
1
+ import { __makeTemplateObject } from "tslib";
2
+ import styled from 'styled-components';
3
+ export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background: rgba(0, 0, 0, 0.6);\n z-index: 999;\n"], ["\n width: 100vw;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n background: rgba(0, 0, 0, 0.6);\n z-index: 999;\n"])));
4
+ export var Modal = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n width: 430px;\n padding: 24px;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n border-radius: 4px;\n background: #fff;\n"], ["\n display: flex;\n width: 430px;\n padding: 24px;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n border-radius: 4px;\n background: #fff;\n"])));
5
+ export var ModalHeader = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n gap: 16px;\n align-self: stretch;\n align-items: center;\n"], ["\n display: flex;\n gap: 16px;\n align-self: stretch;\n align-items: center;\n"])));
6
+ export var ModalIcon = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n padding: 4px;\n align-items: center;\n border-radius: 4px;\n background-color: ", ";\n"], ["\n display: flex;\n padding: 4px;\n align-items: center;\n border-radius: 4px;\n background-color: ", ";\n"])), function (props) { return props.$bg; });
7
+ export var ModalTitle = styled.h1(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: #1d1d1d;\n font-size: 24px;\n font-style: normal;\n font-weight: 500;\n letter-spacing: 0.25px;\n margin: 0;\n"], ["\n color: #1d1d1d;\n font-size: 24px;\n font-style: normal;\n font-weight: 500;\n letter-spacing: 0.25px;\n margin: 0;\n"])));
8
+ export var ModalBody = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n width: 100%;\n border-bottom: 2px solid #a3a3a3;\n margin-top: 16px;\n padding-bottom: 32px;\n"], ["\n display: flex;\n width: 100%;\n border-bottom: 2px solid #a3a3a3;\n margin-top: 16px;\n padding-bottom: 32px;\n"])));
9
+ export var ModalText = styled.p(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: rgba(0, 0, 0, 0.87);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n letter-spacing: 0.17px;\n margin: 0;\n"], ["\n color: rgba(0, 0, 0, 0.87);\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n letter-spacing: 0.17px;\n margin: 0;\n"])));
10
+ export var ModalFooter = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n width: 100%;\n margin-top: 8px;\n gap: 8px;\n"], ["\n display: flex;\n justify-content: flex-end;\n width: 100%;\n margin-top: 8px;\n gap: 8px;\n"])));
11
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
12
+ //# sourceMappingURL=StatusModal.style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusModal.style.js","sourceRoot":"","sources":["../../../../src/components/StatusModal/StatusModal.style.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,+QAAA,4MAWlC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,2PAAA,wLAS9B,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,MAAM,CAAC,GAAG,uJAAA,oFAKpC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,oLAAiB,0GAK9B,EAAkB,KACvC,KADqB,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,GAAG,EAAT,CAAS,CACvC,CAAC;AAEF,MAAM,CAAC,IAAM,UAAU,GAAG,MAAM,CAAC,EAAE,mMAAA,gIAOlC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,GAAG,4LAAA,yHAMlC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,CAAC,+MAAA,4IAOhC,IAAA,CAAC;AAEF,MAAM,CAAC,IAAM,WAAW,GAAG,MAAM,CAAC,GAAG,wKAAA,qGAMpC,IAAA,CAAC"}
@@ -27,4 +27,5 @@ import TextInput from './components/TextInput';
27
27
  import Table from './components/Table';
28
28
  import UncontrolledTable from './components/UncontrolledTable';
29
29
  import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
30
- export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs };
30
+ import { ModalStatus } from './components/StatusModal/StatusModal';
31
+ export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs, ModalStatus, };
package/dist/esm/index.js CHANGED
@@ -27,5 +27,6 @@ import TextInput from './components/TextInput';
27
27
  import Table from './components/Table';
28
28
  import UncontrolledTable from './components/UncontrolledTable';
29
29
  import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
30
- export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs };
30
+ import { ModalStatus } from './components/StatusModal/StatusModal';
31
+ export { Accordion, Button, Card, ChatMessage, ChatMessageBalloon, CheckBox, DatePicker, getPalette, IconButton, Icons, Modal, Paper, ProgressBar, RadioGroup, RangerSlider, Select, Tabs, Tag, TextField, NormaProvider, themes, DateInput, Box, Breadcrumb, SelectInput, MultiSelectInput, Text, Title, TextInput, Table, UncontrolledTable, UncontrolledTabs, ModalStatus, };
31
32
  //# 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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,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,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,aAAa,EACb,MAAM,EACN,SAAS,EACT,GAAG,EACH,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,GACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "norma-library",
3
- "version": "0.5.142",
3
+ "version": "0.5.144",
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": {
@@ -0,0 +1,74 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const Container = styled.div`
4
+ width: 100vw;
5
+ height: 100vh;
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ background: rgba(0, 0, 0, 0.6);
13
+ z-index: 999;
14
+ `;
15
+
16
+ export const Modal = styled.div`
17
+ display: flex;
18
+ width: 430px;
19
+ padding: 24px;
20
+ flex-direction: column;
21
+ justify-content: center;
22
+ align-items: flex-start;
23
+ border-radius: 4px;
24
+ background: #fff;
25
+ `;
26
+
27
+ export const ModalHeader = styled.div`
28
+ display: flex;
29
+ gap: 16px;
30
+ align-self: stretch;
31
+ align-items: center;
32
+ `;
33
+
34
+ export const ModalIcon = styled.div<{ $bg: string }>`
35
+ display: flex;
36
+ padding: 4px;
37
+ align-items: center;
38
+ border-radius: 4px;
39
+ background-color: ${props => props.$bg};
40
+ `;
41
+
42
+ export const ModalTitle = styled.h1`
43
+ color: #1d1d1d;
44
+ font-size: 24px;
45
+ font-style: normal;
46
+ font-weight: 500;
47
+ letter-spacing: 0.25px;
48
+ margin: 0;
49
+ `;
50
+
51
+ export const ModalBody = styled.div`
52
+ display: flex;
53
+ width: 100%;
54
+ border-bottom: 2px solid #a3a3a3;
55
+ margin-top: 16px;
56
+ padding-bottom: 32px;
57
+ `;
58
+
59
+ export const ModalText = styled.p`
60
+ color: rgba(0, 0, 0, 0.87);
61
+ font-size: 16px;
62
+ font-style: normal;
63
+ font-weight: 400;
64
+ letter-spacing: 0.17px;
65
+ margin: 0;
66
+ `;
67
+
68
+ export const ModalFooter = styled.div`
69
+ display: flex;
70
+ justify-content: flex-end;
71
+ width: 100%;
72
+ margin-top: 8px;
73
+ gap: 8px;
74
+ `;
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+
3
+ import { WarningRounded, CheckCircleRounded, InfoRounded } from '@mui/icons-material';
4
+
5
+ import * as S from './StatusModal.style';
6
+ import { Button } from '../Button';
7
+ import { OnAction } from '@/types';
8
+
9
+ interface ModalStatusProps {
10
+ title: string;
11
+ text: string;
12
+ type: 'success' | 'info' | 'warning';
13
+ actions: OnAction[];
14
+ }
15
+
16
+ export const ModalStatus = (props: ModalStatusProps) => {
17
+ const { title, text, type, actions } = props;
18
+
19
+ const iconBgColor = {
20
+ warning: '#FFDB9F',
21
+ info: '#D9FCFE',
22
+ success: '#C9F5CB',
23
+ };
24
+
25
+ return (
26
+ <S.Container>
27
+ <S.Modal>
28
+ <S.ModalHeader>
29
+ <S.ModalIcon $bg={iconBgColor[type]}>
30
+ {type === 'warning' && <WarningRounded sx={{ fill: '#B74608' }} />}
31
+ {type === 'info' && <InfoRounded sx={{ fill: '#154F8C' }} />}
32
+ {type === 'success' && <CheckCircleRounded sx={{ fill: '#2E7D32' }} />}
33
+ </S.ModalIcon>
34
+ <S.ModalTitle>{title}</S.ModalTitle>
35
+ </S.ModalHeader>
36
+ <S.ModalBody>
37
+ <S.ModalText>{text}</S.ModalText>
38
+ </S.ModalBody>
39
+ <S.ModalFooter>
40
+ {actions.map((action, key) => {
41
+ return (
42
+ <Button
43
+ key={key}
44
+ color={action.color || 'primary'}
45
+ variant={action.variant || 'contained'}
46
+ disabled={action.disabled}
47
+ onClick={action.action}
48
+ >
49
+ {action.label}
50
+ </Button>
51
+ );
52
+ })}
53
+ </S.ModalFooter>
54
+ </S.Modal>
55
+ </S.Container>
56
+ );
57
+ };
package/src/index.ts CHANGED
@@ -18,17 +18,16 @@ import { ChatMessage, ChatMessageBalloon } from './components';
18
18
  import { NormaProvider } from './providers/NormaProvider';
19
19
  import { themes, getPalette } from './helpers';
20
20
  import DateInput from './components/DateInput';
21
- import Box from './components/Box'
21
+ import Box from './components/Box';
22
22
  import Breadcrumb from './components/Breadcrumb';
23
23
  import SelectInput from './components/SelectInput';
24
24
  import MultiSelectInput from './components/MultiSelectInput';
25
- import { Title, Text } from './components/Typography'
25
+ import { Title, Text } from './components/Typography';
26
26
  import TextInput from './components/TextInput';
27
27
  import Table from './components/Table';
28
28
  import UncontrolledTable from './components/UncontrolledTable';
29
29
  import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
30
-
31
-
30
+ import { ModalStatus } from './components/StatusModal/StatusModal';
32
31
 
33
32
  export {
34
33
  Accordion,
@@ -62,5 +61,6 @@ export {
62
61
  TextInput,
63
62
  Table,
64
63
  UncontrolledTable,
65
- UncontrolledTabs
64
+ UncontrolledTabs,
65
+ ModalStatus,
66
66
  };
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+
3
+ import type { Meta } from '@storybook/react';
4
+ import { ModalStatus } from '../components/StatusModal/StatusModal';
5
+ import { OnAction } from '../types';
6
+
7
+ const actions: OnAction[] = [
8
+ {
9
+ label: 'Cancelar',
10
+ action: () => {},
11
+ },
12
+ {
13
+ label: 'Entendi',
14
+ action: () => {},
15
+ },
16
+ ];
17
+
18
+ const meta = {
19
+ title: 'Layout/ModalStatus',
20
+ component: ModalStatus,
21
+ parameters: {
22
+ layout: 'centered',
23
+ },
24
+ tags: ['autodocs'],
25
+ argTypes: {},
26
+ } satisfies Meta<typeof ModalStatus>;
27
+
28
+ export default meta;
29
+
30
+ export const ModalSuccess = () => {
31
+ return <ModalStatus title="Título" text="Lorem ipsum dolor sit amet." actions={actions} type="success" />;
32
+ };
33
+
34
+ ModalSuccess.storyName = 'Modal Success';
35
+
36
+ export const ModalWarning = () => {
37
+ return <ModalStatus title="Título" text="Lorem ipsum dolor sit amet." actions={actions} type="warning" />;
38
+ };
39
+
40
+ ModalWarning.storyName = 'Modal Warning';
41
+
42
+ export const ModalInfo = () => {
43
+ return <ModalStatus title="Título" text="Lorem ipsum dolor sit amet." type="info" actions={actions} />;
44
+ };
45
+
46
+ ModalInfo.storyName = 'Modal Info';