@tedi-design-system/react 19.2.0-rc.8 → 19.2.0-rc.9
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/bundle-stats.html +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/package.json +2 -2
- package/src/tedi/components/form/textarea/textarea.cjs.js +1 -1
- package/src/tedi/components/form/textarea/textarea.es.js +71 -62
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs3.js"),r=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");process.env.NODE_ENV==="production"?e.__module.exports=r.__require():e.__module.exports=o.__require();var t=e.__module.exports;exports.reactIsExports=t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as r } from "../../../../_virtual/index.es3.js";
|
|
2
2
|
import { __require as e } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as o } from "./cjs/react-is.development.es.js";
|
|
4
4
|
process.env.NODE_ENV === "production" ? r.exports = e() : r.exports = o();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs4.js"),t=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");var r;function u(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=o.__require()),e.__module.exports}exports.__require=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index.es4.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.es.js";
|
|
4
4
|
var r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "19.2.0-rc.
|
|
3
|
+
"version": "19.2.0-rc.9",
|
|
4
4
|
"description": "TEDI Design System React component library — accessible, reusable UI components. Docs & live examples: https://storybook.tedi.ee/react/rc/",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"jest": "29.7.0",
|
|
127
127
|
"jest-environment-jsdom": "30.4.1",
|
|
128
128
|
"linkify-string": "^4.1.3",
|
|
129
|
-
"lint-staged": "^
|
|
129
|
+
"lint-staged": "^17.6.0",
|
|
130
130
|
"next": "^16.2.2",
|
|
131
131
|
"prettier": "^2.8.8",
|
|
132
132
|
"react": "18.3.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react/jsx-runtime"),b=require("../../../../../external/classnames/index.cjs.js"),a=require("react"),L=require("../textfield/textfield.cjs.js"),m=require("./textarea.module.scss.cjs.js"),M=a.forwardRef((N,i)=>{const{className:_,helper:w=[],characterLimit:d,onChange:l,onChangeEvent:y,value:h,defaultValue:q,autoGrow:t=!1,minRows:f=3,maxRows:v=12,height:T="7.5rem",maxHeight:c,...z}=N,[C,A]=a.useState(q??""),u=a.useRef(null),[R,E]=a.useState("auto"),O=a.useCallback(e=>{!h&&!(l||y)&&A(e),l==null||l(e)},[h,l,y]),H=a.useMemo(()=>h??C,[h,C]),r=a.useCallback(()=>{if(!t||!u.current)return;const e=u.current,p=e.style.overflow;e.style.overflow="hidden";const o=window.getComputedStyle(e);let n=parseFloat(o.lineHeight);isNaN(n)&&(n=(parseFloat(o.fontSize)||16)*1.5);const s=parseFloat(o.paddingTop),g=parseFloat(o.paddingBottom),x=o.boxSizing==="border-box"?(parseFloat(o.borderTopWidth)||0)+(parseFloat(o.borderBottomWidth)||0):0;e.style.height="auto";const I=e.scrollHeight-s-g,V=Math.ceil((I-1)/n),F=`${Math.min(Math.max(V,f),v)*n+s+g+x}px`;e.style.height=F,E(F),e.style.overflow=p,e.style.overflowY=e.scrollHeight-e.clientHeight>1?"auto":"hidden"},[t,f,v]);a.useEffect(()=>{t&&requestAnimationFrame(()=>{r()})},[H,t,r]),a.useEffect(()=>{t&&u.current&&r()},[t,r]),a.useEffect(()=>{const e=u.current;if(!t||!e||typeof ResizeObserver>"u")return;let p=e.clientWidth;const o=new ResizeObserver(n=>{var x;const s=((x=n[0])==null?void 0:x.contentRect.width)??0,g=s!==p;p=s,s>0&&g&&r()});return o.observe(e),()=>o.disconnect()},[t,r]);const W=a.useCallback(e=>{i&&(typeof i=="function"?i(e):i.current=e),e!=null&&e.input&&e.input instanceof HTMLTextAreaElement&&(u.current=e.input,t&&setTimeout(r,0))},[i,t,r]),j=a.useMemo(()=>t?{rows:f,style:{...c?{maxHeight:c}:{},overflow:"hidden",height:R}}:{style:{height:T,...c?{maxHeight:c}:{},overflow:"auto"}},[t,f,c,T,R]),S=H.length,k=d?`${S}/${d}`:"",B=[...Array.isArray(w)?w:[w],...d?[{type:S>d?"error":"hint",text:k,position:"right",className:b.default(m.default["tedi-textarea__character-count"])}]:[]];return $.jsx(L.TextField,{...z,ref:W,"data-name":"textarea",inputClassName:b.default(m.default["tedi-textarea__input"],{[m.default["tedi-textarea__input--auto-grow"]]:t}),isTextArea:!0,className:b.default(m.default["tedi-textarea"],_),value:H,onChange:O,onChangeEvent:y,helper:B,input:j})});M.displayName="Textarea";exports.Textarea=M;
|
|
@@ -1,93 +1,102 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import a, { forwardRef as
|
|
1
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
+
import v from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import a, { forwardRef as q, useRef as G, useEffect as b } from "react";
|
|
4
4
|
import { TextField as P } from "../textfield/textfield.es.js";
|
|
5
|
-
import
|
|
6
|
-
const Y =
|
|
5
|
+
import x from "./textarea.module.scss.es.js";
|
|
6
|
+
const Y = q((_, i) => {
|
|
7
7
|
const {
|
|
8
|
-
className:
|
|
9
|
-
helper:
|
|
10
|
-
characterLimit:
|
|
11
|
-
onChange:
|
|
12
|
-
onChangeEvent:
|
|
13
|
-
value:
|
|
14
|
-
defaultValue:
|
|
8
|
+
className: z,
|
|
9
|
+
helper: w = [],
|
|
10
|
+
characterLimit: h,
|
|
11
|
+
onChange: l,
|
|
12
|
+
onChangeEvent: y,
|
|
13
|
+
value: p,
|
|
14
|
+
defaultValue: M,
|
|
15
15
|
autoGrow: e = !1,
|
|
16
|
-
minRows:
|
|
17
|
-
maxRows:
|
|
18
|
-
height:
|
|
19
|
-
maxHeight:
|
|
20
|
-
...
|
|
21
|
-
} =
|
|
16
|
+
minRows: f = 3,
|
|
17
|
+
maxRows: C = 12,
|
|
18
|
+
height: R = "7.5rem",
|
|
19
|
+
maxHeight: c,
|
|
20
|
+
...A
|
|
21
|
+
} = _, [T, W] = a.useState(M ?? ""), u = G(null), [F, k] = a.useState("auto"), B = a.useCallback(
|
|
22
22
|
(t) => {
|
|
23
|
-
!
|
|
23
|
+
!p && !(l || y) && W(t), l == null || l(t);
|
|
24
24
|
},
|
|
25
|
-
[
|
|
26
|
-
),
|
|
25
|
+
[p, l, y]
|
|
26
|
+
), H = a.useMemo(() => p ?? T, [p, T]), r = a.useCallback(() => {
|
|
27
27
|
if (!e || !u.current) return;
|
|
28
|
-
const t = u.current,
|
|
28
|
+
const t = u.current, d = t.style.overflow;
|
|
29
29
|
t.style.overflow = "hidden";
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
isNaN(
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
S(() => {
|
|
30
|
+
const o = window.getComputedStyle(t);
|
|
31
|
+
let n = parseFloat(o.lineHeight);
|
|
32
|
+
isNaN(n) && (n = (parseFloat(o.fontSize) || 16) * 1.5);
|
|
33
|
+
const s = parseFloat(o.paddingTop), m = parseFloat(o.paddingBottom), g = o.boxSizing === "border-box" ? (parseFloat(o.borderTopWidth) || 0) + (parseFloat(o.borderBottomWidth) || 0) : 0;
|
|
34
|
+
t.style.height = "auto";
|
|
35
|
+
const $ = t.scrollHeight - s - m, L = Math.ceil(($ - 1) / n), S = `${Math.min(Math.max(L, f), C) * n + s + m + g}px`;
|
|
36
|
+
t.style.height = S, k(S), t.style.overflow = d, t.style.overflowY = t.scrollHeight - t.clientHeight > 1 ? "auto" : "hidden";
|
|
37
|
+
}, [e, f, C]);
|
|
38
|
+
b(() => {
|
|
40
39
|
e && requestAnimationFrame(() => {
|
|
41
|
-
|
|
40
|
+
r();
|
|
42
41
|
});
|
|
43
|
-
}, [
|
|
44
|
-
e && u.current &&
|
|
45
|
-
}, [e,
|
|
46
|
-
|
|
42
|
+
}, [H, e, r]), b(() => {
|
|
43
|
+
e && u.current && r();
|
|
44
|
+
}, [e, r]), b(() => {
|
|
45
|
+
const t = u.current;
|
|
46
|
+
if (!e || !t || typeof ResizeObserver > "u") return;
|
|
47
|
+
let d = t.clientWidth;
|
|
48
|
+
const o = new ResizeObserver((n) => {
|
|
49
|
+
var g;
|
|
50
|
+
const s = ((g = n[0]) == null ? void 0 : g.contentRect.width) ?? 0, m = s !== d;
|
|
51
|
+
d = s, s > 0 && m && r();
|
|
52
|
+
});
|
|
53
|
+
return o.observe(t), () => o.disconnect();
|
|
54
|
+
}, [e, r]);
|
|
55
|
+
const E = a.useCallback(
|
|
47
56
|
(t) => {
|
|
48
|
-
|
|
57
|
+
i && (typeof i == "function" ? i(t) : i.current = t), t != null && t.input && t.input instanceof HTMLTextAreaElement && (u.current = t.input, e && setTimeout(r, 0));
|
|
49
58
|
},
|
|
50
|
-
[
|
|
51
|
-
),
|
|
52
|
-
rows:
|
|
59
|
+
[i, e, r]
|
|
60
|
+
), I = a.useMemo(() => e ? {
|
|
61
|
+
rows: f,
|
|
53
62
|
style: {
|
|
54
|
-
...
|
|
63
|
+
...c ? { maxHeight: c } : {},
|
|
55
64
|
overflow: "hidden",
|
|
56
|
-
height:
|
|
65
|
+
height: F
|
|
57
66
|
}
|
|
58
67
|
} : {
|
|
59
68
|
style: {
|
|
60
|
-
height:
|
|
61
|
-
...
|
|
69
|
+
height: R,
|
|
70
|
+
...c ? { maxHeight: c } : {},
|
|
62
71
|
overflow: "auto"
|
|
63
72
|
}
|
|
64
|
-
}, [e,
|
|
65
|
-
...Array.isArray(
|
|
66
|
-
...
|
|
73
|
+
}, [e, f, c, R, F]), N = H.length, O = h ? `${N}/${h}` : "", V = [
|
|
74
|
+
...Array.isArray(w) ? w : [w],
|
|
75
|
+
...h ? [
|
|
67
76
|
{
|
|
68
|
-
type:
|
|
69
|
-
text:
|
|
77
|
+
type: N > h ? "error" : "hint",
|
|
78
|
+
text: O,
|
|
70
79
|
position: "right",
|
|
71
|
-
className:
|
|
80
|
+
className: v(x["tedi-textarea__character-count"])
|
|
72
81
|
}
|
|
73
82
|
] : []
|
|
74
83
|
];
|
|
75
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ j(
|
|
76
85
|
P,
|
|
77
86
|
{
|
|
78
|
-
...
|
|
79
|
-
ref:
|
|
87
|
+
...A,
|
|
88
|
+
ref: E,
|
|
80
89
|
"data-name": "textarea",
|
|
81
|
-
inputClassName:
|
|
82
|
-
[
|
|
90
|
+
inputClassName: v(x["tedi-textarea__input"], {
|
|
91
|
+
[x["tedi-textarea__input--auto-grow"]]: e
|
|
83
92
|
}),
|
|
84
93
|
isTextArea: !0,
|
|
85
|
-
className:
|
|
86
|
-
value:
|
|
87
|
-
onChange:
|
|
88
|
-
onChangeEvent:
|
|
89
|
-
helper:
|
|
90
|
-
input:
|
|
94
|
+
className: v(x["tedi-textarea"], z),
|
|
95
|
+
value: H,
|
|
96
|
+
onChange: B,
|
|
97
|
+
onChangeEvent: y,
|
|
98
|
+
helper: V,
|
|
99
|
+
input: I
|
|
91
100
|
}
|
|
92
101
|
);
|
|
93
102
|
});
|