@transcend-io/contact-form-schema
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -8,2 +8,10 @@ import { z } from 'zod'; | ||
/** | ||
* Company sizes options - used to populate the company size select field | ||
*/ | ||
declare const CompanySizesOptions: readonly ["Under 200 employees", "200 to 500 employees", "500 to 1000 employees", "1000 to 5000 employees", "Above 5000 employees"]; | ||
/** | ||
* Partner Types Options - used to populate the partner type select field | ||
*/ | ||
declare const PartnerTypesOptions: readonly ["Technology partner", "Law firm partner", "Consulting partner"]; | ||
/** | ||
* The fields that are part of the contact form itself. | ||
@@ -308,3 +316,3 @@ * This can be used to validate ALL contact forms, even if they omit some of the optional fields. | ||
type ContactFormBody = z.infer<typeof ContactFormBody>; | ||
export { CONTACT_FORM_VERSION, ContactFormFields, ContactFormMetadata, ContactFormBody }; | ||
export { CONTACT_FORM_VERSION, CompanySizesOptions, PartnerTypesOptions, ContactFormFields, ContactFormMetadata, ContactFormBody }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,3 +9,3 @@ import DOMPurify from 'isomorphic-dompurify'; | ||
*/ | ||
const CONTACT_FORM_VERSION = '3.1.2'; | ||
const CONTACT_FORM_VERSION = '3.1.3'; | ||
/** | ||
@@ -19,2 +19,20 @@ * Sanitize inputs to prevent XSS | ||
/** | ||
* Company sizes options - used to populate the company size select field | ||
*/ | ||
const CompanySizesOptions = [ | ||
'Under 200 employees', | ||
'200 to 500 employees', | ||
'500 to 1000 employees', | ||
'1000 to 5000 employees', | ||
'Above 5000 employees', | ||
]; | ||
/** | ||
* Partner Types Options - used to populate the partner type select field | ||
*/ | ||
const PartnerTypesOptions = [ | ||
'Technology partner', | ||
'Law firm partner', | ||
'Consulting partner', | ||
]; | ||
/** | ||
* The fields that are part of the contact form itself. | ||
@@ -35,11 +53,3 @@ * This can be used to validate ALL contact forms, even if they omit some of the optional fields. | ||
/** The company's employee count */ | ||
companySize: z | ||
.enum([ | ||
'Under 200 employees', | ||
'200 to 500 employees', | ||
'500 to 1000 employees', | ||
'1000 to 5000 employees', | ||
'Above 5000 employees', | ||
]) | ||
.optional(), | ||
companySize: z.enum(CompanySizesOptions).optional(), | ||
/** The submitter's phone number */ | ||
@@ -59,5 +69,3 @@ phone: z | ||
/** If this is a partner contacting us */ | ||
partnerType: z | ||
.enum(['Technology partner', 'Law firm partner', 'Consulting partner']) | ||
.optional(), | ||
partnerType: z.enum(PartnerTypesOptions).optional(), | ||
/** If this is a partner submitting a referral */ | ||
@@ -126,3 +134,3 @@ referralPartner: z | ||
export { CONTACT_FORM_VERSION, ContactFormBody, ContactFormFields, ContactFormMetadata }; | ||
export { CONTACT_FORM_VERSION, CompanySizesOptions, ContactFormBody, ContactFormFields, ContactFormMetadata, PartnerTypesOptions }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@transcend-io/contact-form-schema", | ||
"type": "module", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "description": "Schema for the marketing contact form.", |
@@ -9,3 +9,3 @@ import DOMPurify from 'isomorphic-dompurify'; | ||
*/ | ||
export const CONTACT_FORM_VERSION: string = '3.1.2'; | ||
export const CONTACT_FORM_VERSION: string = '3.1.3'; | ||
@@ -21,2 +21,21 @@ /** | ||
/** | ||
* Company sizes options - used to populate the company size select field | ||
*/ | ||
export const CompanySizesOptions = [ | ||
'Under 200 employees', | ||
'200 to 500 employees', | ||
'500 to 1000 employees', | ||
'1000 to 5000 employees', | ||
'Above 5000 employees', | ||
] as const; | ||
/** | ||
* Partner Types Options - used to populate the partner type select field | ||
*/ | ||
export const PartnerTypesOptions = [ | ||
'Technology partner', | ||
'Law firm partner', | ||
'Consulting partner', | ||
] as const; | ||
/** | ||
* The fields that are part of the contact form itself. | ||
@@ -42,11 +61,3 @@ * This can be used to validate ALL contact forms, even if they omit some of the optional fields. | ||
/** The company's employee count */ | ||
companySize: z | ||
.enum([ | ||
'Under 200 employees', | ||
'200 to 500 employees', | ||
'500 to 1000 employees', | ||
'1000 to 5000 employees', | ||
'Above 5000 employees', | ||
]) | ||
.optional(), | ||
companySize: z.enum(CompanySizesOptions).optional(), | ||
@@ -71,5 +82,3 @@ /** The submitter's phone number */ | ||
/** If this is a partner contacting us */ | ||
partnerType: z | ||
.enum(['Technology partner', 'Law firm partner', 'Consulting partner']) | ||
.optional(), | ||
partnerType: z.enum(PartnerTypesOptions).optional(), | ||
@@ -76,0 +85,0 @@ /** If this is a partner submitting a referral */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67793
712