@aivex/ui 1.2.0-dev.6 → 1.2.0-dev.8
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 +7 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8479,33 +8479,52 @@ 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, maxCount: 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
|
+
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),
|
|
8495
|
+
onChange: x ? D : _,
|
|
8496
|
+
onFocus: (e) => {
|
|
8497
|
+
b(!0), f?.(e);
|
|
8498
|
+
},
|
|
8499
|
+
onBlur: (e) => {
|
|
8500
|
+
b(!1), p?.(e);
|
|
8501
|
+
},
|
|
8502
|
+
...v
|
|
8503
|
+
});
|
|
8504
|
+
return /* @__PURE__ */ q($l, {
|
|
8485
8505
|
id: u,
|
|
8486
8506
|
label: t,
|
|
8487
8507
|
helperText: n,
|
|
8488
|
-
error:
|
|
8508
|
+
error: E,
|
|
8489
8509
|
disabled: i,
|
|
8490
|
-
focused:
|
|
8510
|
+
focused: y,
|
|
8491
8511
|
size: a,
|
|
8492
8512
|
layout: "block",
|
|
8493
8513
|
startContent: c,
|
|
8494
8514
|
endContent: l,
|
|
8495
|
-
children: /* @__PURE__ */
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
}
|
|
8507
|
-
|
|
8508
|
-
})
|
|
8515
|
+
children: x ? /* @__PURE__ */ J("div", {
|
|
8516
|
+
className: "aivex:flex aivex:w-full aivex:flex-col aivex:gap-xs",
|
|
8517
|
+
children: [k, /* @__PURE__ */ J("div", {
|
|
8518
|
+
className: "aivex:flex aivex:w-full aivex:items-center aivex:justify-end aivex:gap-2xs aivex:text-body-sm-regular aivex:whitespace-nowrap",
|
|
8519
|
+
children: [/* @__PURE__ */ q("span", {
|
|
8520
|
+
className: E ? "aivex:text-text-danger" : "aivex:text-text-tertiary",
|
|
8521
|
+
children: T
|
|
8522
|
+
}), /* @__PURE__ */ q("span", {
|
|
8523
|
+
className: "aivex:text-text-tertiary",
|
|
8524
|
+
children: `/ ${m}`
|
|
8525
|
+
})]
|
|
8526
|
+
})]
|
|
8527
|
+
}) : k
|
|
8509
8528
|
});
|
|
8510
8529
|
}
|
|
8511
8530
|
//#endregion
|