meticulous-ui 3.6.3 → 3.6.4

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,92 +1,91 @@
1
- import { jsxs as R, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as F, jsx as o } from "react/jsx-runtime";
2
2
  import { useState as J, useRef as K } from "react";
3
3
  import { Wrapper as M, TextareaBox as Q, Parent as U, Label as V, HelperText as X } from "./styles.js";
4
4
  import { LeftIconWrapper as Y, RightIconWrapper as Z } from "../Input/styles.js";
5
- import { getColor as _, getIcon as F } from "./helpers.js";
6
- import D from "../../../colors/white.js";
7
- import ee from "../../../colors/grey.js";
8
- import b from "./SvgIcon.js";
9
- const he = ({
5
+ import { getColor as _, getIcon as v } from "./helpers.js";
6
+ import tt from "../../../colors/white.js";
7
+ import ot from "../../../colors/grey.js";
8
+ import w from "./SvgIcon.js";
9
+ const dt = ({
10
10
  label: s,
11
- onChange: v,
12
- value: t,
13
- type: B,
14
- hasError: j,
15
- name: p = "textarea",
16
- color: C = "blue",
11
+ onChange: C,
12
+ value: r,
13
+ type: b,
14
+ hasError: B,
15
+ name: u = "textarea",
16
+ color: H = "blue",
17
17
  helperText: c = "",
18
- background: u = "transparent",
19
- outerBackground: H = D,
20
- isDynamic: i,
21
- isResizeNone: L,
22
- rows: S = "2",
23
- cols: W = "20",
24
- leftIcon: w,
25
- rightIcon: z,
26
- placeholder: a,
27
- ...P
18
+ background: g = "transparent",
19
+ outerBackground: S = tt,
20
+ isDynamic: m,
21
+ isResizeNone: j,
22
+ rows: z = "2",
23
+ cols: L = "20",
24
+ leftIcon: W,
25
+ rightIcon: P,
26
+ placeholder: i,
27
+ ...T
28
28
  }) => {
29
- const [o, g] = J(!1), h = _(C), $ = K(null), k = () => g(!0), A = () => g(!1), E = (q) => {
30
- if (i) {
31
- const n = $.current;
32
- if (n) {
33
- n.style.height = "0px";
34
- const G = n.scrollHeight;
35
- n.style.height = `${G}px`;
36
- }
29
+ const [e, $] = J(!1), a = _(H), h = K(null), k = (t) => {
30
+ t.style.height = "";
31
+ const R = t.scrollHeight - t.clientHeight;
32
+ if (R > 0) {
33
+ const G = parseFloat(window.getComputedStyle(t).height);
34
+ t.style.height = `${G + R}px`;
37
35
  }
38
- v(q);
39
- }, I = { color: ee.m500, size: 20 }, l = F(w), d = F(z), f = !!l, x = !!d, r = j, N = i, O = u, T = i ? {} : { rows: S }, m = `textarea-${p}`, y = c ? `${m}-helper` : void 0;
40
- return /* @__PURE__ */ R(M, { children: [
41
- /* @__PURE__ */ e(
36
+ }, A = () => $(!0), E = () => $(!1), N = (t) => {
37
+ m && h.current && k(h.current), C(t);
38
+ }, I = { color: ot.m500, size: 20 }, d = v(W), f = v(P), l = !!d, x = !!f, n = B, O = m, q = g, D = { rows: z }, p = `textarea-${u}`, y = c ? `${p}-helper` : void 0;
39
+ return /* @__PURE__ */ F(M, { children: [
40
+ /* @__PURE__ */ o(
42
41
  Q,
43
42
  {
44
- type: B,
45
- name: p,
46
- $hasError: r,
47
- value: t,
48
- $isFocused: o,
49
- $shade: h,
50
- $isDynamic: N,
51
- $background: O,
52
- cols: W,
53
- $hasLeftIcon: f,
43
+ type: b,
44
+ name: u,
45
+ $hasError: n,
46
+ value: r,
47
+ $isFocused: e,
48
+ $shade: a,
49
+ $isDynamic: O,
50
+ $background: q,
51
+ cols: L,
52
+ $hasLeftIcon: l,
54
53
  $hasRightIcon: x,
55
- $isResizeNone: L,
56
- ...T,
57
- id: m,
58
- "aria-invalid": r ? !0 : void 0,
54
+ $isResizeNone: j,
55
+ ...D,
56
+ id: p,
57
+ "aria-invalid": n ? !0 : void 0,
59
58
  "aria-describedby": y,
60
- ref: $,
61
- onFocus: k,
62
- onBlur: A,
63
- onChange: E,
64
- ...P
59
+ ref: h,
60
+ onFocus: A,
61
+ onBlur: E,
62
+ onChange: N,
63
+ ...T
65
64
  }
66
65
  ),
67
- l && /* @__PURE__ */ e(Y, { "aria-hidden": "true", style: { top: "1.2rem", transform: "none" }, children: /* @__PURE__ */ e(b, { svgIcon: l, iconStyles: I }) }),
68
- d && /* @__PURE__ */ e(Z, { "aria-hidden": "true", style: { top: "1.2rem", transform: "none" }, children: /* @__PURE__ */ e(b, { svgIcon: d, iconStyles: I }) }),
69
- /* @__PURE__ */ R(U, { children: [
70
- (s || a && !t) && /* @__PURE__ */ e(
66
+ d && /* @__PURE__ */ o(Y, { "aria-hidden": "true", style: { top: "1.2rem", transform: "none" }, children: /* @__PURE__ */ o(w, { svgIcon: d, iconStyles: I }) }),
67
+ f && /* @__PURE__ */ o(Z, { "aria-hidden": "true", style: { top: "1.2rem", transform: "none" }, children: /* @__PURE__ */ o(w, { svgIcon: f, iconStyles: I }) }),
68
+ /* @__PURE__ */ F(U, { children: [
69
+ (s || i && !r) && /* @__PURE__ */ o(
71
70
  V,
72
71
  {
73
72
  as: "label",
74
- htmlFor: m,
75
- $hasError: r,
76
- $isFocused: o,
77
- $shade: h,
78
- $value: t,
79
- $outerBackground: o || t ? H : u,
80
- $hasLeftIcon: f,
73
+ htmlFor: p,
74
+ $hasError: n,
75
+ $isFocused: e,
76
+ $shade: a,
77
+ $value: r,
78
+ $outerBackground: e || r ? S : g,
79
+ $hasLeftIcon: l,
81
80
  $hasRightIcon: x,
82
- $onlyPh: a && !s,
83
- children: s || a
81
+ $onlyPh: i && !s,
82
+ children: s || i
84
83
  }
85
84
  ),
86
- c && /* @__PURE__ */ e(X, { id: y, $hasError: r, $isFocused: o, $shade: h, $hasLeftIcon: f, children: c })
85
+ c && /* @__PURE__ */ o(X, { id: y, $hasError: n, $isFocused: e, $shade: a, $hasLeftIcon: l, children: c })
87
86
  ] })
88
87
  ] });
89
88
  };
90
89
  export {
91
- he as default
90
+ dt as default
92
91
  };
@@ -1,12 +1,12 @@
1
1
  import o, { css as r } from "styled-components";
2
2
  import { black as a } from "../../../colors/black.js";
3
3
  import l from "../../../colors/grey.js";
4
- import s from "../../../colors/red.js";
4
+ import m from "../../../colors/red.js";
5
5
  import { getCssShade as i } from "./helpers.js";
6
6
  const b = o.textarea`
7
7
  border-radius: 0.64rem;
8
8
  font-size: 2.24rem;
9
- border: 2px solid ${({ $hasError: e }) => e ? s.m400 : a.m200};
9
+ border: 2px solid ${({ $hasError: e }) => e ? m.m400 : a.m200};
10
10
  padding: 0.96rem;
11
11
  font-weight: 400;
12
12
  transition: border-color 0.3s ease;
@@ -20,8 +20,6 @@ const b = o.textarea`
20
20
 
21
21
  ${({ $isDynamic: e }) => e && r`
22
22
  resize: none;
23
- display: block;
24
- overflow: hidden;
25
23
  `}
26
24
 
27
25
  &:-webkit-autofill,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meticulous-ui",
3
- "version": "3.6.3",
3
+ "version": "3.6.4",
4
4
  "license": "ISC",
5
5
  "description": "A comprehensive React UI component library with a wide range of customizable components, icons, colors, and utilities for building modern web applications.",
6
6
  "types": "./index.d.ts",