@verifiedinc-public/shared-ui-elements 12.8.1 → 12.8.3
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/components/form/NewOneClickForm/core/fields/employer.d.ts +14 -14
- package/dist/components/form/NewOneClickForm/core/fields/index.d.ts +14 -14
- package/dist/components/form/NewOneClickForm/core/form/form.mjs +1 -1
- package/dist/components/form/NewOneClickForm/core/formats/employer.format.mjs +1 -1
- package/dist/components/form/NewOneClickForm/core/validations/employer/employer.schema.d.ts +14 -14
- package/dist/components/form/NewOneClickForm/core/validations/employer/employer.schema.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/input/employer.field.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/readonly/employer.field.mjs +1 -1
- package/dist/components/form/NewOneClickForm/react/ui/fields/shared.d.ts +49 -4
- package/dist/components/form/NewOneClickForm/react/ui/fields/shared.mjs +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export declare const employer: {
|
|
|
12
12
|
employer: import('zod').ZodObject<{
|
|
13
13
|
name: import('zod').ZodString;
|
|
14
14
|
legalName: import('zod').ZodOptional<import('zod').ZodString>;
|
|
15
|
-
address: import('zod').ZodEffects<import('zod').ZodEffects<import('zod').ZodObject<{
|
|
15
|
+
address: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodEffects<import('zod').ZodObject<{
|
|
16
16
|
line1: import('zod').ZodOptional<import('zod').ZodString>;
|
|
17
17
|
line2: import('zod').ZodOptional<import('zod').ZodString>;
|
|
18
18
|
city: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -61,54 +61,54 @@ export declare const employer: {
|
|
|
61
61
|
state?: string | undefined;
|
|
62
62
|
country?: string | undefined;
|
|
63
63
|
zipCode?: string | undefined;
|
|
64
|
-
}
|
|
64
|
+
}>>;
|
|
65
65
|
}, "strip", import('zod').ZodTypeAny, {
|
|
66
|
-
|
|
66
|
+
name: string;
|
|
67
|
+
address?: {
|
|
67
68
|
line1?: string | undefined;
|
|
68
69
|
line2?: string | undefined;
|
|
69
70
|
city?: string | undefined;
|
|
70
71
|
state?: string | undefined;
|
|
71
72
|
country?: "US" | undefined;
|
|
72
73
|
zipCode?: string | undefined;
|
|
73
|
-
};
|
|
74
|
-
name: string;
|
|
74
|
+
} | undefined;
|
|
75
75
|
legalName?: string | undefined;
|
|
76
76
|
}, {
|
|
77
|
-
|
|
77
|
+
name: string;
|
|
78
|
+
address?: {
|
|
78
79
|
line1?: string | undefined;
|
|
79
80
|
line2?: string | undefined;
|
|
80
81
|
city?: string | undefined;
|
|
81
82
|
state?: string | undefined;
|
|
82
83
|
country?: string | undefined;
|
|
83
84
|
zipCode?: string | undefined;
|
|
84
|
-
};
|
|
85
|
-
name: string;
|
|
85
|
+
} | undefined;
|
|
86
86
|
legalName?: string | undefined;
|
|
87
87
|
}>;
|
|
88
88
|
}, "strip", import('zod').ZodTypeAny, {
|
|
89
89
|
employer: {
|
|
90
|
-
|
|
90
|
+
name: string;
|
|
91
|
+
address?: {
|
|
91
92
|
line1?: string | undefined;
|
|
92
93
|
line2?: string | undefined;
|
|
93
94
|
city?: string | undefined;
|
|
94
95
|
state?: string | undefined;
|
|
95
96
|
country?: "US" | undefined;
|
|
96
97
|
zipCode?: string | undefined;
|
|
97
|
-
};
|
|
98
|
-
name: string;
|
|
98
|
+
} | undefined;
|
|
99
99
|
legalName?: string | undefined;
|
|
100
100
|
};
|
|
101
101
|
}, {
|
|
102
102
|
employer: {
|
|
103
|
-
|
|
103
|
+
name: string;
|
|
104
|
+
address?: {
|
|
104
105
|
line1?: string | undefined;
|
|
105
106
|
line2?: string | undefined;
|
|
106
107
|
city?: string | undefined;
|
|
107
108
|
state?: string | undefined;
|
|
108
109
|
country?: string | undefined;
|
|
109
110
|
zipCode?: string | undefined;
|
|
110
|
-
};
|
|
111
|
-
name: string;
|
|
111
|
+
} | undefined;
|
|
112
112
|
legalName?: string | undefined;
|
|
113
113
|
};
|
|
114
114
|
}>;
|
|
@@ -609,7 +609,7 @@ export declare const fields: {
|
|
|
609
609
|
employer: import('zod').ZodObject<{
|
|
610
610
|
name: import('zod').ZodString;
|
|
611
611
|
legalName: import('zod').ZodOptional<import('zod').ZodString>;
|
|
612
|
-
address: import('zod').ZodEffects<import('zod').ZodEffects<import('zod').ZodObject<{
|
|
612
|
+
address: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodEffects<import('zod').ZodObject<{
|
|
613
613
|
line1: import('zod').ZodOptional<import('zod').ZodString>;
|
|
614
614
|
line2: import('zod').ZodOptional<import('zod').ZodString>;
|
|
615
615
|
city: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -658,54 +658,54 @@ export declare const fields: {
|
|
|
658
658
|
state?: string | undefined;
|
|
659
659
|
country?: string | undefined;
|
|
660
660
|
zipCode?: string | undefined;
|
|
661
|
-
}
|
|
661
|
+
}>>;
|
|
662
662
|
}, "strip", import('zod').ZodTypeAny, {
|
|
663
|
-
|
|
663
|
+
name: string;
|
|
664
|
+
address?: {
|
|
664
665
|
line1?: string | undefined;
|
|
665
666
|
line2?: string | undefined;
|
|
666
667
|
city?: string | undefined;
|
|
667
668
|
state?: string | undefined;
|
|
668
669
|
country?: "US" | undefined;
|
|
669
670
|
zipCode?: string | undefined;
|
|
670
|
-
};
|
|
671
|
-
name: string;
|
|
671
|
+
} | undefined;
|
|
672
672
|
legalName?: string | undefined;
|
|
673
673
|
}, {
|
|
674
|
-
|
|
674
|
+
name: string;
|
|
675
|
+
address?: {
|
|
675
676
|
line1?: string | undefined;
|
|
676
677
|
line2?: string | undefined;
|
|
677
678
|
city?: string | undefined;
|
|
678
679
|
state?: string | undefined;
|
|
679
680
|
country?: string | undefined;
|
|
680
681
|
zipCode?: string | undefined;
|
|
681
|
-
};
|
|
682
|
-
name: string;
|
|
682
|
+
} | undefined;
|
|
683
683
|
legalName?: string | undefined;
|
|
684
684
|
}>;
|
|
685
685
|
}, "strip", import('zod').ZodTypeAny, {
|
|
686
686
|
employer: {
|
|
687
|
-
|
|
687
|
+
name: string;
|
|
688
|
+
address?: {
|
|
688
689
|
line1?: string | undefined;
|
|
689
690
|
line2?: string | undefined;
|
|
690
691
|
city?: string | undefined;
|
|
691
692
|
state?: string | undefined;
|
|
692
693
|
country?: "US" | undefined;
|
|
693
694
|
zipCode?: string | undefined;
|
|
694
|
-
};
|
|
695
|
-
name: string;
|
|
695
|
+
} | undefined;
|
|
696
696
|
legalName?: string | undefined;
|
|
697
697
|
};
|
|
698
698
|
}, {
|
|
699
699
|
employer: {
|
|
700
|
-
|
|
700
|
+
name: string;
|
|
701
|
+
address?: {
|
|
701
702
|
line1?: string | undefined;
|
|
702
703
|
line2?: string | undefined;
|
|
703
704
|
city?: string | undefined;
|
|
704
705
|
state?: string | undefined;
|
|
705
706
|
country?: string | undefined;
|
|
706
707
|
zipCode?: string | undefined;
|
|
707
|
-
};
|
|
708
|
-
name: string;
|
|
708
|
+
} | undefined;
|
|
709
709
|
legalName?: string | undefined;
|
|
710
710
|
};
|
|
711
711
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=Object.defineProperty,a=(s,e,i)=>e in s?t(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,l=(s,e,i)=>a(s,typeof e!="symbol"?e+"":e,i);import{credentialKeys as
|
|
1
|
+
"use strict";var t=Object.defineProperty,a=(s,e,i)=>e in s?t(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,l=(s,e,i)=>a(s,typeof e!="symbol"?e+"":e,i);import{credentialKeys as o}from"../fields/index.mjs";const r=s=>typeof s=="string"?s.trim():Array.isArray(s)?s.map(r):s&&typeof s=="object"?Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,i])=>[e,r(i)])):s;class c{constructor(e){l(this,"fields"),this.fields=e}get isValid(){return Object.values(this.fields).every(e=>e.isValid)}get isEmpty(){return Object.values(this.fields).every(e=>e.schema.key===o.phone?!0:e.isEmpty)}get isDirty(){return Object.values(this.fields).some(e=>e.isDirty)}get isDisabled(){return Object.values(this.fields).every(e=>e.isDisabled)}get values(){return Object.fromEntries(Object.values(this.fields).map(e=>[e.schema.key,r(e.value)]))}}export{c as Form};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=l=>{var o;const e=l?.employer;return e!=null&&e.name?[e.name,(o=e.address)==null?void 0:o.state].filter(Boolean).join(" \u2014 "):null};export{n as employerFormat};
|
|
@@ -3,7 +3,7 @@ export declare const employerSchema: z.ZodObject<{
|
|
|
3
3
|
employer: z.ZodObject<{
|
|
4
4
|
name: z.ZodString;
|
|
5
5
|
legalName: z.ZodOptional<z.ZodString>;
|
|
6
|
-
address: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
6
|
+
address: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
7
7
|
line1: z.ZodOptional<z.ZodString>;
|
|
8
8
|
line2: z.ZodOptional<z.ZodString>;
|
|
9
9
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -52,54 +52,54 @@ export declare const employerSchema: z.ZodObject<{
|
|
|
52
52
|
state?: string | undefined;
|
|
53
53
|
country?: string | undefined;
|
|
54
54
|
zipCode?: string | undefined;
|
|
55
|
-
}
|
|
55
|
+
}>>;
|
|
56
56
|
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
|
|
57
|
+
name: string;
|
|
58
|
+
address?: {
|
|
58
59
|
line1?: string | undefined;
|
|
59
60
|
line2?: string | undefined;
|
|
60
61
|
city?: string | undefined;
|
|
61
62
|
state?: string | undefined;
|
|
62
63
|
country?: "US" | undefined;
|
|
63
64
|
zipCode?: string | undefined;
|
|
64
|
-
};
|
|
65
|
-
name: string;
|
|
65
|
+
} | undefined;
|
|
66
66
|
legalName?: string | undefined;
|
|
67
67
|
}, {
|
|
68
|
-
|
|
68
|
+
name: string;
|
|
69
|
+
address?: {
|
|
69
70
|
line1?: string | undefined;
|
|
70
71
|
line2?: string | undefined;
|
|
71
72
|
city?: string | undefined;
|
|
72
73
|
state?: string | undefined;
|
|
73
74
|
country?: string | undefined;
|
|
74
75
|
zipCode?: string | undefined;
|
|
75
|
-
};
|
|
76
|
-
name: string;
|
|
76
|
+
} | undefined;
|
|
77
77
|
legalName?: string | undefined;
|
|
78
78
|
}>;
|
|
79
79
|
}, "strip", z.ZodTypeAny, {
|
|
80
80
|
employer: {
|
|
81
|
-
|
|
81
|
+
name: string;
|
|
82
|
+
address?: {
|
|
82
83
|
line1?: string | undefined;
|
|
83
84
|
line2?: string | undefined;
|
|
84
85
|
city?: string | undefined;
|
|
85
86
|
state?: string | undefined;
|
|
86
87
|
country?: "US" | undefined;
|
|
87
88
|
zipCode?: string | undefined;
|
|
88
|
-
};
|
|
89
|
-
name: string;
|
|
89
|
+
} | undefined;
|
|
90
90
|
legalName?: string | undefined;
|
|
91
91
|
};
|
|
92
92
|
}, {
|
|
93
93
|
employer: {
|
|
94
|
-
|
|
94
|
+
name: string;
|
|
95
|
+
address?: {
|
|
95
96
|
line1?: string | undefined;
|
|
96
97
|
line2?: string | undefined;
|
|
97
98
|
city?: string | undefined;
|
|
98
99
|
state?: string | undefined;
|
|
99
100
|
country?: string | undefined;
|
|
100
101
|
zipCode?: string | undefined;
|
|
101
|
-
};
|
|
102
|
-
name: string;
|
|
102
|
+
} | undefined;
|
|
103
103
|
legalName?: string | undefined;
|
|
104
104
|
};
|
|
105
105
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{z as e}from"zod";import{employerNameSchema as m}from"./employerName.schema.mjs";import{legalNameSchema as o}from"./legalName.schema.mjs";import{requiredAddressSchema as a}from"../address/address.schema.mjs";const r=e.object({employer:e.object({name:m,legalName:o.optional(),address:a})});export{r as employerSchema};
|
|
1
|
+
"use strict";import{z as e}from"zod";import{employerNameSchema as m}from"./employerName.schema.mjs";import{legalNameSchema as o}from"./legalName.schema.mjs";import{requiredAddressSchema as a}from"../address/address.schema.mjs";const r=e.object({employer:e.object({name:m,legalName:o.optional(),address:a.optional()})});export{r as employerSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useState as
|
|
1
|
+
"use strict";import{useState as x}from"react";import{Stack as A,TextField as P,Box as I}from"@mui/material";import{AddressInput as S}from"../../../../../AddressInput/index.mjs";import{useFormField as B}from"../../../core/field.hook.mjs";import{RequiredLabel as U,toFieldValueAttribute as n}from"../shared.mjs";import{useOneClickForm as j}from"../../form.context.mjs";import{jsxs as D,jsx as s}from"react/jsx-runtime";import{addressFormat as T}from"../../../../core/formats/address.format.mjs";function q({fieldKey:h}){var u,m;const{options:r}=j(),{field:l,setValue:b}=B({key:h}),[C,k]=x({});if(!l)return null;const c=l.value;if(!c)return null;const t=c.employer,a=t.address??{},d=r.features.enableUserPrivacy,o=e=>{k(i=>i[e]?i:{...i,[e]:!0})},p=e=>{b({employer:{...t,...e}})},f=e=>{const i=Object.values(e).some(Boolean);p({address:i?e:void 0}),o("address")},z=((m=(u=l.errors)==null?void 0:u.error)==null?void 0:m.issues)??[],v=e=>{var i;if(!(!l.touched&&!C[e]))return(i=z.find(F=>F.path[1]===e))==null?void 0:i.message},y=v("name"),g=v("address");return D(A,{spacing:2,children:[s(P,{"data-testid":"data-field-atomic-employer.name","data-verified-sdk-field-value":n(t.name,d),fullWidth:!0,size:"small",label:s(U,{required:l.isRequired,children:"Name"}),value:t.name??"",onChange:e=>{p({name:e.target.value}),o("name")},onBlur:()=>o("name"),error:!!y,helperText:y,disabled:l.isDisabled,InputProps:{"data-mask-me":!0},inputProps:{autoCorrect:"off"}}),s(I,{"data-testid":"data-field-composite-employer.address","data-verified-sdk-field-value":n(a.line1?T(a):void 0,d),width:"100%",children:s(S,{size:"small",label:"Address",defaultValue:{line1:a.line1,city:a.city,state:a.state,zipCode:a.zipCode,country:a.country??"US"},onChange:e=>{typeof e!="string"&&f({line1:e?.line1,line2:a.line2??"",city:e?.city,state:e?.state,zipCode:e?.zipCode,country:e?.country==="US"?"US":void 0})},onBlur:()=>o("address"),error:!!g,helperText:g,disabled:l.isDisabled,InputProps:{"data-mask-me":!0},service:{googlePlacesAutocompletePlaces:r.servicePaths.googlePlacesAutocompletePlaces,googlePlacesGetPlace:r.servicePaths.googlePlacesGetPlace}})}),s(P,{"data-testid":"data-field-atomic-employer.address.line2","data-verified-sdk-field-value":n(a.line2,d),fullWidth:!0,size:"small",label:"Line 2",value:a.line2??"",onChange:e=>f({...a,line2:e.target.value}),disabled:l.isDisabled,InputProps:{"data-mask-me":!0},inputProps:{autoCorrect:"off"}})]})}export{q as EmployerInputField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Stack as
|
|
1
|
+
"use strict";import{Stack as n,MenuItem as f,Typography as s}from"@mui/material";import{useFormField as p}from"../../../core/field.hook.mjs";import{useOneClickForm as v}from"../../form.context.mjs";import{toFieldValueAttribute as m}from"../shared.mjs";import{FieldSectionTitle as y,FieldSectionContent as h,FieldLabelBase as b}from"../style.mjs";import{VariantSelectField as F}from"./variantSelect.field.mjs";import{jsxs as o,jsx as i}from"react/jsx-runtime";import{addressFormat as g}from"../../../../core/formats/address.format.mjs";function u({label:a,value:l,testId:t,fieldValue:r}){return o(n,{direction:"row","data-testid":t,"data-verified-sdk-field-value":r,children:[i(b,{label:a}),i(s,{"data-mask-me":!0,variant:"body1",sx:{fontSize:20,fontWeight:300,wordBreak:"break-word",textAlign:"left"},children:l})]})}function c({item:a}){var l;const{options:t}=v(),r=t.features.enableUserPrivacy,e=(l=a.address)!=null&&l.line1?g(a.address):null;return o(n,{spacing:1.25,children:[i(u,{label:"Name",value:a.name,testId:"data-field-atomic-employer.name",fieldValue:m(a.name,r)}),e&&i(u,{label:"Address",value:e,testId:"data-field-composite-employer.address",fieldValue:m(e,r)})]})}function k({fieldKey:a}){var l;const{field:t}=p({key:a});if(!t)return null;if(!t.hasVariants){const e=(l=t.value)==null?void 0:l.employer;return e?o(n,{spacing:1.25,children:[i(y,{fieldKey:a}),i(h,{spacing:1.25,children:i(c,{item:e})})]}):null}const r=t.variants??[];return i(F,{fieldKey:a,testId:`data-employer-select-${a}`,renderValue:()=>{var e;const d=(e=t.value)==null?void 0:e.employer;return d?i(c,{item:d}):null},children:r.map(e=>i(f,{value:e.id,onClick:d=>d.stopPropagation(),sx:{maxWidth:"100%",whiteSpace:"pre-wrap"},children:i(s,{variant:"body1",fontWeight:500,children:e.displayValue??"-"})},e.id))})}export{k as EmployerField};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { FormField } from '../../../core/form';
|
|
2
2
|
import { OneClickFormOptions } from '../form.context';
|
|
3
|
+
/**
|
|
4
|
+
* Value for the `data-verified-sdk-field-value` attribute, withheld when user privacy is enabled.
|
|
5
|
+
* @param value The field value to expose.
|
|
6
|
+
* @param userPrivacyEnabled Whether the user privacy feature is enabled.
|
|
7
|
+
* @returns The value to expose, or undefined.
|
|
8
|
+
*/
|
|
9
|
+
export declare const toFieldValueAttribute: <T>(value: T, userPrivacyEnabled?: boolean) => T | undefined;
|
|
3
10
|
/**
|
|
4
11
|
* Makes attributes for a field.
|
|
5
12
|
* @param field The field to make attributes for.
|
|
@@ -14,7 +21,45 @@ export declare const makeAttributes: ({ userPrivacyEnabled, field, fieldKey, opt
|
|
|
14
21
|
role: string;
|
|
15
22
|
'aria-label': string | undefined;
|
|
16
23
|
'data-testid': string;
|
|
17
|
-
'data-verified-sdk-field-value':
|
|
24
|
+
'data-verified-sdk-field-value': string | {
|
|
25
|
+
memberId: string;
|
|
26
|
+
payer: {
|
|
27
|
+
name: string;
|
|
28
|
+
verifiedId: string;
|
|
29
|
+
logoUrl?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
id?: number | undefined;
|
|
32
|
+
} | {
|
|
33
|
+
employer: {
|
|
34
|
+
name: string;
|
|
35
|
+
address?: {
|
|
36
|
+
line1?: string | undefined;
|
|
37
|
+
line2?: string | undefined;
|
|
38
|
+
city?: string | undefined;
|
|
39
|
+
state?: string | undefined;
|
|
40
|
+
country?: "US" | undefined;
|
|
41
|
+
zipCode?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
legalName?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
firstName?: string | undefined;
|
|
47
|
+
lastName?: string | undefined;
|
|
48
|
+
middleName?: string | undefined;
|
|
49
|
+
} | {
|
|
50
|
+
line1?: string | undefined;
|
|
51
|
+
line2?: string | undefined;
|
|
52
|
+
city?: string | undefined;
|
|
53
|
+
state?: string | undefined;
|
|
54
|
+
country?: string | undefined;
|
|
55
|
+
zipCode?: string | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
documentNumber?: string | undefined;
|
|
58
|
+
issuanceState?: string | undefined;
|
|
59
|
+
issuanceDate?: string | undefined;
|
|
60
|
+
expirationDate?: string | undefined;
|
|
61
|
+
address?: undefined;
|
|
62
|
+
} | null | undefined;
|
|
18
63
|
};
|
|
19
64
|
/**
|
|
20
65
|
* Returns the autocomplete attribute value based on the type of the field.
|
|
@@ -37,15 +82,15 @@ export declare const getFieldValue: (field: FormField, options: OneClickFormOpti
|
|
|
37
82
|
id?: number | undefined;
|
|
38
83
|
} | {
|
|
39
84
|
employer: {
|
|
40
|
-
|
|
85
|
+
name: string;
|
|
86
|
+
address?: {
|
|
41
87
|
line1?: string | undefined;
|
|
42
88
|
line2?: string | undefined;
|
|
43
89
|
city?: string | undefined;
|
|
44
90
|
state?: string | undefined;
|
|
45
91
|
country?: "US" | undefined;
|
|
46
92
|
zipCode?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
name: string;
|
|
93
|
+
} | undefined;
|
|
49
94
|
legalName?: string | undefined;
|
|
50
95
|
};
|
|
51
96
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Typography as
|
|
1
|
+
"use strict";import{Typography as m}from"@mui/material";import{credentialKeys as s}from"../../../core/fields/index.mjs";import{jsx as l,Fragment as o,jsxs as u}from"react/jsx-runtime";import{fieldInputTypes as p}from"../../../core/fields/constants.mjs";const d=(e,a)=>a?void 0:e,h=({userPrivacyEnabled:e,field:a,fieldKey:t,options:i})=>({role:"region","aria-label":a?.schema.characteristics.label,"data-testid":a?.schema.characteristics.inputType===p.composite?`data-field-composite-${t}`:`data-field-atomic-${t}`,"data-verified-sdk-field-value":d(a?n(a,i):void 0,e)});function f(e){return e===s.firstName?"given-name":e===s.lastName?"family-name":e===s.phone?"tel":e===s.address?"street-address address-level2 address-level1 postal-code":e===s.line2?"address-line2":"off"}const n=(e,a)=>{if(!(typeof e.value=="object"&&e.schema.key!==s.address&&e.schema.key!==s.healthInsurance&&e.schema.key!==s.employer))return e.schema.key===s.state||e.schema.key===s.issuanceState||e.schema.key===s.birthDate||e.schema.key===s.expirationDate||e.schema.key===s.issuanceDate?e.value:c(e,a)},c=(e,a)=>{var t,i;const r=e.displayValue;return(i=(t=a.features.field)==null?void 0:t.dob)!=null&&i.redactYear&&e.schema.key===s.birthDate&&typeof r=="string"?r.replace(/\/\d{4}$/,"/\u2022\u2022\u2022\u2022"):r};function y({children:e,required:a}){return a?u(o,{children:[e," ",l(m,{"data-asterisk":!0,component:"span",color:"error",variant:"subtitle2",sx:{fontSize:"inherit"},children:"\u273D"})]}):l(o,{children:e})}export{y as RequiredLabel,f as getAutoCompleteAttributeValue,c as getFieldDisplayValue,n as getFieldValue,h as makeAttributes,d as toFieldValueAttribute};
|