@cntrl-site/components 1.0.1-alpha.2 → 1.0.1-alpha.4

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.
@@ -0,0 +1,9 @@
1
+ export type ValidatableFormField = {
2
+ name: string;
3
+ type: 'text' | 'textarea' | 'phone' | 'email';
4
+ };
5
+ export declare const isValidEmailFormat: (value: string) => boolean;
6
+ /** Allows typical user input; requires at least 7 and at most 15 digits (E.164 max). */
7
+ export declare const isValidPhoneFormat: (value: string) => boolean;
8
+ /** First invalid non-empty email/phone in field order, or null. */
9
+ export declare const getFormFieldValidationError: (visibleFields: ValidatableFormField[], values: Record<string, string>) => string | null;
@@ -1,4 +1,6 @@
1
1
  export { scalingValue } from './scalingValue';
2
+ export { getFormFieldValidationError, isValidEmailFormat, isValidPhoneFormat, } from './formFieldValidation';
3
+ export type { ValidatableFormField } from './formFieldValidation';
2
4
  export { useScopedStyles } from './useScopedStyles';
3
5
  export type { ScopedStyles } from './useScopedStyles';
4
6
  export type { CommonComponentProps } from '../props';