@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.
- package/dist/blocks/auth/index.js +15 -16
- package/dist/blocks/auth/index.mjs +16 -17
- package/dist/blocks/index.js +15 -16
- package/dist/blocks/index.mjs +1 -1
- package/dist/{chunk-NPD4FUIM.mjs → chunk-JXN2PVGT.mjs} +16 -17
- package/dist/elements/index.d.mts +1 -0
- package/dist/elements/index.d.ts +1 -0
- package/dist/elements/index.js +15 -16
- package/dist/elements/index.mjs +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -16
- package/dist/index.mjs +16 -17
- package/dist/phoneInput/index.d.mts +2 -1
- package/dist/phoneInput/index.d.ts +2 -1
- package/dist/phoneInput/index.js +15 -16
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +16 -17
- package/dist/phoneInput/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// elements/phoneInput/PhoneInput.tsx
|
4
|
-
import React5, { useState, useRef
|
4
|
+
import React5, { useState, useRef } from "react";
|
5
5
|
|
6
6
|
// util/index.ts
|
7
7
|
import { clsx } from "clsx";
|
@@ -2045,16 +2045,14 @@ var Select = ({
|
|
2045
2045
|
};
|
2046
2046
|
|
2047
2047
|
// elements/phoneInput/PhoneInput.tsx
|
2048
|
-
var PhoneInput = ({
|
2048
|
+
var PhoneInput = ({
|
2049
|
+
labelProps,
|
2050
|
+
inputProps,
|
2051
|
+
...props
|
2052
|
+
}) => {
|
2049
2053
|
const [phoneNumber, setPhoneNumber] = useState("");
|
2050
2054
|
const [countryCode, setCountryCode] = useState(props.preferredCountry);
|
2051
2055
|
const inputRef = useRef(null);
|
2052
|
-
useEffect(() => {
|
2053
|
-
var _a;
|
2054
|
-
if (inputRef.current) {
|
2055
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
2056
|
-
}
|
2057
|
-
}, []);
|
2058
2056
|
const handleInputChange = (e) => {
|
2059
2057
|
const validChars = /^[0-9-()]+$/;
|
2060
2058
|
const input = e.target.value;
|
@@ -2070,31 +2068,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
2070
2068
|
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(
|
2071
2069
|
Select,
|
2072
2070
|
{
|
2071
|
+
phoneCode: true,
|
2073
2072
|
width: "fit",
|
2074
2073
|
hideHelperText: true,
|
2075
|
-
phoneCode: true,
|
2076
2074
|
hideIndicator: true,
|
2077
|
-
placeholder: "Code",
|
2078
|
-
options: countries_default,
|
2079
2075
|
isMulti: false,
|
2080
2076
|
isSearchable: true,
|
2081
2077
|
isClearable: false,
|
2082
|
-
|
2078
|
+
placeholder: "Code",
|
2079
|
+
options: countries_default,
|
2080
|
+
onChange: setCountryCode,
|
2083
2081
|
value: countryCode == null ? void 0 : countryCode.label,
|
2084
|
-
|
2082
|
+
defaultValue: props.preferredCountry
|
2085
2083
|
}
|
2086
2084
|
), /* @__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(
|
2087
2085
|
"input",
|
2088
2086
|
{
|
2087
|
+
type: "tel",
|
2089
2088
|
ref: inputRef,
|
2090
2089
|
id: "phone-number",
|
2090
|
+
value: phoneNumber,
|
2091
|
+
onChange: handleInputChange,
|
2092
|
+
placeholder: props.placeholder,
|
2091
2093
|
className: cn(
|
2092
2094
|
"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"
|
2093
2095
|
),
|
2094
|
-
|
2095
|
-
value: phoneNumber,
|
2096
|
-
type: "tel",
|
2097
|
-
placeholder: props.placeholder
|
2096
|
+
...inputProps
|
2098
2097
|
}
|
2099
2098
|
))), /* @__PURE__ */ React5.createElement(
|
2100
2099
|
"p",
|