@consumidor-positivo/aurora 0.0.63 → 0.0.64

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.
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { c as classNames } from "../../index-CweZ_OcN.js";
3
3
  import "../Icon/index.es.js";
4
4
  import { IconCheck } from "../icons/IconCheck/index.es.js";
5
- import { F as Field } from "../../index-sLk4K3iM.js";
5
+ import { F as Field } from "../../index-DY3hp3Pl.js";
6
6
  import { k as COLOR_NEUTRAL_00 } from "../../tokens-TYOJv1j5.js";
7
7
  import './styles.css';const CheckboxField = ({
8
8
  label,
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import { F as Field } from "../../index-sLk4K3iM.js";
3
+ import { F as Field } from "../../index-DY3hp3Pl.js";
4
4
  import { Conditional } from "../Conditional/index.es.js";
5
5
  import { Text } from "../Text/index.es.js";
6
6
  import $dbSRa$react__default, { useState } from "react";
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { F as Field } from "../../index-sLk4K3iM.js";
2
+ import { F as Field } from "../../index-DY3hp3Pl.js";
3
3
  const InputField = ({
4
4
  optional,
5
5
  requiredInput,
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { F as Field } from "../../index-sLk4K3iM.js";
2
+ import { F as Field } from "../../index-DY3hp3Pl.js";
3
3
  import { useState } from "react";
4
4
  import './styles.css';const usePasswordField = () => {
5
5
  const [showPassword, setShowPassword] = useState(false);
@@ -4,7 +4,7 @@ import "../Icon/index.es.js";
4
4
  import { IconCheck } from "../icons/IconCheck/index.es.js";
5
5
  import { IconChevronDown } from "../icons/IconChevronDown/index.es.js";
6
6
  import { IconSlash } from "../icons/IconSlash/index.es.js";
7
- import { F as Field } from "../../index-sLk4K3iM.js";
7
+ import { F as Field } from "../../index-DY3hp3Pl.js";
8
8
  import { useState, useRef, useEffect } from "react";
9
9
  import './styles.css';const useSelectField = (options, initialValue, onChange, disabled, register, autocomplete = false) => {
10
10
  var _a;
@@ -0,0 +1,71 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Text } from "../Text/index.es.js";
4
+ import { F as Field } from "../../index-DY3hp3Pl.js";
5
+ const TextAreaField = ({
6
+ optional,
7
+ required,
8
+ success,
9
+ error,
10
+ errorMessage,
11
+ label,
12
+ id,
13
+ disabled,
14
+ style,
15
+ className,
16
+ textAreaStyle,
17
+ textareaRef,
18
+ maxLength,
19
+ ...props
20
+ }) => {
21
+ const [charCount, setCharCount] = useState(0);
22
+ const handleInputChange = (e) => {
23
+ setCharCount(e.target.value.length);
24
+ };
25
+ return /* @__PURE__ */ jsxs(
26
+ Field.Root,
27
+ {
28
+ style,
29
+ customclass: className,
30
+ success,
31
+ error,
32
+ disabled,
33
+ children: [
34
+ /* @__PURE__ */ jsx(
35
+ Field.Label,
36
+ {
37
+ text: label,
38
+ id,
39
+ required,
40
+ optional,
41
+ success,
42
+ error,
43
+ disabled
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx(
47
+ Field.TextArea,
48
+ {
49
+ id,
50
+ textareaRef,
51
+ disabled,
52
+ style: textAreaStyle,
53
+ maxLength,
54
+ onChange: handleInputChange,
55
+ ...props
56
+ }
57
+ ),
58
+ maxLength && /* @__PURE__ */ jsxs(Text, { className: "au-field__char-counter", children: [
59
+ charCount,
60
+ "/",
61
+ maxLength
62
+ ] }),
63
+ /* @__PURE__ */ jsx(Field.ErrorMessage, { hasError: !!error, message: errorMessage })
64
+ ]
65
+ }
66
+ );
67
+ };
68
+ export {
69
+ TextAreaField
70
+ };
71
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/TextareaField/index.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { Text } from '@components/Text'\nimport Field from '../Field'\n\nexport type TextAreaProps =\n React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n optional?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n label?: string\n textAreaStyle?: React.CSSProperties\n textareaRef?: React.RefObject<HTMLTextAreaElement>\n }\n\nexport const TextAreaField = ({\n optional,\n required,\n success,\n error,\n errorMessage,\n label,\n id,\n disabled,\n style,\n className,\n textAreaStyle,\n textareaRef,\n maxLength,\n ...props\n}: TextAreaProps) => {\n const [charCount, setCharCount] = useState(0)\n\n const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setCharCount(e.target.value.length)\n }\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={required}\n optional={optional}\n success={success}\n error={error}\n disabled={disabled}\n />\n <Field.TextArea\n id={id}\n textareaRef={textareaRef}\n disabled={disabled}\n style={textAreaStyle}\n maxLength={maxLength}\n onChange={handleInputChange}\n {...props}\n />\n {maxLength && (\n <Text className=\"au-field__char-counter\">\n {charCount}/{maxLength}\n </Text>\n )}\n <Field.ErrorMessage hasError={!!error} message={errorMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;;;AAeO,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;AAAA,EACA,GAAG;AACL,MAAqB;AACnB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,CAAC;AAEtC,QAAA,oBAAoB,CAAC,MAA8C;AAC1D,iBAAA,EAAE,OAAO,MAAM,MAAM;AAAA,EAAA;AAIlC,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;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,QACA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA,UAAU;AAAA,YACT,GAAG;AAAA,UAAA;AAAA,QACN;AAAA,QACC,aACC,qBAAC,MAAK,EAAA,WAAU,0BACb,UAAA;AAAA,UAAA;AAAA,UAAU;AAAA,UAAE;AAAA,QAAA,GACf;AAAA,QAEF,oBAAC,MAAM,cAAN,EAAmB,UAAU,CAAC,CAAC,OAAO,SAAS,cAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpE;"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { F as Field } from "../../index-sLk4K3iM.js";
2
+ import { F as Field } from "../../index-DY3hp3Pl.js";
3
3
  import { useRef, useState, useEffect } from "react";
4
4
  import './styles.css';function inputtedValueIsValid(value) {
5
5
  const numberValue = Number(value);
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type FieldTextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
3
+ textareaRef?: React.RefObject<HTMLTextAreaElement>;
4
+ customclass?: string;
5
+ };
6
+ export declare const FieldTextArea: ({ textareaRef, customclass, ...props }: FieldTextAreaProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -29,5 +29,9 @@ declare const _default: {
29
29
  hasError?: boolean | undefined;
30
30
  message?: string | undefined;
31
31
  }) => import("react/jsx-runtime").JSX.Element | null;
32
+ TextArea: ({ textareaRef, customclass, ...props }: import('react').TextareaHTMLAttributes<HTMLTextAreaElement> & {
33
+ textareaRef?: import('react').RefObject<HTMLTextAreaElement> | undefined;
34
+ customclass?: string | undefined;
35
+ }) => import("react/jsx-runtime").JSX.Element;
32
36
  };
33
37
  export default _default;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export type TextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
3
+ optional?: boolean;
4
+ success?: boolean;
5
+ error?: boolean;
6
+ errorMessage?: string;
7
+ label?: string;
8
+ textAreaStyle?: React.CSSProperties;
9
+ textareaRef?: React.RefObject<HTMLTextAreaElement>;
10
+ };
11
+ export declare const TextAreaField: ({ optional, required, success, error, errorMessage, label, id, disabled, style, className, textAreaStyle, textareaRef, maxLength, ...props }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- .au-field{cursor:pointer;border-radius:8px}.au-field__input-holder{position:relative;height:56px}.au-field__input{background-color:#fff;border:1px solid #454a54;border-radius:8px;box-sizing:border-box;font-family:inherit;font-size:16px;line-height:22px;padding:16px;height:56px;width:100%}.au-field__input:hover{border:1px solid #16181d}.au-field__input:focus{border-color:#0048db;outline:1px solid #0048db}.au-field:focus-within:not(.au-field--error) .au-field__header-label{color:#0048db}.au-field__header{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px}.au-field__header-label{color:#454a54;cursor:pointer;font-size:14px;font-weight:600}.au-field__header-label--required{color:#991717}.au-field__header-icon span{font-size:14px;color:#454a54}.au-field__right-slot{position:absolute;right:16px;top:50%;transform:translateY(-50%)}.au-field__error-message{color:#991717;font-size:16px;font-weight:400;line-height:24px;padding-top:8px}.au-field--disabled{cursor:not-allowed}.au-field--disabled .au-field__input{background-color:#e2e4e9;border-color:#5e6573;color:#5e6573;cursor:not-allowed}.au-field--disabled .au-field__header-label{color:#5e6573;cursor:not-allowed}.au-field--error .au-field__input{background-color:#f5eff0;border-color:#991717}.au-field--error .au-field__input:focus{border-color:#0048db}.au-field--error .au-field__header-label{color:#991717}.au-field--success .au-field__input{animation:inputSuccess 2s forwards}.au-field--success .au-field__header-label{animation:labelSuccess 2s forwards}.au-field--success .au-field__header-icon .au-icon{animation:iconSucess 2s forwards}@keyframes inputSuccess{0%,70%{background-color:#f0fcf5;border-color:#10593b}}@keyframes labelSuccess{0%,70%{color:#10593b}}@keyframes iconSucess{0%,70%{opacity:1}to{opacity:0}}
1
+ .au-field{cursor:pointer;border-radius:8px}.au-field__input-holder{position:relative;height:56px}.au-field__input{height:56px}.au-field__input,.au-field__textarea{background-color:#fff;border:1px solid #454a54;border-radius:8px;box-sizing:border-box;font-family:inherit;font-size:16px;line-height:22px;padding:16px;width:100%}.au-field__input:hover,.au-field__textarea:hover{border:1px solid #16181d}.au-field__input:focus,.au-field__textarea:focus{border-color:#0048db;outline:1px solid #0048db}.au-field__char-counter{text-align:right}.au-field:focus-within:not(.au-field--error) .au-field__header-label{color:#0048db}.au-field__header{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px}.au-field__header-label{color:#454a54;cursor:pointer;font-size:14px;font-weight:600}.au-field__header-label--required{color:#991717}.au-field__header-icon span{font-size:14px;color:#454a54}.au-field__right-slot{position:absolute;right:16px;top:50%;transform:translateY(-50%)}.au-field__error-message{color:#991717;font-size:16px;font-weight:400;line-height:24px;padding-top:8px}.au-field--disabled{cursor:not-allowed}.au-field--disabled .au-field__input,.au-field--disabled .au-field__textarea{background-color:#e2e4e9;border-color:#5e6573;color:#5e6573;cursor:not-allowed}.au-field--disabled .au-field__header-label{color:#5e6573;cursor:not-allowed}.au-field--error .au-field__input,.au-field--error .au-field__textarea{background-color:#f5eff0;border-color:#991717}.au-field--error .au-field__input:focus,.au-field--error .au-field__textarea:focus{border-color:#0048db}.au-field--error .au-field__header-label{color:#991717}.au-field--success .au-field__input,.au-field--success .au-field__textarea{animation:inputSuccess 2s forwards}.au-field--success .au-field__header-label{animation:labelSuccess 2s forwards}.au-field--success .au-field__header-icon .au-icon{animation:iconSucess 2s forwards}@keyframes inputSuccess{0%,70%{background-color:#f0fcf5;border-color:#10593b}}@keyframes labelSuccess{0%,70%{color:#10593b}}@keyframes iconSucess{0%,70%{opacity:1}to{opacity:0}}
@@ -79,14 +79,23 @@ const FieldRoot = ({
79
79
  });
80
80
  return /* @__PURE__ */ jsx("div", { className: inputClasses, style, children });
81
81
  };
82
+ const FieldTextArea = ({
83
+ textareaRef,
84
+ customclass,
85
+ ...props
86
+ }) => {
87
+ const textareaClasses = classNames("au-field__textarea", customclass);
88
+ return /* @__PURE__ */ jsx("textarea", { className: textareaClasses, ref: textareaRef, ...props });
89
+ };
82
90
  const Field = {
83
91
  Root: FieldRoot,
84
92
  Input: FieldInput,
85
93
  InputHolder: FieldInputHolder,
86
94
  Label: FieldLabel,
87
- ErrorMessage: FieldErrorMessage
95
+ ErrorMessage: FieldErrorMessage,
96
+ TextArea: FieldTextArea
88
97
  };
89
98
  export {
90
99
  Field as F
91
100
  };
92
- //# sourceMappingURL=index-sLk4K3iM.js.map
101
+ //# sourceMappingURL=index-DY3hp3Pl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DY3hp3Pl.js","sources":["../lib/components/form/Field/ErrorMessage.tsx","../lib/components/form/Field/Input.tsx","../lib/components/form/Field/InputHolder.tsx","../lib/components/form/Field/Label.tsx","../lib/components/form/Field/Root.tsx","../lib/components/form/Field/TextArea.tsx","../lib/components/form/Field/index.tsx"],"sourcesContent":["type ErrorMessageProps = {\n hasError?: boolean\n message?: string\n}\n\nexport const FieldErrorMessage = ({ hasError, message }: ErrorMessageProps) => {\n if (!hasError || !message) return null\n\n return <p className=\"au-field__error-message\">{message}</p>\n}\n","import classNames from 'classnames'\n\ntype FieldInputProps = React.InputHTMLAttributes<HTMLInputElement> & {\n inputRef?: React.RefObject<HTMLInputElement>\n customclass?: string\n}\n\nexport const FieldInput = ({\n inputRef,\n customclass,\n ...props\n}: FieldInputProps) => {\n const inputClasses = classNames('au-field__input', customclass)\n\n return <input className={inputClasses} ref={inputRef} {...props} />\n}\n","import React from 'react'\n\ntype FieldInputHolderProps = {\n children?: React.ReactNode\n rightSideSlot?: React.ReactNode\n}\n\nexport const FieldInputHolder = ({\n children,\n rightSideSlot,\n}: FieldInputHolderProps) => {\n return (\n <div className=\"au-field__input-holder\">\n {children}\n {rightSideSlot && (\n <div className=\"au-field__right-slot\">{rightSideSlot}</div>\n )}\n </div>\n )\n}\n","import { IconAlertCircle, IconCheck, IconSlash } from '@components/icons'\nimport {\n COLOR_ERROR_50,\n COLOR_NEUTRAL_40,\n COLOR_SUCCESS_50,\n} from '@core/tokens'\n\ntype FieldLabelProps = {\n id?: string\n text?: string\n required?: boolean\n optional?: boolean\n success?: boolean\n error?: boolean\n disabled?: boolean\n}\n\nexport const FieldLabel = ({\n id,\n text,\n required,\n optional,\n success,\n error,\n disabled,\n}: FieldLabelProps) => {\n if (!text) return null\n\n const states = [\n { state: 'optional', value: !!optional, icon: <span>(Opcional)</span> },\n {\n state: 'success',\n value: !!success,\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n {\n state: 'error',\n value: !!error,\n icon: <IconAlertCircle rawColor={COLOR_ERROR_50} />,\n },\n {\n state: 'disabled',\n value: !!disabled,\n icon: <IconSlash rawColor={COLOR_NEUTRAL_40} />,\n },\n ]\n\n const currentState = states.find(({ value }) => !!value)\n\n return (\n <div className=\"au-field__header\">\n <label htmlFor={id} className=\"au-field__header-label\">\n {text}{' '}\n {required && (\n <strong className=\"au-field__header-label--required\">*</strong>\n )}\n </label>\n <div className=\"au-field__header-icon\">{currentState?.icon}</div>\n </div>\n )\n}\n","import classNames from 'classnames'\n\ntype FieldRootProps = {\n children: React.ReactNode\n disabled?: boolean\n success?: boolean\n error?: boolean\n style?: React.CSSProperties\n customclass?: string\n}\n\nexport const FieldRoot = ({\n children,\n disabled,\n success,\n error,\n style,\n customclass,\n}: FieldRootProps) => {\n const inputClasses = classNames('au-field', customclass, {\n 'au-field--disabled': !!disabled,\n 'au-field--success': !!success,\n 'au-field--error': !!error,\n })\n\n return (\n <div className={inputClasses} style={style}>\n {children}\n </div>\n )\n}\n","import classNames from 'classnames'\n\ntype FieldTextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n textareaRef?: React.RefObject<HTMLTextAreaElement>\n customclass?: string\n}\n\nexport const FieldTextArea = ({\n textareaRef,\n customclass,\n ...props\n}: FieldTextAreaProps) => {\n const textareaClasses = classNames('au-field__textarea', customclass)\n\n return <textarea className={textareaClasses} ref={textareaRef} {...props} />\n}\n","import { FieldErrorMessage } from './ErrorMessage'\nimport { FieldInput } from './Input'\nimport { FieldInputHolder } from './InputHolder'\nimport { FieldLabel } from './Label'\nimport { FieldRoot } from './Root'\nimport { FieldTextArea } from './TextArea'\nimport './styles.scss'\n\nexport default {\n Root: FieldRoot,\n Input: FieldInput,\n InputHolder: FieldInputHolder,\n Label: FieldLabel,\n ErrorMessage: FieldErrorMessage,\n TextArea: FieldTextArea,\n}"],"names":[],"mappings":";;;;;;;AAKO,MAAM,oBAAoB,CAAC,EAAE,UAAU,cAAiC;AAC7E,MAAI,CAAC,YAAY,CAAC,QAAgB,QAAA;AAElC,SAAQ,oBAAA,KAAA,EAAE,WAAU,2BAA2B,UAAQ,QAAA,CAAA;AACzD;ACFO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuB;AACf,QAAA,eAAe,WAAW,mBAAmB,WAAW;AAE9D,6BAAQ,SAAM,EAAA,WAAW,cAAc,KAAK,UAAW,GAAG,MAAO,CAAA;AACnE;ACRO,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AACF,MAA6B;AAEzB,SAAA,qBAAC,OAAI,EAAA,WAAU,0BACZ,UAAA;AAAA,IAAA;AAAA,IACA,iBACC,oBAAC,OAAI,EAAA,WAAU,wBAAwB,UAAc,eAAA;AAAA,EAEzD,EAAA,CAAA;AAEJ;ACFO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACjB,MAAA,C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,MAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA0B;AAClB,QAAA,kBAAkB,WAAW,sBAAsB,WAAW;AAEpE,6BAAQ,YAAS,EAAA,WAAW,iBAAiB,KAAK,aAAc,GAAG,MAAO,CAAA;AAC5E;ACPA,MAAe,QAAA;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,cAAc;AAAA,EACd,UAAU;AACd;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@consumidor-positivo/aurora",
3
3
  "private": false,
4
- "version": "0.0.63",
4
+ "version": "0.0.64",
5
5
  "type": "module",
6
6
  "main": "./dist/main.es.js",
7
7
  "modules": "./dist/main.es.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-sLk4K3iM.js","sources":["../lib/components/form/Field/ErrorMessage.tsx","../lib/components/form/Field/Input.tsx","../lib/components/form/Field/InputHolder.tsx","../lib/components/form/Field/Label.tsx","../lib/components/form/Field/Root.tsx","../lib/components/form/Field/index.tsx"],"sourcesContent":["type ErrorMessageProps = {\n hasError?: boolean\n message?: string\n}\n\nexport const FieldErrorMessage = ({ hasError, message }: ErrorMessageProps) => {\n if (!hasError || !message) return null\n\n return <p className=\"au-field__error-message\">{message}</p>\n}\n","import classNames from 'classnames'\n\ntype FieldInputProps = React.InputHTMLAttributes<HTMLInputElement> & {\n inputRef?: React.RefObject<HTMLInputElement>\n customclass?: string\n}\n\nexport const FieldInput = ({\n inputRef,\n customclass,\n ...props\n}: FieldInputProps) => {\n const inputClasses = classNames('au-field__input', customclass)\n\n return <input className={inputClasses} ref={inputRef} {...props} />\n}\n","import React from 'react'\n\ntype FieldInputHolderProps = {\n children?: React.ReactNode\n rightSideSlot?: React.ReactNode\n}\n\nexport const FieldInputHolder = ({\n children,\n rightSideSlot,\n}: FieldInputHolderProps) => {\n return (\n <div className=\"au-field__input-holder\">\n {children}\n {rightSideSlot && (\n <div className=\"au-field__right-slot\">{rightSideSlot}</div>\n )}\n </div>\n )\n}\n","import { IconAlertCircle, IconCheck, IconSlash } from '@components/icons'\nimport {\n COLOR_ERROR_50,\n COLOR_NEUTRAL_40,\n COLOR_SUCCESS_50,\n} from '@core/tokens'\n\ntype FieldLabelProps = {\n id?: string\n text?: string\n required?: boolean\n optional?: boolean\n success?: boolean\n error?: boolean\n disabled?: boolean\n}\n\nexport const FieldLabel = ({\n id,\n text,\n required,\n optional,\n success,\n error,\n disabled,\n}: FieldLabelProps) => {\n if (!text) return null\n\n const states = [\n { state: 'optional', value: !!optional, icon: <span>(Opcional)</span> },\n {\n state: 'success',\n value: !!success,\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n {\n state: 'error',\n value: !!error,\n icon: <IconAlertCircle rawColor={COLOR_ERROR_50} />,\n },\n {\n state: 'disabled',\n value: !!disabled,\n icon: <IconSlash rawColor={COLOR_NEUTRAL_40} />,\n },\n ]\n\n const currentState = states.find(({ value }) => !!value)\n\n return (\n <div className=\"au-field__header\">\n <label htmlFor={id} className=\"au-field__header-label\">\n {text}{' '}\n {required && (\n <strong className=\"au-field__header-label--required\">*</strong>\n )}\n </label>\n <div className=\"au-field__header-icon\">{currentState?.icon}</div>\n </div>\n )\n}\n","import classNames from 'classnames'\n\ntype FieldRootProps = {\n children: React.ReactNode\n disabled?: boolean\n success?: boolean\n error?: boolean\n style?: React.CSSProperties\n customclass?: string\n}\n\nexport const FieldRoot = ({\n children,\n disabled,\n success,\n error,\n style,\n customclass,\n}: FieldRootProps) => {\n const inputClasses = classNames('au-field', customclass, {\n 'au-field--disabled': !!disabled,\n 'au-field--success': !!success,\n 'au-field--error': !!error,\n })\n\n return (\n <div className={inputClasses} style={style}>\n {children}\n </div>\n )\n}\n","import { FieldErrorMessage } from './ErrorMessage'\nimport { FieldInput } from './Input'\nimport { FieldInputHolder } from './InputHolder'\nimport { FieldLabel } from './Label'\nimport { FieldRoot } from './Root'\nimport './styles.scss'\n\nexport default {\n Root: FieldRoot,\n Input: FieldInput,\n InputHolder: FieldInputHolder,\n Label: FieldLabel,\n ErrorMessage: FieldErrorMessage,\n}"],"names":[],"mappings":";;;;;;;AAKO,MAAM,oBAAoB,CAAC,EAAE,UAAU,cAAiC;AAC7E,MAAI,CAAC,YAAY,CAAC,QAAgB,QAAA;AAElC,SAAQ,oBAAA,KAAA,EAAE,WAAU,2BAA2B,UAAQ,QAAA,CAAA;AACzD;ACFO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAuB;AACf,QAAA,eAAe,WAAW,mBAAmB,WAAW;AAE9D,6BAAQ,SAAM,EAAA,WAAW,cAAc,KAAK,UAAW,GAAG,MAAO,CAAA;AACnE;ACRO,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AACF,MAA6B;AAEzB,SAAA,qBAAC,OAAI,EAAA,WAAU,0BACZ,UAAA;AAAA,IAAA;AAAA,IACA,iBACC,oBAAC,OAAI,EAAA,WAAU,wBAAwB,UAAc,eAAA;AAAA,EAEzD,EAAA,CAAA;AAEJ;ACFO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACjB,MAAA,CAAC,KAAa,QAAA;AAElB,QAAM,SAAS;AAAA,IACb,EAAE,OAAO,YAAY,OAAO,CAAC,CAAC,UAAU,MAAM,oBAAC,QAAK,EAAA,UAAA,aAAU,CAAA,EAAQ;AAAA,IACtE;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,WAAU,EAAA,UAAU,iBAAkB,CAAA;AAAA,IAC/C;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,iBAAgB,EAAA,UAAU,eAAgB,CAAA;AAAA,IACnD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