@sikka/hawa 0.46.3-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 (89) 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 +87 -133
  6. package/dist/blocks/auth/index.mjs +21 -53
  7. package/dist/blocks/feedback/index.js +69 -80
  8. package/dist/blocks/feedback/index.mjs +5 -5
  9. package/dist/blocks/index.d.mts +3 -3
  10. package/dist/blocks/index.d.ts +3 -3
  11. package/dist/blocks/index.js +87 -133
  12. package/dist/blocks/index.mjs +6 -25
  13. package/dist/blocks/misc/index.js +70 -84
  14. package/dist/blocks/misc/index.mjs +5 -5
  15. package/dist/blocks/pricing/index.js +1 -1
  16. package/dist/blocks/pricing/index.mjs +4 -4
  17. package/dist/{chunk-QLUJEUIB.mjs → chunk-342KIV4R.mjs} +83 -110
  18. package/dist/{chunk-EHJXQQDP.mjs → chunk-5S5DR7KF.mjs} +1 -1
  19. package/dist/{chunk-HJVL6X7I.mjs → chunk-6SJUUJOV.mjs} +1 -1
  20. package/dist/{chunk-7O555VJR.mjs → chunk-AWJSHOYU.mjs} +69 -80
  21. package/dist/{chunk-U72MOMEK.mjs → chunk-C2UOOH4X.mjs} +1 -1
  22. package/dist/{chunk-7L5VUKZ7.mjs → chunk-EOH6A3GR.mjs} +2 -5
  23. package/dist/{chunk-6UOJKVIA.mjs → chunk-IFWYR5W2.mjs} +1 -1
  24. package/dist/{chunk-YXUHXKKK.mjs → chunk-JP2N5WKD.mjs} +1 -1
  25. package/dist/{chunk-R37QEYSB.mjs → chunk-NMW4GM4G.mjs} +1 -1
  26. package/dist/{chunk-CIMTNOLA.mjs → chunk-WUMDFBEK.mjs} +1 -1
  27. package/dist/colorPicker/index.js +1 -1
  28. package/dist/colorPicker/index.js.map +1 -1
  29. package/dist/colorPicker/index.mjs +1 -1
  30. package/dist/colorPicker/index.mjs.map +1 -1
  31. package/dist/combobox/index.js +1 -1
  32. package/dist/combobox/index.js.map +1 -1
  33. package/dist/combobox/index.mjs +1 -1
  34. package/dist/combobox/index.mjs.map +1 -1
  35. package/dist/dataTable/index.js +2 -5
  36. package/dist/dataTable/index.js.map +1 -1
  37. package/dist/dataTable/index.mjs +2 -5
  38. package/dist/dataTable/index.mjs.map +1 -1
  39. package/dist/elements/index.d.mts +2 -2
  40. package/dist/elements/index.d.ts +2 -2
  41. package/dist/elements/index.js +83 -110
  42. package/dist/elements/index.mjs +3 -3
  43. package/dist/index.d.mts +10 -9
  44. package/dist/index.d.ts +10 -9
  45. package/dist/index.js +87 -133
  46. package/dist/index.mjs +87 -133
  47. package/dist/input/index.js +2 -5
  48. package/dist/input/index.js.map +1 -1
  49. package/dist/input/index.mjs +2 -5
  50. package/dist/input/index.mjs.map +1 -1
  51. package/dist/layout/index.js +1 -1
  52. package/dist/layout/index.mjs +2 -2
  53. package/dist/passwordInput/index.js +2 -5
  54. package/dist/passwordInput/index.js.map +1 -1
  55. package/dist/passwordInput/index.mjs +2 -5
  56. package/dist/passwordInput/index.mjs.map +1 -1
  57. package/dist/phoneInput/index.d.mts +7 -7
  58. package/dist/phoneInput/index.d.ts +7 -7
  59. package/dist/phoneInput/index.js +79 -86
  60. package/dist/phoneInput/index.js.map +1 -1
  61. package/dist/phoneInput/index.mjs +79 -86
  62. package/dist/phoneInput/index.mjs.map +1 -1
  63. package/dist/pinInput/index.js +3 -20
  64. package/dist/pinInput/index.js.map +1 -1
  65. package/dist/pinInput/index.mjs +3 -20
  66. package/dist/pinInput/index.mjs.map +1 -1
  67. package/dist/select/index.d.mts +1 -0
  68. package/dist/select/index.d.ts +1 -0
  69. package/dist/select/index.js +69 -80
  70. package/dist/select/index.js.map +1 -1
  71. package/dist/select/index.mjs +69 -80
  72. package/dist/select/index.mjs.map +1 -1
  73. package/dist/simpleTable/index.js +1 -1
  74. package/dist/simpleTable/index.js.map +1 -1
  75. package/dist/simpleTable/index.mjs +1 -1
  76. package/dist/simpleTable/index.mjs.map +1 -1
  77. package/dist/skeleton/index.js +1 -1
  78. package/dist/skeleton/index.js.map +1 -1
  79. package/dist/skeleton/index.mjs +1 -1
  80. package/dist/skeleton/index.mjs.map +1 -1
  81. package/dist/stats/index.js +1 -1
  82. package/dist/stats/index.js.map +1 -1
  83. package/dist/stats/index.mjs +1 -1
  84. package/dist/stats/index.mjs.map +1 -1
  85. package/dist/textarea/index.js +1 -1
  86. package/dist/textarea/index.js.map +1 -1
  87. package/dist/textarea/index.mjs +1 -1
  88. package/dist/textarea/index.mjs.map +1 -1
  89. package/package.json +1 -1
@@ -1863,7 +1863,7 @@ function Skeleton({
1863
1863
  };
1864
1864
  const styledAs = {
1865
1865
  div: "",
1866
- input: "!h-[38px] !w-full"
1866
+ input: "hawa-h-[40px] hawa-w-full"
1867
1867
  };
1868
1868
  return /* @__PURE__ */ React4.createElement(
1869
1869
  "div",
@@ -1885,6 +1885,7 @@ function Skeleton({
1885
1885
  var Select = ({
1886
1886
  labelProps,
1887
1887
  labelKey = "label",
1888
+ valueKey = "value",
1888
1889
  ...props
1889
1890
  }) => {
1890
1891
  const NoOption = () => {
@@ -1904,13 +1905,7 @@ var Select = ({
1904
1905
  children
1905
1906
  );
1906
1907
  };
1907
- const Option = ({
1908
- children,
1909
- innerProps,
1910
- innerRef,
1911
- isFocused,
1912
- isSelected
1913
- }) => {
1908
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
1914
1909
  return /* @__PURE__ */ React5.createElement(
1915
1910
  "div",
1916
1911
  {
@@ -1925,14 +1920,7 @@ var Select = ({
1925
1920
  children
1926
1921
  );
1927
1922
  };
1928
- const Menu = ({
1929
- cx,
1930
- children,
1931
- getStyles,
1932
- innerProps,
1933
- innerRef,
1934
- ...menuProps
1935
- }) => {
1923
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
1936
1924
  const menuOpen = menuProps.selectProps.menuIsOpen;
1937
1925
  return /* @__PURE__ */ React5.createElement(
1938
1926
  "div",
@@ -1961,71 +1949,72 @@ var Select = ({
1961
1949
  )
1962
1950
  },
1963
1951
  props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label),
1964
- props.isLoading ? /* @__PURE__ */ React5.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
1965
- // TODO: enable keyboard to go to the next item in the list
1966
- /* @__PURE__ */ React5.createElement(
1967
- ReactSelect,
1968
- {
1969
- noOptionsMessage: NoOption,
1970
- classNames: {
1971
- control: () => cn(
1972
- props.phoneCode && "hawa-rounded-r-none",
1973
- props.controlClassNames
1974
- ),
1975
- container: () => cn(
1976
- selectContainerStyles,
1977
- props.phoneCode && phoneCodeStyles,
1978
- props.isMulti && "hawa-ps-0 "
1979
- ),
1980
- placeholder: () => cn(
1981
- selectPlaceholderStyles,
1982
- props.disabled && "hawa-text-muted-foreground"
1983
- ),
1984
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
1985
- singleValue: () => cn(
1986
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
1987
- ),
1988
- indicatorsContainer: () => cn(
1989
- selectIndicatorContainerStyles,
1990
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
1991
- props.disabled && "hawa-opacity-30"
1992
- )
1993
- },
1994
- unstyled: true,
1995
- autoFocus: false,
1996
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
1952
+ props.isLoading ? /* @__PURE__ */ React5.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ React5.createElement(
1953
+ ReactSelect,
1954
+ {
1955
+ noOptionsMessage: NoOption,
1956
+ classNames: {
1957
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
1958
+ container: () => cn(
1959
+ selectContainerStyles,
1960
+ props.phoneCode && phoneCodeStyles,
1961
+ props.isMulti && "hawa-ps-0 "
1962
+ ),
1963
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
1964
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
1965
+ singleValue: () => cn(
1966
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
1967
+ ),
1968
+ indicatorsContainer: () => cn(
1969
+ selectIndicatorContainerStyles,
1970
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
1971
+ props.disabled && "hawa-opacity-30"
1972
+ )
1973
+ },
1974
+ unstyled: true,
1975
+ autoFocus: false,
1976
+ components: props.hideIndicator ? {
1977
+ Option: (optionProps) => /* @__PURE__ */ React5.createElement(
1997
1978
  Option,
1998
- Menu,
1999
- ValueContainer: (e) => /* @__PURE__ */ React5.createElement(
2000
- "div",
2001
- {
2002
- className: cn(
2003
- e.className,
2004
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
2005
- ),
2006
- ...e
2007
- }
2008
- ),
2009
- MultiValueContainer: (e) => /* @__PURE__ */ React5.createElement(
2010
- "div",
2011
- {
2012
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
2013
- ...e
2014
- }
2015
- )
2016
- },
2017
- onChange: (newValue, action) => props.onChange(newValue, action),
2018
- options: props.options,
2019
- getOptionLabel: props.getOptionLabel,
2020
- defaultValue: props.defaultValue,
2021
- value: props.value,
2022
- placeholder: props.placeholder,
2023
- isDisabled: props.disabled,
2024
- isClearable: props.isClearable,
2025
- isMulti: props.isMulti,
2026
- isSearchable: props.isSearchable
2027
- }
2028
- )
1979
+ {
1980
+ ...optionProps,
1981
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
1982
+ }
1983
+ ),
1984
+ Menu,
1985
+ IndicatorsContainer: () => null
1986
+ } : {
1987
+ Option,
1988
+ Menu,
1989
+ ValueContainer: (e) => /* @__PURE__ */ React5.createElement(
1990
+ "div",
1991
+ {
1992
+ className: cn(
1993
+ e.className,
1994
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
1995
+ ),
1996
+ ...e
1997
+ }
1998
+ ),
1999
+ MultiValueContainer: (e) => /* @__PURE__ */ React5.createElement(
2000
+ "div",
2001
+ {
2002
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
2003
+ ...e
2004
+ }
2005
+ )
2006
+ },
2007
+ onChange: (newValue, action) => props.onChange(newValue, action),
2008
+ options: props.options,
2009
+ getOptionLabel: props.getOptionLabel,
2010
+ defaultValue: props.defaultValue,
2011
+ value: props.value,
2012
+ placeholder: props.placeholder,
2013
+ isDisabled: props.disabled,
2014
+ isClearable: props.isClearable,
2015
+ isMulti: props.isMulti,
2016
+ isSearchable: props.isSearchable
2017
+ }
2029
2018
  ) : /* @__PURE__ */ React5.createElement(
2030
2019
  CreatableSelect,
2031
2020
  {
@@ -2067,11 +2056,13 @@ var PhoneInput = ({
2067
2056
  countryCodes,
2068
2057
  ...props
2069
2058
  }) => {
2059
+ var _a;
2070
2060
  const [phoneNumber, setPhoneNumber] = useState("");
2071
- const [countryCode, setCountryCode] = useState(props.preferredCountry);
2061
+ const [countryCode, setCountryCode] = useState(
2062
+ props.preferredCountry || { label: "+966" }
2063
+ );
2072
2064
  const inputRef = useRef(null);
2073
2065
  const handleInputChange = (e) => {
2074
- console.log("test e ", e.target.value);
2075
2066
  const validChars = /^[0-9-()]+$/;
2076
2067
  const input = e.target.value;
2077
2068
  if (input === "" || validChars.test(input)) {
@@ -2093,11 +2084,13 @@ var PhoneInput = ({
2093
2084
  isMulti: false,
2094
2085
  isSearchable: true,
2095
2086
  isClearable: false,
2096
- placeholder: "Code",
2087
+ placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
2097
2088
  options: countryCodes || countries_default,
2098
- onChange: setCountryCode,
2099
- value: countryCode == null ? void 0 : countryCode.label,
2100
- defaultValue: props.preferredCountry
2089
+ onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
2090
+ valueKey: "label",
2091
+ labelKey: "label",
2092
+ value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
2093
+ defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
2101
2094
  }
2102
2095
  ), /* @__PURE__ */ React6.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React6.createElement(
2103
2096
  "input",