@incodetech/web 0.0.0-dev-20260515-ec7243b → 0.0.0-dev-20260515-a07df20
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/base.css +2 -6
- package/dist/curp-validation/curp-validation.es.js +105 -108
- package/package.json +2 -2
package/dist/base.css
CHANGED
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
margin: 0;
|
|
66
66
|
padding: 0;
|
|
67
67
|
position: relative;
|
|
68
|
+
overflow-y: auto;
|
|
68
69
|
}
|
|
69
70
|
.IncodeComponent *, .IncodeComponent :after, .IncodeComponent :before, .IncodeComponent ::backdrop {
|
|
70
71
|
box-sizing: border-box;
|
|
@@ -1650,11 +1651,7 @@
|
|
|
1650
1651
|
border-color: var(--color-dropdown-border-focused, var(--dropdown-border-focused));
|
|
1651
1652
|
background-color: var(--color-dropdown-surface-focused, var(--dropdown-surface-focused));
|
|
1652
1653
|
}
|
|
1653
|
-
.IncodeDropdownComposedTrigger[data-error="true"] {
|
|
1654
|
-
border-color: var(--color-dropdown-border-negative, var(--dropdown-border-negative));
|
|
1655
|
-
background-color: var(--color-dropdown-surface-negative, var(--dropdown-surface-negative));
|
|
1656
|
-
}
|
|
1657
|
-
.IncodeDropdownComposedTrigger[data-error="true"][data-focused="true"] {
|
|
1654
|
+
.IncodeDropdownComposedTrigger[data-error="true"], .IncodeDropdownComposedTrigger[data-error="true"][data-focused="true"] {
|
|
1658
1655
|
border-style: var(--tw-border-style);
|
|
1659
1656
|
border-width: 2px;
|
|
1660
1657
|
border-color: var(--color-dropdown-border-negative, var(--dropdown-border-negative));
|
|
@@ -4027,7 +4024,6 @@
|
|
|
4027
4024
|
flex-direction: column;
|
|
4028
4025
|
flex: 1;
|
|
4029
4026
|
display: flex;
|
|
4030
|
-
overflow-y: auto;
|
|
4031
4027
|
}
|
|
4032
4028
|
@media (min-width: 48rem) {
|
|
4033
4029
|
.IncodePageContainer .IncodePageInner {
|
|
@@ -18,8 +18,8 @@ import { n as g, t as _ } from "../requiredLabelHint-BLwgqozE.js";
|
|
|
18
18
|
import { t as v } from "../autoFocusTitle-QexamZ4i.js";
|
|
19
19
|
import { GENERATE_CURP_FIELDS as y, createCurpValidationManager as b, mexicanStates as x } from "@incodetech/core/curp-validation";
|
|
20
20
|
//#region src/modules/curp-validation/curpInput.tsx
|
|
21
|
-
var S = ({ curp: t,
|
|
22
|
-
let { t:
|
|
21
|
+
var S = ({ curp: t, errorKey: n, onCurpChange: i, onCurpBlur: a, onVerify: s, onSwitchToGenerate: c, disabled: u = !1, placeholder: d, continueLabel: p, dontHaveLabel: m }) => {
|
|
22
|
+
let { t: h } = e(), g = d ?? h("curp.placeholder.curp") ?? "CURP", _ = p ?? h("curp.continue") ?? "Continue", v = m ?? h("curp.dontHave") ?? "I don't have my CURP", y = n ? h(n) : void 0, b = t.length === 0 || !!y || u;
|
|
23
23
|
return /* @__PURE__ */ r("div", {
|
|
24
24
|
class: "IncodeCurpValidation IncodeCurpInput",
|
|
25
25
|
children: [
|
|
@@ -30,146 +30,141 @@ var S = ({ curp: t, isValid: n, onCurpChange: i, onVerify: a, onSwitchToGenerate
|
|
|
30
30
|
let t = e.target;
|
|
31
31
|
i(t.value.toUpperCase());
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
onBlur: a,
|
|
34
|
+
placeholder: g,
|
|
35
|
+
disabled: u,
|
|
35
36
|
required: !0,
|
|
36
37
|
maxLength: 18,
|
|
37
|
-
"aria-label":
|
|
38
|
+
"aria-label": h("curp.placeholder.curp") ?? "CURP",
|
|
39
|
+
error: y,
|
|
40
|
+
showErrorIcon: !!y
|
|
38
41
|
}),
|
|
39
42
|
/* @__PURE__ */ r(o, {}),
|
|
40
43
|
/* @__PURE__ */ r(l, {
|
|
41
44
|
type: "button",
|
|
42
|
-
onClick:
|
|
43
|
-
disabled:
|
|
45
|
+
onClick: s,
|
|
46
|
+
disabled: b,
|
|
44
47
|
"data-testid": "curp-verify",
|
|
45
|
-
children:
|
|
48
|
+
children: _
|
|
46
49
|
}),
|
|
47
50
|
/* @__PURE__ */ r(l, {
|
|
48
51
|
type: "button",
|
|
49
52
|
variant: "secondary",
|
|
50
|
-
onClick:
|
|
51
|
-
disabled:
|
|
53
|
+
onClick: c,
|
|
54
|
+
disabled: u,
|
|
52
55
|
"data-testid": "curp-switch-to-generate",
|
|
53
|
-
children:
|
|
56
|
+
children: v
|
|
54
57
|
})
|
|
55
58
|
]
|
|
56
59
|
});
|
|
57
|
-
}, C = ({ form: t,
|
|
58
|
-
let { t:
|
|
59
|
-
firstName:
|
|
60
|
-
firstLast:
|
|
61
|
-
secondLast:
|
|
62
|
-
gender:
|
|
63
|
-
genderPlaceholder:
|
|
64
|
-
male:
|
|
65
|
-
female:
|
|
66
|
-
other:
|
|
67
|
-
dob:
|
|
68
|
-
birthState:
|
|
69
|
-
statePlaceholder:
|
|
70
|
-
generate:
|
|
71
|
-
...
|
|
72
|
-
},
|
|
73
|
-
let t = _(v, b[e]);
|
|
74
|
-
return t ? d(`forms.label.${t}`) : void 0;
|
|
75
|
-
}, C = (e) => (t) => {
|
|
60
|
+
}, C = ({ form: t, validationErrors: i, onFormChange: a, onValidateField: s, onGenerate: c, disabled: u = !1, labels: d }) => {
|
|
61
|
+
let { t: h } = e(), v = {
|
|
62
|
+
firstName: h("curp.labels.firstName") ?? "Your First name",
|
|
63
|
+
firstLast: h("curp.labels.firstLast") ?? "Your First last name",
|
|
64
|
+
secondLast: h("curp.labels.secondLast") ?? "Your Second last name",
|
|
65
|
+
gender: h("curp.labels.genderV2") ?? "Gender",
|
|
66
|
+
genderPlaceholder: h("curp.placeholder.gender") ?? "Choose gender",
|
|
67
|
+
male: h("curp.labels.maleV2") ?? "Male",
|
|
68
|
+
female: h("curp.labels.femaleV2") ?? "Female",
|
|
69
|
+
other: h("curp.labels.other") ?? "Other",
|
|
70
|
+
dob: h("curp.labels.dob") ?? "Date of birth",
|
|
71
|
+
birthState: h("curp.labels.birthState") ?? "State of birth",
|
|
72
|
+
statePlaceholder: h("curp.placeholder.state") ?? "Select state",
|
|
73
|
+
generate: h("curp.generateCta") ?? "Generate CURP",
|
|
74
|
+
...d
|
|
75
|
+
}, b = n(() => g(y.map((e) => e.required)), []), S = !!i && Object.keys(i).length > 0, C = (e) => (t) => {
|
|
76
76
|
let n = t.target;
|
|
77
77
|
a({ [e]: n.value });
|
|
78
|
-
}, w =
|
|
78
|
+
}, w = (e) => () => {
|
|
79
|
+
s(e);
|
|
80
|
+
}, T = [
|
|
79
81
|
{
|
|
80
82
|
value: "H",
|
|
81
|
-
label:
|
|
83
|
+
label: v.male
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
86
|
value: "M",
|
|
85
|
-
label:
|
|
87
|
+
label: v.female
|
|
86
88
|
},
|
|
87
89
|
{
|
|
88
90
|
value: "X",
|
|
89
|
-
label:
|
|
91
|
+
label: v.other
|
|
90
92
|
}
|
|
91
|
-
],
|
|
93
|
+
], E = x.map((e) => ({
|
|
92
94
|
value: e.value,
|
|
93
95
|
label: e.label
|
|
94
|
-
}))
|
|
96
|
+
})), D = (e) => {
|
|
97
|
+
switch (e) {
|
|
98
|
+
case "name": return v.firstName;
|
|
99
|
+
case "firstLastName": return v.firstLast;
|
|
100
|
+
case "secondLastName": return v.secondLast;
|
|
101
|
+
case "gender": return v.gender;
|
|
102
|
+
case "birthDate": return v.dob;
|
|
103
|
+
case "birthState": return v.birthState;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
95
106
|
return /* @__PURE__ */ r("div", {
|
|
96
107
|
class: "IncodeCurpValidation IncodeGenerateCurpForm",
|
|
97
108
|
children: [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
disabled: c,
|
|
150
|
-
required: b.birthDate,
|
|
151
|
-
"data-testid": "curp-birth-date"
|
|
152
|
-
}),
|
|
153
|
-
/* @__PURE__ */ r(p, {
|
|
154
|
-
id: "curp-birth-state",
|
|
155
|
-
label: h.birthState,
|
|
156
|
-
labelHint: S("birthState"),
|
|
157
|
-
placeholder: h.statePlaceholder,
|
|
158
|
-
value: t.birthState,
|
|
159
|
-
options: T,
|
|
160
|
-
disabled: c,
|
|
161
|
-
required: b.birthState,
|
|
162
|
-
onChange: (e) => a({ birthState: e }),
|
|
163
|
-
"data-testid": "curp-birth-state",
|
|
164
|
-
searchable: !0
|
|
109
|
+
y.map((e) => {
|
|
110
|
+
let n = _(b, e.required), o = n ? h(`forms.label.${n}`) ?? void 0 : void 0, s = i?.[e.key], c = s ? h(s) ?? void 0 : void 0, l = D(e.key);
|
|
111
|
+
if (e.type === "dropdown") {
|
|
112
|
+
let n = e.key === "gender" ? T : E, i = e.key === "gender" ? v.genderPlaceholder : v.statePlaceholder;
|
|
113
|
+
return /* @__PURE__ */ r(p, {
|
|
114
|
+
id: `curp-${e.key === "birthState" ? "birth-state" : "gender"}`,
|
|
115
|
+
label: l,
|
|
116
|
+
labelHint: o,
|
|
117
|
+
placeholder: i,
|
|
118
|
+
value: t[e.key],
|
|
119
|
+
options: n,
|
|
120
|
+
disabled: u,
|
|
121
|
+
required: e.required,
|
|
122
|
+
onChange: (t) => {
|
|
123
|
+
e.key === "gender" ? a({ gender: t }) : a({ [e.key]: t });
|
|
124
|
+
},
|
|
125
|
+
onBlur: w(e.key),
|
|
126
|
+
error: c,
|
|
127
|
+
showErrorIcon: !!c,
|
|
128
|
+
"data-testid": e.key === "gender" ? "curp-gender" : "curp-birth-state",
|
|
129
|
+
...e.key === "birthState" ? { searchable: !0 } : {}
|
|
130
|
+
}, e.key);
|
|
131
|
+
}
|
|
132
|
+
return e.type === "date" ? /* @__PURE__ */ r(m, {
|
|
133
|
+
id: "curp-birth-date",
|
|
134
|
+
label: l,
|
|
135
|
+
labelHint: o,
|
|
136
|
+
value: t.birthDate,
|
|
137
|
+
onInput: C("birthDate"),
|
|
138
|
+
onBlur: w("birthDate"),
|
|
139
|
+
max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
140
|
+
placeholder: h("curp.placeholder.dob") ?? "mm/dd/yyyy",
|
|
141
|
+
disabled: u,
|
|
142
|
+
required: e.required,
|
|
143
|
+
error: c,
|
|
144
|
+
showErrorIcon: !!c,
|
|
145
|
+
"data-testid": "curp-birth-date"
|
|
146
|
+
}, e.key) : /* @__PURE__ */ r(f, {
|
|
147
|
+
id: e.key === "name" ? "curp-first-name" : e.key === "firstLastName" ? "curp-first-last" : "curp-second-last",
|
|
148
|
+
label: l,
|
|
149
|
+
labelHint: o,
|
|
150
|
+
value: t[e.key],
|
|
151
|
+
onInput: C(e.key),
|
|
152
|
+
onBlur: w(e.key),
|
|
153
|
+
placeholder: l,
|
|
154
|
+
disabled: u,
|
|
155
|
+
required: e.required,
|
|
156
|
+
error: c,
|
|
157
|
+
showErrorIcon: !!c,
|
|
158
|
+
...e.autoComplete ? { autoComplete: e.autoComplete } : {}
|
|
159
|
+
}, e.key);
|
|
165
160
|
}),
|
|
166
161
|
/* @__PURE__ */ r(o, { size: 16 }),
|
|
167
162
|
/* @__PURE__ */ r(l, {
|
|
168
163
|
type: "button",
|
|
169
|
-
onClick:
|
|
170
|
-
disabled:
|
|
164
|
+
onClick: c,
|
|
165
|
+
disabled: S || u,
|
|
171
166
|
"data-testid": "curp-generate",
|
|
172
|
-
children:
|
|
167
|
+
children: v.generate
|
|
173
168
|
})
|
|
174
169
|
]
|
|
175
170
|
});
|
|
@@ -184,8 +179,9 @@ var S = ({ curp: t, isValid: n, onCurpChange: i, onVerify: a, onSwitchToGenerate
|
|
|
184
179
|
title: m("curp.enterCurp") ?? "Enter your CURP",
|
|
185
180
|
children: /* @__PURE__ */ r(S, {
|
|
186
181
|
curp: h.curp,
|
|
187
|
-
|
|
182
|
+
errorKey: h.validationErrors?.curp,
|
|
188
183
|
onCurpChange: (e) => g.setCurp(e),
|
|
184
|
+
onCurpBlur: () => g.validateField("curp"),
|
|
189
185
|
onVerify: () => g.verify(),
|
|
190
186
|
onSwitchToGenerate: () => g.switchToGenerate(),
|
|
191
187
|
placeholder: m("curp.placeholder.curp") ?? "CURP",
|
|
@@ -199,8 +195,9 @@ var S = ({ curp: t, isValid: n, onCurpChange: i, onVerify: a, onSwitchToGenerate
|
|
|
199
195
|
hideFooterBranding: !0,
|
|
200
196
|
children: /* @__PURE__ */ r(C, {
|
|
201
197
|
form: h.form,
|
|
202
|
-
|
|
198
|
+
validationErrors: h.validationErrors,
|
|
203
199
|
onFormChange: (e) => g.setGenerateForm(e),
|
|
200
|
+
onValidateField: (e) => g.validateField(e),
|
|
204
201
|
onGenerate: () => g.generate()
|
|
205
202
|
})
|
|
206
203
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-20260515-
|
|
3
|
+
"version": "0.0.0-dev-20260515-a07df20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
"qrcode": "^1.5.4",
|
|
240
240
|
"signature_pad": "^5.1.3",
|
|
241
241
|
"tailwindcss": "^4.1.17",
|
|
242
|
-
"@incodetech/core": "0.0.0-dev-20260515-
|
|
242
|
+
"@incodetech/core": "0.0.0-dev-20260515-a07df20"
|
|
243
243
|
},
|
|
244
244
|
"devDependencies": {
|
|
245
245
|
"@microsoft/api-extractor": "^7.53.3",
|