@sikka/hawa 0.31.6-next → 0.31.7-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.
@@ -3224,16 +3224,14 @@ var Select = ({
3224
3224
  };
3225
3225
 
3226
3226
  // elements/phoneInput/PhoneInput.tsx
3227
- var PhoneInput = ({ labelProps, ...props }) => {
3227
+ var PhoneInput = ({
3228
+ labelProps,
3229
+ inputProps,
3230
+ ...props
3231
+ }) => {
3228
3232
  const [phoneNumber, setPhoneNumber] = (0, import_react9.useState)("");
3229
3233
  const [countryCode, setCountryCode] = (0, import_react9.useState)(props.preferredCountry);
3230
3234
  const inputRef = (0, import_react9.useRef)(null);
3231
- (0, import_react9.useEffect)(() => {
3232
- var _a;
3233
- if (inputRef.current) {
3234
- (_a = inputRef.current) == null ? void 0 : _a.focus();
3235
- }
3236
- }, []);
3237
3235
  const handleInputChange = (e) => {
3238
3236
  const validChars = /^[0-9-()]+$/;
3239
3237
  const input = e.target.value;
@@ -3249,31 +3247,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
3249
3247
  return /* @__PURE__ */ import_react9.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ import_react9.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react9.default.createElement(
3250
3248
  Select,
3251
3249
  {
3250
+ phoneCode: true,
3252
3251
  width: "fit",
3253
3252
  hideHelperText: true,
3254
- phoneCode: true,
3255
3253
  hideIndicator: true,
3256
- placeholder: "Code",
3257
- options: countries_default,
3258
3254
  isMulti: false,
3259
3255
  isSearchable: true,
3260
3256
  isClearable: false,
3261
- defaultValue: props.preferredCountry,
3257
+ placeholder: "Code",
3258
+ options: countries_default,
3259
+ onChange: setCountryCode,
3262
3260
  value: countryCode == null ? void 0 : countryCode.label,
3263
- onChange: setCountryCode
3261
+ defaultValue: props.preferredCountry
3264
3262
  }
3265
3263
  ), /* @__PURE__ */ import_react9.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_react9.default.createElement(
3266
3264
  "input",
3267
3265
  {
3266
+ type: "tel",
3268
3267
  ref: inputRef,
3269
3268
  id: "phone-number",
3269
+ value: phoneNumber,
3270
+ onChange: handleInputChange,
3271
+ placeholder: props.placeholder,
3270
3272
  className: cn(
3271
3273
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
3272
3274
  ),
3273
- onChange: handleInputChange,
3274
- value: phoneNumber,
3275
- type: "tel",
3276
- placeholder: props.placeholder
3275
+ ...inputProps
3277
3276
  }
3278
3277
  ))), /* @__PURE__ */ import_react9.default.createElement(
3279
3278
  "p",
@@ -629,7 +629,7 @@ var Alert = ({
629
629
  };
630
630
 
631
631
  // elements/phoneInput/PhoneInput.tsx
632
- import React4, { useState as useState2, useRef as useRef2, useEffect as useEffect2 } from "react";
632
+ import React4, { useState as useState2, useRef as useRef2 } from "react";
633
633
 
634
634
  // countries.ts
635
635
  var countries = [
@@ -2325,16 +2325,14 @@ var countries = [
2325
2325
  var countries_default = countries;
2326
2326
 
2327
2327
  // elements/phoneInput/PhoneInput.tsx
2328
- var PhoneInput = ({ labelProps, ...props }) => {
2328
+ var PhoneInput = ({
2329
+ labelProps,
2330
+ inputProps,
2331
+ ...props
2332
+ }) => {
2329
2333
  const [phoneNumber, setPhoneNumber] = useState2("");
2330
2334
  const [countryCode, setCountryCode] = useState2(props.preferredCountry);
2331
2335
  const inputRef = useRef2(null);
2332
- useEffect2(() => {
2333
- var _a;
2334
- if (inputRef.current) {
2335
- (_a = inputRef.current) == null ? void 0 : _a.focus();
2336
- }
2337
- }, []);
2338
2336
  const handleInputChange = (e) => {
2339
2337
  const validChars = /^[0-9-()]+$/;
2340
2338
  const input = e.target.value;
@@ -2350,31 +2348,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
2350
2348
  return /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React4.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React4.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React4.createElement(
2351
2349
  Select,
2352
2350
  {
2351
+ phoneCode: true,
2353
2352
  width: "fit",
2354
2353
  hideHelperText: true,
2355
- phoneCode: true,
2356
2354
  hideIndicator: true,
2357
- placeholder: "Code",
2358
- options: countries_default,
2359
2355
  isMulti: false,
2360
2356
  isSearchable: true,
2361
2357
  isClearable: false,
2362
- defaultValue: props.preferredCountry,
2358
+ placeholder: "Code",
2359
+ options: countries_default,
2360
+ onChange: setCountryCode,
2363
2361
  value: countryCode == null ? void 0 : countryCode.label,
2364
- onChange: setCountryCode
2362
+ defaultValue: props.preferredCountry
2365
2363
  }
2366
2364
  ), /* @__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(
2367
2365
  "input",
2368
2366
  {
2367
+ type: "tel",
2369
2368
  ref: inputRef,
2370
2369
  id: "phone-number",
2370
+ value: phoneNumber,
2371
+ onChange: handleInputChange,
2372
+ placeholder: props.placeholder,
2371
2373
  className: cn(
2372
2374
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
2373
2375
  ),
2374
- onChange: handleInputChange,
2375
- value: phoneNumber,
2376
- type: "tel",
2377
- placeholder: props.placeholder
2376
+ ...inputProps
2378
2377
  }
2379
2378
  ))), /* @__PURE__ */ React4.createElement(
2380
2379
  "p",
@@ -3245,16 +3245,14 @@ var Select = ({
3245
3245
  };
3246
3246
 
3247
3247
  // elements/phoneInput/PhoneInput.tsx
3248
- var PhoneInput = ({ labelProps, ...props }) => {
3248
+ var PhoneInput = ({
3249
+ labelProps,
3250
+ inputProps,
3251
+ ...props
3252
+ }) => {
3249
3253
  const [phoneNumber, setPhoneNumber] = (0, import_react9.useState)("");
3250
3254
  const [countryCode, setCountryCode] = (0, import_react9.useState)(props.preferredCountry);
3251
3255
  const inputRef = (0, import_react9.useRef)(null);
3252
- (0, import_react9.useEffect)(() => {
3253
- var _a;
3254
- if (inputRef.current) {
3255
- (_a = inputRef.current) == null ? void 0 : _a.focus();
3256
- }
3257
- }, []);
3258
3256
  const handleInputChange = (e) => {
3259
3257
  const validChars = /^[0-9-()]+$/;
3260
3258
  const input = e.target.value;
@@ -3270,31 +3268,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
3270
3268
  return /* @__PURE__ */ import_react9.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ import_react9.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react9.default.createElement(
3271
3269
  Select,
3272
3270
  {
3271
+ phoneCode: true,
3273
3272
  width: "fit",
3274
3273
  hideHelperText: true,
3275
- phoneCode: true,
3276
3274
  hideIndicator: true,
3277
- placeholder: "Code",
3278
- options: countries_default,
3279
3275
  isMulti: false,
3280
3276
  isSearchable: true,
3281
3277
  isClearable: false,
3282
- defaultValue: props.preferredCountry,
3278
+ placeholder: "Code",
3279
+ options: countries_default,
3280
+ onChange: setCountryCode,
3283
3281
  value: countryCode == null ? void 0 : countryCode.label,
3284
- onChange: setCountryCode
3282
+ defaultValue: props.preferredCountry
3285
3283
  }
3286
3284
  ), /* @__PURE__ */ import_react9.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_react9.default.createElement(
3287
3285
  "input",
3288
3286
  {
3287
+ type: "tel",
3289
3288
  ref: inputRef,
3290
3289
  id: "phone-number",
3290
+ value: phoneNumber,
3291
+ onChange: handleInputChange,
3292
+ placeholder: props.placeholder,
3291
3293
  className: cn(
3292
3294
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
3293
3295
  ),
3294
- onChange: handleInputChange,
3295
- value: phoneNumber,
3296
- type: "tel",
3297
- placeholder: props.placeholder
3296
+ ...inputProps
3298
3297
  }
3299
3298
  ))), /* @__PURE__ */ import_react9.default.createElement(
3300
3299
  "p",
@@ -26,7 +26,7 @@ import {
26
26
  UncheckMark,
27
27
  VeryBadEmoji,
28
28
  VeryGoodEmoji
29
- } from "../chunk-NPD4FUIM.mjs";
29
+ } from "../chunk-JXN2PVGT.mjs";
30
30
  import "../chunk-R2SKHHDK.mjs";
31
31
  import {
32
32
  Button,
@@ -534,7 +534,7 @@ var Select = ({
534
534
  };
535
535
 
536
536
  // elements/phoneInput/PhoneInput.tsx
537
- import React5, { useState as useState2, useRef as useRef2, useEffect as useEffect2 } from "react";
537
+ import React5, { useState as useState2, useRef as useRef2 } from "react";
538
538
 
539
539
  // countries.ts
540
540
  var countries = [
@@ -2230,16 +2230,14 @@ var countries = [
2230
2230
  var countries_default = countries;
2231
2231
 
2232
2232
  // elements/phoneInput/PhoneInput.tsx
2233
- var PhoneInput = ({ labelProps, ...props }) => {
2233
+ var PhoneInput = ({
2234
+ labelProps,
2235
+ inputProps,
2236
+ ...props
2237
+ }) => {
2234
2238
  const [phoneNumber, setPhoneNumber] = useState2("");
2235
2239
  const [countryCode, setCountryCode] = useState2(props.preferredCountry);
2236
2240
  const inputRef = useRef2(null);
2237
- useEffect2(() => {
2238
- var _a;
2239
- if (inputRef.current) {
2240
- (_a = inputRef.current) == null ? void 0 : _a.focus();
2241
- }
2242
- }, []);
2243
2241
  const handleInputChange = (e) => {
2244
2242
  const validChars = /^[0-9-()]+$/;
2245
2243
  const input = e.target.value;
@@ -2255,31 +2253,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
2255
2253
  return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React5.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React5.createElement(
2256
2254
  Select,
2257
2255
  {
2256
+ phoneCode: true,
2258
2257
  width: "fit",
2259
2258
  hideHelperText: true,
2260
- phoneCode: true,
2261
2259
  hideIndicator: true,
2262
- placeholder: "Code",
2263
- options: countries_default,
2264
2260
  isMulti: false,
2265
2261
  isSearchable: true,
2266
2262
  isClearable: false,
2267
- defaultValue: props.preferredCountry,
2263
+ placeholder: "Code",
2264
+ options: countries_default,
2265
+ onChange: setCountryCode,
2268
2266
  value: countryCode == null ? void 0 : countryCode.label,
2269
- onChange: setCountryCode
2267
+ defaultValue: props.preferredCountry
2270
2268
  }
2271
2269
  ), /* @__PURE__ */ React5.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React5.createElement(
2272
2270
  "input",
2273
2271
  {
2272
+ type: "tel",
2274
2273
  ref: inputRef,
2275
2274
  id: "phone-number",
2275
+ value: phoneNumber,
2276
+ onChange: handleInputChange,
2277
+ placeholder: props.placeholder,
2276
2278
  className: cn(
2277
2279
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
2278
2280
  ),
2279
- onChange: handleInputChange,
2280
- value: phoneNumber,
2281
- type: "tel",
2282
- placeholder: props.placeholder
2281
+ ...inputProps
2283
2282
  }
2284
2283
  ))), /* @__PURE__ */ React5.createElement(
2285
2284
  "p",
@@ -659,6 +659,7 @@ type PhoneInputTypes = {
659
659
  labelProps?: LabelProps;
660
660
  placeholder?: string;
661
661
  handleChange?: (value: string) => void;
662
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
662
663
  };
663
664
  declare const PhoneInput: FC<PhoneInputTypes>;
664
665
 
@@ -659,6 +659,7 @@ type PhoneInputTypes = {
659
659
  labelProps?: LabelProps;
660
660
  placeholder?: string;
661
661
  handleChange?: (value: string) => void;
662
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
662
663
  };
663
664
  declare const PhoneInput: FC<PhoneInputTypes>;
664
665
 
@@ -6686,16 +6686,14 @@ var countries = [
6686
6686
  var countries_default = countries;
6687
6687
 
6688
6688
  // elements/phoneInput/PhoneInput.tsx
6689
- var PhoneInput = ({ labelProps, ...props }) => {
6689
+ var PhoneInput = ({
6690
+ labelProps,
6691
+ inputProps,
6692
+ ...props
6693
+ }) => {
6690
6694
  const [phoneNumber, setPhoneNumber] = (0, import_react33.useState)("");
6691
6695
  const [countryCode, setCountryCode] = (0, import_react33.useState)(props.preferredCountry);
6692
6696
  const inputRef = (0, import_react33.useRef)(null);
6693
- (0, import_react33.useEffect)(() => {
6694
- var _a;
6695
- if (inputRef.current) {
6696
- (_a = inputRef.current) == null ? void 0 : _a.focus();
6697
- }
6698
- }, []);
6699
6697
  const handleInputChange = (e) => {
6700
6698
  const validChars = /^[0-9-()]+$/;
6701
6699
  const input = e.target.value;
@@ -6711,31 +6709,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
6711
6709
  return /* @__PURE__ */ import_react33.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react33.default.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ import_react33.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react33.default.createElement(
6712
6710
  Select,
6713
6711
  {
6712
+ phoneCode: true,
6714
6713
  width: "fit",
6715
6714
  hideHelperText: true,
6716
- phoneCode: true,
6717
6715
  hideIndicator: true,
6718
- placeholder: "Code",
6719
- options: countries_default,
6720
6716
  isMulti: false,
6721
6717
  isSearchable: true,
6722
6718
  isClearable: false,
6723
- defaultValue: props.preferredCountry,
6719
+ placeholder: "Code",
6720
+ options: countries_default,
6721
+ onChange: setCountryCode,
6724
6722
  value: countryCode == null ? void 0 : countryCode.label,
6725
- onChange: setCountryCode
6723
+ defaultValue: props.preferredCountry
6726
6724
  }
6727
6725
  ), /* @__PURE__ */ import_react33.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_react33.default.createElement(
6728
6726
  "input",
6729
6727
  {
6728
+ type: "tel",
6730
6729
  ref: inputRef,
6731
6730
  id: "phone-number",
6731
+ value: phoneNumber,
6732
+ onChange: handleInputChange,
6733
+ placeholder: props.placeholder,
6732
6734
  className: cn(
6733
6735
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
6734
6736
  ),
6735
- onChange: handleInputChange,
6736
- value: phoneNumber,
6737
- type: "tel",
6738
- placeholder: props.placeholder
6737
+ ...inputProps
6739
6738
  }
6740
6739
  ))), /* @__PURE__ */ import_react33.default.createElement(
6741
6740
  "p",
@@ -27,7 +27,7 @@ import {
27
27
  TabsTrigger,
28
28
  Textarea,
29
29
  UncheckMark
30
- } from "../chunk-NPD4FUIM.mjs";
30
+ } from "../chunk-JXN2PVGT.mjs";
31
31
  import {
32
32
  useClipboard
33
33
  } from "../chunk-R2SKHHDK.mjs";
package/dist/index.d.mts CHANGED
@@ -860,6 +860,7 @@ type PhoneInputTypes = {
860
860
  labelProps?: LabelProps;
861
861
  placeholder?: string;
862
862
  handleChange?: (value: string) => void;
863
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
863
864
  };
864
865
  declare const PhoneInput: FC<PhoneInputTypes>;
865
866
 
package/dist/index.d.ts CHANGED
@@ -860,6 +860,7 @@ type PhoneInputTypes = {
860
860
  labelProps?: LabelProps;
861
861
  placeholder?: string;
862
862
  handleChange?: (value: string) => void;
863
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
863
864
  };
864
865
  declare const PhoneInput: FC<PhoneInputTypes>;
865
866
 
package/dist/index.js CHANGED
@@ -7064,16 +7064,14 @@ var countries = [
7064
7064
  var countries_default = countries;
7065
7065
 
7066
7066
  // elements/phoneInput/PhoneInput.tsx
7067
- var PhoneInput = ({ labelProps, ...props }) => {
7067
+ var PhoneInput = ({
7068
+ labelProps,
7069
+ inputProps,
7070
+ ...props
7071
+ }) => {
7068
7072
  const [phoneNumber, setPhoneNumber] = (0, import_react33.useState)("");
7069
7073
  const [countryCode, setCountryCode] = (0, import_react33.useState)(props.preferredCountry);
7070
7074
  const inputRef = (0, import_react33.useRef)(null);
7071
- (0, import_react33.useEffect)(() => {
7072
- var _a;
7073
- if (inputRef.current) {
7074
- (_a = inputRef.current) == null ? void 0 : _a.focus();
7075
- }
7076
- }, []);
7077
7075
  const handleInputChange = (e) => {
7078
7076
  const validChars = /^[0-9-()]+$/;
7079
7077
  const input = e.target.value;
@@ -7089,31 +7087,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
7089
7087
  return /* @__PURE__ */ import_react33.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react33.default.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ import_react33.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react33.default.createElement(
7090
7088
  Select,
7091
7089
  {
7090
+ phoneCode: true,
7092
7091
  width: "fit",
7093
7092
  hideHelperText: true,
7094
- phoneCode: true,
7095
7093
  hideIndicator: true,
7096
- placeholder: "Code",
7097
- options: countries_default,
7098
7094
  isMulti: false,
7099
7095
  isSearchable: true,
7100
7096
  isClearable: false,
7101
- defaultValue: props.preferredCountry,
7097
+ placeholder: "Code",
7098
+ options: countries_default,
7099
+ onChange: setCountryCode,
7102
7100
  value: countryCode == null ? void 0 : countryCode.label,
7103
- onChange: setCountryCode
7101
+ defaultValue: props.preferredCountry
7104
7102
  }
7105
7103
  ), /* @__PURE__ */ import_react33.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_react33.default.createElement(
7106
7104
  "input",
7107
7105
  {
7106
+ type: "tel",
7108
7107
  ref: inputRef,
7109
7108
  id: "phone-number",
7109
+ value: phoneNumber,
7110
+ onChange: handleInputChange,
7111
+ placeholder: props.placeholder,
7110
7112
  className: cn(
7111
7113
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
7112
7114
  ),
7113
- onChange: handleInputChange,
7114
- value: phoneNumber,
7115
- type: "tel",
7116
- placeholder: props.placeholder
7115
+ ...inputProps
7117
7116
  }
7118
7117
  ))), /* @__PURE__ */ import_react33.default.createElement(
7119
7118
  "p",
package/dist/index.mjs CHANGED
@@ -5138,7 +5138,7 @@ var BadgedComponent = ({
5138
5138
  };
5139
5139
 
5140
5140
  // elements/phoneInput/PhoneInput.tsx
5141
- import React48, { useState as useState26, useRef as useRef16, useEffect as useEffect22 } from "react";
5141
+ import React48, { useState as useState26, useRef as useRef16 } from "react";
5142
5142
 
5143
5143
  // countries.ts
5144
5144
  var countries = [
@@ -6834,16 +6834,14 @@ var countries = [
6834
6834
  var countries_default = countries;
6835
6835
 
6836
6836
  // elements/phoneInput/PhoneInput.tsx
6837
- var PhoneInput = ({ labelProps, ...props }) => {
6837
+ var PhoneInput = ({
6838
+ labelProps,
6839
+ inputProps,
6840
+ ...props
6841
+ }) => {
6838
6842
  const [phoneNumber, setPhoneNumber] = useState26("");
6839
6843
  const [countryCode, setCountryCode] = useState26(props.preferredCountry);
6840
6844
  const inputRef = useRef16(null);
6841
- useEffect22(() => {
6842
- var _a;
6843
- if (inputRef.current) {
6844
- (_a = inputRef.current) == null ? void 0 : _a.focus();
6845
- }
6846
- }, []);
6847
6845
  const handleInputChange = (e) => {
6848
6846
  const validChars = /^[0-9-()]+$/;
6849
6847
  const input = e.target.value;
@@ -6859,31 +6857,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
6859
6857
  return /* @__PURE__ */ React48.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React48.createElement(Label2, { ...labelProps }, props.label), /* @__PURE__ */ React48.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React48.createElement(
6860
6858
  Select,
6861
6859
  {
6860
+ phoneCode: true,
6862
6861
  width: "fit",
6863
6862
  hideHelperText: true,
6864
- phoneCode: true,
6865
6863
  hideIndicator: true,
6866
- placeholder: "Code",
6867
- options: countries_default,
6868
6864
  isMulti: false,
6869
6865
  isSearchable: true,
6870
6866
  isClearable: false,
6871
- defaultValue: props.preferredCountry,
6867
+ placeholder: "Code",
6868
+ options: countries_default,
6869
+ onChange: setCountryCode,
6872
6870
  value: countryCode == null ? void 0 : countryCode.label,
6873
- onChange: setCountryCode
6871
+ defaultValue: props.preferredCountry
6874
6872
  }
6875
6873
  ), /* @__PURE__ */ React48.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React48.createElement(
6876
6874
  "input",
6877
6875
  {
6876
+ type: "tel",
6878
6877
  ref: inputRef,
6879
6878
  id: "phone-number",
6879
+ value: phoneNumber,
6880
+ onChange: handleInputChange,
6881
+ placeholder: props.placeholder,
6880
6882
  className: cn(
6881
6883
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
6882
6884
  ),
6883
- onChange: handleInputChange,
6884
- value: phoneNumber,
6885
- type: "tel",
6886
- placeholder: props.placeholder
6885
+ ...inputProps
6887
6886
  }
6888
6887
  ))), /* @__PURE__ */ React48.createElement(
6889
6888
  "p",
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FC } from 'react';
2
+ import React__default, { FC } from 'react';
3
3
 
4
4
  type PositionType = "top" | "bottom" | "right" | "left";
5
5
 
@@ -19,6 +19,7 @@ type PhoneInputTypes = {
19
19
  labelProps?: LabelProps;
20
20
  placeholder?: string;
21
21
  handleChange?: (value: string) => void;
22
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
22
23
  };
23
24
  declare const PhoneInput: FC<PhoneInputTypes>;
24
25
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FC } from 'react';
2
+ import React__default, { FC } from 'react';
3
3
 
4
4
  type PositionType = "top" | "bottom" | "right" | "left";
5
5
 
@@ -19,6 +19,7 @@ type PhoneInputTypes = {
19
19
  labelProps?: LabelProps;
20
20
  placeholder?: string;
21
21
  handleChange?: (value: string) => void;
22
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
22
23
  };
23
24
  declare const PhoneInput: FC<PhoneInputTypes>;
24
25
 
@@ -2080,16 +2080,14 @@ var Select = ({
2080
2080
  };
2081
2081
 
2082
2082
  // elements/phoneInput/PhoneInput.tsx
2083
- var PhoneInput = ({ labelProps, ...props }) => {
2083
+ var PhoneInput = ({
2084
+ labelProps,
2085
+ inputProps,
2086
+ ...props
2087
+ }) => {
2084
2088
  const [phoneNumber, setPhoneNumber] = (0, import_react4.useState)("");
2085
2089
  const [countryCode, setCountryCode] = (0, import_react4.useState)(props.preferredCountry);
2086
2090
  const inputRef = (0, import_react4.useRef)(null);
2087
- (0, import_react4.useEffect)(() => {
2088
- var _a;
2089
- if (inputRef.current) {
2090
- (_a = inputRef.current) == null ? void 0 : _a.focus();
2091
- }
2092
- }, []);
2093
2091
  const handleInputChange = (e) => {
2094
2092
  const validChars = /^[0-9-()]+$/;
2095
2093
  const input = e.target.value;
@@ -2105,31 +2103,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
2105
2103
  return /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react4.default.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ import_react4.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react4.default.createElement(
2106
2104
  Select,
2107
2105
  {
2106
+ phoneCode: true,
2108
2107
  width: "fit",
2109
2108
  hideHelperText: true,
2110
- phoneCode: true,
2111
2109
  hideIndicator: true,
2112
- placeholder: "Code",
2113
- options: countries_default,
2114
2110
  isMulti: false,
2115
2111
  isSearchable: true,
2116
2112
  isClearable: false,
2117
- defaultValue: props.preferredCountry,
2113
+ placeholder: "Code",
2114
+ options: countries_default,
2115
+ onChange: setCountryCode,
2118
2116
  value: countryCode == null ? void 0 : countryCode.label,
2119
- onChange: setCountryCode
2117
+ defaultValue: props.preferredCountry
2120
2118
  }
2121
2119
  ), /* @__PURE__ */ import_react4.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_react4.default.createElement(
2122
2120
  "input",
2123
2121
  {
2122
+ type: "tel",
2124
2123
  ref: inputRef,
2125
2124
  id: "phone-number",
2125
+ value: phoneNumber,
2126
+ onChange: handleInputChange,
2127
+ placeholder: props.placeholder,
2126
2128
  className: cn(
2127
2129
  "hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
2128
2130
  ),
2129
- onChange: handleInputChange,
2130
- value: phoneNumber,
2131
- type: "tel",
2132
- placeholder: props.placeholder
2131
+ ...inputProps
2133
2132
  }
2134
2133
  ))), /* @__PURE__ */ import_react4.default.createElement(
2135
2134
  "p",