@pipelinesolucoes/notification 1.0.1 → 1.0.2-beta.2
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/components/ConfirmMessage.d.ts +84 -0
- package/dist/components/ConfirmMessage.js +145 -0
- package/dist/components/ConfirmMessage.js.map +1 -0
- package/dist/constant.d.ts +11 -0
- package/dist/constant.js +12 -0
- package/dist/constant.js.map +1 -0
- package/dist/hooks/useConfirmMessage.d.ts +71 -0
- package/dist/hooks/useConfirmMessage.js +92 -0
- package/dist/hooks/useConfirmMessage.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/style/ButtonFormStyled.d.ts +18 -0
- package/dist/style/ButtonFormStyled.js +25 -0
- package/dist/style/ButtonFormStyled.js.map +1 -0
- package/dist/theme.d.ts +2 -27
- package/dist/theme.js +10 -227
- package/dist/theme.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -9
- package/dist/pages/_app.d.ts +0 -2
- package/dist/pages/_app.js +0 -20
- package/dist/pages/_app.js.map +0 -1
- package/dist/pages/_document.d.ts +0 -9
- package/dist/pages/_document.js +0 -33
- package/dist/pages/_document.js.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CSSObject, TypographyVariant } from '@mui/material/styles';
|
|
3
|
+
import { BorderProps, ColorProps, LayoutProps, PipelineSolucoesTypographyTokens } from '@pipelinesolucoes/theme';
|
|
4
|
+
interface ConfirmMessageProps extends Pick<ColorProps, 'background' | 'color'>, BorderProps, LayoutProps {
|
|
5
|
+
icon?: React.ReactElement;
|
|
6
|
+
message: string;
|
|
7
|
+
variantMessage: TypographyVariant;
|
|
8
|
+
variantButton?: TypographyVariant;
|
|
9
|
+
backgroundCancelButton?: string;
|
|
10
|
+
backgroundHoverCancelButton?: string;
|
|
11
|
+
colorCancelButton?: string;
|
|
12
|
+
colorHoverCancelButton?: string;
|
|
13
|
+
borderRadiusCancelButton?: string;
|
|
14
|
+
borderCancelButton?: string;
|
|
15
|
+
boxShadowCancelButton?: string;
|
|
16
|
+
widthCancelButton?: string;
|
|
17
|
+
heightCancelButton?: string;
|
|
18
|
+
paddingCancelButton?: string;
|
|
19
|
+
marginCancelButton?: string;
|
|
20
|
+
backgroundConfirmButton?: string;
|
|
21
|
+
backgroundHoverConfirmButton?: string;
|
|
22
|
+
colorConfirmButton?: string;
|
|
23
|
+
colorHoverConfirmButton?: string;
|
|
24
|
+
borderRadiusConfirmButton?: string;
|
|
25
|
+
borderConfirmButton?: string;
|
|
26
|
+
boxShadowConfirmButton?: string;
|
|
27
|
+
widthConfirmButton?: string;
|
|
28
|
+
heightConfirmButton?: string;
|
|
29
|
+
paddingConfirmButton?: string;
|
|
30
|
+
marginConfirmButton?: string;
|
|
31
|
+
onCancel?: () => void;
|
|
32
|
+
onConfirm?: () => void;
|
|
33
|
+
cancelLabel?: string;
|
|
34
|
+
confirmLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const MessageStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
37
|
+
typo?: CSSObject | PipelineSolucoesTypographyTokens;
|
|
38
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
39
|
+
/**
|
|
40
|
+
* Componente que exibe uma mensagem com um ícone opcional e ações de confirmação,
|
|
41
|
+
* renderizando dois botões: "Cancelar" e "OK".
|
|
42
|
+
*
|
|
43
|
+
* @param {string | number} [width='100%'] Largura do container principal.
|
|
44
|
+
* @param {string | number} [height='auto'] Altura do container principal.
|
|
45
|
+
* @param {string | number} [padding=16] Espaçamento interno do container principal.
|
|
46
|
+
* @param {string | number} [margin=0] Margem externa do container principal.
|
|
47
|
+
* @param {string} [background='#ffffff'] Cor de fundo do container principal.
|
|
48
|
+
* @param {string} [color='inherit'] Cor do texto do container principal.
|
|
49
|
+
* @param {string | number} [borderRadius=12] Raio da borda do container principal.
|
|
50
|
+
* @param {string} [boxShadow='none'] Sombra do container principal.
|
|
51
|
+
* @param {React.ReactElement} [icon] Ícone do Material UI exibido à esquerda da mensagem.
|
|
52
|
+
* @param {string} message Texto da mensagem exibida. Obrigatório.
|
|
53
|
+
* @param {() => void} [onCancel] Callback disparado ao clicar em "Cancelar".
|
|
54
|
+
* @param {() => void} [onConfirm] Callback disparado ao clicar em "OK".
|
|
55
|
+
* @param {string} [cancelLabel='Cancelar'] Texto do botão "Cancelar".
|
|
56
|
+
* @param {string} [confirmLabel='OK'] Texto do botão "OK".
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* import React from 'react';
|
|
61
|
+
* import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
|
62
|
+
* import { ConfirmMessage } from '@/components/ConfirmMessage';
|
|
63
|
+
*
|
|
64
|
+
* const Example = () => {
|
|
65
|
+
* return (
|
|
66
|
+
* <ConfirmMessage
|
|
67
|
+
* icon={<WarningAmberIcon />}
|
|
68
|
+
* message="Tem certeza que deseja remover este item?"
|
|
69
|
+
* onCancel={() => console.log('Cancelou')}
|
|
70
|
+
* onConfirm={() => console.log('Confirmou')}
|
|
71
|
+
* width={520}
|
|
72
|
+
* padding={20}
|
|
73
|
+
* background="#fff8e1"
|
|
74
|
+
* borderRadius={14}
|
|
75
|
+
* boxShadow="0 6px 20px rgba(0,0,0,0.08)"
|
|
76
|
+
* cancelLabel="Não"
|
|
77
|
+
* confirmLabel="Sim"
|
|
78
|
+
* />
|
|
79
|
+
* );
|
|
80
|
+
* };
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
declare const ConfirmMessage: React.FC<ConfirmMessageProps>;
|
|
84
|
+
export default ConfirmMessage;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { styled, useTheme } from '@mui/material/styles';
|
|
4
|
+
import Box from '@mui/material/Box';
|
|
5
|
+
import { ButtonStyled } from '@/style/ButtonFormStyled';
|
|
6
|
+
const StyledRoot = styled(Box, {
|
|
7
|
+
shouldForwardProp: (prop) => ![
|
|
8
|
+
'width',
|
|
9
|
+
'height',
|
|
10
|
+
'padding',
|
|
11
|
+
'margin',
|
|
12
|
+
'background',
|
|
13
|
+
'color',
|
|
14
|
+
'borderRadius',
|
|
15
|
+
'boxShadow',
|
|
16
|
+
].includes(prop),
|
|
17
|
+
})(({ width, height, padding, margin, background, color, borderRadius, boxShadow }) => ({
|
|
18
|
+
width: width !== null && width !== void 0 ? width : '100%',
|
|
19
|
+
height: height !== null && height !== void 0 ? height : 'auto',
|
|
20
|
+
padding: padding !== null && padding !== void 0 ? padding : 16,
|
|
21
|
+
margin: margin !== null && margin !== void 0 ? margin : 0,
|
|
22
|
+
background: background !== null && background !== void 0 ? background : '#ffffff',
|
|
23
|
+
color: color !== null && color !== void 0 ? color : 'inherit',
|
|
24
|
+
borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : 12,
|
|
25
|
+
boxShadow: boxShadow !== null && boxShadow !== void 0 ? boxShadow : 'none',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
gap: 16,
|
|
31
|
+
}));
|
|
32
|
+
const LeftContent = styled('div')(() => ({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
gap: 12,
|
|
36
|
+
minWidth: 0,
|
|
37
|
+
}));
|
|
38
|
+
const IconWrapper = styled('div')(() => ({
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
}));
|
|
44
|
+
const MessageWrapper = styled('div')(() => ({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
minWidth: 0,
|
|
48
|
+
}));
|
|
49
|
+
const ActionsWrapper = styled('div')(() => ({
|
|
50
|
+
display: 'flex',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
gap: 8,
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
}));
|
|
55
|
+
export const MessageStyle = styled('div', {
|
|
56
|
+
shouldForwardProp: (prop) => !['typo'].includes(prop),
|
|
57
|
+
})(({ typo }) => (Object.assign({ color: 'inherit', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, (typo !== null && typo !== void 0 ? typo : {}))));
|
|
58
|
+
/**
|
|
59
|
+
* Componente que exibe uma mensagem com um ícone opcional e ações de confirmação,
|
|
60
|
+
* renderizando dois botões: "Cancelar" e "OK".
|
|
61
|
+
*
|
|
62
|
+
* @param {string | number} [width='100%'] Largura do container principal.
|
|
63
|
+
* @param {string | number} [height='auto'] Altura do container principal.
|
|
64
|
+
* @param {string | number} [padding=16] Espaçamento interno do container principal.
|
|
65
|
+
* @param {string | number} [margin=0] Margem externa do container principal.
|
|
66
|
+
* @param {string} [background='#ffffff'] Cor de fundo do container principal.
|
|
67
|
+
* @param {string} [color='inherit'] Cor do texto do container principal.
|
|
68
|
+
* @param {string | number} [borderRadius=12] Raio da borda do container principal.
|
|
69
|
+
* @param {string} [boxShadow='none'] Sombra do container principal.
|
|
70
|
+
* @param {React.ReactElement} [icon] Ícone do Material UI exibido à esquerda da mensagem.
|
|
71
|
+
* @param {string} message Texto da mensagem exibida. Obrigatório.
|
|
72
|
+
* @param {() => void} [onCancel] Callback disparado ao clicar em "Cancelar".
|
|
73
|
+
* @param {() => void} [onConfirm] Callback disparado ao clicar em "OK".
|
|
74
|
+
* @param {string} [cancelLabel='Cancelar'] Texto do botão "Cancelar".
|
|
75
|
+
* @param {string} [confirmLabel='OK'] Texto do botão "OK".
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* import React from 'react';
|
|
80
|
+
* import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
|
81
|
+
* import { ConfirmMessage } from '@/components/ConfirmMessage';
|
|
82
|
+
*
|
|
83
|
+
* const Example = () => {
|
|
84
|
+
* return (
|
|
85
|
+
* <ConfirmMessage
|
|
86
|
+
* icon={<WarningAmberIcon />}
|
|
87
|
+
* message="Tem certeza que deseja remover este item?"
|
|
88
|
+
* onCancel={() => console.log('Cancelou')}
|
|
89
|
+
* onConfirm={() => console.log('Confirmou')}
|
|
90
|
+
* width={520}
|
|
91
|
+
* padding={20}
|
|
92
|
+
* background="#fff8e1"
|
|
93
|
+
* borderRadius={14}
|
|
94
|
+
* boxShadow="0 6px 20px rgba(0,0,0,0.08)"
|
|
95
|
+
* cancelLabel="Não"
|
|
96
|
+
* confirmLabel="Sim"
|
|
97
|
+
* />
|
|
98
|
+
* );
|
|
99
|
+
* };
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
const ConfirmMessage = ({ width, height, padding, margin, background, color, borderRadius, boxShadow, icon, message, variantMessage, variantButton, backgroundCancelButton, backgroundHoverCancelButton, colorCancelButton, colorHoverCancelButton, borderRadiusCancelButton, borderCancelButton, boxShadowCancelButton, widthCancelButton, heightCancelButton, paddingCancelButton, marginCancelButton, backgroundConfirmButton, backgroundHoverConfirmButton, colorConfirmButton, colorHoverConfirmButton, borderRadiusConfirmButton, borderConfirmButton, boxShadowConfirmButton, widthConfirmButton, heightConfirmButton, paddingConfirmButton, marginConfirmButton, onCancel, onConfirm, cancelLabel = 'Cancelar', confirmLabel = 'OK', }) => {
|
|
103
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68;
|
|
104
|
+
const cancelDisabled = !onCancel;
|
|
105
|
+
const confirmDisabled = !onConfirm;
|
|
106
|
+
const theme = useTheme();
|
|
107
|
+
const themeNotification = (_a = theme.pipelinesolucoes) === null || _a === void 0 ? void 0 : _a.notification;
|
|
108
|
+
const wnotific = (_c = (_b = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.width) !== null && _b !== void 0 ? _b : width) !== null && _c !== void 0 ? _c : '100%';
|
|
109
|
+
const hnotific = (_e = (_d = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.height) !== null && _d !== void 0 ? _d : height) !== null && _e !== void 0 ? _e : 'auto';
|
|
110
|
+
const pnotific = (_g = (_f = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.padding) !== null && _f !== void 0 ? _f : padding) !== null && _g !== void 0 ? _g : '16px';
|
|
111
|
+
const mnotific = (_j = (_h = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.margin) !== null && _h !== void 0 ? _h : margin) !== null && _j !== void 0 ? _j : '0';
|
|
112
|
+
const bnotific = (_l = (_k = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.background) !== null && _k !== void 0 ? _k : background) !== null && _l !== void 0 ? _l : '#ffffff';
|
|
113
|
+
const clnotific = (_o = (_m = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.color) !== null && _m !== void 0 ? _m : color) !== null && _o !== void 0 ? _o : 'inherit';
|
|
114
|
+
const brnotific = (_q = (_p = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.borderRadius) !== null && _p !== void 0 ? _p : borderRadius) !== null && _q !== void 0 ? _q : 'inherit';
|
|
115
|
+
const bsnotific = (_s = (_r = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.boxShadow) !== null && _r !== void 0 ? _r : boxShadow) !== null && _s !== void 0 ? _s : 'none';
|
|
116
|
+
const typoMessage = (_u = (_t = (variantMessage && theme.typography[variantMessage])) !== null && _t !== void 0 ? _t : themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.typography) !== null && _u !== void 0 ? _u : theme.typography.body1;
|
|
117
|
+
const bgButtonConfirm = (_x = backgroundConfirmButton !== null && backgroundConfirmButton !== void 0 ? backgroundConfirmButton : (_w = (_v = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _v === void 0 ? void 0 : _v.primary) === null || _w === void 0 ? void 0 : _w.background) !== null && _x !== void 0 ? _x : undefined;
|
|
118
|
+
const bgHoverButtonConfirm = (_0 = backgroundHoverConfirmButton !== null && backgroundHoverConfirmButton !== void 0 ? backgroundHoverConfirmButton : (_z = (_y = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _y === void 0 ? void 0 : _y.primary) === null || _z === void 0 ? void 0 : _z.backgroundHover) !== null && _0 !== void 0 ? _0 : undefined;
|
|
119
|
+
const cButtonConfirm = (_3 = colorConfirmButton !== null && colorConfirmButton !== void 0 ? colorConfirmButton : (_2 = (_1 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _1 === void 0 ? void 0 : _1.primary) === null || _2 === void 0 ? void 0 : _2.color) !== null && _3 !== void 0 ? _3 : undefined;
|
|
120
|
+
const cHoverButtonConfirm = (_6 = colorHoverConfirmButton !== null && colorHoverConfirmButton !== void 0 ? colorHoverConfirmButton : (_5 = (_4 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _4 === void 0 ? void 0 : _4.primary) === null || _5 === void 0 ? void 0 : _5.colorHover) !== null && _6 !== void 0 ? _6 : undefined;
|
|
121
|
+
const brButtonConfirm = (_9 = borderRadiusConfirmButton !== null && borderRadiusConfirmButton !== void 0 ? borderRadiusConfirmButton : (_8 = (_7 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _7 === void 0 ? void 0 : _7.primary) === null || _8 === void 0 ? void 0 : _8.borderRadius) !== null && _9 !== void 0 ? _9 : undefined;
|
|
122
|
+
const bdButtonConfirm = (_12 = borderConfirmButton !== null && borderConfirmButton !== void 0 ? borderConfirmButton : (_11 = (_10 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _10 === void 0 ? void 0 : _10.primary) === null || _11 === void 0 ? void 0 : _11.border) !== null && _12 !== void 0 ? _12 : undefined;
|
|
123
|
+
const bsButtonConfirm = (_15 = boxShadowConfirmButton !== null && boxShadowConfirmButton !== void 0 ? boxShadowConfirmButton : (_14 = (_13 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _13 === void 0 ? void 0 : _13.primary) === null || _14 === void 0 ? void 0 : _14.boxShadow) !== null && _15 !== void 0 ? _15 : undefined;
|
|
124
|
+
const pButtonConfirm = (_18 = paddingConfirmButton !== null && paddingConfirmButton !== void 0 ? paddingConfirmButton : (_17 = (_16 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _16 === void 0 ? void 0 : _16.primary) === null || _17 === void 0 ? void 0 : _17.padding) !== null && _18 !== void 0 ? _18 : undefined;
|
|
125
|
+
const mButtonConfirm = (_21 = marginConfirmButton !== null && marginConfirmButton !== void 0 ? marginConfirmButton : (_20 = (_19 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _19 === void 0 ? void 0 : _19.primary) === null || _20 === void 0 ? void 0 : _20.padding) !== null && _21 !== void 0 ? _21 : undefined;
|
|
126
|
+
const wButtonConfirm = (_24 = widthConfirmButton !== null && widthConfirmButton !== void 0 ? widthConfirmButton : (_23 = (_22 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _22 === void 0 ? void 0 : _22.primary) === null || _23 === void 0 ? void 0 : _23.padding) !== null && _24 !== void 0 ? _24 : undefined;
|
|
127
|
+
const hButtonConfirm = (_27 = heightConfirmButton !== null && heightConfirmButton !== void 0 ? heightConfirmButton : (_26 = (_25 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _25 === void 0 ? void 0 : _25.primary) === null || _26 === void 0 ? void 0 : _26.padding) !== null && _27 !== void 0 ? _27 : undefined;
|
|
128
|
+
const typoConfirm = (_31 = (_28 = (variantButton && theme.typography[variantButton])) !== null && _28 !== void 0 ? _28 : (_30 = (_29 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _29 === void 0 ? void 0 : _29.primary) === null || _30 === void 0 ? void 0 : _30.typography) !== null && _31 !== void 0 ? _31 : theme.typography.body1;
|
|
129
|
+
const bgButtonCancel = (_34 = backgroundCancelButton !== null && backgroundCancelButton !== void 0 ? backgroundCancelButton : (_33 = (_32 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _32 === void 0 ? void 0 : _32.secondary) === null || _33 === void 0 ? void 0 : _33.background) !== null && _34 !== void 0 ? _34 : undefined;
|
|
130
|
+
const bgHoverButtonCancel = (_37 = backgroundHoverCancelButton !== null && backgroundHoverCancelButton !== void 0 ? backgroundHoverCancelButton : (_36 = (_35 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _35 === void 0 ? void 0 : _35.secondary) === null || _36 === void 0 ? void 0 : _36.backgroundHover) !== null && _37 !== void 0 ? _37 : undefined;
|
|
131
|
+
const cButtonCancel = (_40 = colorCancelButton !== null && colorCancelButton !== void 0 ? colorCancelButton : (_39 = (_38 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _38 === void 0 ? void 0 : _38.secondary) === null || _39 === void 0 ? void 0 : _39.color) !== null && _40 !== void 0 ? _40 : undefined;
|
|
132
|
+
const cHoverButtonCancel = (_43 = colorHoverCancelButton !== null && colorHoverCancelButton !== void 0 ? colorHoverCancelButton : (_42 = (_41 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _41 === void 0 ? void 0 : _41.secondary) === null || _42 === void 0 ? void 0 : _42.colorHover) !== null && _43 !== void 0 ? _43 : undefined;
|
|
133
|
+
const brButtonCancel = (_46 = borderRadiusCancelButton !== null && borderRadiusCancelButton !== void 0 ? borderRadiusCancelButton : (_45 = (_44 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _44 === void 0 ? void 0 : _44.secondary) === null || _45 === void 0 ? void 0 : _45.borderRadius) !== null && _46 !== void 0 ? _46 : undefined;
|
|
134
|
+
const bdButtonCancel = (_49 = borderCancelButton !== null && borderCancelButton !== void 0 ? borderCancelButton : (_48 = (_47 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _47 === void 0 ? void 0 : _47.secondary) === null || _48 === void 0 ? void 0 : _48.border) !== null && _49 !== void 0 ? _49 : undefined;
|
|
135
|
+
const bsButtonCancel = (_52 = boxShadowCancelButton !== null && boxShadowCancelButton !== void 0 ? boxShadowCancelButton : (_51 = (_50 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _50 === void 0 ? void 0 : _50.secondary) === null || _51 === void 0 ? void 0 : _51.boxShadow) !== null && _52 !== void 0 ? _52 : undefined;
|
|
136
|
+
const pButtonCancel = (_55 = paddingCancelButton !== null && paddingCancelButton !== void 0 ? paddingCancelButton : (_54 = (_53 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _53 === void 0 ? void 0 : _53.secondary) === null || _54 === void 0 ? void 0 : _54.padding) !== null && _55 !== void 0 ? _55 : undefined;
|
|
137
|
+
const mButtonCancel = (_58 = marginCancelButton !== null && marginCancelButton !== void 0 ? marginCancelButton : (_57 = (_56 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _56 === void 0 ? void 0 : _56.secondary) === null || _57 === void 0 ? void 0 : _57.padding) !== null && _58 !== void 0 ? _58 : undefined;
|
|
138
|
+
const wButtonCancel = (_61 = widthCancelButton !== null && widthCancelButton !== void 0 ? widthCancelButton : (_60 = (_59 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _59 === void 0 ? void 0 : _59.secondary) === null || _60 === void 0 ? void 0 : _60.padding) !== null && _61 !== void 0 ? _61 : undefined;
|
|
139
|
+
const hButtonCancel = (_64 = heightCancelButton !== null && heightCancelButton !== void 0 ? heightCancelButton : (_63 = (_62 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _62 === void 0 ? void 0 : _62.secondary) === null || _63 === void 0 ? void 0 : _63.padding) !== null && _64 !== void 0 ? _64 : undefined;
|
|
140
|
+
const typoCancel = (_68 = (_65 = (variantButton && theme.typography[variantButton])) !== null && _65 !== void 0 ? _65 : (_67 = (_66 = themeNotification === null || themeNotification === void 0 ? void 0 : themeNotification.buttons) === null || _66 === void 0 ? void 0 : _66.secondary) === null || _67 === void 0 ? void 0 : _67.typography) !== null && _68 !== void 0 ? _68 : theme.typography.body1;
|
|
141
|
+
return (_jsxs(StyledRoot, { width: wnotific, height: hnotific, padding: pnotific, margin: mnotific, background: bnotific, color: clnotific, borderRadius: brnotific, boxShadow: bsnotific, role: "status", "aria-live": "polite", children: [_jsxs(LeftContent, { children: [icon ? _jsx(IconWrapper, { "aria-hidden": "true", children: icon }) : null, _jsx(MessageWrapper, { children: _jsx(MessageStyle, { typo: typoMessage, children: message }) })] }), _jsxs(ActionsWrapper, { children: [_jsx(ButtonStyled, { backgroundButton: bgButtonCancel, backgroundHoverButton: bgHoverButtonCancel, colorButton: cButtonCancel, colorHoverButton: cHoverButtonCancel, borderRadiusButton: brButtonCancel, borderButton: bdButtonCancel, boxShadowButton: bsButtonCancel, widthButton: wButtonCancel, heightButton: hButtonCancel, paddingButton: pButtonCancel, marginButton: mButtonCancel, typo: typoCancel, onClick: onCancel, disabled: cancelDisabled, "aria-disabled": cancelDisabled, children: cancelLabel }), _jsx(ButtonStyled, { backgroundButton: bgButtonConfirm, backgroundHoverButton: bgHoverButtonConfirm, colorButton: cButtonConfirm, colorHoverButton: cHoverButtonConfirm, borderRadiusButton: brButtonConfirm, borderButton: bdButtonConfirm, boxShadowButton: bsButtonConfirm, widthButton: wButtonConfirm, heightButton: hButtonConfirm, paddingButton: pButtonConfirm, marginButton: mButtonConfirm, typo: typoConfirm, onClick: onConfirm, disabled: confirmDisabled, "aria-disabled": confirmDisabled, children: confirmLabel })] })] }));
|
|
142
|
+
};
|
|
143
|
+
ConfirmMessage.displayName = 'ConfirmMessage';
|
|
144
|
+
export default ConfirmMessage;
|
|
145
|
+
//# sourceMappingURL=ConfirmMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmMessage.js","sourceRoot":"","sources":["../../src/components/ConfirmMessage.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAa,MAAM,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA2CxD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,EAAE;IAC7B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,OAAO;QACP,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,OAAO;QACP,cAAc;QACd,WAAW;KACZ,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC7B,CAAC,CAGC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtF,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM;IACtB,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,MAAM;IACxB,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;IACtB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AI,EAEnE,KAAC,cAAc,cACb,KAAC,YAAY,IAAC,IAAI,EAAE,WAAW,YAC5B,OAAO,GACK,GACA,IACL,EAEd,MAAC,cAAc,eACb,KAAC,YAAY,IACX,gBAAgB,EAAE,cAAc,EAChC,qBAAqB,EAAE,mBAAmB,EAC1C,WAAW,EAAE,aAAa,EAC1B,gBAAgB,EAAE,kBAAkB,EACpC,kBAAkB,EAAE,cAAc,EAClC,YAAY,EAAE,cAAc,EAC5B,eAAe,EAAE,cAAc,EAC/B,WAAW,EAAE,aAAa,EAC1B,YAAY,EAAE,aAAa,EAC3B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,aAAa,EAC3B,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,cAAc,mBACT,cAAc,YAE5B,WAAW,GACC,EAEf,KAAC,YAAY,IACX,gBAAgB,EAAE,eAAe,EACjC,qBAAqB,EAAE,oBAAoB,EAC3C,WAAW,EAAE,cAAc,EAC3B,gBAAgB,EAAE,mBAAmB,EACrC,kBAAkB,EAAE,eAAe,EACnC,YAAY,EAAE,eAAe,EAC7B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,cAAc,EAC3B,YAAY,EAAE,cAAc,EAC5B,aAAa,EAAE,cAAc,EAC7B,YAAY,EAAE,cAAc,EAC5B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,eAAe,mBACV,eAAe,YAE7B,YAAY,GACA,IACA,IAEN,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const fbbackground = "#fff";
|
|
2
|
+
export declare const fbbackgroundDisabled = "#E5E7EB";
|
|
3
|
+
export declare const fbcolor = "#000";
|
|
4
|
+
export declare const fbcolorDisabled = "#9CA3AF";
|
|
5
|
+
export declare const fbborderRadius = "0";
|
|
6
|
+
export declare const fbboxShadow = "none";
|
|
7
|
+
export declare const fbborderColor = "#ccc";
|
|
8
|
+
export declare const fbcolorFocused = "#1976d2";
|
|
9
|
+
export declare const fbpadding = "8px";
|
|
10
|
+
export declare const fbmargin = "0";
|
|
11
|
+
export declare const fbheigth = "64px";
|
package/dist/constant.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const fbbackground = '#fff';
|
|
2
|
+
export const fbbackgroundDisabled = "#E5E7EB";
|
|
3
|
+
export const fbcolor = '#000';
|
|
4
|
+
export const fbcolorDisabled = "#9CA3AF";
|
|
5
|
+
export const fbborderRadius = "0";
|
|
6
|
+
export const fbboxShadow = "none";
|
|
7
|
+
export const fbborderColor = '#ccc';
|
|
8
|
+
export const fbcolorFocused = '#1976d2';
|
|
9
|
+
export const fbpadding = '8px';
|
|
10
|
+
export const fbmargin = '0';
|
|
11
|
+
export const fbheigth = '64px';
|
|
12
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AACnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAC9C,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;AAC9B,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AAExC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAC5B,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ConfirmMessage from '../components/ConfirmMessage';
|
|
3
|
+
/**
|
|
4
|
+
* As props do ConfirmMessage devem existir no arquivo ConfirmMessage.
|
|
5
|
+
* Como o hook controla onCancel/onConfirm, nós omitimos essas duas props do "options".
|
|
6
|
+
*/
|
|
7
|
+
type ConfirmMessageComponentProps = React.ComponentProps<typeof ConfirmMessage>;
|
|
8
|
+
export interface ConfirmMessageOptions extends Omit<ConfirmMessageComponentProps, 'onCancel' | 'onConfirm'> {
|
|
9
|
+
/**
|
|
10
|
+
* Se clicar no backdrop (fora do card) fecha como "cancelar".
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
closeOnBackdropClick?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Se pressionar ESC fecha como "cancelar".
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
closeOnEsc?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Controla se o overlay/backdrop aparece.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
withBackdrop?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* zIndex do overlay.
|
|
26
|
+
* @default 1300
|
|
27
|
+
*/
|
|
28
|
+
zIndex?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Opacidade do backdrop quando withBackdrop=true.
|
|
31
|
+
* @default 0.4
|
|
32
|
+
*/
|
|
33
|
+
backdropOpacity?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Hook que expõe uma função `confirm(options)` que abre o ConfirmMessage
|
|
37
|
+
* e retorna uma Promise<boolean>:
|
|
38
|
+
* - true => usuário confirmou
|
|
39
|
+
* - false => usuário cancelou/fechou
|
|
40
|
+
*
|
|
41
|
+
* Além disso, retorna `ConfirmMessagePortal` (um ReactNode) que você deve renderizar
|
|
42
|
+
* uma vez no componente (normalmente no final do JSX).
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* const { confirm, ConfirmMessagePortal } = useConfirmMessage();
|
|
47
|
+
*
|
|
48
|
+
* const handleDelete = async () => {
|
|
49
|
+
* const ok = await confirm({ message: 'Deseja excluir?', confirmLabel: 'Excluir' });
|
|
50
|
+
* if (!ok) return;
|
|
51
|
+
* // ...deletar
|
|
52
|
+
* };
|
|
53
|
+
*
|
|
54
|
+
* return (
|
|
55
|
+
* <>
|
|
56
|
+
* <button onClick={handleDelete}>Excluir</button>
|
|
57
|
+
* {ConfirmMessagePortal}
|
|
58
|
+
* </>
|
|
59
|
+
* );
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
declare const useConfirmMessage: {
|
|
63
|
+
(): {
|
|
64
|
+
confirm: (options: ConfirmMessageOptions) => Promise<boolean>;
|
|
65
|
+
close: (result: boolean) => void;
|
|
66
|
+
isOpen: boolean;
|
|
67
|
+
ConfirmMessagePortal: import("react/jsx-runtime").JSX.Element | null;
|
|
68
|
+
};
|
|
69
|
+
displayName: string;
|
|
70
|
+
};
|
|
71
|
+
export default useConfirmMessage;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
16
|
+
import ConfirmMessage from '../components/ConfirmMessage';
|
|
17
|
+
/**
|
|
18
|
+
* Hook que expõe uma função `confirm(options)` que abre o ConfirmMessage
|
|
19
|
+
* e retorna uma Promise<boolean>:
|
|
20
|
+
* - true => usuário confirmou
|
|
21
|
+
* - false => usuário cancelou/fechou
|
|
22
|
+
*
|
|
23
|
+
* Além disso, retorna `ConfirmMessagePortal` (um ReactNode) que você deve renderizar
|
|
24
|
+
* uma vez no componente (normalmente no final do JSX).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { confirm, ConfirmMessagePortal } = useConfirmMessage();
|
|
29
|
+
*
|
|
30
|
+
* const handleDelete = async () => {
|
|
31
|
+
* const ok = await confirm({ message: 'Deseja excluir?', confirmLabel: 'Excluir' });
|
|
32
|
+
* if (!ok) return;
|
|
33
|
+
* // ...deletar
|
|
34
|
+
* };
|
|
35
|
+
*
|
|
36
|
+
* return (
|
|
37
|
+
* <>
|
|
38
|
+
* <button onClick={handleDelete}>Excluir</button>
|
|
39
|
+
* {ConfirmMessagePortal}
|
|
40
|
+
* </>
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
const useConfirmMessage = () => {
|
|
45
|
+
const [state, setState] = useState({ open: false });
|
|
46
|
+
const close = useCallback((result) => {
|
|
47
|
+
setState((prev) => {
|
|
48
|
+
var _a;
|
|
49
|
+
(_a = prev.resolve) === null || _a === void 0 ? void 0 : _a.call(prev, result);
|
|
50
|
+
return { open: false };
|
|
51
|
+
});
|
|
52
|
+
}, []);
|
|
53
|
+
const confirm = useCallback((options) => {
|
|
54
|
+
return new Promise((resolve) => {
|
|
55
|
+
setState({
|
|
56
|
+
open: true,
|
|
57
|
+
resolve,
|
|
58
|
+
options,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}, []);
|
|
62
|
+
const ConfirmMessagePortal = useMemo(() => {
|
|
63
|
+
if (!state.open || !state.options)
|
|
64
|
+
return null;
|
|
65
|
+
const _a = state.options, { closeOnBackdropClick = true, closeOnEsc = true, withBackdrop = true, zIndex = 1300, backdropOpacity = 0.4 } = _a, confirmMessageProps = __rest(_a, ["closeOnBackdropClick", "closeOnEsc", "withBackdrop", "zIndex", "backdropOpacity"]);
|
|
66
|
+
const handleBackdropClick = () => {
|
|
67
|
+
if (closeOnBackdropClick)
|
|
68
|
+
close(false);
|
|
69
|
+
};
|
|
70
|
+
const handleKeyDown = (e) => {
|
|
71
|
+
if (!closeOnEsc)
|
|
72
|
+
return;
|
|
73
|
+
if (e.key === 'Escape')
|
|
74
|
+
close(false);
|
|
75
|
+
};
|
|
76
|
+
return (_jsxs(Box, { onKeyDown: handleKeyDown, tabIndex: -1, sx: Object.assign({ position: 'fixed', inset: 0, zIndex, display: 'flex', alignItems: 'center', justifyContent: 'center' }, (withBackdrop
|
|
77
|
+
? { backgroundColor: `rgba(0,0,0,${backdropOpacity})` }
|
|
78
|
+
: {})), children: [_jsx(Box, { onClick: handleBackdropClick, sx: {
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
inset: 0,
|
|
81
|
+
} }), _jsx(Box, { sx: { position: 'relative', maxWidth: 'calc(100vw - 32px)' }, onClick: (e) => e.stopPropagation(), children: _jsx(ConfirmMessage, Object.assign({}, confirmMessageProps, { onCancel: () => close(false), onConfirm: () => close(true) })) })] }));
|
|
82
|
+
}, [close, state.open, state.options]);
|
|
83
|
+
return {
|
|
84
|
+
confirm,
|
|
85
|
+
close,
|
|
86
|
+
isOpen: state.open,
|
|
87
|
+
ConfirmMessagePortal,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
useConfirmMessage.displayName = 'useConfirmMessage';
|
|
91
|
+
export default useConfirmMessage;
|
|
92
|
+
//# sourceMappingURL=useConfirmMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAEvC,OAAO;QACL,OAAO;QACP,KAAK;QACL,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,oBAAoB;KACrB,CAAC;AACJ,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEpD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import '@pipelinesolucoes/theme';
|
|
1
2
|
export { default as TermsAndPrivacyBar } from './components/TermsAndPrivacyBar';
|
|
2
3
|
export { default as TermsAndPrivacyCard } from './components/TermsAndPrivacyCard';
|
|
4
|
+
export { default as ConfirmMessage } from './components/ConfirmMessage';
|
|
5
|
+
export { default as useConfirmMessage } from './hooks/useConfirmMessage';
|
|
3
6
|
export type { BorderProps } from "./types/style/BorderProps";
|
|
4
7
|
export type { LayoutProps } from "./types/style/LayoutProps";
|
|
5
8
|
export type { ColorProps } from "./types/style/ColorProps";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import '@pipelinesolucoes/theme';
|
|
1
2
|
export { default as TermsAndPrivacyBar } from './components/TermsAndPrivacyBar';
|
|
2
3
|
export { default as TermsAndPrivacyCard } from './components/TermsAndPrivacyCard';
|
|
4
|
+
export { default as ConfirmMessage } from './components/ConfirmMessage';
|
|
5
|
+
export { default as useConfirmMessage } from './hooks/useConfirmMessage';
|
|
3
6
|
export { COLOR_STYLE_FORWARD_PROPS } from './types/style/ColorProps';
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAC,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAMxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PipelineSolucoesTypographyTokens } from "@pipelinesolucoes/theme";
|
|
2
|
+
import { CSSObject } from "@mui/material";
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
textButton?: string;
|
|
5
|
+
backgroundButton?: string;
|
|
6
|
+
backgroundHoverButton?: string;
|
|
7
|
+
colorButton?: string;
|
|
8
|
+
colorHoverButton?: string;
|
|
9
|
+
borderRadiusButton?: string;
|
|
10
|
+
borderButton?: string;
|
|
11
|
+
boxShadowButton?: string;
|
|
12
|
+
widthButton?: string;
|
|
13
|
+
heightButton?: string;
|
|
14
|
+
paddingButton?: string;
|
|
15
|
+
marginButton?: string;
|
|
16
|
+
typo?: CSSObject | PipelineSolucoesTypographyTokens;
|
|
17
|
+
}
|
|
18
|
+
export declare const ButtonStyled: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style" | "className" | "tabIndex" | "color" | "children" | "disabled" | "href" | "sx" | "classes" | "variant" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loading" | "loadingIndicator" | "loadingPosition" | "size" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ButtonProps, {}, {}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { fbborderRadius, fbboxShadow, fbcolor } from "../constant";
|
|
2
|
+
import { Button, styled } from "@mui/material";
|
|
3
|
+
const BUTTON_STYLE_FORWARD_PROPS = [
|
|
4
|
+
"textButton",
|
|
5
|
+
"variantButton",
|
|
6
|
+
"backgroundButton",
|
|
7
|
+
"backgroundHoverButton",
|
|
8
|
+
"colorButton",
|
|
9
|
+
"colorHoverButton",
|
|
10
|
+
"borderRadiusButton",
|
|
11
|
+
"borderButton",
|
|
12
|
+
"boxShadowButton",
|
|
13
|
+
"widthButton",
|
|
14
|
+
"heightButton",
|
|
15
|
+
"paddingButton",
|
|
16
|
+
"marginButton",
|
|
17
|
+
"typo",
|
|
18
|
+
];
|
|
19
|
+
export const ButtonStyled = styled(Button, {
|
|
20
|
+
shouldForwardProp: (prop) => !BUTTON_STYLE_FORWARD_PROPS.includes(prop),
|
|
21
|
+
})(({ backgroundButton, backgroundHoverButton, colorButton, colorHoverButton, borderRadiusButton, borderButton, boxShadowButton, widthButton, heightButton, paddingButton, marginButton, typo, }) => (Object.assign(Object.assign({ color: colorButton !== null && colorButton !== void 0 ? colorButton : fbcolor, background: backgroundButton !== null && backgroundButton !== void 0 ? backgroundButton : 'transparent', borderRadius: borderRadiusButton !== null && borderRadiusButton !== void 0 ? borderRadiusButton : fbborderRadius, textTransform: "none", cursor: "pointer", padding: paddingButton !== null && paddingButton !== void 0 ? paddingButton : '4px 24px', boxShadow: boxShadowButton !== null && boxShadowButton !== void 0 ? boxShadowButton : fbboxShadow, width: widthButton, height: heightButton, border: borderButton, margin: marginButton }, (typo !== null && typo !== void 0 ? typo : {})), { "&:hover": {
|
|
22
|
+
background: backgroundHoverButton !== null && backgroundHoverButton !== void 0 ? backgroundHoverButton : 'transparent',
|
|
23
|
+
color: colorHoverButton !== null && colorHoverButton !== void 0 ? colorHoverButton : fbcolor,
|
|
24
|
+
} })));
|
|
25
|
+
//# sourceMappingURL=ButtonFormStyled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonFormStyled.js","sourceRoot":"","sources":["../../src/style/ButtonFormStyled.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,MAAM,EAAa,MAAM,EAAE,MAAM,eAAe,CAAC;AAsB1D,MAAM,0BAA0B,GAAG;IACjC,YAAY;IACZ,eAAe;IACf,kBAAkB;IAClB,uBAAuB;IACvB,aAAa;IACb,kBAAkB;IAClB,oBAAoB;IACpB,cAAc;IACd,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,eAAe;IACf,cAAc;IACd,MAAM;CACE,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IACvC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,0BAA0B,CAAC,QAAQ,CAAC,IAAyB,CAAC;CAC/F,CAAC,CACA,CAAC,EACC,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,IAAI,GACL,EAAE,EAAE,CAAC,+BAEJ,KAAK,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,OAAO,EAC7B,UAAU,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,aAAa,EAC7C,YAAY,EAAE,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,cAAc,EAClD,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,SAAS,EAEjB,OAAO,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,UAAU,EACpC,SAAS,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,WAAW,EACzC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,IAEjB,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,KAEf,SAAS,EAAE;QACT,UAAU,EAAE,qBAAqB,aAArB,qBAAqB,cAArB,qBAAqB,GAAI,aAAa;QAClD,KAAK,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,OAAO;KACnC,IACD,CACH,CAAC"}
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare
|
|
3
|
-
interface ButtonOptions {
|
|
4
|
-
background: string;
|
|
5
|
-
backgroundHover: string;
|
|
6
|
-
color: string;
|
|
7
|
-
colorHover: string;
|
|
8
|
-
borderRadius: string;
|
|
9
|
-
boxShadow?: string;
|
|
10
|
-
}
|
|
11
|
-
interface Palette {
|
|
12
|
-
custom: {
|
|
13
|
-
primaryButton: ButtonOptions;
|
|
14
|
-
secondaryButton: ButtonOptions;
|
|
15
|
-
borderColor?: string;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
interface PaletteOptions {
|
|
19
|
-
custom?: {
|
|
20
|
-
primaryButton?: ButtonOptions;
|
|
21
|
-
secondaryButton?: ButtonOptions;
|
|
22
|
-
borderColor?: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
declare const theme: import("@mui/material/styles").Theme;
|
|
27
|
-
export { theme };
|
|
1
|
+
import { ThemeOptions } from '@mui/material/styles';
|
|
2
|
+
export declare const notificationThemeOptions: ThemeOptions;
|