@treeal/ds 0.1.4 → 0.1.5
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/assets/style.css +1 -1
- package/dist/components/Input/Input.d.ts +4 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs13.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.esm10.js +1 -1
- package/dist/index.esm11.js +1 -1
- package/dist/index.esm12.js +1 -1
- package/dist/index.esm13.js +1 -1
- package/dist/index.esm15.js +1 -1
- package/dist/index.esm16.js +1 -1
- package/dist/index.esm19.js +60 -22
- package/dist/index.esm19.js.map +1 -1
- package/dist/index.esm20.js +22 -60
- package/dist/index.esm20.js.map +1 -1
- package/dist/index.esm21.js +22 -20
- package/dist/index.esm21.js.map +1 -1
- package/dist/index.esm22.js +40 -12
- package/dist/index.esm22.js.map +1 -1
- package/dist/index.esm23.js +60 -22
- package/dist/index.esm23.js.map +1 -1
- package/dist/index.esm24.js +22 -22
- package/dist/index.esm25.js +20 -36
- package/dist/index.esm25.js.map +1 -1
- package/dist/index.esm26.js +22 -102
- package/dist/index.esm26.js.map +1 -1
- package/dist/index.esm27.js +102 -22
- package/dist/index.esm27.js.map +1 -1
- package/dist/index.esm28.js +12 -60
- package/dist/index.esm28.js.map +1 -1
- package/dist/index.esm6.js +1 -1
- package/dist/index.esm7.js +1 -1
- package/dist/index.esm8.js +1 -1
- package/dist/index.esm9.js +30 -28
- package/dist/index.esm9.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm26.js
CHANGED
|
@@ -1,106 +1,26 @@
|
|
|
1
|
-
const e = "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
headerTitle: r,
|
|
13
|
-
headerActions: m,
|
|
14
|
-
bellBtn: v,
|
|
15
|
-
links: b,
|
|
16
|
-
linksOpen: d,
|
|
17
|
-
linksClosed: p,
|
|
18
|
-
linksMobile: I,
|
|
19
|
-
section: h,
|
|
20
|
-
sectionTitle: k,
|
|
21
|
-
sectionItems: M,
|
|
22
|
-
item: C,
|
|
23
|
-
itemOpen: L,
|
|
24
|
-
itemOpenActive: A,
|
|
25
|
-
itemClosed: B,
|
|
26
|
-
itemClosedActive: O,
|
|
27
|
-
itemMobile: f,
|
|
28
|
-
itemMobileActive: w,
|
|
29
|
-
itemIcon: g,
|
|
30
|
-
itemIconDark: u,
|
|
31
|
-
itemIconLight: D,
|
|
32
|
-
itemLabel: R,
|
|
33
|
-
itemLabelDefault: T,
|
|
34
|
-
itemLabelActive: F,
|
|
35
|
-
itemLabelMobile: N,
|
|
36
|
-
chevron: x,
|
|
37
|
-
footer: y,
|
|
38
|
-
collapseBtn: j,
|
|
39
|
-
collapseBtnClosed: q,
|
|
40
|
-
collapseBtnIcon: z,
|
|
41
|
-
footerMobile: E,
|
|
42
|
-
ctaBtn: G,
|
|
43
|
-
workspace: H,
|
|
44
|
-
workspaceIcon: J,
|
|
45
|
-
workspaceLabel: K,
|
|
46
|
-
avatarRow: P,
|
|
47
|
-
avatar: Q,
|
|
48
|
-
avatarInitials: S,
|
|
49
|
-
avatarInfo: U,
|
|
50
|
-
avatarName: V,
|
|
51
|
-
avatarRole: W
|
|
1
|
+
const e = "_base_106pz_9", c = "_checkDefault_106pz_18", o = "_radioDefault_106pz_19", _ = "_checkChecked_106pz_40", t = "_radioChecked_106pz_41", a = "_checkIcon_106pz_64", k = "_radioIcon_106pz_86", d = "_toggleWrapper_106pz_105", r = "_toggleTrack_106pz_113", g = "_toggleChecked_106pz_140", h = {
|
|
2
|
+
base: e,
|
|
3
|
+
checkDefault: c,
|
|
4
|
+
radioDefault: o,
|
|
5
|
+
checkChecked: _,
|
|
6
|
+
radioChecked: t,
|
|
7
|
+
checkIcon: a,
|
|
8
|
+
radioIcon: k,
|
|
9
|
+
toggleWrapper: d,
|
|
10
|
+
toggleTrack: r,
|
|
11
|
+
toggleChecked: g
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
G as ctaBtn,
|
|
66
|
-
X as default,
|
|
67
|
-
y as footer,
|
|
68
|
-
E as footerMobile,
|
|
69
|
-
n as header,
|
|
70
|
-
m as headerActions,
|
|
71
|
-
s as headerClosed,
|
|
72
|
-
l as headerMobile,
|
|
73
|
-
a as headerOpen,
|
|
74
|
-
r as headerTitle,
|
|
75
|
-
C as item,
|
|
76
|
-
B as itemClosed,
|
|
77
|
-
O as itemClosedActive,
|
|
78
|
-
g as itemIcon,
|
|
79
|
-
u as itemIconDark,
|
|
80
|
-
D as itemIconLight,
|
|
81
|
-
R as itemLabel,
|
|
82
|
-
F as itemLabelActive,
|
|
83
|
-
T as itemLabelDefault,
|
|
84
|
-
N as itemLabelMobile,
|
|
85
|
-
f as itemMobile,
|
|
86
|
-
w as itemMobileActive,
|
|
87
|
-
L as itemOpen,
|
|
88
|
-
A as itemOpenActive,
|
|
89
|
-
b as links,
|
|
90
|
-
p as linksClosed,
|
|
91
|
-
I as linksMobile,
|
|
92
|
-
d as linksOpen,
|
|
93
|
-
i as logoFull,
|
|
94
|
-
c as logoIcon,
|
|
95
|
-
e as nav,
|
|
96
|
-
o as navClosed,
|
|
97
|
-
_ as navMobile,
|
|
98
|
-
t as navOpen,
|
|
99
|
-
h as section,
|
|
100
|
-
M as sectionItems,
|
|
101
|
-
k as sectionTitle,
|
|
102
|
-
H as workspace,
|
|
103
|
-
J as workspaceIcon,
|
|
104
|
-
K as workspaceLabel
|
|
14
|
+
e as base,
|
|
15
|
+
_ as checkChecked,
|
|
16
|
+
c as checkDefault,
|
|
17
|
+
a as checkIcon,
|
|
18
|
+
h as default,
|
|
19
|
+
t as radioChecked,
|
|
20
|
+
o as radioDefault,
|
|
21
|
+
k as radioIcon,
|
|
22
|
+
g as toggleChecked,
|
|
23
|
+
r as toggleTrack,
|
|
24
|
+
d as toggleWrapper
|
|
105
25
|
};
|
|
106
26
|
//# sourceMappingURL=index.esm26.js.map
|
package/dist/index.esm26.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm26.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm26.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/index.esm27.js
CHANGED
|
@@ -1,26 +1,106 @@
|
|
|
1
|
-
const e = "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
const e = "_nav_53r24_22", t = "_navOpen_53r24_32", o = "_navClosed_53r24_33", _ = "_navMobile_53r24_42", n = "_header_53r24_51", a = "_headerOpen_53r24_58", s = "_headerClosed_53r24_64", l = "_headerMobile_53r24_73", c = "_logoIcon_53r24_80", i = "_logoFull_53r24_87", r = "_headerTitle_53r24_93", m = "_headerActions_53r24_102", v = "_bellBtn_53r24_108", b = "_links_53r24_129", d = "_linksOpen_53r24_136", p = "_linksClosed_53r24_137", I = "_linksMobile_53r24_138", h = "_section_53r24_142", k = "_sectionTitle_53r24_147", M = "_sectionItems_53r24_160", C = "_item_53r24_168", L = "_itemOpen_53r24_181", A = "_itemOpenActive_53r24_191", B = "_itemClosed_53r24_201", O = "_itemClosedActive_53r24_211", f = "_itemMobile_53r24_222", w = "_itemMobileActive_53r24_231", g = "_itemIcon_53r24_237", u = "_itemIconDark_53r24_246", D = "_itemIconLight_53r24_247", R = "_itemLabel_53r24_251", T = "_itemLabelDefault_53r24_263", F = "_itemLabelActive_53r24_264", N = "_itemLabelMobile_53r24_265", x = "_chevron_53r24_269", y = "_footer_53r24_283", j = "_collapseBtn_53r24_289", q = "_collapseBtnClosed_53r24_310", z = "_collapseBtnIcon_53r24_314", E = "_footerMobile_53r24_326", G = "_ctaBtn_53r24_335", H = "_workspace_53r24_358", J = "_workspaceIcon_53r24_372", K = "_workspaceLabel_53r24_383", P = "_avatarRow_53r24_397", Q = "_avatar_53r24_397", S = "_avatarInitials_53r24_415", U = "_avatarInfo_53r24_422", V = "_avatarName_53r24_430", W = "_avatarRole_53r24_441", X = {
|
|
2
|
+
nav: e,
|
|
3
|
+
navOpen: t,
|
|
4
|
+
navClosed: o,
|
|
5
|
+
navMobile: _,
|
|
6
|
+
header: n,
|
|
7
|
+
headerOpen: a,
|
|
8
|
+
headerClosed: s,
|
|
9
|
+
headerMobile: l,
|
|
10
|
+
logoIcon: c,
|
|
11
|
+
logoFull: i,
|
|
12
|
+
headerTitle: r,
|
|
13
|
+
headerActions: m,
|
|
14
|
+
bellBtn: v,
|
|
15
|
+
links: b,
|
|
16
|
+
linksOpen: d,
|
|
17
|
+
linksClosed: p,
|
|
18
|
+
linksMobile: I,
|
|
19
|
+
section: h,
|
|
20
|
+
sectionTitle: k,
|
|
21
|
+
sectionItems: M,
|
|
22
|
+
item: C,
|
|
23
|
+
itemOpen: L,
|
|
24
|
+
itemOpenActive: A,
|
|
25
|
+
itemClosed: B,
|
|
26
|
+
itemClosedActive: O,
|
|
27
|
+
itemMobile: f,
|
|
28
|
+
itemMobileActive: w,
|
|
29
|
+
itemIcon: g,
|
|
30
|
+
itemIconDark: u,
|
|
31
|
+
itemIconLight: D,
|
|
32
|
+
itemLabel: R,
|
|
33
|
+
itemLabelDefault: T,
|
|
34
|
+
itemLabelActive: F,
|
|
35
|
+
itemLabelMobile: N,
|
|
36
|
+
chevron: x,
|
|
37
|
+
footer: y,
|
|
38
|
+
collapseBtn: j,
|
|
39
|
+
collapseBtnClosed: q,
|
|
40
|
+
collapseBtnIcon: z,
|
|
41
|
+
footerMobile: E,
|
|
42
|
+
ctaBtn: G,
|
|
43
|
+
workspace: H,
|
|
44
|
+
workspaceIcon: J,
|
|
45
|
+
workspaceLabel: K,
|
|
46
|
+
avatarRow: P,
|
|
47
|
+
avatar: Q,
|
|
48
|
+
avatarInitials: S,
|
|
49
|
+
avatarInfo: U,
|
|
50
|
+
avatarName: V,
|
|
51
|
+
avatarRole: W
|
|
12
52
|
};
|
|
13
53
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
54
|
+
Q as avatar,
|
|
55
|
+
U as avatarInfo,
|
|
56
|
+
S as avatarInitials,
|
|
57
|
+
V as avatarName,
|
|
58
|
+
W as avatarRole,
|
|
59
|
+
P as avatarRow,
|
|
60
|
+
v as bellBtn,
|
|
61
|
+
x as chevron,
|
|
62
|
+
j as collapseBtn,
|
|
63
|
+
q as collapseBtnClosed,
|
|
64
|
+
z as collapseBtnIcon,
|
|
65
|
+
G as ctaBtn,
|
|
66
|
+
X as default,
|
|
67
|
+
y as footer,
|
|
68
|
+
E as footerMobile,
|
|
69
|
+
n as header,
|
|
70
|
+
m as headerActions,
|
|
71
|
+
s as headerClosed,
|
|
72
|
+
l as headerMobile,
|
|
73
|
+
a as headerOpen,
|
|
74
|
+
r as headerTitle,
|
|
75
|
+
C as item,
|
|
76
|
+
B as itemClosed,
|
|
77
|
+
O as itemClosedActive,
|
|
78
|
+
g as itemIcon,
|
|
79
|
+
u as itemIconDark,
|
|
80
|
+
D as itemIconLight,
|
|
81
|
+
R as itemLabel,
|
|
82
|
+
F as itemLabelActive,
|
|
83
|
+
T as itemLabelDefault,
|
|
84
|
+
N as itemLabelMobile,
|
|
85
|
+
f as itemMobile,
|
|
86
|
+
w as itemMobileActive,
|
|
87
|
+
L as itemOpen,
|
|
88
|
+
A as itemOpenActive,
|
|
89
|
+
b as links,
|
|
90
|
+
p as linksClosed,
|
|
91
|
+
I as linksMobile,
|
|
92
|
+
d as linksOpen,
|
|
93
|
+
i as logoFull,
|
|
94
|
+
c as logoIcon,
|
|
95
|
+
e as nav,
|
|
96
|
+
o as navClosed,
|
|
97
|
+
_ as navMobile,
|
|
98
|
+
t as navOpen,
|
|
99
|
+
h as section,
|
|
100
|
+
M as sectionItems,
|
|
101
|
+
k as sectionTitle,
|
|
102
|
+
H as workspace,
|
|
103
|
+
J as workspaceIcon,
|
|
104
|
+
K as workspaceLabel
|
|
25
105
|
};
|
|
26
106
|
//# sourceMappingURL=index.esm27.js.map
|
package/dist/index.esm27.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm27.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm27.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.esm28.js
CHANGED
|
@@ -1,64 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
pageTitleDesktop: _,
|
|
8
|
-
pageTitleMobile: n,
|
|
9
|
-
actions: c,
|
|
10
|
-
actionsMobileOpen: r,
|
|
11
|
-
workspace: w,
|
|
12
|
-
workspaceFull: v,
|
|
13
|
-
workspaceLeft: i,
|
|
14
|
-
statusDot: l,
|
|
15
|
-
workspaceCol: p,
|
|
16
|
-
workspaceAccount: j,
|
|
17
|
-
workspaceName: u,
|
|
18
|
-
workspaceArrow: k,
|
|
19
|
-
bellBtn: m,
|
|
20
|
-
menuBtn: b,
|
|
21
|
-
menuIcon: g,
|
|
22
|
-
navUser: M,
|
|
23
|
-
avatar: T,
|
|
24
|
-
avatarImg: A,
|
|
25
|
-
avatarInitials: B,
|
|
26
|
-
userText: D,
|
|
27
|
-
userName: I,
|
|
28
|
-
userRole: f,
|
|
29
|
-
ctaBtn: N,
|
|
30
|
-
mainActions: O
|
|
1
|
+
const t = "_tabList_dww9d_3", d = "_tab_dww9d_3", s = "_active_dww9d_40", _ = "_disabled_dww9d_40", a = "_icon_dww9d_65", c = {
|
|
2
|
+
tabList: t,
|
|
3
|
+
tab: d,
|
|
4
|
+
active: s,
|
|
5
|
+
disabled: _,
|
|
6
|
+
icon: a
|
|
31
7
|
};
|
|
32
8
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
N as ctaBtn,
|
|
40
|
-
d as default,
|
|
41
|
-
a as header,
|
|
42
|
-
O as mainActions,
|
|
43
|
-
b as menuBtn,
|
|
44
|
-
g as menuIcon,
|
|
45
|
-
M as navUser,
|
|
46
|
-
s as pageTitle,
|
|
47
|
-
_ as pageTitleDesktop,
|
|
48
|
-
n as pageTitleMobile,
|
|
49
|
-
l as statusDot,
|
|
50
|
-
I as userName,
|
|
51
|
-
f as userRole,
|
|
52
|
-
D as userText,
|
|
53
|
-
e as variantDefault,
|
|
54
|
-
t as variantMobile,
|
|
55
|
-
o as variantMobileOpen,
|
|
56
|
-
w as workspace,
|
|
57
|
-
j as workspaceAccount,
|
|
58
|
-
k as workspaceArrow,
|
|
59
|
-
p as workspaceCol,
|
|
60
|
-
v as workspaceFull,
|
|
61
|
-
i as workspaceLeft,
|
|
62
|
-
u as workspaceName
|
|
9
|
+
s as active,
|
|
10
|
+
c as default,
|
|
11
|
+
_ as disabled,
|
|
12
|
+
a as icon,
|
|
13
|
+
d as tab,
|
|
14
|
+
t as tabList
|
|
63
15
|
};
|
|
64
16
|
//# sourceMappingURL=index.esm28.js.map
|
package/dist/index.esm28.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm28.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm28.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/index.esm6.js
CHANGED
package/dist/index.esm7.js
CHANGED
package/dist/index.esm8.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import e from "./index.
|
|
2
|
+
import e from "./index.esm19.js";
|
|
3
3
|
function b() {
|
|
4
4
|
return /* @__PURE__ */ i("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
5
5
|
/* @__PURE__ */ n("path", { d: "M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" }),
|
package/dist/index.esm9.js
CHANGED
|
@@ -1,86 +1,88 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
3
|
-
import r from "./index.
|
|
4
|
-
function
|
|
2
|
+
import { useId as N, useState as E } from "react";
|
|
3
|
+
import r from "./index.esm22.js";
|
|
4
|
+
function y() {
|
|
5
5
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
6
6
|
/* @__PURE__ */ e("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
7
7
|
/* @__PURE__ */ e("polyline", { points: "22,6 12,13 2,6", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
8
8
|
] });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function A() {
|
|
11
11
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
12
12
|
/* @__PURE__ */ e("circle", { cx: "11", cy: "11", r: "7", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }),
|
|
13
13
|
/* @__PURE__ */ e("path", { d: "M16.5 16.5L21 21", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" })
|
|
14
14
|
] });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function D() {
|
|
17
17
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
18
18
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
19
19
|
/* @__PURE__ */ e("path", { d: "M16 2v4M8 2v4M3 10h18", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
20
20
|
] });
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function S() {
|
|
23
23
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
24
24
|
/* @__PURE__ */ e("rect", { x: "5", y: "11", width: "14", height: "11", rx: "2", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
25
25
|
/* @__PURE__ */ e("path", { d: "M8 11V7a4 4 0 0 1 8 0v4", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
26
26
|
] });
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function z() {
|
|
29
29
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
30
30
|
/* @__PURE__ */ e("path", { d: "M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
31
31
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3", stroke: "currentColor", strokeWidth: "1.75" })
|
|
32
32
|
] });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function H() {
|
|
35
35
|
return /* @__PURE__ */ t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
|
|
36
36
|
/* @__PURE__ */ e("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
37
37
|
/* @__PURE__ */ e("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
38
38
|
/* @__PURE__ */ e("path", { d: "M1 1l22 22", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" })
|
|
39
39
|
] });
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function V({
|
|
42
42
|
state: n = "Default",
|
|
43
|
+
size: f = "md",
|
|
43
44
|
inputType: o = "text",
|
|
44
45
|
label: l,
|
|
45
46
|
placeholder: v,
|
|
46
47
|
message: s,
|
|
47
48
|
iconLabel: h,
|
|
48
|
-
iconLeft:
|
|
49
|
+
iconLeft: m,
|
|
49
50
|
iconRight: p,
|
|
50
51
|
value: w,
|
|
51
|
-
onChange:
|
|
52
|
-
onSearch:
|
|
53
|
-
id:
|
|
54
|
-
className:
|
|
55
|
-
...
|
|
52
|
+
onChange: L,
|
|
53
|
+
onSearch: g,
|
|
54
|
+
id: x,
|
|
55
|
+
className: b,
|
|
56
|
+
...C
|
|
56
57
|
}) {
|
|
57
|
-
const
|
|
58
|
+
const j = N(), i = x ?? j, [d, I] = E(!1), a = n === "Disabled", c = n === "Error", B = o === "password" ? d ? "text" : "password" : o === "search" ? "text" : o, u = m ?? (o === "email" ? /* @__PURE__ */ e(y, {}) : o === "password" ? /* @__PURE__ */ e(S, {}) : void 0), k = p ?? (o === "password" ? /* @__PURE__ */ e(
|
|
58
59
|
"button",
|
|
59
60
|
{
|
|
60
61
|
type: "button",
|
|
61
62
|
className: r.toggleBtn,
|
|
62
|
-
onClick: () =>
|
|
63
|
+
onClick: () => I((M) => !M),
|
|
63
64
|
"aria-label": d ? "Ocultar senha" : "Mostrar senha",
|
|
64
65
|
tabIndex: -1,
|
|
65
|
-
children: d ? /* @__PURE__ */ e(
|
|
66
|
+
children: d ? /* @__PURE__ */ e(z, {}) : /* @__PURE__ */ e(H, {})
|
|
66
67
|
}
|
|
67
|
-
) : o === "date" ? /* @__PURE__ */ e(
|
|
68
|
+
) : o === "date" ? /* @__PURE__ */ e(D, {}) : o === "search" ? /* @__PURE__ */ e(
|
|
68
69
|
"button",
|
|
69
70
|
{
|
|
70
71
|
type: "button",
|
|
71
72
|
className: r.searchBtn,
|
|
72
|
-
onClick:
|
|
73
|
+
onClick: g,
|
|
73
74
|
"aria-label": "Buscar",
|
|
74
75
|
tabIndex: -1,
|
|
75
|
-
children: /* @__PURE__ */ e(
|
|
76
|
+
children: /* @__PURE__ */ e(A, {})
|
|
76
77
|
}
|
|
77
|
-
) : void 0),
|
|
78
|
+
) : void 0), W = [
|
|
78
79
|
r.field,
|
|
80
|
+
f === "sm" ? r.fieldSm : r.fieldMd,
|
|
79
81
|
n === "Hover" ? r.hover : "",
|
|
80
82
|
n === "Active" ? r.active : "",
|
|
81
83
|
a ? r.disabled : "",
|
|
82
84
|
c ? r.error : "",
|
|
83
|
-
|
|
85
|
+
b
|
|
84
86
|
].filter(Boolean).join(" ");
|
|
85
87
|
return /* @__PURE__ */ t("div", { className: r.wrapper, children: [
|
|
86
88
|
l && /* @__PURE__ */ t("div", { className: r.labelRow, children: [
|
|
@@ -94,21 +96,21 @@ function R({
|
|
|
94
96
|
),
|
|
95
97
|
h && /* @__PURE__ */ e("span", { className: r.labelIcon, "aria-hidden": "true", children: h })
|
|
96
98
|
] }),
|
|
97
|
-
/* @__PURE__ */ t("div", { className:
|
|
99
|
+
/* @__PURE__ */ t("div", { className: W, children: [
|
|
98
100
|
u && /* @__PURE__ */ e("span", { className: r.icon, "aria-hidden": "true", children: u }),
|
|
99
101
|
/* @__PURE__ */ e(
|
|
100
102
|
"input",
|
|
101
103
|
{
|
|
102
104
|
id: i,
|
|
103
|
-
type:
|
|
105
|
+
type: B,
|
|
104
106
|
className: r.input,
|
|
105
107
|
placeholder: v,
|
|
106
108
|
disabled: a,
|
|
107
109
|
value: w,
|
|
108
|
-
onChange:
|
|
110
|
+
onChange: L,
|
|
109
111
|
"aria-invalid": c,
|
|
110
112
|
"aria-describedby": s ? `${i}-message` : void 0,
|
|
111
|
-
...
|
|
113
|
+
...C
|
|
112
114
|
}
|
|
113
115
|
),
|
|
114
116
|
k && /* @__PURE__ */ e("span", { className: [r.icon, o === "search" || o === "password" ? r.iconAction : ""].filter(Boolean).join(" "), children: k })
|
|
@@ -124,6 +126,6 @@ function R({
|
|
|
124
126
|
] });
|
|
125
127
|
}
|
|
126
128
|
export {
|
|
127
|
-
|
|
129
|
+
V as Input
|
|
128
130
|
};
|
|
129
131
|
//# sourceMappingURL=index.esm9.js.map
|
package/dist/index.esm9.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm9.js","sources":["../components/Input/Input.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\nimport styles from './Input.module.css';\n\nexport type InputState = 'Default' | 'Hover' | 'Active' | 'Disabled' | 'Error';\nexport type InputType = 'text' | 'email' | 'password' | 'search' | 'date';\n\n// ─── Built-in SVG icons ───────────────────────────────────────────────────────\n\nfunction IconEmail() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <polyline points=\"22,6 12,13 2,6\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n );\n}\n\nfunction IconSearch() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\"/>\n <path d=\"M16.5 16.5L21 21\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\"/>\n </svg>\n );\n}\n\nfunction IconCalendar() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M16 2v4M8 2v4M3 10h18\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n );\n}\n\nfunction IconLock() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"5\" y=\"11\" width=\"14\" height=\"11\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M8 11V7a4 4 0 0 1 8 0v4\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n );\n}\n\nfunction IconEye() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <circle cx=\"12\" cy=\"12\" r=\"3\" stroke=\"currentColor\" strokeWidth=\"1.75\"/>\n </svg>\n );\n}\n\nfunction IconEyeOff() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M1 1l22 22\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\"/>\n </svg>\n );\n}\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type'> {\n /** Visual/interaction state. Defaults to 'Default'. */\n state?: InputState;\n /**\n * Semantic input type. Sets the correct HTML type and auto-adds icons.\n * - email → envelope icon left\n * - password → lock icon left + show/hide toggle right\n * - search → search icon left + green search button right\n * - date → calendar icon right\n */\n inputType?: InputType;\n /** Label text rendered above the field. */\n label?: string;\n placeholder?: string;\n /** Helper or error message rendered below the field. */\n message?: string;\n /** Info icon rendered beside the label. */\n iconLabel?: React.ReactNode;\n /** Icon rendered inside the field, left side (24×24 slot). */\n iconLeft?: React.ReactNode;\n /** Icon rendered inside the field, right side (24×24 slot). */\n iconRight?: React.ReactNode;\n value?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n /** Called when search button is clicked (only for inputType=\"search\") */\n onSearch?: () => void;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function Input({\n state = 'Default',\n inputType = 'text',\n label,\n placeholder,\n message,\n iconLabel,\n iconLeft,\n iconRight,\n value,\n onChange,\n onSearch,\n id: idProp,\n className,\n ...props\n}: InputProps) {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const [showPassword, setShowPassword] = useState(false);\n\n const isDisabled = state === 'Disabled';\n const isError = state === 'Error';\n\n // ── Resolve HTML type ──────────────────────────────────────────────────────\n const htmlType = inputType === 'password'\n ? (showPassword ? 'text' : 'password')\n : inputType === 'search'\n ? 'text'\n : inputType;\n\n // ── Resolve built-in icons ─────────────────────────────────────────────────\n const resolvedIconLeft: React.ReactNode =\n iconLeft ??\n (inputType === 'email' ? <IconEmail /> :\n inputType === 'password' ? <IconLock /> :\n undefined);\n\n const resolvedIconRight: React.ReactNode =\n iconRight ??\n (inputType === 'password'\n ? (\n <button\n type=\"button\"\n className={styles.toggleBtn}\n onClick={() => setShowPassword((v) => !v)}\n aria-label={showPassword ? 'Ocultar senha' : 'Mostrar senha'}\n tabIndex={-1}\n >\n {showPassword ? <IconEye /> : <IconEyeOff />}\n </button>\n )\n : inputType === 'date'\n ? <IconCalendar />\n : inputType === 'search'\n ? (\n <button\n type=\"button\"\n className={styles.searchBtn}\n onClick={onSearch}\n aria-label=\"Buscar\"\n tabIndex={-1}\n >\n <IconSearch />\n </button>\n )\n : undefined);\n\n const fieldClass = [\n styles.field,\n state === 'Hover' ? styles.hover : '',\n state === 'Active' ? styles.active : '',\n isDisabled ? styles.disabled : '',\n isError ? styles.error : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={styles.wrapper}>\n {label && (\n <div className={styles.labelRow}>\n <label\n htmlFor={id}\n className={[styles.label, isDisabled ? styles.labelDisabled : '']\n .filter(Boolean)\n .join(' ')}\n >\n {label}\n </label>\n {iconLabel && (\n <span className={styles.labelIcon} aria-hidden=\"true\">\n {iconLabel}\n </span>\n )}\n </div>\n )}\n\n <div className={fieldClass}>\n {resolvedIconLeft && (\n <span className={styles.icon} aria-hidden=\"true\">\n {resolvedIconLeft}\n </span>\n )}\n <input\n id={id}\n type={htmlType}\n className={styles.input}\n placeholder={placeholder}\n disabled={isDisabled}\n value={value}\n onChange={onChange}\n aria-invalid={isError}\n aria-describedby={message ? `${id}-message` : undefined}\n {...props}\n />\n {resolvedIconRight && (\n <span className={[styles.icon, inputType === 'search' || inputType === 'password' ? styles.iconAction : ''].filter(Boolean).join(' ')}>\n {resolvedIconRight}\n </span>\n )}\n </div>\n\n {message && (\n <p\n id={`${id}-message`}\n className={[styles.message, isError ? styles.messageError : '']\n .filter(Boolean)\n .join(' ')}\n >\n {message}\n </p>\n )}\n </div>\n );\n}\n"],"names":["IconEmail","jsxs","jsx","IconSearch","IconCalendar","IconLock","IconEye","IconEyeOff","Input","state","inputType","label","placeholder","message","iconLabel","iconLeft","iconRight","value","onChange","onSearch","idProp","className","props","generatedId","useId","id","showPassword","setShowPassword","useState","isDisabled","isError","htmlType","resolvedIconLeft","resolvedIconRight","styles","v","fieldClass"],"mappings":";;;AAQA,S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AAGuB,CAAE;AAAA,QACT,WAAW,CAACS,EAAO,SAASJ,IAAUI,EAAO,eAAe,EAAE,EAC3D,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,QAEV,UAAArB;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index.esm9.js","sources":["../components/Input/Input.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\nimport styles from './Input.module.css';\n\nexport type InputState = 'Default' | 'Hover' | 'Active' | 'Disabled' | 'Error';\nexport type InputType = 'text' | 'email' | 'password' | 'search' | 'date';\nexport type InputSize = 'sm' | 'md';\n\n// ─── Built-in SVG icons ───────────────────────────────────────────────────────\n\nfunction IconEmail() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <polyline points=\"22,6 12,13 2,6\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n );\n}\n\nfunction IconSearch() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\"/>\n <path d=\"M16.5 16.5L21 21\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\"/>\n </svg>\n );\n}\n\nfunction IconCalendar() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M16 2v4M8 2v4M3 10h18\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n );\n}\n\nfunction IconLock() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"5\" y=\"11\" width=\"14\" height=\"11\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M8 11V7a4 4 0 0 1 8 0v4\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n </svg>\n );\n}\n\nfunction IconEye() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7z\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <circle cx=\"12\" cy=\"12\" r=\"3\" stroke=\"currentColor\" strokeWidth=\"1.75\"/>\n </svg>\n );\n}\n\nfunction IconEyeOff() {\n return (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n <path d=\"M1 1l22 22\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\"/>\n </svg>\n );\n}\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport interface InputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'type'> {\n /** Visual/interaction state. Defaults to 'Default'. */\n state?: InputState;\n /** Size variant. sm = 36px height, md = 48px height. Defaults to 'md'. */\n size?: InputSize;\n /**\n * Semantic input type. Sets the correct HTML type and auto-adds icons.\n * - email → envelope icon left\n * - password → lock icon left + show/hide toggle right\n * - search → search icon left + green search button right\n * - date → calendar icon right\n */\n inputType?: InputType;\n /** Label text rendered above the field. */\n label?: string;\n placeholder?: string;\n /** Helper or error message rendered below the field. */\n message?: string;\n /** Info icon rendered beside the label. */\n iconLabel?: React.ReactNode;\n /** Icon rendered inside the field, left side (24×24 slot). */\n iconLeft?: React.ReactNode;\n /** Icon rendered inside the field, right side (24×24 slot). */\n iconRight?: React.ReactNode;\n value?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;\n /** Called when search button is clicked (only for inputType=\"search\") */\n onSearch?: () => void;\n}\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\nexport function Input({\n state = 'Default',\n size = 'md',\n inputType = 'text',\n label,\n placeholder,\n message,\n iconLabel,\n iconLeft,\n iconRight,\n value,\n onChange,\n onSearch,\n id: idProp,\n className,\n ...props\n}: InputProps) {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const [showPassword, setShowPassword] = useState(false);\n\n const isDisabled = state === 'Disabled';\n const isError = state === 'Error';\n\n // ── Resolve HTML type ──────────────────────────────────────────────────────\n const htmlType = inputType === 'password'\n ? (showPassword ? 'text' : 'password')\n : inputType === 'search'\n ? 'text'\n : inputType;\n\n // ── Resolve built-in icons ─────────────────────────────────────────────────\n const resolvedIconLeft: React.ReactNode =\n iconLeft ??\n (inputType === 'email' ? <IconEmail /> :\n inputType === 'password' ? <IconLock /> :\n undefined);\n\n const resolvedIconRight: React.ReactNode =\n iconRight ??\n (inputType === 'password'\n ? (\n <button\n type=\"button\"\n className={styles.toggleBtn}\n onClick={() => setShowPassword((v) => !v)}\n aria-label={showPassword ? 'Ocultar senha' : 'Mostrar senha'}\n tabIndex={-1}\n >\n {showPassword ? <IconEye /> : <IconEyeOff />}\n </button>\n )\n : inputType === 'date'\n ? <IconCalendar />\n : inputType === 'search'\n ? (\n <button\n type=\"button\"\n className={styles.searchBtn}\n onClick={onSearch}\n aria-label=\"Buscar\"\n tabIndex={-1}\n >\n <IconSearch />\n </button>\n )\n : undefined);\n\n const fieldClass = [\n styles.field,\n size === 'sm' ? styles.fieldSm : styles.fieldMd,\n state === 'Hover' ? styles.hover : '',\n state === 'Active' ? styles.active : '',\n isDisabled ? styles.disabled : '',\n isError ? styles.error : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={styles.wrapper}>\n {label && (\n <div className={styles.labelRow}>\n <label\n htmlFor={id}\n className={[styles.label, isDisabled ? styles.labelDisabled : '']\n .filter(Boolean)\n .join(' ')}\n >\n {label}\n </label>\n {iconLabel && (\n <span className={styles.labelIcon} aria-hidden=\"true\">\n {iconLabel}\n </span>\n )}\n </div>\n )}\n\n <div className={fieldClass}>\n {resolvedIconLeft && (\n <span className={styles.icon} aria-hidden=\"true\">\n {resolvedIconLeft}\n </span>\n )}\n <input\n id={id}\n type={htmlType}\n className={styles.input}\n placeholder={placeholder}\n disabled={isDisabled}\n value={value}\n onChange={onChange}\n aria-invalid={isError}\n aria-describedby={message ? `${id}-message` : undefined}\n {...props}\n />\n {resolvedIconRight && (\n <span className={[styles.icon, inputType === 'search' || inputType === 'password' ? styles.iconAction : ''].filter(Boolean).join(' ')}>\n {resolvedIconRight}\n </span>\n )}\n </div>\n\n {message && (\n <p\n id={`${id}-message`}\n className={[styles.message, isError ? styles.messageError : '']\n .filter(Boolean)\n .join(' ')}\n >\n {message}\n </p>\n )}\n </div>\n );\n}\n"],"names":["IconEmail","jsxs","jsx","IconSearch","IconCalendar","IconLock","IconEye","IconEyeOff","Input","state","size","inputType","label","placeholder","message","iconLabel","iconLeft","iconRight","value","onChange","onSearch","idProp","className","props","generatedId","useId","id","showPassword","setShowPassword","useState","isDisabled","isError","htmlType","resolvedIconLeft","resolvedIconRight","styles","v","fieldClass"],"mappings":";;;AASA,SAASA,IAAY;AACnB,SACE,gBAAAC,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,eAAY,QACtE,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,+EAA8E,QAAO,gBAAe,aAAY,QAAO,eAAc,SAAQ,gBAAe,QAAA,CAAO;AAAA,IAC3K,gBAAAA,EAAC,YAAA,EAAS,QAAO,kBAAiB,QAAO,gBAAe,aAAY,QAAO,eAAc,SAAQ,gBAAe,QAAA,CAAO;AAAA,EAAA,GACzH;AAEJ;AAEA,SAASC,IAAa;AACpB,SACE,gBAAAF,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,eAAY,QACtE,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAA,EAAO,IAAG,MAAK,IAAG,MAAK,GAAE,KAAI,QAAO,gBAAe,aAAY,QAAO,eAAc,SAAO;AAAA,IAC5F,gBAAAA,EAAC,UAAK,GAAE,oBAAmB,QAAO,gBAAe,aAAY,QAAO,eAAc,QAAA,CAAO;AAAA,EAAA,GAC3F;AAEJ;AAEA,SAASE,IAAe;AACtB,SACE,gBAAAH,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,eAAY,QACtE,UAAA;AAAA,IAAA,gBAAAC,EAAC,UAAK,GAAE,KAAI,GAAE,KAAI,OAAM,MAAK,QAAO,MAAK,IAAG,KAAI,QAAO,gBAAe,aAAY,QAAO,eAAc,SAAQ,gBAAe,SAAO;AAAA,IACrI,gBAAAA,EAAC,QAAA,EAAK,GAAE,yBAAwB,QAAO,gBAAe,aAAY,QAAO,eAAc,SAAQ,gBAAe,QAAA,C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