@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/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, ...m }) {
8483
- let [h, g] = K(!1), _ = {};
8484
- return o !== void 0 && (_.minHeight = typeof o == "number" ? `${o}px` : o), s && o !== void 0 && (_.height = _.minHeight, _.maxHeight = _.minHeight), /* @__PURE__ */ q($l, {
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: r,
8508
+ error: E,
8489
8509
  disabled: i,
8490
- focused: h,
8510
+ focused: y,
8491
8511
  size: a,
8492
8512
  layout: "block",
8493
8513
  startContent: c,
8494
8514
  endContent: l,
8495
- children: /* @__PURE__ */ q("textarea", {
8496
- ref: d,
8497
- id: u,
8498
- disabled: i,
8499
- style: _,
8500
- 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", s ? "aivex:resize-none aivex:overflow-auto" : "aivex:resize-vertical", e),
8501
- onFocus: (e) => {
8502
- g(!0), f?.(e);
8503
- },
8504
- onBlur: (e) => {
8505
- g(!1), p?.(e);
8506
- },
8507
- ...m
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