@tedi-design-system/react 19.1.2-rc.4 → 19.2.0-rc.1
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/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.d.ts +6 -0
- package/src/tedi/components/form/multi-value-field/multi-value-field.es.js +126 -117
- package/src/tedi/components/form/multi-value-field/multi-value-field.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.module.scss.es.js +2 -0
- package/src/tedi/components/form/select/components/select-clear-indicator.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-clear-indicator.es.js +21 -10
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.d.ts +6 -0
- package/src/tedi/components/form/select/select.es.js +173 -171
- package/src/tedi/components/form/select/select.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/select/select.module.scss.es.js +2 -1
- package/src/tedi/components/form/textarea/textarea.d.ts +1 -1
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.d.ts +6 -0
- package/src/tedi/components/form/textfield/textfield.es.js +86 -84
- package/src/tedi/components/form/textfield/textfield.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.module.scss.es.js +2 -0
|
@@ -1,162 +1,164 @@
|
|
|
1
1
|
import { jsx as n, jsxs as S } from "react/jsx-runtime";
|
|
2
2
|
import _ from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import y, { forwardRef as
|
|
3
|
+
import y, { forwardRef as be, useMemo as b, useCallback as w } from "react";
|
|
4
4
|
import { Icon as D } from "../../base/icon/icon.es.js";
|
|
5
|
-
import { ClosingButton as
|
|
6
|
-
import { Separator as
|
|
5
|
+
import { ClosingButton as Ie } from "../../buttons/closing-button/closing-button.es.js";
|
|
6
|
+
import { Separator as ge } from "../../misc/separator/separator.es.js";
|
|
7
7
|
import { FeedbackText as U } from "../feedback-text/feedback-text.es.js";
|
|
8
|
-
import { Field as
|
|
9
|
-
import { FormLabel as
|
|
10
|
-
import { useOptionalInputGroup as
|
|
11
|
-
import
|
|
8
|
+
import { Field as Ne } from "../field/field.es.js";
|
|
9
|
+
import { FormLabel as Ae } from "../form-label/form-label.es.js";
|
|
10
|
+
import { useOptionalInputGroup as Ce } from "../input-group/input-group.es.js";
|
|
11
|
+
import r from "./textfield.module.scss.es.js";
|
|
12
12
|
import { useBreakpointProps as ke } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
|
-
import { useLabels as
|
|
14
|
-
const
|
|
13
|
+
import { useLabels as Se } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
const we = {
|
|
15
15
|
large: 24,
|
|
16
16
|
default: 18
|
|
17
|
-
}, Be =
|
|
17
|
+
}, Be = be((I, J) => {
|
|
18
18
|
var M;
|
|
19
19
|
const { getCurrentBreakpointProps: Q } = ke(I.defaultServerBreakpoint), {
|
|
20
|
-
id:
|
|
20
|
+
id: ze,
|
|
21
21
|
label: g,
|
|
22
22
|
className: W,
|
|
23
23
|
inputClassName: X,
|
|
24
24
|
disabled: d,
|
|
25
|
-
required:
|
|
25
|
+
required: B,
|
|
26
26
|
hideLabel: z,
|
|
27
|
-
invalid:
|
|
27
|
+
invalid: f,
|
|
28
28
|
readOnly: F,
|
|
29
29
|
icon: i,
|
|
30
|
-
onIconClick:
|
|
30
|
+
onIconClick: x,
|
|
31
31
|
iconButtonProps: p,
|
|
32
32
|
size: s = "default",
|
|
33
33
|
placeholder: Y,
|
|
34
34
|
isArrowsHidden: Z = !0,
|
|
35
35
|
isClearable: R,
|
|
36
|
-
|
|
36
|
+
showClearOnInteraction: G,
|
|
37
|
+
onClear: v,
|
|
37
38
|
onChange: o,
|
|
38
|
-
onChangeEvent:
|
|
39
|
-
onKeyUp:
|
|
40
|
-
onKeyDown:
|
|
41
|
-
onKeyPress:
|
|
39
|
+
onChangeEvent: ee,
|
|
40
|
+
onKeyUp: re,
|
|
41
|
+
onKeyDown: te,
|
|
42
|
+
onKeyPress: ae,
|
|
42
43
|
defaultValue: $,
|
|
43
44
|
value: N,
|
|
44
45
|
onFocus: A,
|
|
45
|
-
onBlur:
|
|
46
|
-
onClick:
|
|
46
|
+
onBlur: C,
|
|
47
|
+
onClick: ie,
|
|
47
48
|
helper: e,
|
|
48
49
|
input: a,
|
|
49
|
-
name:
|
|
50
|
-
isTextArea:
|
|
51
|
-
startSlot:
|
|
52
|
-
endSlot:
|
|
53
|
-
...
|
|
54
|
-
} = Q(I) || {}, { getLabel: L } =
|
|
50
|
+
name: le,
|
|
51
|
+
isTextArea: ne,
|
|
52
|
+
startSlot: se,
|
|
53
|
+
endSlot: oe,
|
|
54
|
+
...de
|
|
55
|
+
} = Q(I) || {}, { getLabel: L } = Se(), O = y.useRef(null), T = y.useRef(null), [ce, E] = y.useState(N ?? $ ?? ""), P = N ?? ce, c = !!(R && P && !F), m = (M = Ce) == null ? void 0 : M(), fe = y.useId(), me = m == null ? void 0 : m.hasExternalLabel, u = I.id ?? (m == null ? void 0 : m.inputId) ?? fe;
|
|
55
56
|
y.useImperativeHandle(J, () => ({
|
|
56
57
|
get input() {
|
|
57
|
-
return
|
|
58
|
+
return T.current;
|
|
58
59
|
},
|
|
59
60
|
get inner() {
|
|
60
|
-
return
|
|
61
|
+
return O.current;
|
|
61
62
|
}
|
|
62
63
|
}));
|
|
63
|
-
const V = b(() => Array.isArray(e) ?
|
|
64
|
-
(
|
|
65
|
-
h ||
|
|
64
|
+
const V = b(() => Array.isArray(e) ? f || e.some((t) => t.type === "error") : f || (e == null ? void 0 : e.type) === "error", [f, e]), ue = b(() => !e || Array.isArray(e) && e.length === 0 ? !1 : Array.isArray(e) ? !f && e.every((t) => t.type === "valid") : !f && e.type === "valid", [f, e]), pe = s === "large" ? "default" : s, h = N !== void 0, ye = w(
|
|
65
|
+
(t) => {
|
|
66
|
+
h || E(t), o == null || o(t);
|
|
66
67
|
},
|
|
67
68
|
[h, o]
|
|
68
|
-
), j =
|
|
69
|
-
h ||
|
|
70
|
-
}, [h, o,
|
|
69
|
+
), j = w(() => {
|
|
70
|
+
h || E(""), o == null || o(""), v == null || v();
|
|
71
|
+
}, [h, o, v]), H = w(() => {
|
|
71
72
|
if (!i) return null;
|
|
72
|
-
const
|
|
73
|
-
size: s === "large" ? 24 : s === "small" ? !!
|
|
74
|
-
className:
|
|
75
|
-
}, q = typeof i == "string" ? { ...
|
|
76
|
-
return
|
|
73
|
+
const k = {
|
|
74
|
+
size: s === "large" ? 24 : s === "small" ? !!x ? 18 : 16 : 18,
|
|
75
|
+
className: r["tedi-textfield__icon"]
|
|
76
|
+
}, q = typeof i == "string" ? { ...k, name: i } : { ...k, ...i, className: _(k.className, i.className) };
|
|
77
|
+
return x ? /* @__PURE__ */ n(
|
|
77
78
|
"button",
|
|
78
79
|
{
|
|
79
80
|
type: "button",
|
|
80
81
|
...p,
|
|
81
|
-
className: _(
|
|
82
|
-
onClick: d ? void 0 :
|
|
82
|
+
className: _(r["tedi-textfield__icon-wrapper"], p == null ? void 0 : p.className),
|
|
83
|
+
onClick: d ? void 0 : x,
|
|
83
84
|
disabled: d,
|
|
84
85
|
children: /* @__PURE__ */ n(D, { ...q })
|
|
85
86
|
}
|
|
86
|
-
) : /* @__PURE__ */ n("div", { className:
|
|
87
|
-
}, [i, s,
|
|
88
|
-
|
|
87
|
+
) : /* @__PURE__ */ n("div", { className: r["tedi-textfield__icon-wrapper"], "aria-hidden": "true", children: /* @__PURE__ */ n(D, { ...q }) });
|
|
88
|
+
}, [i, s, x, p, d]), K = b(() => c ? /* @__PURE__ */ n(
|
|
89
|
+
Ie,
|
|
89
90
|
{
|
|
90
|
-
iconSize:
|
|
91
|
+
iconSize: we[s === "large" ? "large" : "default"],
|
|
91
92
|
onClick: d ? void 0 : j,
|
|
92
93
|
disabled: d,
|
|
93
94
|
title: L("clear"),
|
|
94
|
-
className:
|
|
95
|
+
className: r["tedi-textfield__clear-button"]
|
|
95
96
|
}
|
|
96
|
-
) : null, [
|
|
97
|
+
) : null, [c, s, d, j, L]), xe = b(() => !c && !i ? null : /* @__PURE__ */ S("div", { className: r["tedi-textfield__right-area"], children: [
|
|
97
98
|
K,
|
|
98
|
-
|
|
99
|
+
c && i && /* @__PURE__ */ n(ge, { color: "primary", axis: "vertical", className: r["tedi-textfield__separator"] }),
|
|
99
100
|
i && H()
|
|
100
|
-
] }), [
|
|
101
|
-
|
|
101
|
+
] }), [c, i, K, H]), ve = /* @__PURE__ */ n(
|
|
102
|
+
Ne,
|
|
102
103
|
{
|
|
103
104
|
...a,
|
|
104
105
|
id: u,
|
|
105
|
-
name:
|
|
106
|
+
name: le,
|
|
106
107
|
value: P,
|
|
107
108
|
defaultValue: $,
|
|
108
|
-
onChange:
|
|
109
|
-
onChangeEvent:
|
|
109
|
+
onChange: ye,
|
|
110
|
+
onChangeEvent: ee,
|
|
110
111
|
disabled: d,
|
|
111
112
|
readOnly: F || (a == null ? void 0 : a.readOnly),
|
|
112
|
-
required:
|
|
113
|
+
required: B,
|
|
113
114
|
invalid: V,
|
|
114
115
|
placeholder: Y,
|
|
115
|
-
className: _(
|
|
116
|
-
[
|
|
116
|
+
className: _(r["tedi-textfield__input"], X, {
|
|
117
|
+
[r["tedi-textfield__input--hidden-arrows"]]: Z
|
|
117
118
|
}),
|
|
118
|
-
onFocus: (
|
|
119
|
+
onFocus: (t) => {
|
|
119
120
|
var l;
|
|
120
|
-
(l = a == null ? void 0 : a.onFocus) == null || l.call(a,
|
|
121
|
+
(l = a == null ? void 0 : a.onFocus) == null || l.call(a, t), A == null || A(t);
|
|
121
122
|
},
|
|
122
|
-
onBlur: (
|
|
123
|
+
onBlur: (t) => {
|
|
123
124
|
var l;
|
|
124
|
-
(l = a == null ? void 0 : a.onBlur) == null || l.call(a,
|
|
125
|
+
(l = a == null ? void 0 : a.onBlur) == null || l.call(a, t), C == null || C(t);
|
|
125
126
|
},
|
|
126
|
-
isTextArea:
|
|
127
|
-
"aria-describedby": !e || Array.isArray(e) && e.length === 0 ? void 0 : Array.isArray(e) ? e.map((
|
|
127
|
+
isTextArea: ne,
|
|
128
|
+
"aria-describedby": !e || Array.isArray(e) && e.length === 0 ? void 0 : Array.isArray(e) ? e.map((t, l) => `${u}-helper-${l}`).join(" ") : `${u}-helper`,
|
|
128
129
|
"aria-label": z && typeof g == "string" ? g : void 0,
|
|
129
|
-
ref:
|
|
130
|
+
ref: T
|
|
130
131
|
}
|
|
131
|
-
),
|
|
132
|
-
|
|
133
|
-
{ [
|
|
134
|
-
{ [
|
|
135
|
-
{ [
|
|
136
|
-
{ [
|
|
137
|
-
{ [
|
|
132
|
+
), he = _(
|
|
133
|
+
r["tedi-textfield"],
|
|
134
|
+
{ [r[`tedi-textfield--${s}`]]: s },
|
|
135
|
+
{ [r["tedi-textfield--with-icon"]]: i },
|
|
136
|
+
{ [r["tedi-textfield--invalid"]]: V },
|
|
137
|
+
{ [r["tedi-textfield--valid"]]: ue },
|
|
138
|
+
{ [r["tedi-textfield--clearable"]]: c },
|
|
139
|
+
{ [r["tedi-textfield--clear-on-interaction"]]: c && G },
|
|
138
140
|
W
|
|
139
|
-
),
|
|
140
|
-
return /* @__PURE__ */ S("div", { "data-name": "textfield", ...
|
|
141
|
-
!
|
|
141
|
+
), _e = () => !e || Array.isArray(e) && e.length === 0 ? null : /* @__PURE__ */ n("div", { className: r["tedi-textfield__feedback-wrapper"], children: Array.isArray(e) ? e.map((t, l) => /* @__PURE__ */ n(U, { ...t, id: `${u}-helper-${l}` }, l)) : /* @__PURE__ */ n(U, { ...e, id: `${u}-helper` }) });
|
|
142
|
+
return /* @__PURE__ */ S("div", { "data-name": "textfield", ...de, className: he, children: [
|
|
143
|
+
!me && /* @__PURE__ */ n(Ae, { id: u, label: g, required: B, hideLabel: z, size: pe }),
|
|
142
144
|
/* @__PURE__ */ S(
|
|
143
145
|
"div",
|
|
144
146
|
{
|
|
145
|
-
className:
|
|
146
|
-
onKeyDown:
|
|
147
|
-
onKeyUp:
|
|
148
|
-
onKeyPress:
|
|
149
|
-
onClick:
|
|
150
|
-
ref:
|
|
147
|
+
className: r["tedi-textfield__inner"],
|
|
148
|
+
onKeyDown: te,
|
|
149
|
+
onKeyUp: re,
|
|
150
|
+
onKeyPress: ae,
|
|
151
|
+
onClick: ie,
|
|
152
|
+
ref: O,
|
|
151
153
|
children: [
|
|
152
|
-
ne,
|
|
153
|
-
ve,
|
|
154
154
|
se,
|
|
155
|
-
|
|
155
|
+
ve,
|
|
156
|
+
oe,
|
|
157
|
+
(R || i) && xe
|
|
156
158
|
]
|
|
157
159
|
}
|
|
158
160
|
),
|
|
159
|
-
|
|
161
|
+
_e()
|
|
160
162
|
] });
|
|
161
163
|
});
|
|
162
164
|
Be.displayName = "TextField";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-textfield":"tedi-textfield-376bbeed","tedi-textfield__inner":"tedi-textfield__inner-98791cdd","tedi-textfield__input":"tedi-textfield__input-ade0f9a6","tedi-textfield--invalid":"tedi-textfield--invalid-290ce18d","tedi-textfield--valid":"tedi-textfield--valid-273af8c0","tedi-textfield--clearable":"tedi-textfield--clearable-f47f0508","tedi-textfield--with-icon":"tedi-textfield--with-icon-db2c6f01","tedi-textfield--small":"tedi-textfield--small-4ffcc517","tedi-textfield--large":"tedi-textfield--large-0e4d788c","tedi-textfield__right-area":"tedi-textfield__right-area-6ac81c6b","tedi-textfield__icon-wrapper":"tedi-textfield__icon-wrapper-4935814e","tedi-textfield--inline":"tedi-textfield--inline-7ed55c4e","tedi-textfield__icon":"tedi-textfield__icon-05d4adc8","tedi-textfield__feedback-wrapper":"tedi-textfield__feedback-wrapper-9d47f9c6","tedi-textfield__separator":"tedi-textfield__separator-63d1ba14"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-textfield":"tedi-textfield-376bbeed","tedi-textfield__inner":"tedi-textfield__inner-98791cdd","tedi-textfield__input":"tedi-textfield__input-ade0f9a6","tedi-textfield--invalid":"tedi-textfield--invalid-290ce18d","tedi-textfield--valid":"tedi-textfield--valid-273af8c0","tedi-textfield--clearable":"tedi-textfield--clearable-f47f0508","tedi-textfield--with-icon":"tedi-textfield--with-icon-db2c6f01","tedi-textfield--small":"tedi-textfield--small-4ffcc517","tedi-textfield--large":"tedi-textfield--large-0e4d788c","tedi-textfield__right-area":"tedi-textfield__right-area-6ac81c6b","tedi-textfield--clear-on-interaction":"tedi-textfield--clear-on-interaction-155ed896","tedi-textfield__clear-button":"tedi-textfield__clear-button-edbbffef","tedi-textfield__icon-wrapper":"tedi-textfield__icon-wrapper-4935814e","tedi-textfield--inline":"tedi-textfield--inline-7ed55c4e","tedi-textfield__icon":"tedi-textfield__icon-05d4adc8","tedi-textfield__feedback-wrapper":"tedi-textfield__feedback-wrapper-9d47f9c6","tedi-textfield__separator":"tedi-textfield__separator-63d1ba14"};exports.default=e;
|
|
@@ -9,6 +9,8 @@ const e = {
|
|
|
9
9
|
"tedi-textfield--small": "tedi-textfield--small-4ffcc517",
|
|
10
10
|
"tedi-textfield--large": "tedi-textfield--large-0e4d788c",
|
|
11
11
|
"tedi-textfield__right-area": "tedi-textfield__right-area-6ac81c6b",
|
|
12
|
+
"tedi-textfield--clear-on-interaction": "tedi-textfield--clear-on-interaction-155ed896",
|
|
13
|
+
"tedi-textfield__clear-button": "tedi-textfield__clear-button-edbbffef",
|
|
12
14
|
"tedi-textfield__icon-wrapper": "tedi-textfield__icon-wrapper-4935814e",
|
|
13
15
|
"tedi-textfield--inline": "tedi-textfield--inline-7ed55c4e",
|
|
14
16
|
"tedi-textfield__icon": "tedi-textfield__icon-05d4adc8",
|