@aivex/ui 1.2.0-dev.6 → 1.2.0-dev.7
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/components/Textarea/Textarea.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8479,33 +8479,53 @@ function r_({ className: e, size: t = "sm", label: n, helperText: r, error: i, d
|
|
|
8479
8479
|
}
|
|
8480
8480
|
//#endregion
|
|
8481
8481
|
//#region src/components/Textarea/Textarea.tsx
|
|
8482
|
-
function i_({ className: e, label: t, helperText: n, error: r, disabled: i, size: a = "md", minHeight: o, fixedHeight: s, startContent: c, endContent: l, id: u, ref: d, onFocus: f, onBlur: p,
|
|
8483
|
-
let [
|
|
8484
|
-
|
|
8482
|
+
function i_({ className: e, label: t, helperText: n, error: r, disabled: i, size: a = "md", minHeight: o, fixedHeight: s, startContent: c, endContent: l, id: u, ref: d, onFocus: f, onBlur: p, maxLength: m, value: h, defaultValue: g, onChange: _, ...v }) {
|
|
8483
|
+
let [y, b] = K(!1), x = m != null, S = (e) => e == null ? 0 : String(e).length, [C, w] = K(() => S(h ?? g)), T = h == null ? C : S(h), E = !!r || x && T > m, D = (e) => {
|
|
8484
|
+
w(e.target.value.length), _?.(e);
|
|
8485
|
+
}, O = {};
|
|
8486
|
+
o !== void 0 && (O.minHeight = typeof o == "number" ? `${o}px` : o), s && o !== void 0 && (O.height = O.minHeight, O.maxHeight = O.minHeight);
|
|
8487
|
+
let k = /* @__PURE__ */ q("textarea", {
|
|
8488
|
+
ref: d,
|
|
8489
|
+
id: u,
|
|
8490
|
+
disabled: i,
|
|
8491
|
+
style: O,
|
|
8492
|
+
value: h,
|
|
8493
|
+
defaultValue: g,
|
|
8494
|
+
maxLength: x ? void 0 : m,
|
|
8495
|
+
className: R("aivex:w-full aivex:min-w-0 aivex:bg-transparent aivex:text-text-primary aivex:placeholder:text-text-tertiary aivex:outline-none", a === "sm" ? "aivex:text-body-md-regular" : "aivex:text-body-lg-regular", "aivex:resize-none aivex:overflow-auto", e),
|
|
8496
|
+
onChange: x ? D : _,
|
|
8497
|
+
onFocus: (e) => {
|
|
8498
|
+
b(!0), f?.(e);
|
|
8499
|
+
},
|
|
8500
|
+
onBlur: (e) => {
|
|
8501
|
+
b(!1), p?.(e);
|
|
8502
|
+
},
|
|
8503
|
+
...v
|
|
8504
|
+
});
|
|
8505
|
+
return /* @__PURE__ */ q($l, {
|
|
8485
8506
|
id: u,
|
|
8486
8507
|
label: t,
|
|
8487
8508
|
helperText: n,
|
|
8488
|
-
error:
|
|
8509
|
+
error: E,
|
|
8489
8510
|
disabled: i,
|
|
8490
|
-
focused:
|
|
8511
|
+
focused: y,
|
|
8491
8512
|
size: a,
|
|
8492
8513
|
layout: "block",
|
|
8493
8514
|
startContent: c,
|
|
8494
8515
|
endContent: l,
|
|
8495
|
-
children: /* @__PURE__ */
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
}
|
|
8507
|
-
|
|
8508
|
-
})
|
|
8516
|
+
children: x ? /* @__PURE__ */ J("div", {
|
|
8517
|
+
className: "aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs",
|
|
8518
|
+
children: [k, /* @__PURE__ */ J("div", {
|
|
8519
|
+
className: "aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-2xs aivex:text-body-sm-regular aivex:whitespace-nowrap",
|
|
8520
|
+
children: [/* @__PURE__ */ q("span", {
|
|
8521
|
+
className: E ? "aivex:text-text-danger" : "aivex:text-text-tertiary",
|
|
8522
|
+
children: T
|
|
8523
|
+
}), /* @__PURE__ */ q("span", {
|
|
8524
|
+
className: "aivex:text-text-tertiary",
|
|
8525
|
+
children: `/ ${m}`
|
|
8526
|
+
})]
|
|
8527
|
+
})]
|
|
8528
|
+
}) : k
|
|
8509
8529
|
});
|
|
8510
8530
|
}
|
|
8511
8531
|
//#endregion
|