@consumidor-positivo/aurora 0.0.178 → 0.0.179

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 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/InputField/index.tsx"],"sourcesContent":["import Field from '../Field'\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {\n showOptionalLabel?: boolean\n requiredInput?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n helpMessage?: string\n rightSlot?: React.ReactNode\n label?: string\n inputStyle?: React.CSSProperties\n inputRef?: React.RefObject<HTMLInputElement>\n numericKeypad?: boolean\n}\n\nexport const InputField = ({\n showOptionalLabel,\n requiredInput,\n success,\n error,\n errorMessage,\n helpMessage,\n label,\n id,\n disabled,\n style,\n className,\n inputStyle,\n rightSlot,\n inputRef,\n numericKeypad,\n ...props\n}: InputProps) => {\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 showOptionalLabel={showOptionalLabel}\n required={requiredInput}\n success={success}\n error={error}\n disabled={disabled}\n />\n <Field.InputHolder rightSideSlot={rightSlot}>\n <Field.Input\n id={id}\n inputRef={inputRef}\n inputMode={numericKeypad ? \"numeric\" : undefined}\n disabled={disabled}\n style={inputStyle}\n {...props}\n />\n </Field.InputHolder>\n <Field.Message hasError={!!error} errorMessage={errorMessage} helpMessage={helpMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;AAgBO,MAAM,aAAa,CAAC;AAAA,EACzB;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;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAkB;AAGd,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,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,QACC,oBAAA,MAAM,aAAN,EAAkB,eAAe,WAChC,UAAA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC;AAAA,YACA;AAAA,YACA,WAAW,gBAAgB,YAAY;AAAA,YACvC;AAAA,YACA,OAAO;AAAA,YACN,GAAG;AAAA,UAAA;AAAA,QAAA,GAER;AAAA,QACA,oBAAC,MAAM,SAAN,EAAc,UAAU,CAAC,CAAC,OAAO,cAA4B,aAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9F;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/InputField/index.tsx"],"sourcesContent":["import Field from '../Field'\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {\n showOptionalLabel?: boolean\n requiredInput?: boolean\n success?: boolean\n error?: boolean\n errorMessage?: string\n helpMessage?: string\n rightSlot?: React.ReactNode\n label?: string | React.ReactNode\n inputStyle?: React.CSSProperties\n inputRef?: React.RefObject<HTMLInputElement>\n numericKeypad?: boolean\n}\n\nexport const InputField = ({\n showOptionalLabel,\n requiredInput,\n success,\n error,\n errorMessage,\n helpMessage,\n label,\n id,\n disabled,\n style,\n className,\n inputStyle,\n rightSlot,\n inputRef,\n numericKeypad,\n ...props\n}: InputProps) => {\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 showOptionalLabel={showOptionalLabel}\n required={requiredInput}\n success={success}\n error={error}\n disabled={disabled}\n />\n <Field.InputHolder rightSideSlot={rightSlot}>\n <Field.Input\n id={id}\n inputRef={inputRef}\n inputMode={numericKeypad ? \"numeric\" : undefined}\n disabled={disabled}\n style={inputStyle}\n {...props}\n />\n </Field.InputHolder>\n <Field.Message hasError={!!error} errorMessage={errorMessage} helpMessage={helpMessage} />\n </Field.Root>\n )\n}\n"],"names":[],"mappings":";;AAgBO,MAAM,aAAa,CAAC;AAAA,EACzB;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;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAkB;AAGd,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,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,QACC,oBAAA,MAAM,aAAN,EAAkB,eAAe,WAChC,UAAA;AAAA,UAAC,MAAM;AAAA,UAAN;AAAA,YACC;AAAA,YACA;AAAA,YACA,WAAW,gBAAgB,YAAY;AAAA,YACvC;AAAA,YACA,OAAO;AAAA,YACN,GAAG;AAAA,UAAA;AAAA,QAAA,GAER;AAAA,QACA,oBAAC,MAAM,SAAN,EAAc,UAAU,CAAC,CAAC,OAAO,cAA4B,aAA0B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9F;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/Label/index.tsx"],"sourcesContent":["import { IconAlertOctagon, 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 success?: boolean\n error?: boolean\n disabled?: boolean\n showOptionalLabel?: boolean\n}\n\nexport const FieldLabel = ({\n id,\n text,\n required,\n success,\n error,\n disabled,\n showOptionalLabel = true,\n}: FieldLabelProps) => {\n if (!text) return null\n\n const states = [\n {\n state: 'success',\n value: !!success,\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n {\n state: 'error',\n value: !!error,\n icon: <IconAlertOctagon 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 {showOptionalLabel && !required && (\n <span className=\"au-field__header-label--optional\">(Opcional)</span>\n )}\n {!showOptionalLabel && 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"],"names":[],"mappings":";;;;;;;AAiBO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AACtB,MAAuB;AACjB,MAAA,CAAC,KAAa,QAAA;AAElB,QAAM,SAAS;AAAA,IACb;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,kBAAiB,EAAA,UAAU,eAAgB,CAAA;AAAA,IACpD;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,WAAU,EAAA,UAAU,iBAAkB,CAAA;AAAA,IAC/C;AAAA,EAAA;AAGI,QAAA,eAAe,OAAO,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,KAAK;AAGrD,SAAA,qBAAC,OAAI,EAAA,WAAU,oBACb,UAAA;AAAA,IAAA,qBAAC,SAAM,EAAA,SAAS,IAAI,WAAU,0BAC3B,UAAA;AAAA,MAAA;AAAA,MAAM;AAAA,MACN,qBAAqB,CAAC,gCACpB,QAAK,EAAA,WAAU,oCAAmC,UAAU,cAAA;AAAA,MAE9D,CAAC,qBAAqB,gCACpB,UAAO,EAAA,WAAU,oCAAmC,UAAC,KAAA;AAAA,IAAA,GAE1D;AAAA,IACC,oBAAA,OAAA,EAAI,WAAU,yBAAyB,uDAAc,MAAK;AAAA,EAC7D,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../lib/components/form/Field/Label/index.tsx"],"sourcesContent":["import { IconAlertOctagon, 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 | React.ReactNode\n required?: boolean\n success?: boolean\n error?: boolean\n disabled?: boolean\n showOptionalLabel?: boolean\n}\n\nexport const FieldLabel = ({\n id,\n text,\n required,\n success,\n error,\n disabled,\n showOptionalLabel = true,\n}: FieldLabelProps) => {\n if (!text) return null\n\n const states = [\n {\n state: 'success',\n value: !!success,\n icon: <IconCheck rawColor={COLOR_SUCCESS_50} />,\n },\n {\n state: 'error',\n value: !!error,\n icon: <IconAlertOctagon 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 {showOptionalLabel && !required && (\n <span className=\"au-field__header-label--optional\">(Opcional)</span>\n )}\n {!showOptionalLabel && 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"],"names":[],"mappings":";;;;;;;AAiBO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AACtB,MAAuB;AACjB,MAAA,CAAC,KAAa,QAAA;AAElB,QAAM,SAAS;AAAA,IACb;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,kBAAiB,EAAA,UAAU,eAAgB,CAAA;AAAA,IACpD;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO,CAAC,CAAC;AAAA,MACT,MAAM,oBAAC,WAAU,EAAA,UAAU,iBAAkB,CAAA;AAAA,IAC/C;AAAA,EAAA;AAGI,QAAA,eAAe,OAAO,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,KAAK;AAGrD,SAAA,qBAAC,OAAI,EAAA,WAAU,oBACb,UAAA;AAAA,IAAA,qBAAC,SAAM,EAAA,SAAS,IAAI,WAAU,0BAC3B,UAAA;AAAA,MAAA;AAAA,MAAM;AAAA,MACN,qBAAqB,CAAC,gCACpB,QAAK,EAAA,WAAU,oCAAmC,UAAU,cAAA;AAAA,MAE9D,CAAC,qBAAqB,gCACpB,UAAO,EAAA,WAAU,oCAAmC,UAAC,KAAA;AAAA,IAAA,GAE1D;AAAA,IACC,oBAAA,OAAA,EAAI,WAAU,yBAAyB,uDAAc,MAAK;AAAA,EAC7D,EAAA,CAAA;AAEJ;"}
@@ -1,6 +1,7 @@
1
+ /// <reference types="react" />
1
2
  type FieldLabelProps = {
2
3
  id?: string;
3
- text?: string;
4
+ text?: string | React.ReactNode;
4
5
  required?: boolean;
5
6
  success?: boolean;
6
7
  error?: boolean;
@@ -18,7 +18,7 @@ declare const _default: {
18
18
  }) => import("react/jsx-runtime").JSX.Element;
19
19
  Label: ({ id, text, required, success, error, disabled, showOptionalLabel, }: {
20
20
  id?: string | undefined;
21
- text?: string | undefined;
21
+ text?: import('react').ReactNode;
22
22
  required?: boolean | undefined;
23
23
  success?: boolean | undefined;
24
24
  error?: boolean | undefined;
@@ -7,7 +7,7 @@ export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
7
7
  errorMessage?: string;
8
8
  helpMessage?: string;
9
9
  rightSlot?: React.ReactNode;
10
- label?: string;
10
+ label?: string | React.ReactNode;
11
11
  inputStyle?: React.CSSProperties;
12
12
  inputRef?: React.RefObject<HTMLInputElement>;
13
13
  numericKeypad?: boolean;
@@ -1 +1 @@
1
- .au-field{cursor:pointer;border-radius:8px}.au-field__input-holder{position:relative;height:56px}.au-field__input{height:56px}.au-field__textarea{padding:10px;box-sizing:border-box;resize:vertical;border:none;outline:none;width:100%;height:100%;min-width:100%}.au-field__textarea--horizontal-resize{resize:both}.au-field__textarea-container{position:relative;display:inline-block;min-width:100%}.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;color:#454a54}.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-label--optional{color:#454a54;font-weight:400}.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__message{font-size:14px;font-weight:400;line-height:22px;padding-top:8px;color:#454a54}.au-field__message--error{color:#991717}.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}}
1
+ .au-field{cursor:pointer;border-radius:8px}.au-field__input-holder{position:relative;height:56px}.au-field__input{height:56px}.au-field__textarea{padding:10px;box-sizing:border-box;resize:vertical;border:none;outline:none;width:100%;height:100%;min-width:100%}.au-field__textarea--horizontal-resize{resize:both}.au-field__textarea-container{position:relative;display:inline-block;min-width:100%}.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;color:#454a54}.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{display:flex;gap:4px;color:#454a54;cursor:pointer;font-size:14px;font-weight:600}.au-field__header-label--required{color:#991717}.au-field__header-label--optional{color:#454a54;font-weight:400}.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__message{font-size:14px;font-weight:400;line-height:22px;padding-top:8px;color:#454a54}.au-field__message--error{color:#991717}.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}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@consumidor-positivo/aurora",
3
3
  "private": false,
4
- "version": "0.0.178",
4
+ "version": "0.0.179",
5
5
  "type": "module",
6
6
  "main": "./dist/main.es.js",
7
7
  "modules": "./dist/main.es.js",