@consumidor-positivo/aurora 0.0.125 → 0.0.127
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.
|
@@ -26,6 +26,7 @@ const PasswordField = ({
|
|
|
26
26
|
disabled,
|
|
27
27
|
style,
|
|
28
28
|
className,
|
|
29
|
+
numericKeypad,
|
|
29
30
|
...props
|
|
30
31
|
}) => {
|
|
31
32
|
const { fieldType, textButton, changeVisibility } = usePasswordField();
|
|
@@ -58,6 +59,7 @@ const PasswordField = ({
|
|
|
58
59
|
type: fieldType,
|
|
59
60
|
id,
|
|
60
61
|
inputRef,
|
|
62
|
+
inputMode: numericKeypad ? "numeric" : void 0,
|
|
61
63
|
disabled,
|
|
62
64
|
...props
|
|
63
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/PasswordField/hook.tsx","../../../lib/components/form/PasswordField/index.tsx"],"sourcesContent":["import { useState } from 'react'\n\nexport const usePasswordField = () => {\n const [showPassword, setShowPassword] = useState<boolean>(false)\n const fieldType = showPassword ? 'text' : 'password'\n const textButton = showPassword ? 'ocultar' : 'mostrar'\n\n function changeVisibility() {\n setShowPassword((prevState) => !prevState)\n }\n\n return {\n fieldType,\n textButton,\n changeVisibility,\n }\n}\n","import Field from '../Field'\nimport { usePasswordField } from './hook'\nimport './styles.scss'\n\ntype PasswordFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {\n type?: 'password'\n showOptionalLabel?: boolean\n requiredInput?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n label?: string\n inputRef?: React.RefObject<HTMLInputElement>\n}\n\nexport const PasswordField = ({\n showOptionalLabel,\n requiredInput,\n success,\n error,\n errorMessage,\n label,\n inputRef,\n id,\n disabled,\n style,\n className,\n ...props\n}: PasswordFieldProps) => {\n const { fieldType, textButton, changeVisibility } = usePasswordField()\n\n return (\n <Field.Root\n style={style}\n customclass={className}\n success={success}\n error={error}\n disabled={disabled}>\n <Field.Label\n text={label}\n id={id}\n required={requiredInput}\n showOptionalLabel={showOptionalLabel}\n success={success}\n error={error}\n disabled={disabled}\n />\n <div className=\"au-password-field__container\">\n <Field.Input\n customclass=\"au-password-field__input\"\n type={fieldType}\n id={id}\n inputRef={inputRef}\n disabled={disabled}\n {...props}\n />\n <button\n className=\"au-password-field__btn\"\n onClick={changeVisibility}\n disabled={disabled}\n\t\t\t\t\ttype=\"button\">\n {textButton}\n </button>\n </div>\n <Field.ErrorMessage hasError={!!error} message={errorMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkB,KAAK;AACzD,QAAA,YAAY,eAAe,SAAS;AACpC,QAAA,aAAa,eAAe,YAAY;AAE9C,WAAS,mBAAmB;AACV,oBAAA,CAAC,cAAc,CAAC,SAAS;AAAA,EAC3C;AAEO,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/form/PasswordField/hook.tsx","../../../lib/components/form/PasswordField/index.tsx"],"sourcesContent":["import { useState } from 'react'\n\nexport const usePasswordField = () => {\n const [showPassword, setShowPassword] = useState<boolean>(false)\n const fieldType = showPassword ? 'text' : 'password'\n const textButton = showPassword ? 'ocultar' : 'mostrar'\n\n function changeVisibility() {\n setShowPassword((prevState) => !prevState)\n }\n\n return {\n fieldType,\n textButton,\n changeVisibility,\n }\n}\n","import Field from '../Field'\nimport { usePasswordField } from './hook'\nimport './styles.scss'\n\ntype PasswordFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {\n type?: 'password'\n showOptionalLabel?: boolean\n requiredInput?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n label?: string\n inputRef?: React.RefObject<HTMLInputElement>\n numericKeypad?: boolean\n}\n\nexport const PasswordField = ({\n showOptionalLabel,\n requiredInput,\n success,\n error,\n errorMessage,\n label,\n inputRef,\n id,\n disabled,\n style,\n className,\n numericKeypad,\n ...props\n}: PasswordFieldProps) => {\n const { fieldType, textButton, changeVisibility } = usePasswordField()\n\n return (\n <Field.Root\n style={style}\n customclass={className}\n success={success}\n error={error}\n disabled={disabled}>\n <Field.Label\n text={label}\n id={id}\n required={requiredInput}\n showOptionalLabel={showOptionalLabel}\n success={success}\n error={error}\n disabled={disabled}\n />\n <div className=\"au-password-field__container\">\n <Field.Input\n customclass=\"au-password-field__input\"\n type={fieldType}\n id={id}\n inputRef={inputRef}\n inputMode={numericKeypad ? \"numeric\" : undefined}\n disabled={disabled}\n {...props}\n />\n <button\n className=\"au-password-field__btn\"\n onClick={changeVisibility}\n disabled={disabled}\n\t\t\t\t\ttype=\"button\">\n {textButton}\n </button>\n </div>\n <Field.ErrorMessage hasError={!!error} message={errorMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;;AAEO,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkB,KAAK;AACzD,QAAA,YAAY,eAAe,SAAS;AACpC,QAAA,aAAa,eAAe,YAAY;AAE9C,WAAS,mBAAmB;AACV,oBAAA,CAAC,cAAc,CAAC,SAAS;AAAA,EAC3C;AAEO,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;ACAO,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA0B;AACxB,QAAM,EAAE,WAAW,YAAY,qBAAqB,iBAAiB;AAGnE,SAAA;AAAA,IAAC,MAAM;AAAA,IAAN;AAAA,MACC;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAA;AAAA,QAAA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,QACA,qBAAC,OAAI,EAAA,WAAU,gCACb,UAAA;AAAA,UAAA;AAAA,YAAC,MAAM;AAAA,YAAN;AAAA,cACC,aAAY;AAAA,cACZ,MAAM;AAAA,cACN;AAAA,cACA;AAAA,cACA,WAAW,gBAAgB,YAAY;AAAA,cACvC;AAAA,cACC,GAAG;AAAA,YAAA;AAAA,UACN;AAAA,UACA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,SAAS;AAAA,cACT;AAAA,cACL,MAAK;AAAA,cACC,UAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA,GACF;AAAA,QACA,oBAAC,MAAM,cAAN,EAAmB,UAAU,CAAC,CAAC,OAAO,SAAS,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-text{font-family:"Source Sans 3",sans-serif;font-weight:400}.au-text--color-common{color:#16181d}.au-text--color-secondary{color:#454a54}.au-text--color-white{color:#fff}.au-text--weight-bold{font-weight:700}.au-text--weight-semibold{font-weight:600}.au-text--weight-medium{font-weight:500}.au-text--weight-regular{font-weight:400}.au-text--weight-light{font-weight:300}.au-text--display-large,.au-text--display-medium,.au-text--display-small{font-family:Lexend Deca,sans-serif}.au-text--display-large{font-size:56px;line-height:
|
|
1
|
+
.au-text{font-family:"Source Sans 3",sans-serif;font-weight:400}.au-text--color-common{color:#16181d}.au-text--color-secondary{color:#454a54}.au-text--color-white{color:#fff}.au-text--weight-bold{font-weight:700}.au-text--weight-semibold{font-weight:600}.au-text--weight-medium{font-weight:500}.au-text--weight-regular{font-weight:400}.au-text--weight-light{font-weight:300}.au-text--display-large,.au-text--display-medium,.au-text--display-small{font-family:Lexend Deca,sans-serif}.au-text--display-large{font-size:56px;line-height:78px}.au-text--display-medium{font-size:48px;line-height:67px}.au-text--display-small{font-size:40px;line-height:56px}.au-text--heading-big,.au-text--heading-large,.au-text--heading-medium,.au-text--heading-small,.au-text--heading-micro{font-family:Lexend Deca,sans-serif}.au-text--heading-big{font-size:32px;line-height:45px}.au-text--heading-large{font-size:28px;line-height:39px}.au-text--heading-medium{font-size:24px;line-height:34px}.au-text--heading-small{font-size:20px;line-height:28px}.au-text--heading-micro{font-size:16px;line-height:24px}.au-text--body-big,.au-text--body-large,.au-text--body-medium,.au-text--body-small{font-family:"Source Sans 3",sans-serif}.au-text--body-big{font-size:24px;line-height:34px}.au-text--body-large{font-size:20px;line-height:28px}.au-text--body-medium{font-size:16px;line-height:24px}.au-text--body-small{font-size:14px;line-height:22px}.au-text--caption{font-family:"Source Sans 3",sans-serif;font-size:12px;line-height:19px}@media (min-width: 1024px){.au-text--desk-display-large,.au-text--desk-display-medium,.au-text--desk-display-small{font-family:Lexend Deca,sans-serif}.au-text--desk-display-large{font-size:56px;line-height:78px}.au-text--desk-display-medium{font-size:48px;line-height:67px}.au-text--desk-display-small{font-size:40px;line-height:56px}.au-text--desk-heading-big,.au-text--desk-heading-large,.au-text--desk-heading-medium,.au-text--desk-heading-small,.au-text--desk-heading-micro{font-family:Lexend Deca,sans-serif}.au-text--desk-heading-big{font-size:32px;line-height:45px}.au-text--desk-heading-large{font-size:28px;line-height:39px}.au-text--desk-heading-medium{font-size:24px;line-height:34px}.au-text--desk-heading-small{font-size:20px;line-height:28px}.au-text--desk-heading-micro{font-size:16px;line-height:24px}.au-text--desk-body-big,.au-text--desk-body-large,.au-text--desk-body-medium,.au-text--desk-body-small{font-family:"Source Sans 3",sans-serif}.au-text--desk-body-big{font-size:24px;line-height:34px}.au-text--desk-body-large{font-size:20px;line-height:28px}.au-text--desk-body-medium{font-size:16px;line-height:24px}.au-text--desk-body-small{font-size:14px;line-height:22px}.au-text--desk-caption{font-family:"Source Sans 3",sans-serif;font-size:12px;line-height:19px}}
|
|
@@ -8,6 +8,7 @@ type PasswordFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
8
8
|
errorMessage?: string;
|
|
9
9
|
label?: string;
|
|
10
10
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
11
|
+
numericKeypad?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const PasswordField: ({ showOptionalLabel, requiredInput, success, error, errorMessage, label, inputRef, id, disabled, style, className, ...props }: PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const PasswordField: ({ showOptionalLabel, requiredInput, success, error, errorMessage, label, inputRef, id, disabled, style, className, numericKeypad, ...props }: PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|