@sikka/hawa 0.31.5-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/{Radio-bhKmANMf.d.ts → Radio-3B8RZYJA.d.ts} +1 -1
- package/dist/{Radio-9MkZay6D.d.mts → Radio-L369ID7b.d.mts} +1 -1
- package/dist/blocks/auth/index.js +54 -21
- package/dist/blocks/auth/index.mjs +17 -18
- package/dist/blocks/feedback/index.js +39 -5
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.d.mts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.js +54 -21
- package/dist/blocks/index.mjs +1 -1
- package/dist/blocks/misc/index.js +39 -5
- package/dist/blocks/misc/index.mjs +1 -1
- package/dist/{chunk-6HRJIMXY.mjs → chunk-JXN2PVGT.mjs} +55 -22
- package/dist/{chunk-34LNWMOZ.mjs → chunk-WAVKQ44V.mjs} +39 -5
- package/dist/elements/index.d.mts +3 -2
- package/dist/elements/index.d.ts +3 -2
- package/dist/elements/index.js +54 -21
- package/dist/elements/index.mjs +1 -1
- package/dist/index.css +6 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +54 -21
- package/dist/index.mjs +55 -22
- package/dist/phoneInput/index.d.mts +2 -1
- package/dist/phoneInput/index.d.ts +2 -1
- package/dist/phoneInput/index.js +54 -21
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +55 -22
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +39 -5
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +39 -5
- package/dist/select/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";
|
@@ -1940,22 +1940,56 @@ var Select = ({
|
|
1940
1940
|
props.controlClassNames
|
1941
1941
|
),
|
1942
1942
|
container: () => cn(
|
1943
|
-
"hawa-rounded",
|
1944
|
-
props.phoneCode && "hawa-
|
1943
|
+
"hawa-rounded ",
|
1944
|
+
props.phoneCode && "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
1945
1945
|
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
1946
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
1946
|
+
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
1947
|
+
props.isMulti && "hawa-ps-0 "
|
1947
1948
|
),
|
1948
1949
|
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
1949
1950
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
1950
1951
|
singleValue: () => "hawa-text-foreground",
|
1951
1952
|
indicatorsContainer: () => cn(
|
1952
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
1953
|
+
"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ",
|
1953
1954
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
1954
1955
|
)
|
1955
1956
|
},
|
1956
1957
|
unstyled: true,
|
1957
1958
|
autoFocus: true,
|
1958
|
-
components: props.hideIndicator ? {
|
1959
|
+
components: props.hideIndicator ? {
|
1960
|
+
Option,
|
1961
|
+
Menu,
|
1962
|
+
IndicatorsContainer: () => null
|
1963
|
+
} : {
|
1964
|
+
Option,
|
1965
|
+
Menu,
|
1966
|
+
// Control: (e) => (
|
1967
|
+
// <div
|
1968
|
+
// className={cn(e.className, "hawa-flex hawa-flex-row")}
|
1969
|
+
// {...e}
|
1970
|
+
// />
|
1971
|
+
// ),
|
1972
|
+
ValueContainer: (e) => /* @__PURE__ */ React4.createElement(
|
1973
|
+
"div",
|
1974
|
+
{
|
1975
|
+
className: cn(
|
1976
|
+
e.className,
|
1977
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
|
1978
|
+
),
|
1979
|
+
...e
|
1980
|
+
}
|
1981
|
+
),
|
1982
|
+
MultiValueContainer: (e) => /* @__PURE__ */ React4.createElement(
|
1983
|
+
"div",
|
1984
|
+
{
|
1985
|
+
className: cn(
|
1986
|
+
// e.className,
|
1987
|
+
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
1988
|
+
),
|
1989
|
+
...e
|
1990
|
+
}
|
1991
|
+
)
|
1992
|
+
},
|
1959
1993
|
onChange: (newValue, action) => props.onChange(newValue, action),
|
1960
1994
|
options: props.options,
|
1961
1995
|
getOptionLabel: props.getOptionLabel,
|
@@ -2011,16 +2045,14 @@ var Select = ({
|
|
2011
2045
|
};
|
2012
2046
|
|
2013
2047
|
// elements/phoneInput/PhoneInput.tsx
|
2014
|
-
var PhoneInput = ({
|
2048
|
+
var PhoneInput = ({
|
2049
|
+
labelProps,
|
2050
|
+
inputProps,
|
2051
|
+
...props
|
2052
|
+
}) => {
|
2015
2053
|
const [phoneNumber, setPhoneNumber] = useState("");
|
2016
2054
|
const [countryCode, setCountryCode] = useState(props.preferredCountry);
|
2017
2055
|
const inputRef = useRef(null);
|
2018
|
-
useEffect(() => {
|
2019
|
-
var _a;
|
2020
|
-
if (inputRef.current) {
|
2021
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
2022
|
-
}
|
2023
|
-
}, []);
|
2024
2056
|
const handleInputChange = (e) => {
|
2025
2057
|
const validChars = /^[0-9-()]+$/;
|
2026
2058
|
const input = e.target.value;
|
@@ -2036,31 +2068,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
2036
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(
|
2037
2069
|
Select,
|
2038
2070
|
{
|
2071
|
+
phoneCode: true,
|
2039
2072
|
width: "fit",
|
2040
2073
|
hideHelperText: true,
|
2041
|
-
phoneCode: true,
|
2042
2074
|
hideIndicator: true,
|
2043
|
-
placeholder: "Code",
|
2044
|
-
options: countries_default,
|
2045
2075
|
isMulti: false,
|
2046
2076
|
isSearchable: true,
|
2047
2077
|
isClearable: false,
|
2048
|
-
|
2078
|
+
placeholder: "Code",
|
2079
|
+
options: countries_default,
|
2080
|
+
onChange: setCountryCode,
|
2049
2081
|
value: countryCode == null ? void 0 : countryCode.label,
|
2050
|
-
|
2082
|
+
defaultValue: props.preferredCountry
|
2051
2083
|
}
|
2052
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(
|
2053
2085
|
"input",
|
2054
2086
|
{
|
2087
|
+
type: "tel",
|
2055
2088
|
ref: inputRef,
|
2056
2089
|
id: "phone-number",
|
2090
|
+
value: phoneNumber,
|
2091
|
+
onChange: handleInputChange,
|
2092
|
+
placeholder: props.placeholder,
|
2057
2093
|
className: cn(
|
2058
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"
|
2059
2095
|
),
|
2060
|
-
|
2061
|
-
value: phoneNumber,
|
2062
|
-
type: "tel",
|
2063
|
-
placeholder: props.placeholder
|
2096
|
+
...inputProps
|
2064
2097
|
}
|
2065
2098
|
))), /* @__PURE__ */ React5.createElement(
|
2066
2099
|
"p",
|