@zydon/common 2.4.92 → 2.4.94
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.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { StackProps } from '@mui/material/Stack';
|
|
2
4
|
|
|
3
5
|
interface PasswordRulesProps {
|
|
4
6
|
password: string;
|
|
@@ -9,8 +11,11 @@ interface PasswordRulesProps {
|
|
|
9
11
|
match?: {
|
|
10
12
|
passwordMatch?: boolean;
|
|
11
13
|
};
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
containerProps?: StackProps;
|
|
16
|
+
theme?: 'light' | 'dark';
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
declare const PasswordRules: ({ password, passwordSize, numberChar, specialCharacter, upperCaseChar, match, }: PasswordRulesProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare const PasswordRules: ({ password, passwordSize, numberChar, specialCharacter, upperCaseChar, match, title, theme, containerProps, }: PasswordRulesProps) => react_jsx_runtime.JSX.Element;
|
|
15
20
|
|
|
16
21
|
export { PasswordRules as default };
|
|
@@ -2,10 +2,10 @@ import { d } from '../../chunk-KOELUX3V.js';
|
|
|
2
2
|
import { a as a$1 } from '../../chunk-GEGVRJQE.js';
|
|
3
3
|
import '../../chunk-XELLQQ2N.js';
|
|
4
4
|
import a from '@mui/material/Typography';
|
|
5
|
-
import
|
|
5
|
+
import i from '@mui/material/Stack';
|
|
6
6
|
import { styled, alpha } from '@mui/material/styles';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var R=styled(
|
|
9
|
+
var R=styled(i)(({theme:e})=>({width:"100%",borderColor:`${alpha(e.palette.grey[500],.32)}`,padding:16,borderRadius:8,gap:8})),y=styled(i)(()=>({gap:4})),t=styled(i,{shouldForwardProp:e=>e!=="themeColor"})(({theme:e,themeColor:s})=>({flexDirection:"row",alignItems:"center",gap:8,color:s==="light"?e.palette.text.secondary:e.palette.common.white,div:{fontSize:12},strong:{fontWeight:700,color:s==="light"?e.palette.text.primary:e.palette.common.white}}));var l=({passed:e})=>e?jsx(a$1,{icon:"SIMPLE_CHECK",color:"success.main"}):jsx(a$1,{icon:"WARNING_TRIANGULE",color:"warning.main"}),I=({password:e,passwordSize:s,numberChar:d$1=!1,specialCharacter:m=!1,upperCaseChar:g=!1,match:u,title:f="Sua senha deve conter:",theme:n="light",containerProps:P})=>{let{hasSpecialCharacter:C,hasUpperCaseChar:v,isLengthValid:T,hasNumberChar:w}=d(e,s,d$1,m,g);return jsxs(R,{border:"1px solid",...P,children:[f&&jsx(a,{color:"text.secondary",variant:"body2",children:"Sua senha deve conter:"}),jsxs(y,{children:[jsxs(t,{themeColor:n,children:[jsx(l,{passed:T}),jsxs(a,{component:"div",children:[jsxs("strong",{children:[s[0],"-",s[1]]})," ","caracteres"]})]}),g&&jsxs(t,{themeColor:n,children:[jsx(l,{passed:v}),jsxs(a,{component:"div",children:["Pelo menos uma ",jsx("strong",{children:"letra mai\xFAscula"})]})]}),d$1&&jsxs(t,{themeColor:n,children:[jsx(l,{passed:w}),jsxs(a,{component:"div",children:["Pelo menos ",jsx("strong",{children:"um n\xFAmero"})]})]}),m&&jsxs(t,{themeColor:n,children:[jsx(l,{passed:C}),jsxs(a,{component:"div",children:["Pelo menos um ",jsx("strong",{children:"caracter especial"})," ",jsx("span",{children:"(#,@,!,?)"})]})]}),u&&jsxs(t,{themeColor:n,children:[jsx(l,{passed:u.passwordMatch}),jsx(a,{component:"div",children:"Senha e confirma\xE7\xE3o de senha devem ser iguais"})]})]})]})},G=I;
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { G as default };
|
|
@@ -14,6 +14,6 @@ type PasswordProps = BaseField<TextFieldProps> & {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
declare const Password: ({ name, sx, rules, passwordSize, specialCharacter, upperCaseChar, numberChar, showErrorMessage, match, helperText, ...other }: PasswordProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare const Password: ({ name, sx, rules, passwordSize, specialCharacter, upperCaseChar, numberChar, showErrorMessage, match, helperText, InputProps, ...other }: PasswordProps) => react_jsx_runtime.JSX.Element;
|
|
18
18
|
|
|
19
19
|
export { Password as default };
|
|
@@ -4,10 +4,10 @@ import { a as a$1 } from '../../../chunk-GEGVRJQE.js';
|
|
|
4
4
|
import '../../../chunk-XELLQQ2N.js';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { useFormContext } from 'react-hook-form';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
import b from '@mui/material/IconButton';
|
|
8
|
+
import y from '@mui/material/InputAdornment';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var N=({name:e,sx:P,rules:n,passwordSize:d$1,specialCharacter:i,upperCaseChar:p,numberChar:l,showErrorMessage:x,match:r,helperText:m,InputProps:f,...I})=>{let{watch:h}=useFormContext(),g=h(e),[t,v]=useState(!1),{hasNumberChar:C,hasSpecialCharacter:V,hasUpperCaseChar:A,isLengthValid:F}=d(g,d$1,l,i,p),S=(!V||!A||!F||!C)&&!x?"none":void 0;return jsx(a,{"data-intercom-target":e,...I,name:e,type:t?"text":"password",InputProps:{...f,endAdornment:jsxs(y,{position:"end",children:[f?.endAdornment,jsx(b,{onClick:()=>v(!t),edge:"end","aria-label":"Mostrar/Ocultar senha",tabIndex:-1,children:jsx(a$1,{icon:t?"VIEW_ON":"VIEW_OFF"})})]})},rules:{...n,validate:{...n?.validate,validationPassword:u=>{let o=d(u,d$1,l,i,p);return !o.hasNumberChar||!o.hasSpecialCharacter||!o.hasUpperCaseChar||!o.isLengthValid?"Senha inv\xE1lida":r&&r.fieldPassword&&h(r.fieldPassword)!==u?"As senhas devem ser iguais":!0}}},sx:{...P,"& .MuiFormHelperText-root":{display:m?void 0:S}},forceShowHelperText:!0,helperText:m})},D=N;
|
|
12
12
|
|
|
13
|
-
export {
|
|
13
|
+
export { D as default };
|