@sikka/hawa 0.46.4-next → 0.47.0-next

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.
Files changed (41) hide show
  1. package/dist/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
  2. package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
  3. package/dist/blocks/auth/index.d.mts +8 -8
  4. package/dist/blocks/auth/index.d.ts +8 -8
  5. package/dist/blocks/auth/index.js +85 -128
  6. package/dist/blocks/auth/index.mjs +18 -50
  7. package/dist/blocks/feedback/index.js +68 -79
  8. package/dist/blocks/feedback/index.mjs +1 -1
  9. package/dist/blocks/index.d.mts +3 -3
  10. package/dist/blocks/index.d.ts +3 -3
  11. package/dist/blocks/index.js +85 -128
  12. package/dist/blocks/index.mjs +5 -24
  13. package/dist/blocks/misc/index.js +68 -79
  14. package/dist/blocks/misc/index.mjs +1 -1
  15. package/dist/{chunk-5CTMGPEF.mjs → chunk-342KIV4R.mjs} +81 -105
  16. package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
  17. package/dist/elements/index.d.mts +2 -2
  18. package/dist/elements/index.d.ts +2 -2
  19. package/dist/elements/index.js +81 -105
  20. package/dist/elements/index.mjs +1 -1
  21. package/dist/index.d.mts +10 -9
  22. package/dist/index.d.ts +10 -9
  23. package/dist/index.js +85 -128
  24. package/dist/index.mjs +85 -128
  25. package/dist/phoneInput/index.d.mts +7 -7
  26. package/dist/phoneInput/index.d.ts +7 -7
  27. package/dist/phoneInput/index.js +78 -85
  28. package/dist/phoneInput/index.js.map +1 -1
  29. package/dist/phoneInput/index.mjs +78 -85
  30. package/dist/phoneInput/index.mjs.map +1 -1
  31. package/dist/pinInput/index.js +3 -20
  32. package/dist/pinInput/index.js.map +1 -1
  33. package/dist/pinInput/index.mjs +3 -20
  34. package/dist/pinInput/index.mjs.map +1 -1
  35. package/dist/select/index.d.mts +1 -0
  36. package/dist/select/index.d.ts +1 -0
  37. package/dist/select/index.js +68 -79
  38. package/dist/select/index.js.map +1 -1
  39. package/dist/select/index.mjs +68 -79
  40. package/dist/select/index.mjs.map +1 -1
  41. package/package.json +1 -1
@@ -11,19 +11,19 @@ type LabelProps = {
11
11
  };
12
12
  declare const Label: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps & React.RefAttributes<HTMLLabelElement>>;
13
13
 
14
+ type PhoneCodeValue = {
15
+ label: string;
16
+ value?: string;
17
+ };
14
18
  type PhoneInputProps = {
15
- preferredCountry?: {
16
- label: string;
17
- };
19
+ preferredCountry?: PhoneCodeValue;
18
20
  helperText?: any;
19
21
  label?: string;
20
22
  labelProps?: LabelProps;
21
23
  placeholder?: string;
22
24
  handleChange?: (value: string) => void;
23
25
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
24
- countryCodes?: {
25
- label: string;
26
- }[];
26
+ countryCodes?: PhoneCodeValue[];
27
27
  };
28
28
  declare const PhoneInput: FC<PhoneInputProps>;
29
29
 
@@ -36,6 +36,7 @@ type SelectTypes = {
36
36
  hideHelperText?: boolean;
37
37
  options: SelectOptionProps[];
38
38
  labelKey?: string;
39
+ valueKey?: string;
39
40
  isCreatable?: boolean;
40
41
  isClearable?: boolean;
41
42
  isMulti?: boolean;
@@ -101,4 +102,4 @@ type RadioTypes = {
101
102
  };
102
103
  declare const Radio: React__default.ForwardRefExoticComponent<RadioTypes & React__default.RefAttributes<HTMLInputElement>>;
103
104
 
104
- 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 };
105
+ 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, type PhoneCodeValue as d, PhoneInput as e };
@@ -11,19 +11,19 @@ type LabelProps = {
11
11
  };
12
12
  declare const Label: React.ForwardRefExoticComponent<React.LabelHTMLAttributes<HTMLLabelElement> & LabelProps & React.RefAttributes<HTMLLabelElement>>;
13
13
 
14
+ type PhoneCodeValue = {
15
+ label: string;
16
+ value?: string;
17
+ };
14
18
  type PhoneInputProps = {
15
- preferredCountry?: {
16
- label: string;
17
- };
19
+ preferredCountry?: PhoneCodeValue;
18
20
  helperText?: any;
19
21
  label?: string;
20
22
  labelProps?: LabelProps;
21
23
  placeholder?: string;
22
24
  handleChange?: (value: string) => void;
23
25
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
24
- countryCodes?: {
25
- label: string;
26
- }[];
26
+ countryCodes?: PhoneCodeValue[];
27
27
  };
28
28
  declare const PhoneInput: FC<PhoneInputProps>;
29
29
 
@@ -36,6 +36,7 @@ type SelectTypes = {
36
36
  hideHelperText?: boolean;
37
37
  options: SelectOptionProps[];
38
38
  labelKey?: string;
39
+ valueKey?: string;
39
40
  isCreatable?: boolean;
40
41
  isClearable?: boolean;
41
42
  isMulti?: boolean;
@@ -101,4 +102,4 @@ type RadioTypes = {
101
102
  };
102
103
  declare const Radio: React__default.ForwardRefExoticComponent<RadioTypes & React__default.RefAttributes<HTMLInputElement>>;
103
104
 
104
- 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 };
105
+ 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, type PhoneCodeValue as d, PhoneInput as e };
@@ -41,19 +41,19 @@ type LabelProps = {
41
41
  required?: boolean;
42
42
  };
43
43
 
44
+ type PhoneCodeValue = {
45
+ label: string;
46
+ value?: string;
47
+ };
44
48
  type PhoneInputProps = {
45
- preferredCountry?: {
46
- label: string;
47
- };
49
+ preferredCountry?: PhoneCodeValue;
48
50
  helperText?: any;
49
51
  label?: string;
50
52
  labelProps?: LabelProps;
51
53
  placeholder?: string;
52
54
  handleChange?: (value: string) => void;
53
55
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
54
- countryCodes?: {
55
- label: string;
56
- }[];
56
+ countryCodes?: PhoneCodeValue[];
57
57
  };
58
58
 
59
59
  type LoginFormTypes = {
@@ -266,7 +266,7 @@ declare const ResetPasswordForm: FC<ResetPasswordType>;
266
266
 
267
267
  type TConfirmation = {
268
268
  texts?: {
269
- checkYourPhone?: string;
269
+ checkYourIdentifier?: string;
270
270
  weSentCode?: string;
271
271
  didntGetCode?: string;
272
272
  resendCode?: string;
@@ -280,7 +280,7 @@ type TConfirmation = {
280
280
  showError?: any;
281
281
  errorTitle?: any;
282
282
  errorText?: any;
283
- phoneNumber?: string;
283
+ identifier?: string;
284
284
  confirmLoading?: boolean;
285
285
  onConfirm?: any;
286
286
  onResend?: any;
@@ -41,19 +41,19 @@ type LabelProps = {
41
41
  required?: boolean;
42
42
  };
43
43
 
44
+ type PhoneCodeValue = {
45
+ label: string;
46
+ value?: string;
47
+ };
44
48
  type PhoneInputProps = {
45
- preferredCountry?: {
46
- label: string;
47
- };
49
+ preferredCountry?: PhoneCodeValue;
48
50
  helperText?: any;
49
51
  label?: string;
50
52
  labelProps?: LabelProps;
51
53
  placeholder?: string;
52
54
  handleChange?: (value: string) => void;
53
55
  inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
54
- countryCodes?: {
55
- label: string;
56
- }[];
56
+ countryCodes?: PhoneCodeValue[];
57
57
  };
58
58
 
59
59
  type LoginFormTypes = {
@@ -266,7 +266,7 @@ declare const ResetPasswordForm: FC<ResetPasswordType>;
266
266
 
267
267
  type TConfirmation = {
268
268
  texts?: {
269
- checkYourPhone?: string;
269
+ checkYourIdentifier?: string;
270
270
  weSentCode?: string;
271
271
  didntGetCode?: string;
272
272
  resendCode?: string;
@@ -280,7 +280,7 @@ type TConfirmation = {
280
280
  showError?: any;
281
281
  errorTitle?: any;
282
282
  errorText?: any;
283
- phoneNumber?: string;
283
+ identifier?: string;
284
284
  confirmLoading?: boolean;
285
285
  onConfirm?: any;
286
286
  onResend?: any;
@@ -3295,6 +3295,7 @@ var import_clsx2 = __toESM(require("clsx"));
3295
3295
  var Select = ({
3296
3296
  labelProps,
3297
3297
  labelKey = "label",
3298
+ valueKey = "value",
3298
3299
  ...props
3299
3300
  }) => {
3300
3301
  const NoOption = () => {
@@ -3314,13 +3315,7 @@ var Select = ({
3314
3315
  children
3315
3316
  );
3316
3317
  };
3317
- const Option = ({
3318
- children,
3319
- innerProps,
3320
- innerRef,
3321
- isFocused,
3322
- isSelected
3323
- }) => {
3318
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
3324
3319
  return /* @__PURE__ */ import_react9.default.createElement(
3325
3320
  "div",
3326
3321
  {
@@ -3335,14 +3330,7 @@ var Select = ({
3335
3330
  children
3336
3331
  );
3337
3332
  };
3338
- const Menu = ({
3339
- cx,
3340
- children,
3341
- getStyles,
3342
- innerProps,
3343
- innerRef,
3344
- ...menuProps
3345
- }) => {
3333
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
3346
3334
  const menuOpen = menuProps.selectProps.menuIsOpen;
3347
3335
  return /* @__PURE__ */ import_react9.default.createElement(
3348
3336
  "div",
@@ -3371,71 +3359,72 @@ var Select = ({
3371
3359
  )
3372
3360
  },
3373
3361
  props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label),
3374
- props.isLoading ? /* @__PURE__ */ import_react9.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
3375
- // TODO: enable keyboard to go to the next item in the list
3376
- /* @__PURE__ */ import_react9.default.createElement(
3377
- import_react_select.default,
3378
- {
3379
- noOptionsMessage: NoOption,
3380
- classNames: {
3381
- control: () => cn(
3382
- props.phoneCode && "hawa-rounded-r-none",
3383
- props.controlClassNames
3384
- ),
3385
- container: () => cn(
3386
- selectContainerStyles,
3387
- props.phoneCode && phoneCodeStyles,
3388
- props.isMulti && "hawa-ps-0 "
3389
- ),
3390
- placeholder: () => cn(
3391
- selectPlaceholderStyles,
3392
- props.disabled && "hawa-text-muted-foreground"
3393
- ),
3394
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
3395
- singleValue: () => cn(
3396
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
3397
- ),
3398
- indicatorsContainer: () => cn(
3399
- selectIndicatorContainerStyles,
3400
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
3401
- props.disabled && "hawa-opacity-30"
3402
- )
3403
- },
3404
- unstyled: true,
3405
- autoFocus: false,
3406
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
3362
+ props.isLoading ? /* @__PURE__ */ import_react9.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react9.default.createElement(
3363
+ import_react_select.default,
3364
+ {
3365
+ noOptionsMessage: NoOption,
3366
+ classNames: {
3367
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
3368
+ container: () => cn(
3369
+ selectContainerStyles,
3370
+ props.phoneCode && phoneCodeStyles,
3371
+ props.isMulti && "hawa-ps-0 "
3372
+ ),
3373
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
3374
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
3375
+ singleValue: () => cn(
3376
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
3377
+ ),
3378
+ indicatorsContainer: () => cn(
3379
+ selectIndicatorContainerStyles,
3380
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
3381
+ props.disabled && "hawa-opacity-30"
3382
+ )
3383
+ },
3384
+ unstyled: true,
3385
+ autoFocus: false,
3386
+ components: props.hideIndicator ? {
3387
+ Option: (optionProps) => /* @__PURE__ */ import_react9.default.createElement(
3407
3388
  Option,
3408
- Menu,
3409
- ValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3410
- "div",
3411
- {
3412
- className: cn(
3413
- e.className,
3414
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
3415
- ),
3416
- ...e
3417
- }
3418
- ),
3419
- MultiValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3420
- "div",
3421
- {
3422
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
3423
- ...e
3424
- }
3425
- )
3426
- },
3427
- onChange: (newValue, action) => props.onChange(newValue, action),
3428
- options: props.options,
3429
- getOptionLabel: props.getOptionLabel,
3430
- defaultValue: props.defaultValue,
3431
- value: props.value,
3432
- placeholder: props.placeholder,
3433
- isDisabled: props.disabled,
3434
- isClearable: props.isClearable,
3435
- isMulti: props.isMulti,
3436
- isSearchable: props.isSearchable
3437
- }
3438
- )
3389
+ {
3390
+ ...optionProps,
3391
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
3392
+ }
3393
+ ),
3394
+ Menu,
3395
+ IndicatorsContainer: () => null
3396
+ } : {
3397
+ Option,
3398
+ Menu,
3399
+ ValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3400
+ "div",
3401
+ {
3402
+ className: cn(
3403
+ e.className,
3404
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
3405
+ ),
3406
+ ...e
3407
+ }
3408
+ ),
3409
+ MultiValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3410
+ "div",
3411
+ {
3412
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
3413
+ ...e
3414
+ }
3415
+ )
3416
+ },
3417
+ onChange: (newValue, action) => props.onChange(newValue, action),
3418
+ options: props.options,
3419
+ getOptionLabel: props.getOptionLabel,
3420
+ defaultValue: props.defaultValue,
3421
+ value: props.value,
3422
+ placeholder: props.placeholder,
3423
+ isDisabled: props.disabled,
3424
+ isClearable: props.isClearable,
3425
+ isMulti: props.isMulti,
3426
+ isSearchable: props.isSearchable
3427
+ }
3439
3428
  ) : /* @__PURE__ */ import_react9.default.createElement(
3440
3429
  import_creatable.default,
3441
3430
  {
@@ -3477,11 +3466,13 @@ var PhoneInput = ({
3477
3466
  countryCodes,
3478
3467
  ...props
3479
3468
  }) => {
3469
+ var _a;
3480
3470
  const [phoneNumber, setPhoneNumber] = (0, import_react10.useState)("");
3481
- const [countryCode, setCountryCode] = (0, import_react10.useState)(props.preferredCountry);
3471
+ const [countryCode, setCountryCode] = (0, import_react10.useState)(
3472
+ props.preferredCountry || { label: "+966" }
3473
+ );
3482
3474
  const inputRef = (0, import_react10.useRef)(null);
3483
3475
  const handleInputChange = (e) => {
3484
- console.log("test e ", e.target.value);
3485
3476
  const validChars = /^[0-9-()]+$/;
3486
3477
  const input = e.target.value;
3487
3478
  if (input === "" || validChars.test(input)) {
@@ -3503,11 +3494,13 @@ var PhoneInput = ({
3503
3494
  isMulti: false,
3504
3495
  isSearchable: true,
3505
3496
  isClearable: false,
3506
- placeholder: "Code",
3497
+ placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
3507
3498
  options: countryCodes || countries_default,
3508
- onChange: setCountryCode,
3509
- value: countryCode == null ? void 0 : countryCode.label,
3510
- defaultValue: props.preferredCountry
3499
+ onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
3500
+ valueKey: "label",
3501
+ labelKey: "label",
3502
+ value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
3503
+ defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
3511
3504
  }
3512
3505
  ), /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ import_react10.default.createElement(
3513
3506
  "input",
@@ -3860,14 +3853,7 @@ var LoginForm = ({
3860
3853
  (texts == null ? void 0 : texts.loginText) || "Login"
3861
3854
  ),
3862
3855
  props.additionalButtons && props.additionalButtons,
3863
- props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement(
3864
- "span",
3865
- {
3866
- onClick: props.onRouteToRegister,
3867
- className: "clickable-link"
3868
- },
3869
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
3870
- ))
3856
+ props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement("span", { onClick: props.onRouteToRegister, className: "clickable-link" }, (texts == null ? void 0 : texts.createAccount) || "Create Account"))
3871
3857
  )),
3872
3858
  props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react14.default.createElement(
3873
3859
  CardFooter,
@@ -4779,14 +4765,7 @@ var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props
4779
4765
  }
4780
4766
  ));
4781
4767
  PinInputRoot.displayName = "PinInputRoot";
4782
- var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
4783
- "div",
4784
- {
4785
- ref,
4786
- className: cn("hawa-flex hawa-items-center", className),
4787
- ...props
4788
- }
4789
- ));
4768
+ var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
4790
4769
  PinInputGroup.displayName = "PinInputGroup";
4791
4770
  var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
4792
4771
  const pinInputContext = React25.useContext(import_input_otp.OTPInputContext);
@@ -4809,22 +4788,12 @@ var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
4809
4788
  PinInputSlot.displayName = "PinInputSlot";
4810
4789
  var PinInputSeperator = React25.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React25.createElement(Dot, null)));
4811
4790
  PinInputSeperator.displayName = "PinInputSeperator";
4812
- var PinInput = ({
4813
- separatorPosition = 0,
4814
- ...props
4815
- }) => {
4791
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
4816
4792
  const maxLength = props.maxLength || 6;
4817
4793
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
4818
4794
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
4819
4795
  const secondGroupLength = maxLength - firstGroupLength;
4820
- return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4821
- PinInputSlot,
4822
- {
4823
- key: index,
4824
- index,
4825
- className: "hawa-w-full hawa-border"
4826
- }
4827
- ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4796
+ return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4828
4797
  PinInputSlot,
4829
4798
  {
4830
4799
  key: index + firstGroupLength,
@@ -4835,10 +4804,7 @@ var PinInput = ({
4835
4804
  };
4836
4805
 
4837
4806
  // blocks/auth/CodeConfirmation.tsx
4838
- var CodeConfirmation = ({
4839
- codeLength = 6,
4840
- ...props
4841
- }) => {
4807
+ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
4842
4808
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4843
4809
  const formSchema = z5.object({
4844
4810
  otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
@@ -4877,14 +4843,7 @@ var CodeConfirmation = ({
4877
4843
  }
4878
4844
  };
4879
4845
  }, []);
4880
- return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(
4881
- Alert,
4882
- {
4883
- title: props.errorTitle,
4884
- text: props.errorText,
4885
- severity: "error"
4886
- }
4887
- ), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react24.default.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ import_react24.default.createElement(
4846
+ return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react24.default.createElement("span", null, props.identifier))), /* @__PURE__ */ import_react24.default.createElement(
4888
4847
  "form",
4889
4848
  {
4890
4849
  noValidate: true,
@@ -4933,9 +4892,7 @@ var CodeConfirmation = ({
4933
4892
  if (props.onCancel) {
4934
4893
  return props.onCancel();
4935
4894
  } else {
4936
- console.log(
4937
- "Cancel button clicked but onCancel prop is missing"
4938
- );
4895
+ console.log("Cancel button clicked but onCancel prop is missing");
4939
4896
  }
4940
4897
  },
4941
4898
  variant: "outline"
@@ -7,7 +7,7 @@ import {
7
7
  } from "../../chunk-47APBDKK.mjs";
8
8
  import {
9
9
  Select
10
- } from "../../chunk-6TG2PHZK.mjs";
10
+ } from "../../chunk-AWJSHOYU.mjs";
11
11
  import {
12
12
  EyeIcon,
13
13
  HiddenEyeIcon
@@ -2518,11 +2518,13 @@ var PhoneInput = ({
2518
2518
  countryCodes,
2519
2519
  ...props
2520
2520
  }) => {
2521
+ var _a;
2521
2522
  const [phoneNumber, setPhoneNumber] = useState2("");
2522
- const [countryCode, setCountryCode] = useState2(props.preferredCountry);
2523
+ const [countryCode, setCountryCode] = useState2(
2524
+ props.preferredCountry || { label: "+966" }
2525
+ );
2523
2526
  const inputRef = useRef2(null);
2524
2527
  const handleInputChange = (e) => {
2525
- console.log("test e ", e.target.value);
2526
2528
  const validChars = /^[0-9-()]+$/;
2527
2529
  const input = e.target.value;
2528
2530
  if (input === "" || validChars.test(input)) {
@@ -2544,11 +2546,13 @@ var PhoneInput = ({
2544
2546
  isMulti: false,
2545
2547
  isSearchable: true,
2546
2548
  isClearable: false,
2547
- placeholder: "Code",
2549
+ placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
2548
2550
  options: countryCodes || countries_default,
2549
- onChange: setCountryCode,
2550
- value: countryCode == null ? void 0 : countryCode.label,
2551
- defaultValue: props.preferredCountry
2551
+ onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
2552
+ valueKey: "label",
2553
+ labelKey: "label",
2554
+ value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
2555
+ defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
2552
2556
  }
2553
2557
  ), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
2554
2558
  "input",
@@ -2862,14 +2866,7 @@ var LoginForm = ({
2862
2866
  (texts == null ? void 0 : texts.loginText) || "Login"
2863
2867
  ),
2864
2868
  props.additionalButtons && props.additionalButtons,
2865
- props.allowRegister && /* @__PURE__ */ React5.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React5.createElement(
2866
- "span",
2867
- {
2868
- onClick: props.onRouteToRegister,
2869
- className: "clickable-link"
2870
- },
2871
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
2872
- ))
2869
+ props.allowRegister && /* @__PURE__ */ React5.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React5.createElement("span", { onClick: props.onRouteToRegister, className: "clickable-link" }, (texts == null ? void 0 : texts.createAccount) || "Create Account"))
2873
2870
  )),
2874
2871
  props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React5.createElement(
2875
2872
  CardFooter,
@@ -3772,14 +3769,7 @@ var PinInputRoot = React12.forwardRef(({ className, containerClassName, ...props
3772
3769
  }
3773
3770
  ));
3774
3771
  PinInputRoot.displayName = "PinInputRoot";
3775
- var PinInputGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
3776
- "div",
3777
- {
3778
- ref,
3779
- className: cn("hawa-flex hawa-items-center", className),
3780
- ...props
3781
- }
3782
- ));
3772
+ var PinInputGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
3783
3773
  PinInputGroup.displayName = "PinInputGroup";
3784
3774
  var PinInputSlot = React12.forwardRef(({ index, className, ...props }, ref) => {
3785
3775
  const pinInputContext = React12.useContext(OTPInputContext);
@@ -3802,22 +3792,12 @@ var PinInputSlot = React12.forwardRef(({ index, className, ...props }, ref) => {
3802
3792
  PinInputSlot.displayName = "PinInputSlot";
3803
3793
  var PinInputSeperator = React12.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React12.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React12.createElement(Dot, null)));
3804
3794
  PinInputSeperator.displayName = "PinInputSeperator";
3805
- var PinInput = ({
3806
- separatorPosition = 0,
3807
- ...props
3808
- }) => {
3795
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
3809
3796
  const maxLength = props.maxLength || 6;
3810
3797
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
3811
3798
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
3812
3799
  const secondGroupLength = maxLength - firstGroupLength;
3813
- return /* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React12.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(
3814
- PinInputSlot,
3815
- {
3816
- key: index,
3817
- index,
3818
- className: "hawa-w-full hawa-border"
3819
- }
3820
- ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React12.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(
3800
+ return /* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React12.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React12.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(
3821
3801
  PinInputSlot,
3822
3802
  {
3823
3803
  key: index + firstGroupLength,
@@ -3828,10 +3808,7 @@ var PinInput = ({
3828
3808
  };
3829
3809
 
3830
3810
  // blocks/auth/CodeConfirmation.tsx
3831
- var CodeConfirmation = ({
3832
- codeLength = 6,
3833
- ...props
3834
- }) => {
3811
+ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
3835
3812
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3836
3813
  const formSchema = z5.object({
3837
3814
  otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
@@ -3870,14 +3847,7 @@ var CodeConfirmation = ({
3870
3847
  }
3871
3848
  };
3872
3849
  }, []);
3873
- return /* @__PURE__ */ React13.createElement(Card, null, /* @__PURE__ */ React13.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React13.createElement(
3874
- Alert,
3875
- {
3876
- title: props.errorTitle,
3877
- text: props.errorText,
3878
- severity: "error"
3879
- }
3880
- ), /* @__PURE__ */ React13.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React13.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React13.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ React13.createElement(
3850
+ return /* @__PURE__ */ React13.createElement(Card, null, /* @__PURE__ */ React13.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React13.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ React13.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React13.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React13.createElement("span", null, props.identifier))), /* @__PURE__ */ React13.createElement(
3881
3851
  "form",
3882
3852
  {
3883
3853
  noValidate: true,
@@ -3926,9 +3896,7 @@ var CodeConfirmation = ({
3926
3896
  if (props.onCancel) {
3927
3897
  return props.onCancel();
3928
3898
  } else {
3929
- console.log(
3930
- "Cancel button clicked but onCancel prop is missing"
3931
- );
3899
+ console.log("Cancel button clicked but onCancel prop is missing");
3932
3900
  }
3933
3901
  },
3934
3902
  variant: "outline"