@verifiedinc-public/shared-ui-elements 0.14.5-beta.4 → 0.14.5-beta.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.
@@ -1,4 +1,5 @@
1
1
  import * as zod from 'zod';
2
2
  export declare const birthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
3
+ export declare const birthDateSchemaWithPastOnlyValidation: zod.ZodEffects<zod.ZodDate, Date, Date>;
3
4
  export declare const simpleBirthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
4
5
  export declare const shortenBirthDateSchema: zod.ZodEffects<zod.ZodString, string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verifiedinc-public/shared-ui-elements",
3
- "version": "0.14.5-beta.4",
3
+ "version": "0.14.5-beta.5",
4
4
  "description": "A set of UI components, utilities that is shareable with the core apps.",
5
5
  "private": false,
6
6
  "keywords": [],
@@ -32,6 +32,12 @@ export const birthDateSchema = zod.string().refine((value: string) => {
32
32
  return false;
33
33
  }, 'Date of Birth is invalid');
34
34
 
35
+ export const birthDateSchemaWithPastOnlyValidation = zod.z
36
+ .date()
37
+ .refine((date) => date.getTime() < Date.now(), {
38
+ message: 'Birthday must be in the past',
39
+ });
40
+
35
41
  export const simpleBirthDateSchema = zod.string().refine((value: string) => {
36
42
  const regex = /^\d{2}\d{2}\d{4}$/;
37
43
  if (regex.test(value)) {