@reportportal/ui-kit 0.0.1-alpha.242 → 0.0.1-alpha.243

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.
@@ -0,0 +1,191 @@
1
+ import { jsx as n, jsxs as c, Fragment as E } from "react/jsx-runtime";
2
+ import { forwardRef as Z, useRef as q, useId as nn, useState as L } from "react";
3
+ import { c as on } from "./bind-06a7ff84.js";
4
+ import { S as tn } from "./clear-53660571.js";
5
+ import { b as en, a as sn, S as cn } from "./capslockIcon-b100b9d6.js";
6
+ import { B as an } from "./baseIconButton-251479f7.js";
7
+ import { S as rn } from "./spinLoader-c4a53718.js";
8
+ import { M as ln } from "./maxValueDisplay-9be01a75.js";
9
+ import { FieldLabel as pn } from "./fieldLabel.js";
10
+ import "react-dnd";
11
+ import "react-dnd-html5-backend";
12
+ import { u as _n } from "./useCapsLock-d7f98c9f.js";
13
+ import { Tooltip as dn } from "./tooltip.js";
14
+ const un = "_collapsed_1vr19_11", mn = "_field_1vr19_23", hn = "_placeholder_1vr19_48", fn = "_disabled_1vr19_51", vn = "_error_1vr19_54", wn = "_touched_1vr19_54", xn = "_input_1vr19_73", Nn = "_icon_1vr19_1", kn = "_text_1vr19_207", yn = {
15
+ "icon-container": "_icon-container_1vr19_1",
16
+ "icon-container-additional": "_icon-container-additional_1vr19_1",
17
+ "icon-container-end": "_icon-container-end_1vr19_1",
18
+ "icon-container-start": "_icon-container-start_1vr19_1",
19
+ collapsed: un,
20
+ field: mn,
21
+ "default-width": "_default-width_1vr19_35",
22
+ placeholder: hn,
23
+ disabled: fn,
24
+ error: vn,
25
+ touched: wn,
26
+ "max-length-display": "_max-length-display_1vr19_61",
27
+ "input-container": "_input-container_1vr19_73",
28
+ "type-password": "_type-password_1vr19_77",
29
+ input: xn,
30
+ "with-caps-lock": "_with-caps-lock_1vr19_81",
31
+ "caps-lock-tooltip-wrapper": "_caps-lock-tooltip-wrapper_1vr19_84",
32
+ "caps-lock-tooltip-content": "_caps-lock-tooltip-content_1vr19_96",
33
+ "caps-lock-icon": "_caps-lock-icon_1vr19_107",
34
+ "eye-icon": "_eye-icon_1vr19_117",
35
+ icon: Nn,
36
+ "start-icon": "_start-icon_1vr19_163",
37
+ "clear-icon": "_clear-icon_1vr19_164",
38
+ "additional-content": "_additional-content_1vr19_200",
39
+ text: kn,
40
+ "error-text": "_error-text_1vr19_227",
41
+ "help-text": "_help-text_1vr19_231"
42
+ }, o = on.bind(yn), Pn = Z(
43
+ ({
44
+ value: e = "",
45
+ className: M,
46
+ classNameHelpText: T,
47
+ error: i,
48
+ placeholder: u,
49
+ disabled: s = !1,
50
+ onChange: b,
51
+ touched: m = !1,
52
+ title: I,
53
+ label: l,
54
+ helpText: p,
55
+ defaultWidth: V = !0,
56
+ startIcon: h,
57
+ endIcon: f,
58
+ clearable: P = !1,
59
+ onClear: v,
60
+ isRequired: w = !1,
61
+ hasDoubleMessage: R = !1,
62
+ type: a = "text",
63
+ displayError: j = !0,
64
+ collapsible: H = !1,
65
+ loading: O = !1,
66
+ maxLengthDisplay: U,
67
+ capsLockMessage: x,
68
+ onFocus: $ = () => {
69
+ },
70
+ onBlur: z = () => {
71
+ },
72
+ ...A
73
+ }, G) => {
74
+ const J = q(null), _ = G || J, N = nn(), [k, y] = L(!1), [g, S] = L(!1), { capsLockOn: K } = _n(), C = !!x && K && e.length >= 1 && !s, Q = (t) => {
75
+ y(!0), $(t);
76
+ }, W = (t) => {
77
+ y(!1), z(t);
78
+ }, X = () => {
79
+ var t;
80
+ v && (v(e), (t = _.current) == null || t.focus());
81
+ }, F = j && i && m, D = /* @__PURE__ */ n("span", { className: o("text", "help-text", T), children: p }), Y = () => a !== "password" ? a : g ? "text" : "password", B = (t) => {
82
+ t.preventDefault(), S(!0);
83
+ }, r = (t) => {
84
+ t.preventDefault(), S(!1);
85
+ };
86
+ return /* @__PURE__ */ c(E, { children: [
87
+ l && /* @__PURE__ */ n(pn, { isRequired: w, htmlFor: N, children: l }),
88
+ /* @__PURE__ */ c(
89
+ "div",
90
+ {
91
+ className: o("field", M, {
92
+ error: i,
93
+ touched: m,
94
+ disabled: s,
95
+ "default-width": V,
96
+ collapsed: H && !k && !e
97
+ }),
98
+ title: I,
99
+ children: [
100
+ O ? /* @__PURE__ */ n(rn, {}) : h && /* @__PURE__ */ n(
101
+ "span",
102
+ {
103
+ className: o("icon-container-start"),
104
+ onClick: () => {
105
+ var d;
106
+ (d = _.current) == null || d.focus();
107
+ },
108
+ children: /* @__PURE__ */ n("span", { className: o("icon", { "start-icon": !k }), children: h })
109
+ }
110
+ ),
111
+ /* @__PURE__ */ c(
112
+ "span",
113
+ {
114
+ className: o("input-container", `type-${a}`, { "with-caps-lock": C }),
115
+ children: [
116
+ /* @__PURE__ */ n(
117
+ "input",
118
+ {
119
+ ref: _,
120
+ type: Y(),
121
+ className: o("input"),
122
+ value: e,
123
+ disabled: s,
124
+ id: N,
125
+ onChange: b,
126
+ onFocus: Q,
127
+ onBlur: W,
128
+ ...A
129
+ }
130
+ ),
131
+ C && /* @__PURE__ */ n(
132
+ dn,
133
+ {
134
+ content: x,
135
+ wrapperClassName: o("caps-lock-tooltip-wrapper"),
136
+ contentClassName: o("caps-lock-tooltip-content"),
137
+ children: /* @__PURE__ */ n("span", { className: o("caps-lock-icon"), children: /* @__PURE__ */ n(en, {}) })
138
+ }
139
+ ),
140
+ a === "password" && e && /* @__PURE__ */ n(
141
+ an,
142
+ {
143
+ className: o("eye-icon"),
144
+ onMouseDown: B,
145
+ onMouseLeave: r,
146
+ onMouseUp: r,
147
+ onTouchStart: B,
148
+ onTouchEnd: r,
149
+ onTouchCancel: r,
150
+ children: g ? /* @__PURE__ */ n(sn, {}) : /* @__PURE__ */ n(cn, {})
151
+ }
152
+ ),
153
+ u && !e && /* @__PURE__ */ c("span", { className: o("placeholder"), children: [
154
+ u,
155
+ w && !l && /* @__PURE__ */ n("span", { className: o("asterisk") })
156
+ ] })
157
+ ]
158
+ }
159
+ ),
160
+ /* @__PURE__ */ n(
161
+ ln,
162
+ {
163
+ className: o("max-length-display"),
164
+ value: e.length,
165
+ maxValue: U
166
+ }
167
+ ),
168
+ P && e.length > 0 && /* @__PURE__ */ n("span", { className: o("icon-container-end"), children: /* @__PURE__ */ n(
169
+ "button",
170
+ {
171
+ type: "button",
172
+ className: o("clear-icon", { disabled: s }),
173
+ onClick: X,
174
+ onMouseDown: (t) => t.preventDefault(),
175
+ children: /* @__PURE__ */ n(tn, {})
176
+ }
177
+ ) }),
178
+ f && /* @__PURE__ */ n("span", { className: o("icon-container-end"), children: /* @__PURE__ */ n("span", { className: o("icon"), children: f }) })
179
+ ]
180
+ }
181
+ ),
182
+ (F || p) && /* @__PURE__ */ n("div", { className: o("additional-content", { disabled: s }), children: F ? /* @__PURE__ */ c(E, { children: [
183
+ /* @__PURE__ */ n("span", { className: o("text", "error-text"), children: i }),
184
+ R && D
185
+ ] }) : p && D })
186
+ ] });
187
+ }
188
+ );
189
+ export {
190
+ Pn as F
191
+ };
package/dist/fieldText.js CHANGED
@@ -1,13 +1,20 @@
1
- import { F as o } from "./fieldText-4a8e5496.js";
1
+ import { F as o } from "./fieldText-a4446a77.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
5
5
  import "./clear-53660571.js";
6
- import "./openedEye-8fa4c67d.js";
6
+ import "./capslockIcon-b100b9d6.js";
7
7
  import "./baseIconButton-251479f7.js";
8
8
  import "./spinLoader-c4a53718.js";
9
9
  import "./maxValueDisplay-9be01a75.js";
10
10
  import "./fieldLabel.js";
11
+ import "react-dnd";
12
+ import "react-dnd-html5-backend";
13
+ import "./useCapsLock-d7f98c9f.js";
14
+ import "./tooltip.js";
15
+ import "react-dom";
16
+ import "@floating-ui/react";
17
+ import "./floatingUi-46f5b896.js";
11
18
  export {
12
19
  o as FieldText,
13
20
  o as default