nexaas-ui-components 1.0.103 → 1.0.104
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/index.cjs +19 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -580,19 +580,30 @@ var Input = ({
|
|
|
580
580
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
581
581
|
const [showPassword, setShowPassword] = React6__namespace.default.useState(false);
|
|
582
582
|
const styles = {
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
583
|
+
// Borda/fundo/anel de foco ficam neste wrapper (nao no <input>): o div do icone e
|
|
584
|
+
// renderizado depois do <input> no DOM e fica por cima dele na pilha de empilhamento,
|
|
585
|
+
// entao uma borda desenhada no proprio <input> ficava encoberta pelo fundo opaco do
|
|
586
|
+
// icone no lado esquerdo (visivel sobretudo no anel azul de foco). `input-focus-ring-within`
|
|
587
|
+
// (src/styles/index.css) desenha esse mesmo anel de 1.5px quando o <input> interno ganha
|
|
588
|
+
// foco, via `:focus-within`.
|
|
589
|
+
wrapper: `relative outline-none rounded-lg border-[0.5px] h-[46px] input-focus-ring-within ${disabled ? "bg-[var(--input-bg-disabled)] border-[var(--input-border-disabled)] shadow-none" : `bg-surface shadow-input ${hasError ? "border-dangerous-500" : "border-stroke"}`}`,
|
|
590
|
+
input: `text-p-md pl-2 peer text-paragraph bg-transparent outline-none block pb-[10px] h-full w-full disabled:text-disabled disabled:cursor-not-allowed ${label ? "pt-[22px]" : "pt-[10px]"}`,
|
|
591
|
+
// `top-0 left-0 h-full`: para um filho absolute, o offset e medido a partir do
|
|
592
|
+
// padding-box do ancestral relative (a borda do wrapper ja fica de fora sozinha, o
|
|
593
|
+
// browser nao soma nada por isso). `top-[0.5px]` + `h-[45px]` (usado antes) somava um
|
|
594
|
+
// inset manual de 0.5px SEM encolher a altura pra compensar, entao o icone ultrapassava
|
|
595
|
+
// o padding-box por baixo em 0.5px e estourava a borda inferior. `h-full` ja cobre
|
|
596
|
+
// exatamente o padding-box (46px do wrapper - 2x0.5px de borda = 45px), sem contas.
|
|
597
|
+
// O raio `7.5px` (8px do wrapper - 0.5px de borda) acompanha a curva INTERNA da borda,
|
|
598
|
+
// que e menor que o raio externo pela espessura da borda.
|
|
599
|
+
icon: `absolute bg-neutral-100 top-0 left-0 h-full w-[38px] rounded-l-[7.5px] text-[20px] ${hasError ? "text-dangerous-500" : "text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,
|
|
589
600
|
rightIcon: "absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",
|
|
590
601
|
// `-translate-y-[10px]` (e nao `-translate-y-3`/12px): o label flutuante ficava colado
|
|
591
602
|
// demais no topo do campo. Os 2px a menos de deslocamento aproximam o espaco acima do
|
|
592
603
|
// label do espaco abaixo do conteudo (pb-[10px]). Mesmo valor nos demais inputs.
|
|
593
604
|
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-[10px] scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-[10px] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",
|
|
594
605
|
clear: "absolute top-[8.3px] cursor-pointer text-label text-[22px]",
|
|
595
|
-
error: "
|
|
606
|
+
error: "text-dangerous-500"
|
|
596
607
|
};
|
|
597
608
|
const inlineStyles = {
|
|
598
609
|
inputWithIcon: { paddingLeft: "48px" },
|
|
@@ -600,7 +611,7 @@ var Input = ({
|
|
|
600
611
|
};
|
|
601
612
|
const input = name ? document == null ? void 0 : document.getElementById(name) : null;
|
|
602
613
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
603
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
614
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx9__default.default(styles.wrapper), children: [
|
|
604
615
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
605
616
|
"input",
|
|
606
617
|
{
|