@happeouikit/form-elements 2.3.40 → 2.3.43
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/Checkbox.types.d.ts +3 -4
- package/dist/Input.d.ts +1 -1
- package/dist/Input.types.d.ts +3 -2
- package/dist/Link.d.ts +7 -2
- package/dist/RadioButton.types.d.ts +1 -1
- package/dist/Switch.types.d.ts +3 -3
- package/dist/index.cjs.js +31 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +89 -81
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
- package/messages.json +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as Me, jsx as
|
|
1
|
+
import { jsxs as Me, jsx as Y } from "react/jsx-runtime";
|
|
2
2
|
import * as R from "react";
|
|
3
3
|
import k, { useEffect as Ze, useState as se, forwardRef as ba, useContext as ll, Component as ya, createContext as cl, useCallback as Q, useMemo as We, Fragment as Cn, useRef as _e, useImperativeHandle as dl } from "react";
|
|
4
4
|
import A, { css as jt } from "styled-components";
|
|
@@ -48,7 +48,7 @@ const q0 = (e) => e.replace(/(_|-|,|\.)(.)/g, (t) => t[1].toUpperCase()), Fl = 6
|
|
|
48
48
|
left: "10px",
|
|
49
49
|
fontSize: "18px"
|
|
50
50
|
}, a = { ...r, ...t };
|
|
51
|
-
return () => /* @__PURE__ */
|
|
51
|
+
return () => /* @__PURE__ */ Y(Bl, { children: /* @__PURE__ */ Y(e, { ...a, style: n }) });
|
|
52
52
|
}, xa = ({
|
|
53
53
|
label: e,
|
|
54
54
|
description: t,
|
|
@@ -60,48 +60,50 @@ const q0 = (e) => e.replace(/(_|-|,|\.)(.)/g, (t) => t[1].toUpperCase()), Fl = 6
|
|
|
60
60
|
state: s,
|
|
61
61
|
errorMessage: u,
|
|
62
62
|
disabled: l,
|
|
63
|
-
|
|
63
|
+
readOnly: c,
|
|
64
|
+
...d
|
|
64
65
|
}) => {
|
|
65
|
-
const [
|
|
66
|
-
t ? `${
|
|
67
|
-
r ? `${
|
|
68
|
-
s === "error" && u ? `${
|
|
66
|
+
const [h] = se(() => a || nn()), p = [
|
|
67
|
+
t ? `${h}-description` : "",
|
|
68
|
+
r ? `${h}-hint-message` : "",
|
|
69
|
+
s === "error" && u ? `${h}-error-message` : ""
|
|
69
70
|
].join(" ");
|
|
70
71
|
return /* @__PURE__ */ Me(No, { isDisabled: l || !1, children: [
|
|
71
72
|
!!e && /* @__PURE__ */ Me(Eo, { children: [
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
t && /* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ Y(Vl, { bold: !0, htmlFor: h, isRequired: n || !1, children: e }),
|
|
74
|
+
t && /* @__PURE__ */ Y(
|
|
74
75
|
pe,
|
|
75
76
|
{
|
|
76
|
-
id: `${
|
|
77
|
+
id: `${h}-description`,
|
|
77
78
|
color: "var(--color-secondary-text-on-light, #4a5464)",
|
|
78
79
|
children: t
|
|
79
80
|
}
|
|
80
81
|
)
|
|
81
82
|
] }),
|
|
82
83
|
i && Wl(i, o)(),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ Y(
|
|
84
85
|
Ao,
|
|
85
86
|
{
|
|
86
87
|
title: e || "Styled input",
|
|
87
88
|
hasIcon: !!(i || "").toString(),
|
|
88
89
|
state: s || "default",
|
|
89
|
-
id:
|
|
90
|
+
id: h,
|
|
90
91
|
disabled: l,
|
|
92
|
+
readOnly: c,
|
|
91
93
|
"data-1p-ignore": !0,
|
|
92
94
|
...t ? {
|
|
93
|
-
"aria-describedby":
|
|
95
|
+
"aria-describedby": p
|
|
94
96
|
} : {},
|
|
95
|
-
...
|
|
97
|
+
...d
|
|
96
98
|
}
|
|
97
99
|
),
|
|
98
|
-
r && /* @__PURE__ */ Me(Kr, { id: `${
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
r && /* @__PURE__ */ Me(Kr, { id: `${h}-hint-message`, children: [
|
|
101
|
+
/* @__PURE__ */ Y(wi, { fill: "var(--color-hint-text-on-light, #68778d)" }),
|
|
102
|
+
/* @__PURE__ */ Y(Jr, { color: "var(--color-secondary-text-on-light, #4a5464)", children: r })
|
|
101
103
|
] }),
|
|
102
|
-
s === "error" && u && /* @__PURE__ */ Me(Kr, { id: `${
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
104
|
+
s === "error" && u && /* @__PURE__ */ Me(Kr, { id: `${h}-error-message`, children: [
|
|
105
|
+
/* @__PURE__ */ Y(wi, { fill: "var(--color-alert-primary, #da3939)" }),
|
|
106
|
+
/* @__PURE__ */ Y(Jr, { color: "var(--color-alert-primary, #da3939)", children: u })
|
|
105
107
|
] })
|
|
106
108
|
] });
|
|
107
109
|
}, wi = A(hl)`
|
|
@@ -169,12 +171,18 @@ const q0 = (e) => e.replace(/(_|-|,|\.)(.)/g, (t) => t[1].toUpperCase()), Fl = 6
|
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
|
|
174
|
+
:read-only {
|
|
175
|
+
background-color: var(--color-surface-darken, #f3f5f7);
|
|
176
|
+
border: solid 1px var(--color-disabled-text-on-light);
|
|
177
|
+
color: var(--color-secondary-text-on-light, #4a5464);
|
|
178
|
+
}
|
|
179
|
+
|
|
172
180
|
border-color: ${({ state: e = "default" }) => Wn[e]};
|
|
173
181
|
`, Bl = A.span`
|
|
174
182
|
position: relative;
|
|
175
183
|
`, t1 = ({ label: e, ...t }) => /* @__PURE__ */ Me(Hl, { children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
e && /* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ Y(Yl, { ...t, type: "number" }),
|
|
185
|
+
e && /* @__PURE__ */ Y(Ll, { children: e })
|
|
178
186
|
] }), Yl = A(xa)`
|
|
179
187
|
width: 60px;
|
|
180
188
|
text-align: center;
|
|
@@ -4481,16 +4489,16 @@ const dh = ch, fh = ({ label: e, ...t }, r) => {
|
|
|
4481
4489
|
${ph}
|
|
4482
4490
|
`, gh = A.div`
|
|
4483
4491
|
margin: 4px 0;
|
|
4484
|
-
`, Cs = ba(fh), xs = k.forwardRef((e, t) => /* @__PURE__ */
|
|
4492
|
+
`, Cs = ba(fh), xs = k.forwardRef((e, t) => /* @__PURE__ */ Y(ws, { ref: t, as: "a", ...e, children: e.children })), n1 = k.forwardRef((e, t) => /* @__PURE__ */ Y(
|
|
4485
4493
|
ws,
|
|
4486
4494
|
{
|
|
4487
4495
|
ref: t,
|
|
4488
4496
|
as: "a",
|
|
4489
4497
|
target: "_blank",
|
|
4490
4498
|
rel: "nofollow noopener",
|
|
4491
|
-
...e
|
|
4492
|
-
|
|
4493
|
-
|
|
4499
|
+
...e,
|
|
4500
|
+
children: e.children
|
|
4501
|
+
}
|
|
4494
4502
|
)), ws = A(pe)`
|
|
4495
4503
|
text-decoration: ${({ underline: e }) => e ? "underline" : "none"};
|
|
4496
4504
|
color: ${({ color: e }) => e || ae};
|
|
@@ -4560,7 +4568,7 @@ const r1 = ({
|
|
|
4560
4568
|
[l, i]
|
|
4561
4569
|
), y = We(() => a || nn(), [a]);
|
|
4562
4570
|
return /* @__PURE__ */ Me(wh, { background: c, children: [
|
|
4563
|
-
/* @__PURE__ */
|
|
4571
|
+
/* @__PURE__ */ Y(
|
|
4564
4572
|
vh,
|
|
4565
4573
|
{
|
|
4566
4574
|
"aria-hidden": "true",
|
|
@@ -4577,7 +4585,7 @@ const r1 = ({
|
|
|
4577
4585
|
"aria-describedby": r ? `${y}_description` : void 0
|
|
4578
4586
|
}
|
|
4579
4587
|
),
|
|
4580
|
-
/* @__PURE__ */
|
|
4588
|
+
/* @__PURE__ */ Y(
|
|
4581
4589
|
Kn,
|
|
4582
4590
|
{
|
|
4583
4591
|
type: "button",
|
|
@@ -4592,7 +4600,7 @@ const r1 = ({
|
|
|
4592
4600
|
),
|
|
4593
4601
|
e && /* @__PURE__ */ Me(bh, { children: [
|
|
4594
4602
|
/* @__PURE__ */ Me(yh, { children: [
|
|
4595
|
-
e && /* @__PURE__ */
|
|
4603
|
+
e && /* @__PURE__ */ Y(
|
|
4596
4604
|
xh,
|
|
4597
4605
|
{
|
|
4598
4606
|
bold: !0,
|
|
@@ -4603,9 +4611,9 @@ const r1 = ({
|
|
|
4603
4611
|
children: e
|
|
4604
4612
|
}
|
|
4605
4613
|
),
|
|
4606
|
-
t && /* @__PURE__ */
|
|
4614
|
+
t && /* @__PURE__ */ Y(Ih, { children: t })
|
|
4607
4615
|
] }),
|
|
4608
|
-
r && /* @__PURE__ */
|
|
4616
|
+
r && /* @__PURE__ */ Y(Ch, { id: `${y}_description`, children: r })
|
|
4609
4617
|
] })
|
|
4610
4618
|
] });
|
|
4611
4619
|
}, vh = A.input`
|
|
@@ -4766,7 +4774,7 @@ const r1 = ({
|
|
|
4766
4774
|
[o, a]
|
|
4767
4775
|
);
|
|
4768
4776
|
return /* @__PURE__ */ Me(Oh, { style: i, background: l, children: [
|
|
4769
|
-
/* @__PURE__ */
|
|
4777
|
+
/* @__PURE__ */ Y(
|
|
4770
4778
|
"input",
|
|
4771
4779
|
{
|
|
4772
4780
|
ref: f,
|
|
@@ -4784,7 +4792,7 @@ const r1 = ({
|
|
|
4784
4792
|
...p
|
|
4785
4793
|
}
|
|
4786
4794
|
),
|
|
4787
|
-
n ? /* @__PURE__ */
|
|
4795
|
+
n ? /* @__PURE__ */ Y(
|
|
4788
4796
|
Nt,
|
|
4789
4797
|
{
|
|
4790
4798
|
onClick: g,
|
|
@@ -4793,9 +4801,9 @@ const r1 = ({
|
|
|
4793
4801
|
"aria-disabled": o,
|
|
4794
4802
|
background: l,
|
|
4795
4803
|
...p,
|
|
4796
|
-
children: /* @__PURE__ */
|
|
4804
|
+
children: /* @__PURE__ */ Y(kh, {})
|
|
4797
4805
|
}
|
|
4798
|
-
) : /* @__PURE__ */
|
|
4806
|
+
) : /* @__PURE__ */ Y(
|
|
4799
4807
|
Ct,
|
|
4800
4808
|
{
|
|
4801
4809
|
onClick: g,
|
|
@@ -4804,12 +4812,12 @@ const r1 = ({
|
|
|
4804
4812
|
"aria-disabled": o,
|
|
4805
4813
|
background: l,
|
|
4806
4814
|
...p,
|
|
4807
|
-
children: /* @__PURE__ */
|
|
4815
|
+
children: /* @__PURE__ */ Y(Mh, {})
|
|
4808
4816
|
}
|
|
4809
4817
|
),
|
|
4810
4818
|
e && /* @__PURE__ */ Me(Sh, { children: [
|
|
4811
4819
|
/* @__PURE__ */ Me(Eh, { children: [
|
|
4812
|
-
e && /* @__PURE__ */
|
|
4820
|
+
e && /* @__PURE__ */ Y(
|
|
4813
4821
|
_h,
|
|
4814
4822
|
{
|
|
4815
4823
|
onClick: g,
|
|
@@ -4820,9 +4828,9 @@ const r1 = ({
|
|
|
4820
4828
|
children: e
|
|
4821
4829
|
}
|
|
4822
4830
|
),
|
|
4823
|
-
t && /* @__PURE__ */
|
|
4831
|
+
t && /* @__PURE__ */ Y(Ah, { children: t })
|
|
4824
4832
|
] }),
|
|
4825
|
-
r && /* @__PURE__ */
|
|
4833
|
+
r && /* @__PURE__ */ Y(Nh, { id: `${m}_description`, children: r })
|
|
4826
4834
|
] })
|
|
4827
4835
|
] });
|
|
4828
4836
|
}, Ct = A.span`
|
|
@@ -4967,7 +4975,7 @@ const r1 = ({
|
|
|
4967
4975
|
const I = (g ? [...c, f.value] : c.filter((y) => y !== f.value)).sort(Th(u));
|
|
4968
4976
|
d(I), o && o(I);
|
|
4969
4977
|
};
|
|
4970
|
-
return /* @__PURE__ */
|
|
4978
|
+
return /* @__PURE__ */ Y(Bh, { className: a, children: u.map((f) => /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ Y(
|
|
4971
4979
|
Dh,
|
|
4972
4980
|
{
|
|
4973
4981
|
label: f.label,
|
|
@@ -5028,7 +5036,7 @@ const r1 = ({
|
|
|
5028
5036
|
[i, s.disabled]
|
|
5029
5037
|
);
|
|
5030
5038
|
return /* @__PURE__ */ Me(Xh, { background: n, children: [
|
|
5031
|
-
/* @__PURE__ */
|
|
5039
|
+
/* @__PURE__ */ Y(
|
|
5032
5040
|
"input",
|
|
5033
5041
|
{
|
|
5034
5042
|
type: "radio",
|
|
@@ -5040,7 +5048,7 @@ const r1 = ({
|
|
|
5040
5048
|
"data-testid": o
|
|
5041
5049
|
}
|
|
5042
5050
|
),
|
|
5043
|
-
/* @__PURE__ */
|
|
5051
|
+
/* @__PURE__ */ Y(
|
|
5044
5052
|
gn,
|
|
5045
5053
|
{
|
|
5046
5054
|
onClick: l,
|
|
@@ -5050,7 +5058,7 @@ const r1 = ({
|
|
|
5050
5058
|
),
|
|
5051
5059
|
e && /* @__PURE__ */ Me(Yh, { children: [
|
|
5052
5060
|
/* @__PURE__ */ Me(Vh, { children: [
|
|
5053
|
-
e && /* @__PURE__ */
|
|
5061
|
+
e && /* @__PURE__ */ Y(
|
|
5054
5062
|
Zh,
|
|
5055
5063
|
{
|
|
5056
5064
|
bold: !0,
|
|
@@ -5061,9 +5069,9 @@ const r1 = ({
|
|
|
5061
5069
|
children: e
|
|
5062
5070
|
}
|
|
5063
5071
|
),
|
|
5064
|
-
t && /* @__PURE__ */
|
|
5072
|
+
t && /* @__PURE__ */ Y(Lh, { children: t })
|
|
5065
5073
|
] }),
|
|
5066
|
-
r && /* @__PURE__ */
|
|
5074
|
+
r && /* @__PURE__ */ Y(Hh, { id: `${u}_description`, children: r })
|
|
5067
5075
|
] })
|
|
5068
5076
|
] });
|
|
5069
5077
|
};
|
|
@@ -5164,7 +5172,7 @@ const gn = A.span`
|
|
|
5164
5172
|
|
|
5165
5173
|
input:disabled ~ div {
|
|
5166
5174
|
p,
|
|
5167
|
-
label
|
|
5175
|
+
label {
|
|
5168
5176
|
color: var(--color-disabled-text-on-light);
|
|
5169
5177
|
cursor: default;
|
|
5170
5178
|
}
|
|
@@ -9301,44 +9309,44 @@ function Pr() {
|
|
|
9301
9309
|
var e = zr(this._milliseconds) / 1e3, t = zr(this._days), r = zr(this._months), n, a, i, o, s = this.asSeconds(), u, l, c, d;
|
|
9302
9310
|
return s ? (n = Re(e / 60), a = Re(n / 60), e %= 60, n %= 60, i = Re(r / 12), r %= 12, o = e ? e.toFixed(3).replace(/\.?0+$/, "") : "", u = s < 0 ? "-" : "", l = Zt(this._months) !== Zt(s) ? "-" : "", c = Zt(this._days) !== Zt(s) ? "-" : "", d = Zt(this._milliseconds) !== Zt(s) ? "-" : "", u + "P" + (i ? l + i + "Y" : "") + (r ? l + r + "M" : "") + (t ? c + t + "D" : "") + (a || n || e ? "T" : "") + (a ? d + a + "H" : "") + (n ? d + n + "M" : "") + (e ? d + o + "S" : "")) : "P0D";
|
|
9303
9311
|
}
|
|
9304
|
-
var
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9312
|
+
var V = _r.prototype;
|
|
9313
|
+
V.isValid = Nv;
|
|
9314
|
+
V.abs = ly;
|
|
9315
|
+
V.add = cy;
|
|
9316
|
+
V.subtract = dy;
|
|
9317
|
+
V.as = hy;
|
|
9318
|
+
V.asMilliseconds = my;
|
|
9319
|
+
V.asSeconds = gy;
|
|
9320
|
+
V.asMinutes = vy;
|
|
9321
|
+
V.asHours = by;
|
|
9322
|
+
V.asDays = yy;
|
|
9323
|
+
V.asWeeks = Iy;
|
|
9324
|
+
V.asMonths = Cy;
|
|
9325
|
+
V.asQuarters = xy;
|
|
9326
|
+
V.asYears = wy;
|
|
9327
|
+
V.valueOf = py;
|
|
9328
|
+
V._bubble = fy;
|
|
9329
|
+
V.clone = Dy;
|
|
9330
|
+
V.get = My;
|
|
9331
|
+
V.milliseconds = ky;
|
|
9332
|
+
V.seconds = Sy;
|
|
9333
|
+
V.minutes = Ey;
|
|
9334
|
+
V.hours = Ay;
|
|
9335
|
+
V.days = Ny;
|
|
9336
|
+
V.weeks = Py;
|
|
9337
|
+
V.months = _y;
|
|
9338
|
+
V.years = Oy;
|
|
9339
|
+
V.humanize = Wy;
|
|
9340
|
+
V.toISOString = Pr;
|
|
9341
|
+
V.toString = Pr;
|
|
9342
|
+
V.toJSON = Pr;
|
|
9343
|
+
V.locale = Yu;
|
|
9344
|
+
V.localeData = Lu;
|
|
9345
|
+
V.toIsoString = Be(
|
|
9338
9346
|
"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
|
|
9339
9347
|
Pr
|
|
9340
9348
|
);
|
|
9341
|
-
|
|
9349
|
+
V.lang = Vu;
|
|
9342
9350
|
_("X", 0, 0, "unix");
|
|
9343
9351
|
_("x", 0, 0, "valueOf");
|
|
9344
9352
|
S("x", Sr);
|