@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260925110206 → 0.8.1-dev.20260929055955

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/index.d.mts CHANGED
@@ -174,6 +174,7 @@ interface InputControlProps {
174
174
  helpText?: string;
175
175
  autoFocus?: boolean;
176
176
  heading?: string;
177
+ defaultCountryCode?: string;
177
178
  };
178
179
  }
179
180
 
@@ -260,6 +261,35 @@ declare const PercentageInput: React__default.FC<InputControlProps>;
260
261
 
261
262
  declare const PhoneInput: React__default.FC<InputControlProps>;
262
263
 
264
+ interface CountryCode {
265
+ name: string;
266
+ iso2: string;
267
+ dialCode: string;
268
+ }
269
+ declare const COUNTRY_CODES: CountryCode[];
270
+ /** Returns the country for a dial code, preferring the primary country for shared codes. */
271
+ declare const findCountryByDialCode: (dialCode: string) => CountryCode | undefined;
272
+ /** Returns the country for an ISO 3166-1 alpha-2 code such as "IN" (as returned by the Geo API). */
273
+ declare const findCountryByIso2: (iso2?: string | null) => CountryCode | undefined;
274
+ /** Maps an ISO alpha-2 country code to its dial code: "IN" → "+91". */
275
+ declare const getDialCodeByCountryCode: (iso2?: string | null) => string | undefined;
276
+ /**
277
+ * Resolves either a dial code ("+91") or an ISO alpha-2 country code ("IN") to a country,
278
+ * so callers can pass the Geo API's countryCode straight through.
279
+ */
280
+ declare const resolveCountry: (codeOrDialCode?: string | null) => CountryCode | undefined;
281
+ /** Converts an ISO 3166-1 alpha-2 code into its flag emoji. */
282
+ declare const getCountryFlag: (iso2: string) => string;
283
+ /**
284
+ * Splits a stored phone value like "+91 9534822376" into its country and number.
285
+ * Picks the longest matching dial code, so "+1684..." resolves to American Samoa, not "+1".
286
+ * Values without a leading "+" are treated as a bare number.
287
+ */
288
+ declare const splitPhoneNumber: (value: string) => {
289
+ country?: CountryCode;
290
+ number: string;
291
+ };
292
+
263
293
  declare const NumberInput: React__default.FC<InputControlProps>;
264
294
 
265
295
  declare const CheckboxInput: React__default.FC<InputControlProps>;
@@ -479,4 +509,4 @@ interface DataFormRendererProps {
479
509
  }
480
510
  declare const DataFormRenderer: ({ formDefinition, dataItem, params, tabs, apiBaseUrl, session, widgetProps, onSave, onDelete, onCancelAdd, isAddPage, entityId, }: DataFormRendererProps) => React.JSX.Element | null;
481
511
 
482
- export { type ActionResponse$1 as ActionResponse, Button, CheckboxInput, ColorInput, DataFormRenderer, DataList, DataListRenderer, DateInput, DateTimeInput, EmailInput, EnterAnimationHydrator, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, RadioInput, Select, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
512
+ export { type ActionResponse$1 as ActionResponse, Button, COUNTRY_CODES, CheckboxInput, ColorInput, type CountryCode, DataFormRenderer, DataList, DataListRenderer, DateInput, DateTimeInput, EmailInput, EnterAnimationHydrator, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, RadioInput, Select, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes, findCountryByDialCode, findCountryByIso2, getCountryFlag, getDialCodeByCountryCode, resolveCountry, splitPhoneNumber };
package/dist/index.d.ts CHANGED
@@ -174,6 +174,7 @@ interface InputControlProps {
174
174
  helpText?: string;
175
175
  autoFocus?: boolean;
176
176
  heading?: string;
177
+ defaultCountryCode?: string;
177
178
  };
178
179
  }
179
180
 
@@ -260,6 +261,35 @@ declare const PercentageInput: React__default.FC<InputControlProps>;
260
261
 
261
262
  declare const PhoneInput: React__default.FC<InputControlProps>;
262
263
 
264
+ interface CountryCode {
265
+ name: string;
266
+ iso2: string;
267
+ dialCode: string;
268
+ }
269
+ declare const COUNTRY_CODES: CountryCode[];
270
+ /** Returns the country for a dial code, preferring the primary country for shared codes. */
271
+ declare const findCountryByDialCode: (dialCode: string) => CountryCode | undefined;
272
+ /** Returns the country for an ISO 3166-1 alpha-2 code such as "IN" (as returned by the Geo API). */
273
+ declare const findCountryByIso2: (iso2?: string | null) => CountryCode | undefined;
274
+ /** Maps an ISO alpha-2 country code to its dial code: "IN" → "+91". */
275
+ declare const getDialCodeByCountryCode: (iso2?: string | null) => string | undefined;
276
+ /**
277
+ * Resolves either a dial code ("+91") or an ISO alpha-2 country code ("IN") to a country,
278
+ * so callers can pass the Geo API's countryCode straight through.
279
+ */
280
+ declare const resolveCountry: (codeOrDialCode?: string | null) => CountryCode | undefined;
281
+ /** Converts an ISO 3166-1 alpha-2 code into its flag emoji. */
282
+ declare const getCountryFlag: (iso2: string) => string;
283
+ /**
284
+ * Splits a stored phone value like "+91 9534822376" into its country and number.
285
+ * Picks the longest matching dial code, so "+1684..." resolves to American Samoa, not "+1".
286
+ * Values without a leading "+" are treated as a bare number.
287
+ */
288
+ declare const splitPhoneNumber: (value: string) => {
289
+ country?: CountryCode;
290
+ number: string;
291
+ };
292
+
263
293
  declare const NumberInput: React__default.FC<InputControlProps>;
264
294
 
265
295
  declare const CheckboxInput: React__default.FC<InputControlProps>;
@@ -479,4 +509,4 @@ interface DataFormRendererProps {
479
509
  }
480
510
  declare const DataFormRenderer: ({ formDefinition, dataItem, params, tabs, apiBaseUrl, session, widgetProps, onSave, onDelete, onCancelAdd, isAddPage, entityId, }: DataFormRendererProps) => React.JSX.Element | null;
481
511
 
482
- export { type ActionResponse$1 as ActionResponse, Button, CheckboxInput, ColorInput, DataFormRenderer, DataList, DataListRenderer, DateInput, DateTimeInput, EmailInput, EnterAnimationHydrator, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, RadioInput, Select, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
512
+ export { type ActionResponse$1 as ActionResponse, Button, COUNTRY_CODES, CheckboxInput, ColorInput, type CountryCode, DataFormRenderer, DataList, DataListRenderer, DateInput, DateTimeInput, EmailInput, EnterAnimationHydrator, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, RadioInput, Select, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes, findCountryByDialCode, findCountryByIso2, getCountryFlag, getDialCodeByCountryCode, resolveCountry, splitPhoneNumber };