@sikka/hawa 0.31.17-next → 0.32.0

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.
@@ -10,6 +10,22 @@ type LabelProps = {
10
10
  };
11
11
  declare const Label: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps & React.RefAttributes<HTMLLabelElement>>;
12
12
 
13
+ type PhoneInputProps = {
14
+ preferredCountry?: {
15
+ label: string;
16
+ };
17
+ helperText?: any;
18
+ label?: string;
19
+ labelProps?: LabelProps;
20
+ placeholder?: string;
21
+ handleChange?: (value: string) => void;
22
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
23
+ countryCodes?: {
24
+ label: string;
25
+ }[];
26
+ };
27
+ declare const PhoneInput: FC<PhoneInputProps>;
28
+
13
29
  type SelectOptionProps = {
14
30
  value: any;
15
31
  label: any;
@@ -76,4 +92,4 @@ type RadioTypes = {
76
92
  };
77
93
  declare const Radio: React__default.ForwardRefExoticComponent<RadioTypes & React__default.RefAttributes<HTMLInputElement>>;
78
94
 
79
- export { type LabelProps as L, type RadioOptionsTypes as R, type SelectOptionProps as S, Radio as a, Label as b, Select as c };
95
+ export { type LabelProps as L, type PhoneInputProps as P, type RadioOptionsTypes as R, type SelectOptionProps as S, Radio as a, Label as b, Select as c, PhoneInput as d };
@@ -10,6 +10,22 @@ type LabelProps = {
10
10
  };
11
11
  declare const Label: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps & React.RefAttributes<HTMLLabelElement>>;
12
12
 
13
+ type PhoneInputProps = {
14
+ preferredCountry?: {
15
+ label: string;
16
+ };
17
+ helperText?: any;
18
+ label?: string;
19
+ labelProps?: LabelProps;
20
+ placeholder?: string;
21
+ handleChange?: (value: string) => void;
22
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
23
+ countryCodes?: {
24
+ label: string;
25
+ }[];
26
+ };
27
+ declare const PhoneInput: FC<PhoneInputProps>;
28
+
13
29
  type SelectOptionProps = {
14
30
  value: any;
15
31
  label: any;
@@ -76,4 +92,4 @@ type RadioTypes = {
76
92
  };
77
93
  declare const Radio: React__default.ForwardRefExoticComponent<RadioTypes & React__default.RefAttributes<HTMLInputElement>>;
78
94
 
79
- export { type LabelProps as L, type RadioOptionsTypes as R, type SelectOptionProps as S, Radio as a, Label as b, Select as c };
95
+ export { type LabelProps as L, type PhoneInputProps as P, type RadioOptionsTypes as R, type SelectOptionProps as S, Radio as a, Label as b, Select as c, PhoneInput as d };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { FC } from 'react';
3
- import { a as ThirdPartyAuthTextsTypes, L as LoginFormTextsTypes, D as DirectionType, P as PositionType, b as RegisterFormTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-DXLtO2fL.mjs';
3
+ import { a as ThirdPartyAuthTextsTypes, P as PositionType, L as LoginFormTextsTypes, D as DirectionType, b as RegisterFormTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-DXLtO2fL.mjs';
4
4
 
5
5
  type AuthButtonsType = {
6
6
  texts?: ThirdPartyAuthTextsTypes;
@@ -34,6 +34,28 @@ type AuthButtonsType = {
34
34
  };
35
35
  declare const AuthButtons: React__default.FC<AuthButtonsType>;
36
36
 
37
+ type LabelProps = {
38
+ hint?: React.ReactNode;
39
+ hintSide?: PositionType;
40
+ htmlFor?: string;
41
+ required?: boolean;
42
+ };
43
+
44
+ type PhoneInputProps = {
45
+ preferredCountry?: {
46
+ label: string;
47
+ };
48
+ helperText?: any;
49
+ label?: string;
50
+ labelProps?: LabelProps;
51
+ placeholder?: string;
52
+ handleChange?: (value: string) => void;
53
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
54
+ countryCodes?: {
55
+ label: string;
56
+ }[];
57
+ };
58
+
37
59
  type LoginFormTypes = {
38
60
  /** Object containing text labels used throughout the form. */
39
61
  texts?: LoginFormTextsTypes;
@@ -85,16 +107,11 @@ type LoginFormTypes = {
85
107
  passwordLength?: number;
86
108
  /** If true, the form is displayed without a card container styling.*/
87
109
  cardless?: boolean;
110
+ /** Props to pass to the PhoneInput component */
111
+ phoneInputProps: PhoneInputProps;
88
112
  };
89
113
  declare const LoginForm: FC<LoginFormTypes>;
90
114
 
91
- type LabelProps = {
92
- hint?: React.ReactNode;
93
- hintSide?: PositionType;
94
- htmlFor?: string;
95
- required?: boolean;
96
- };
97
-
98
115
  type SelectOptionProps = {
99
116
  value: any;
100
117
  label: any;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { FC } from 'react';
3
- import { a as ThirdPartyAuthTextsTypes, L as LoginFormTextsTypes, D as DirectionType, P as PositionType, b as RegisterFormTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-DXLtO2fL.js';
3
+ import { a as ThirdPartyAuthTextsTypes, P as PositionType, L as LoginFormTextsTypes, D as DirectionType, b as RegisterFormTextsTypes, N as NewPasswordTextsTypes, c as ResetPasswordTextsTypes } from '../../textTypes-DXLtO2fL.js';
4
4
 
5
5
  type AuthButtonsType = {
6
6
  texts?: ThirdPartyAuthTextsTypes;
@@ -34,6 +34,28 @@ type AuthButtonsType = {
34
34
  };
35
35
  declare const AuthButtons: React__default.FC<AuthButtonsType>;
36
36
 
37
+ type LabelProps = {
38
+ hint?: React.ReactNode;
39
+ hintSide?: PositionType;
40
+ htmlFor?: string;
41
+ required?: boolean;
42
+ };
43
+
44
+ type PhoneInputProps = {
45
+ preferredCountry?: {
46
+ label: string;
47
+ };
48
+ helperText?: any;
49
+ label?: string;
50
+ labelProps?: LabelProps;
51
+ placeholder?: string;
52
+ handleChange?: (value: string) => void;
53
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
54
+ countryCodes?: {
55
+ label: string;
56
+ }[];
57
+ };
58
+
37
59
  type LoginFormTypes = {
38
60
  /** Object containing text labels used throughout the form. */
39
61
  texts?: LoginFormTextsTypes;
@@ -85,16 +107,11 @@ type LoginFormTypes = {
85
107
  passwordLength?: number;
86
108
  /** If true, the form is displayed without a card container styling.*/
87
109
  cardless?: boolean;
110
+ /** Props to pass to the PhoneInput component */
111
+ phoneInputProps: PhoneInputProps;
88
112
  };
89
113
  declare const LoginForm: FC<LoginFormTypes>;
90
114
 
91
- type LabelProps = {
92
- hint?: React.ReactNode;
93
- hintSide?: PositionType;
94
- htmlFor?: string;
95
- required?: boolean;
96
- };
97
-
98
115
  type SelectOptionProps = {
99
116
  value: any;
100
117
  label: any;
@@ -3228,12 +3228,14 @@ var Select = ({
3228
3228
  var PhoneInput = ({
3229
3229
  labelProps,
3230
3230
  inputProps,
3231
+ countryCodes,
3231
3232
  ...props
3232
3233
  }) => {
3233
3234
  const [phoneNumber, setPhoneNumber] = (0, import_react9.useState)("");
3234
3235
  const [countryCode, setCountryCode] = (0, import_react9.useState)(props.preferredCountry);
3235
3236
  const inputRef = (0, import_react9.useRef)(null);
3236
3237
  const handleInputChange = (e) => {
3238
+ console.log("test e ", e.target.value);
3237
3239
  const validChars = /^[0-9-()]+$/;
3238
3240
  const input = e.target.value;
3239
3241
  if (input === "" || validChars.test(input)) {
@@ -3256,7 +3258,7 @@ var PhoneInput = ({
3256
3258
  isSearchable: true,
3257
3259
  isClearable: false,
3258
3260
  placeholder: "Code",
3259
- options: countries_default,
3261
+ options: countryCodes || countries_default,
3260
3262
  onChange: setCountryCode,
3261
3263
  value: countryCode == null ? void 0 : countryCode.label,
3262
3264
  defaultValue: props.preferredCountry
@@ -3377,8 +3379,8 @@ var LoginForm = ({
3377
3379
  required_error: ((_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required) || "Phone Number Required"
3378
3380
  }).refine(
3379
3381
  (value) => {
3380
- let phoneNumber = (0, import_libphonenumber_js.parsePhoneNumber)(value);
3381
- return phoneNumber.isValid();
3382
+ let isPhoneValid = (0, import_libphonenumber_js.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js.isValidPhoneNumber)(value) && (0, import_libphonenumber_js.validatePhoneNumberLength)(value) === void 0;
3383
+ return isPhoneValid;
3382
3384
  },
3383
3385
  { message: ((_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid) || "Phone Number Invalid" }
3384
3386
  )
@@ -3532,7 +3534,15 @@ var LoginForm = ({
3532
3534
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
3533
3535
  helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
3534
3536
  preferredCountry: { label: "+966" },
3535
- handleChange: (e) => field.onChange((0, import_libphonenumber_js.parsePhoneNumber)(e).number)
3537
+ ...props.phoneInputProps,
3538
+ handleChange: (e) => {
3539
+ if ((0, import_libphonenumber_js.isValidPhoneNumber)(e) && (0, import_libphonenumber_js.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js.validatePhoneNumberLength)(e) === void 0) {
3540
+ let parsed = (0, import_libphonenumber_js.parsePhoneNumber)(e);
3541
+ field.onChange(parsed.number);
3542
+ } else {
3543
+ field.onChange(e);
3544
+ }
3545
+ }
3536
3546
  }
3537
3547
  );
3538
3548
  }
@@ -482,7 +482,12 @@ import React5 from "react";
482
482
  import { useState as useState3 } from "react";
483
483
  import { Controller, useForm } from "react-hook-form";
484
484
  import { zodResolver } from "@hookform/resolvers/zod";
485
- import { parsePhoneNumber } from "libphonenumber-js";
485
+ import {
486
+ isPossiblePhoneNumber,
487
+ isValidPhoneNumber,
488
+ parsePhoneNumber,
489
+ validatePhoneNumberLength
490
+ } from "libphonenumber-js";
486
491
  import * as z from "zod";
487
492
 
488
493
  // elements/alert/Alert.tsx
@@ -2329,12 +2334,14 @@ var countries_default = countries;
2329
2334
  var PhoneInput = ({
2330
2335
  labelProps,
2331
2336
  inputProps,
2337
+ countryCodes,
2332
2338
  ...props
2333
2339
  }) => {
2334
2340
  const [phoneNumber, setPhoneNumber] = useState2("");
2335
2341
  const [countryCode, setCountryCode] = useState2(props.preferredCountry);
2336
2342
  const inputRef = useRef2(null);
2337
2343
  const handleInputChange = (e) => {
2344
+ console.log("test e ", e.target.value);
2338
2345
  const validChars = /^[0-9-()]+$/;
2339
2346
  const input = e.target.value;
2340
2347
  if (input === "" || validChars.test(input)) {
@@ -2357,7 +2364,7 @@ var PhoneInput = ({
2357
2364
  isSearchable: true,
2358
2365
  isClearable: false,
2359
2366
  placeholder: "Code",
2360
- options: countries_default,
2367
+ options: countryCodes || countries_default,
2361
2368
  onChange: setCountryCode,
2362
2369
  value: countryCode == null ? void 0 : countryCode.label,
2363
2370
  defaultValue: props.preferredCountry
@@ -2439,8 +2446,8 @@ var LoginForm = ({
2439
2446
  required_error: ((_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required) || "Phone Number Required"
2440
2447
  }).refine(
2441
2448
  (value) => {
2442
- let phoneNumber = parsePhoneNumber(value);
2443
- return phoneNumber.isValid();
2449
+ let isPhoneValid = isPossiblePhoneNumber(value) && isValidPhoneNumber(value) && validatePhoneNumberLength(value) === void 0;
2450
+ return isPhoneValid;
2444
2451
  },
2445
2452
  { message: ((_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid) || "Phone Number Invalid" }
2446
2453
  )
@@ -2594,7 +2601,15 @@ var LoginForm = ({
2594
2601
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
2595
2602
  helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
2596
2603
  preferredCountry: { label: "+966" },
2597
- handleChange: (e) => field.onChange(parsePhoneNumber(e).number)
2604
+ ...props.phoneInputProps,
2605
+ handleChange: (e) => {
2606
+ if (isValidPhoneNumber(e) && isPossiblePhoneNumber(e) && validatePhoneNumberLength(e) === void 0) {
2607
+ let parsed = parsePhoneNumber(e);
2608
+ field.onChange(parsed.number);
2609
+ } else {
2610
+ field.onChange(e);
2611
+ }
2612
+ }
2598
2613
  }
2599
2614
  );
2600
2615
  }
@@ -1,7 +1,7 @@
1
1
  import React__default, { FC, InputHTMLAttributes } from 'react';
2
2
  import { ThirdPartyAuthTextsTypes, LoginFormTextsTypes, RegisterFormTextsTypes, NewPasswordTextsTypes, ResetPasswordTextsTypes, BaseInputType, TextInputType, PricingCardProps, PlanFeature, PricingPlanTexts } from '../types/index.mjs';
3
+ import { P as PhoneInputProps, S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-BpXOu4Hr.mjs';
3
4
  import { D as DirectionType, a as RadioOptionType, O as OrientationType } from '../commonTypes-C-g8nFFC.mjs';
4
- import { S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-D52-m4Ns.mjs';
5
5
  import { M as MenuItemType } from '../DropdownMenu-K3ztliYc.mjs';
6
6
  import '@radix-ui/react-dropdown-menu';
7
7
 
@@ -88,6 +88,8 @@ type LoginFormTypes = {
88
88
  passwordLength?: number;
89
89
  /** If true, the form is displayed without a card container styling.*/
90
90
  cardless?: boolean;
91
+ /** Props to pass to the PhoneInput component */
92
+ phoneInputProps: PhoneInputProps;
91
93
  };
92
94
  declare const LoginForm: FC<LoginFormTypes>;
93
95
 
@@ -1,7 +1,7 @@
1
1
  import React__default, { FC, InputHTMLAttributes } from 'react';
2
2
  import { ThirdPartyAuthTextsTypes, LoginFormTextsTypes, RegisterFormTextsTypes, NewPasswordTextsTypes, ResetPasswordTextsTypes, BaseInputType, TextInputType, PricingCardProps, PlanFeature, PricingPlanTexts } from '../types/index.js';
3
+ import { P as PhoneInputProps, S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-CREjhlGz.js';
3
4
  import { D as DirectionType, a as RadioOptionType, O as OrientationType } from '../commonTypes-C-g8nFFC.js';
4
- import { S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-B-DG0FMr.js';
5
5
  import { M as MenuItemType } from '../DropdownMenu-CJblb-9q.js';
6
6
  import '@radix-ui/react-dropdown-menu';
7
7
 
@@ -88,6 +88,8 @@ type LoginFormTypes = {
88
88
  passwordLength?: number;
89
89
  /** If true, the form is displayed without a card container styling.*/
90
90
  cardless?: boolean;
91
+ /** Props to pass to the PhoneInput component */
92
+ phoneInputProps: PhoneInputProps;
91
93
  };
92
94
  declare const LoginForm: FC<LoginFormTypes>;
93
95
 
@@ -3249,12 +3249,14 @@ var Select = ({
3249
3249
  var PhoneInput = ({
3250
3250
  labelProps,
3251
3251
  inputProps,
3252
+ countryCodes,
3252
3253
  ...props
3253
3254
  }) => {
3254
3255
  const [phoneNumber, setPhoneNumber] = (0, import_react9.useState)("");
3255
3256
  const [countryCode, setCountryCode] = (0, import_react9.useState)(props.preferredCountry);
3256
3257
  const inputRef = (0, import_react9.useRef)(null);
3257
3258
  const handleInputChange = (e) => {
3259
+ console.log("test e ", e.target.value);
3258
3260
  const validChars = /^[0-9-()]+$/;
3259
3261
  const input = e.target.value;
3260
3262
  if (input === "" || validChars.test(input)) {
@@ -3277,7 +3279,7 @@ var PhoneInput = ({
3277
3279
  isSearchable: true,
3278
3280
  isClearable: false,
3279
3281
  placeholder: "Code",
3280
- options: countries_default,
3282
+ options: countryCodes || countries_default,
3281
3283
  onChange: setCountryCode,
3282
3284
  value: countryCode == null ? void 0 : countryCode.label,
3283
3285
  defaultValue: props.preferredCountry
@@ -3534,8 +3536,8 @@ var LoginForm = ({
3534
3536
  required_error: ((_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required) || "Phone Number Required"
3535
3537
  }).refine(
3536
3538
  (value) => {
3537
- let phoneNumber = (0, import_libphonenumber_js.parsePhoneNumber)(value);
3538
- return phoneNumber.isValid();
3539
+ let isPhoneValid = (0, import_libphonenumber_js.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js.isValidPhoneNumber)(value) && (0, import_libphonenumber_js.validatePhoneNumberLength)(value) === void 0;
3540
+ return isPhoneValid;
3539
3541
  },
3540
3542
  { message: ((_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid) || "Phone Number Invalid" }
3541
3543
  )
@@ -3689,7 +3691,15 @@ var LoginForm = ({
3689
3691
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
3690
3692
  helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
3691
3693
  preferredCountry: { label: "+966" },
3692
- handleChange: (e) => field.onChange((0, import_libphonenumber_js.parsePhoneNumber)(e).number)
3694
+ ...props.phoneInputProps,
3695
+ handleChange: (e) => {
3696
+ if ((0, import_libphonenumber_js.isValidPhoneNumber)(e) && (0, import_libphonenumber_js.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js.validatePhoneNumberLength)(e) === void 0) {
3697
+ let parsed = (0, import_libphonenumber_js.parsePhoneNumber)(e);
3698
+ field.onChange(parsed.number);
3699
+ } else {
3700
+ field.onChange(e);
3701
+ }
3702
+ }
3693
3703
  }
3694
3704
  );
3695
3705
  }
@@ -26,7 +26,7 @@ import {
26
26
  UncheckMark,
27
27
  VeryBadEmoji,
28
28
  VeryGoodEmoji
29
- } from "../chunk-VZNDYO6H.mjs";
29
+ } from "../chunk-WFPAI2QC.mjs";
30
30
  import "../chunk-OPYDG34F.mjs";
31
31
  import {
32
32
  Button,
@@ -148,7 +148,12 @@ import React2 from "react";
148
148
  import { useState } from "react";
149
149
  import { Controller, useForm } from "react-hook-form";
150
150
  import { zodResolver } from "@hookform/resolvers/zod";
151
- import { parsePhoneNumber } from "libphonenumber-js";
151
+ import {
152
+ isPossiblePhoneNumber,
153
+ isValidPhoneNumber,
154
+ parsePhoneNumber,
155
+ validatePhoneNumberLength
156
+ } from "libphonenumber-js";
152
157
  import * as z from "zod";
153
158
  var LoginForm = ({
154
159
  loginType = "email",
@@ -200,8 +205,8 @@ var LoginForm = ({
200
205
  required_error: ((_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required) || "Phone Number Required"
201
206
  }).refine(
202
207
  (value) => {
203
- let phoneNumber = parsePhoneNumber(value);
204
- return phoneNumber.isValid();
208
+ let isPhoneValid = isPossiblePhoneNumber(value) && isValidPhoneNumber(value) && validatePhoneNumberLength(value) === void 0;
209
+ return isPhoneValid;
205
210
  },
206
211
  { message: ((_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid) || "Phone Number Invalid" }
207
212
  )
@@ -355,7 +360,15 @@ var LoginForm = ({
355
360
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
356
361
  helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
357
362
  preferredCountry: { label: "+966" },
358
- handleChange: (e) => field.onChange(parsePhoneNumber(e).number)
363
+ ...props.phoneInputProps,
364
+ handleChange: (e) => {
365
+ if (isValidPhoneNumber(e) && isPossiblePhoneNumber(e) && validatePhoneNumberLength(e) === void 0) {
366
+ let parsed = parsePhoneNumber(e);
367
+ field.onChange(parsed.number);
368
+ } else {
369
+ field.onChange(e);
370
+ }
371
+ }
359
372
  }
360
373
  );
361
374
  }
@@ -2233,12 +2233,14 @@ var countries_default = countries;
2233
2233
  var PhoneInput = ({
2234
2234
  labelProps,
2235
2235
  inputProps,
2236
+ countryCodes,
2236
2237
  ...props
2237
2238
  }) => {
2238
2239
  const [phoneNumber, setPhoneNumber] = useState2("");
2239
2240
  const [countryCode, setCountryCode] = useState2(props.preferredCountry);
2240
2241
  const inputRef = useRef2(null);
2241
2242
  const handleInputChange = (e) => {
2243
+ console.log("test e ", e.target.value);
2242
2244
  const validChars = /^[0-9-()]+$/;
2243
2245
  const input = e.target.value;
2244
2246
  if (input === "" || validChars.test(input)) {
@@ -2261,7 +2263,7 @@ var PhoneInput = ({
2261
2263
  isSearchable: true,
2262
2264
  isClearable: false,
2263
2265
  placeholder: "Code",
2264
- options: countries_default,
2266
+ options: countryCodes || countries_default,
2265
2267
  onChange: setCountryCode,
2266
2268
  value: countryCode == null ? void 0 : countryCode.label,
2267
2269
  defaultValue: props.preferredCountry
@@ -13,8 +13,8 @@ import { DialogProps } from '@radix-ui/react-dialog';
13
13
  import { VariantProps } from 'class-variance-authority';
14
14
  import { RowData, ColumnDef } from '@tanstack/react-table';
15
15
  export { ColumnDef } from '@tanstack/react-table';
16
- import { L as LabelProps } from '../Radio-D52-m4Ns.mjs';
17
- export { b as Label, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-D52-m4Ns.mjs';
16
+ import { L as LabelProps } from '../Radio-BpXOu4Hr.mjs';
17
+ export { b as Label, d as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-BpXOu4Hr.mjs';
18
18
  import { Command as Command$1 } from 'cmdk';
19
19
  import * as TabsPrimitive from '@radix-ui/react-tabs';
20
20
  import * as PopoverPrimitive from '@radix-ui/react-popover';
@@ -650,19 +650,6 @@ type BadgeTypes = {
650
650
  declare const Badge: FC<BadgeTypes>;
651
651
  declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
652
652
 
653
- type PhoneInputTypes = {
654
- preferredCountry?: {
655
- label: string;
656
- };
657
- helperText?: any;
658
- label?: string;
659
- labelProps?: LabelProps;
660
- placeholder?: string;
661
- handleChange?: (value: string) => void;
662
- inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
663
- };
664
- declare const PhoneInput: FC<PhoneInputTypes>;
665
-
666
653
  type PinInputTypes = {
667
654
  /** Label text to display for the Pin Input */
668
655
  label?: string;
@@ -888,4 +875,4 @@ type PhoneMockupProps = {
888
875
  };
889
876
  declare const PhoneMockup: React__default.FC<PhoneMockupProps>;
890
877
 
891
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
878
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
@@ -13,8 +13,8 @@ import { DialogProps } from '@radix-ui/react-dialog';
13
13
  import { VariantProps } from 'class-variance-authority';
14
14
  import { RowData, ColumnDef } from '@tanstack/react-table';
15
15
  export { ColumnDef } from '@tanstack/react-table';
16
- import { L as LabelProps } from '../Radio-B-DG0FMr.js';
17
- export { b as Label, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-B-DG0FMr.js';
16
+ import { L as LabelProps } from '../Radio-CREjhlGz.js';
17
+ export { b as Label, d as PhoneInput, P as PhoneInputProps, a as Radio, R as RadioOptionsTypes, c as Select, S as SelectOptionProps } from '../Radio-CREjhlGz.js';
18
18
  import { Command as Command$1 } from 'cmdk';
19
19
  import * as TabsPrimitive from '@radix-ui/react-tabs';
20
20
  import * as PopoverPrimitive from '@radix-ui/react-popover';
@@ -650,19 +650,6 @@ type BadgeTypes = {
650
650
  declare const Badge: FC<BadgeTypes>;
651
651
  declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
652
652
 
653
- type PhoneInputTypes = {
654
- preferredCountry?: {
655
- label: string;
656
- };
657
- helperText?: any;
658
- label?: string;
659
- labelProps?: LabelProps;
660
- placeholder?: string;
661
- handleChange?: (value: string) => void;
662
- inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
663
- };
664
- declare const PhoneInput: FC<PhoneInputTypes>;
665
-
666
653
  type PinInputTypes = {
667
654
  /** Label text to display for the Pin Input */
668
655
  label?: string;
@@ -888,4 +875,4 @@ type PhoneMockupProps = {
888
875
  };
889
876
  declare const PhoneMockup: React__default.FC<PhoneMockupProps>;
890
877
 
891
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
878
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, Alert, AppStores, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, Checkbox, ChipTypes, CodeBlock, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, FileDropzone, FileUploader, Input, InterfaceSettings, LabelProps, Loading, Logos, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, ProgressCircle, ScrollArea, ScrollBar, ScrollIndicator, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, StopPropagationWrapper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TextFieldTypes, Textarea, type TextareaProps, Toaster, ToasterToastProps, Tooltip, buttonVariants, navigationMenuTriggerStyle };
@@ -6692,12 +6692,14 @@ var countries_default = countries;
6692
6692
  var PhoneInput = ({
6693
6693
  labelProps,
6694
6694
  inputProps,
6695
+ countryCodes,
6695
6696
  ...props
6696
6697
  }) => {
6697
6698
  const [phoneNumber, setPhoneNumber] = (0, import_react34.useState)("");
6698
6699
  const [countryCode, setCountryCode] = (0, import_react34.useState)(props.preferredCountry);
6699
6700
  const inputRef = (0, import_react34.useRef)(null);
6700
6701
  const handleInputChange = (e) => {
6702
+ console.log("test e ", e.target.value);
6701
6703
  const validChars = /^[0-9-()]+$/;
6702
6704
  const input = e.target.value;
6703
6705
  if (input === "" || validChars.test(input)) {
@@ -6720,7 +6722,7 @@ var PhoneInput = ({
6720
6722
  isSearchable: true,
6721
6723
  isClearable: false,
6722
6724
  placeholder: "Code",
6723
- options: countries_default,
6725
+ options: countryCodes || countries_default,
6724
6726
  onChange: setCountryCode,
6725
6727
  value: countryCode == null ? void 0 : countryCode.label,
6726
6728
  defaultValue: props.preferredCountry
@@ -27,7 +27,7 @@ import {
27
27
  TabsTrigger,
28
28
  Textarea,
29
29
  UncheckMark
30
- } from "../chunk-VZNDYO6H.mjs";
30
+ } from "../chunk-WFPAI2QC.mjs";
31
31
  import {
32
32
  useClipboard
33
33
  } from "../chunk-OPYDG34F.mjs";
package/dist/index.d.mts CHANGED
@@ -851,7 +851,7 @@ type BadgeTypes = {
851
851
  declare const Badge: FC<BadgeTypes>;
852
852
  declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React__default.JSX.Element;
853
853
 
854
- type PhoneInputTypes = {
854
+ type PhoneInputProps = {
855
855
  preferredCountry?: {
856
856
  label: string;
857
857
  };
@@ -861,8 +861,11 @@ type PhoneInputTypes = {
861
861
  placeholder?: string;
862
862
  handleChange?: (value: string) => void;
863
863
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
864
+ countryCodes?: {
865
+ label: string;
866
+ }[];
864
867
  };
865
- declare const PhoneInput: FC<PhoneInputTypes>;
868
+ declare const PhoneInput: FC<PhoneInputProps>;
866
869
 
867
870
  type PinInputTypes = {
868
871
  /** Label text to display for the Pin Input */
@@ -1572,6 +1575,8 @@ type LoginFormTypes = {
1572
1575
  passwordLength?: number;
1573
1576
  /** If true, the form is displayed without a card container styling.*/
1574
1577
  cardless?: boolean;
1578
+ /** Props to pass to the PhoneInput component */
1579
+ phoneInputProps: PhoneInputProps;
1575
1580
  };
1576
1581
  declare const LoginForm: FC<LoginFormTypes>;
1577
1582
 
@@ -2137,4 +2142,4 @@ interface ContentRect {
2137
2142
  }
2138
2143
  declare const useMeasureDirty: (ref: RefObject<HTMLElement>) => ContentRect;
2139
2144
 
2140
- export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, navigationMenuTriggerStyle, reducer, toast, useBreakpoint, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useTabs, useToast, useWindowSize };
2145
+ export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, AccordionRoot, AccordionTrigger, ActionCard, AdCard, Alert, Announcement, AppLanding, AppLayout, type AppSidebarItemProps, AppStores, AppTabs, AppTopbar, AuthButtons, Avatar, BackToTop, Badge, BadgedComponent, Breadcrumb, type BreadcrumbItemProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CheckEmail, Checkbox, Chip, type ChipColors, type ChipTypes, CodeBlock, CodeConfirmation, ColorPicker, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, type CommandInputProps, CommandItem, CommandList, CommandSeparator, CommandShortcut, ComparingPlans, ContactForm, type ContentRect, Copyrights, Count, DataTable, DestroyableCard, Dialog, DialogBody, DialogCarousel, DialogCarouselContent, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogStep, DialogSteps, DialogTitle, DialogTrigger, DocsLayout, DocsSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadio, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FeedbackEmoji, FeedbackForm, FeedbackRating, FileDropzone, FileUploader, HorizontalPricing, Input, InterfaceSettings, ItemCard, Label, type LabelProps, LandingCard, LeadGenerator, LegalTexts, Loading, LoginForm, Logos, type MenuItemType, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, NewPasswordForm, NoPermission, NotFound, Pagination, PasswordInput, PasswordStrengthIndicator, PhoneInput, type PhoneInputProps, PhoneMockup, PinInput, Popover, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PricingCard, PricingPlans, Progress, ProgressCircle, Radio, type RadioOptionsTypes, RegisterForm, ResetPasswordForm, ScrollArea, ScrollBar, ScrollIndicator, Select, type SelectOptionProps, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarGroup, SidebarItem, SimpleTable, Skeleton, Slider, SortButton, StandardNavigationMenuItem, Stats, StopPropagationWrapper, type SubItem$1 as SubItem, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, type TextFieldTypes, Textarea, type TextareaProps, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, type ToasterToastProps, Tooltip, Usage, type UseFocusWithinOptions, type UseMediaQueryOptions, UserReferralSource, buttonVariants, navigationMenuTriggerStyle, reducer, toast, useBreakpoint, useClipboard, useDialogCarousel, useFocusWithin, useIsomorphicEffect, useMeasureDirty, useMediaQuery, useMultiStepDialog, useTabs, useToast, useWindowSize };