@beweco/aurora-ui 0.6.77 → 0.6.78

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/index.cjs.js CHANGED
@@ -1982,6 +1982,34 @@ var useCloseOnAncestorScroll = function (_a) {
1982
1982
  }, [isOpen, onClose, contentRef]);
1983
1983
  };
1984
1984
 
1985
+ /**
1986
+ * Comparación de texto para los buscadores de los desplegables (país, moneda).
1987
+ *
1988
+ * El problema que resuelve: los nombres de la lista de países mezclan idiomas y
1989
+ * algunos llevan tilde ("Canadá", "República Dominicana"). Un `includes` crudo
1990
+ * exige que quien busca escriba la tilde, así que teclear "canada" no encontraba
1991
+ * Canadá y "republica" no encontraba República Dominicana — el desplegable
1992
+ * respondía "No se encontraron países" con el país delante.
1993
+ */
1994
+ /** Minúsculas y sin diacríticos, para comparar lo que se escribe con lo que se muestra. */
1995
+ var normalizeForSearch = function (value) {
1996
+ return value
1997
+ .normalize("NFD")
1998
+ // Rango de marcas combinantes (tildes, diéresis, cedilla) que deja NFD.
1999
+ // Se usa en vez de \p{Diacritic} porque el flag `u` exige target es6+.
2000
+ .replace(/[̀-ͯ]/g, "")
2001
+ .toLowerCase();
2002
+ };
2003
+ /**
2004
+ * `true` si el término aparece en alguno de los campos, ignorando tildes y
2005
+ * mayúsculas. Los campos ausentes se descartan. Un término vacío casa siempre,
2006
+ * igual que el `includes` que sustituye.
2007
+ */
2008
+ var matchesSearchTerm = function (fields, term) {
2009
+ var needle = normalizeForSearch(term);
2010
+ return fields.some(function (field) { return field != null && normalizeForSearch(field).includes(needle); });
2011
+ };
2012
+
1985
2013
  // Lista de países con código telefónico y código ISO
1986
2014
  var countries = [
1987
2015
  { code: "+57", name: "Colombia", country: "CO" },
@@ -1991,6 +2019,8 @@ var countries = [
1991
2019
  { code: "+503", name: "El Salvador", country: "SV" },
1992
2020
  { code: "+507", name: "Panama", country: "PA" },
1993
2021
  { code: "+506", name: "Costa Rica", country: "CR" },
2022
+ { code: "+504", name: "Honduras", country: "HN" },
2023
+ { code: "+505", name: "Nicaragua", country: "NI" },
1994
2024
  { code: "+51", name: "Peru", country: "PE" },
1995
2025
  { code: "+56", name: "Chile", country: "CL" },
1996
2026
  { code: "+591", name: "Bolivia", country: "BO" },
@@ -2003,6 +2033,9 @@ var countries = [
2003
2033
  { code: "+598", name: "Uruguay", country: "UY" },
2004
2034
  { code: "+58", name: "Venezuela", country: "VE" },
2005
2035
  { code: "+1", name: "United States", country: "US" },
2036
+ // Canadá va detrás del resto de países con +1: para values legacy sin ISO
2037
+ // gana el primer +1 de la lista y ese comportamiento no debe cambiar.
2038
+ { code: "+1", name: "Canadá", country: "CA" },
2006
2039
  { code: "+7", name: "Russia", country: "RU" },
2007
2040
  { code: "+20", name: "Egypt", country: "EG" },
2008
2041
  { code: "+27", name: "South Africa", country: "ZA" },
@@ -2030,6 +2063,7 @@ var defaultTranslations$d = {
2030
2063
  selectCountryAriaLabel: "Seleccionar país",
2031
2064
  expandListAriaLabel: "Desplegar lista de países",
2032
2065
  noCountriesFound: "No se encontraron países",
2066
+ countries: {},
2033
2067
  };
2034
2068
 
2035
2069
  /**
@@ -2057,11 +2091,14 @@ var currencyByCountry = {
2057
2091
  DO: "DOP",
2058
2092
  EC: "USD",
2059
2093
  GT: "GTQ",
2094
+ HN: "HNL",
2095
+ NI: "NIO",
2060
2096
  PR: "USD",
2061
2097
  PY: "PYG",
2062
2098
  UY: "UYU",
2063
2099
  VE: "VES",
2064
2100
  US: "USD",
2101
+ CA: "CAD",
2065
2102
  RU: "RUB",
2066
2103
  EG: "EGP",
2067
2104
  ZA: "ZAR",
@@ -2165,6 +2202,10 @@ var Bulgaria = function () {
2165
2202
  return (jsxRuntime.jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsxs("g", { clipPath: "url(#clip0_13_10424)", children: [jsxRuntime.jsx("path", { d: "M21 0H0V14H21V0Z", fill: "white" }), jsxRuntime.jsx("path", { d: "M21 4.66669H0V14H21V4.66669Z", fill: "#00966E" }), jsxRuntime.jsx("path", { d: "M21 9.33331H0V14H21V9.33331Z", fill: "#D62612" })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_13_10424", children: jsxRuntime.jsx("rect", { width: "21", height: "14", fill: "white" }) }) })] }));
2166
2203
  };
2167
2204
 
2205
+ var Canada = function () {
2206
+ return (jsxRuntime.jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { width: "21", height: "14", fill: "white" }), jsxRuntime.jsx("rect", { width: "5.25", height: "14", fill: "#D80621" }), jsxRuntime.jsx("rect", { x: "15.75", width: "5.25", height: "14", fill: "#D80621" }), jsxRuntime.jsx("path", { d: "M10.50 2.90 L10.92 4.25 L11.75 3.95 L11.45 5.30 L13.30 4.95 L12.85 5.95 L13.20 6.60 L12.00 7.45 L12.30 8.10 L10.95 8.05 L10.50 9.90 L10.05 8.05 L8.70 8.10 L9.00 7.45 L7.80 6.60 L8.15 5.95 L7.70 4.95 L9.55 5.30 L9.25 3.95 L10.08 4.25 Z", fill: "#D80621" }), jsxRuntime.jsx("rect", { x: "10.34", y: "9.7", width: "0.32", height: "1.5", fill: "#D80621" })] }));
2207
+ };
2208
+
2168
2209
  var Chile = function () {
2169
2210
  return (jsxRuntime.jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsxs("g", { clipPath: "url(#clip0_13_10428)", children: [jsxRuntime.jsx("path", { d: "M0 0H21V14H0V0Z", fill: "white" }), jsxRuntime.jsx("path", { d: "M0 7V0H7V10.5L0 7Z", fill: "#0039A6" }), jsxRuntime.jsx("path", { d: "M0 7H21V14H0V7Z", fill: "#D72B1F" }), jsxRuntime.jsx("path", { d: "M3.5 1.75L4.52865 4.91575L1.83575 2.95925H5.16425L2.47135 4.91575L3.5 1.75Z", fill: "white" })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_13_10428", children: jsxRuntime.jsx("rect", { width: "21", height: "14", fill: "white" }) }) })] }));
2170
2211
  };
@@ -2437,6 +2478,7 @@ var flagsMap = {
2437
2478
  BO: Bolivia,
2438
2479
  BR: Brasil,
2439
2480
  BG: Bulgaria,
2481
+ CA: Canada,
2440
2482
  CL: Chile,
2441
2483
  CN: China,
2442
2484
  CO: Colombia,
@@ -2678,12 +2720,14 @@ var Currency = function (_a) {
2678
2720
  !currencySelectorLocked &&
2679
2721
  !disabled &&
2680
2722
  reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", role: "listbox", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
2681
- var searchTerm = e.target.value.toLowerCase();
2723
+ var searchTerm = e.target.value;
2682
2724
  var filtered = options.filter(function (opt) {
2683
- return getCountryName(opt).toLowerCase().includes(searchTerm) ||
2684
- opt.name.toLowerCase().includes(searchTerm) ||
2685
- opt.currency.toLowerCase().includes(searchTerm) ||
2686
- opt.country.toLowerCase().includes(searchTerm);
2725
+ return matchesSearchTerm([
2726
+ getCountryName(opt),
2727
+ opt.name,
2728
+ opt.currency,
2729
+ opt.country,
2730
+ ], searchTerm);
2687
2731
  });
2688
2732
  setFilteredOptions(filtered);
2689
2733
  } }) }), jsxRuntime.jsx("div", { className: "".concat(listMaxHeight, " overflow-y-auto"), children: filteredOptions.length > 0 ? (filteredOptions.map(function (opt) { return (jsxRuntime.jsxs("button", { type: "button", role: "option", "aria-selected": opt.country === selected.country &&
@@ -4580,11 +4624,13 @@ var Phone = function (_a) {
4580
4624
  };
4581
4625
  return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx(FlagIcon, { countryCode: selectedCountry.country, size: "md" }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: " text-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
4582
4626
  reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg", "data-react-aria-top-layer": "true", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
4583
- var searchTerm = e.target.value.toLowerCase();
4627
+ var searchTerm = e.target.value;
4584
4628
  var filtered = uniqueCountries.filter(function (country) {
4585
- return getCountryName(country).toLowerCase().includes(searchTerm) ||
4586
- country.name.toLowerCase().includes(searchTerm) ||
4587
- country.code.toLowerCase().includes(searchTerm);
4629
+ return matchesSearchTerm([
4630
+ getCountryName(country),
4631
+ country.name,
4632
+ country.code,
4633
+ ], searchTerm);
4588
4634
  });
4589
4635
  setFilteredCountries(filtered);
4590
4636
  } }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.country === selectedCountry.country
package/dist/index.esm.js CHANGED
@@ -1983,6 +1983,34 @@ var useCloseOnAncestorScroll = function (_a) {
1983
1983
  }, [isOpen, onClose, contentRef]);
1984
1984
  };
1985
1985
 
1986
+ /**
1987
+ * Comparación de texto para los buscadores de los desplegables (país, moneda).
1988
+ *
1989
+ * El problema que resuelve: los nombres de la lista de países mezclan idiomas y
1990
+ * algunos llevan tilde ("Canadá", "República Dominicana"). Un `includes` crudo
1991
+ * exige que quien busca escriba la tilde, así que teclear "canada" no encontraba
1992
+ * Canadá y "republica" no encontraba República Dominicana — el desplegable
1993
+ * respondía "No se encontraron países" con el país delante.
1994
+ */
1995
+ /** Minúsculas y sin diacríticos, para comparar lo que se escribe con lo que se muestra. */
1996
+ var normalizeForSearch = function (value) {
1997
+ return value
1998
+ .normalize("NFD")
1999
+ // Rango de marcas combinantes (tildes, diéresis, cedilla) que deja NFD.
2000
+ // Se usa en vez de \p{Diacritic} porque el flag `u` exige target es6+.
2001
+ .replace(/[̀-ͯ]/g, "")
2002
+ .toLowerCase();
2003
+ };
2004
+ /**
2005
+ * `true` si el término aparece en alguno de los campos, ignorando tildes y
2006
+ * mayúsculas. Los campos ausentes se descartan. Un término vacío casa siempre,
2007
+ * igual que el `includes` que sustituye.
2008
+ */
2009
+ var matchesSearchTerm = function (fields, term) {
2010
+ var needle = normalizeForSearch(term);
2011
+ return fields.some(function (field) { return field != null && normalizeForSearch(field).includes(needle); });
2012
+ };
2013
+
1986
2014
  // Lista de países con código telefónico y código ISO
1987
2015
  var countries = [
1988
2016
  { code: "+57", name: "Colombia", country: "CO" },
@@ -1992,6 +2020,8 @@ var countries = [
1992
2020
  { code: "+503", name: "El Salvador", country: "SV" },
1993
2021
  { code: "+507", name: "Panama", country: "PA" },
1994
2022
  { code: "+506", name: "Costa Rica", country: "CR" },
2023
+ { code: "+504", name: "Honduras", country: "HN" },
2024
+ { code: "+505", name: "Nicaragua", country: "NI" },
1995
2025
  { code: "+51", name: "Peru", country: "PE" },
1996
2026
  { code: "+56", name: "Chile", country: "CL" },
1997
2027
  { code: "+591", name: "Bolivia", country: "BO" },
@@ -2004,6 +2034,9 @@ var countries = [
2004
2034
  { code: "+598", name: "Uruguay", country: "UY" },
2005
2035
  { code: "+58", name: "Venezuela", country: "VE" },
2006
2036
  { code: "+1", name: "United States", country: "US" },
2037
+ // Canadá va detrás del resto de países con +1: para values legacy sin ISO
2038
+ // gana el primer +1 de la lista y ese comportamiento no debe cambiar.
2039
+ { code: "+1", name: "Canadá", country: "CA" },
2007
2040
  { code: "+7", name: "Russia", country: "RU" },
2008
2041
  { code: "+20", name: "Egypt", country: "EG" },
2009
2042
  { code: "+27", name: "South Africa", country: "ZA" },
@@ -2031,6 +2064,7 @@ var defaultTranslations$d = {
2031
2064
  selectCountryAriaLabel: "Seleccionar país",
2032
2065
  expandListAriaLabel: "Desplegar lista de países",
2033
2066
  noCountriesFound: "No se encontraron países",
2067
+ countries: {},
2034
2068
  };
2035
2069
 
2036
2070
  /**
@@ -2058,11 +2092,14 @@ var currencyByCountry = {
2058
2092
  DO: "DOP",
2059
2093
  EC: "USD",
2060
2094
  GT: "GTQ",
2095
+ HN: "HNL",
2096
+ NI: "NIO",
2061
2097
  PR: "USD",
2062
2098
  PY: "PYG",
2063
2099
  UY: "UYU",
2064
2100
  VE: "VES",
2065
2101
  US: "USD",
2102
+ CA: "CAD",
2066
2103
  RU: "RUB",
2067
2104
  EG: "EGP",
2068
2105
  ZA: "ZAR",
@@ -2166,6 +2203,10 @@ var Bulgaria = function () {
2166
2203
  return (jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxs("g", { clipPath: "url(#clip0_13_10424)", children: [jsx("path", { d: "M21 0H0V14H21V0Z", fill: "white" }), jsx("path", { d: "M21 4.66669H0V14H21V4.66669Z", fill: "#00966E" }), jsx("path", { d: "M21 9.33331H0V14H21V9.33331Z", fill: "#D62612" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_13_10424", children: jsx("rect", { width: "21", height: "14", fill: "white" }) }) })] }));
2167
2204
  };
2168
2205
 
2206
+ var Canada = function () {
2207
+ return (jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { width: "21", height: "14", fill: "white" }), jsx("rect", { width: "5.25", height: "14", fill: "#D80621" }), jsx("rect", { x: "15.75", width: "5.25", height: "14", fill: "#D80621" }), jsx("path", { d: "M10.50 2.90 L10.92 4.25 L11.75 3.95 L11.45 5.30 L13.30 4.95 L12.85 5.95 L13.20 6.60 L12.00 7.45 L12.30 8.10 L10.95 8.05 L10.50 9.90 L10.05 8.05 L8.70 8.10 L9.00 7.45 L7.80 6.60 L8.15 5.95 L7.70 4.95 L9.55 5.30 L9.25 3.95 L10.08 4.25 Z", fill: "#D80621" }), jsx("rect", { x: "10.34", y: "9.7", width: "0.32", height: "1.5", fill: "#D80621" })] }));
2208
+ };
2209
+
2169
2210
  var Chile = function () {
2170
2211
  return (jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxs("g", { clipPath: "url(#clip0_13_10428)", children: [jsx("path", { d: "M0 0H21V14H0V0Z", fill: "white" }), jsx("path", { d: "M0 7V0H7V10.5L0 7Z", fill: "#0039A6" }), jsx("path", { d: "M0 7H21V14H0V7Z", fill: "#D72B1F" }), jsx("path", { d: "M3.5 1.75L4.52865 4.91575L1.83575 2.95925H5.16425L2.47135 4.91575L3.5 1.75Z", fill: "white" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_13_10428", children: jsx("rect", { width: "21", height: "14", fill: "white" }) }) })] }));
2171
2212
  };
@@ -2438,6 +2479,7 @@ var flagsMap = {
2438
2479
  BO: Bolivia,
2439
2480
  BR: Brasil,
2440
2481
  BG: Bulgaria,
2482
+ CA: Canada,
2441
2483
  CL: Chile,
2442
2484
  CN: China,
2443
2485
  CO: Colombia,
@@ -2679,12 +2721,14 @@ var Currency = function (_a) {
2679
2721
  !currencySelectorLocked &&
2680
2722
  !disabled &&
2681
2723
  createPortal(jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", role: "listbox", children: [jsx("div", { className: "p-2", children: jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
2682
- var searchTerm = e.target.value.toLowerCase();
2724
+ var searchTerm = e.target.value;
2683
2725
  var filtered = options.filter(function (opt) {
2684
- return getCountryName(opt).toLowerCase().includes(searchTerm) ||
2685
- opt.name.toLowerCase().includes(searchTerm) ||
2686
- opt.currency.toLowerCase().includes(searchTerm) ||
2687
- opt.country.toLowerCase().includes(searchTerm);
2726
+ return matchesSearchTerm([
2727
+ getCountryName(opt),
2728
+ opt.name,
2729
+ opt.currency,
2730
+ opt.country,
2731
+ ], searchTerm);
2688
2732
  });
2689
2733
  setFilteredOptions(filtered);
2690
2734
  } }) }), jsx("div", { className: "".concat(listMaxHeight, " overflow-y-auto"), children: filteredOptions.length > 0 ? (filteredOptions.map(function (opt) { return (jsxs("button", { type: "button", role: "option", "aria-selected": opt.country === selected.country &&
@@ -4581,11 +4625,13 @@ var Phone = function (_a) {
4581
4625
  };
4582
4626
  return (jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsx("span", { className: "text-danger-500", children: "*" })] })), jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsx(FlagIcon, { countryCode: selectedCountry.country, size: "md" }), jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsx("title", { children: t.expandListAriaLabel }), jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsx(Input$1, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsx("span", { className: " text-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
4583
4627
  createPortal(jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg", "data-react-aria-top-layer": "true", children: [jsx("div", { className: "p-2", children: jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
4584
- var searchTerm = e.target.value.toLowerCase();
4628
+ var searchTerm = e.target.value;
4585
4629
  var filtered = uniqueCountries.filter(function (country) {
4586
- return getCountryName(country).toLowerCase().includes(searchTerm) ||
4587
- country.name.toLowerCase().includes(searchTerm) ||
4588
- country.code.toLowerCase().includes(searchTerm);
4630
+ return matchesSearchTerm([
4631
+ getCountryName(country),
4632
+ country.name,
4633
+ country.code,
4634
+ ], searchTerm);
4589
4635
  });
4590
4636
  setFilteredCountries(filtered);
4591
4637
  } }) }), jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.country === selectedCountry.country
@@ -1 +1 @@
1
- {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/Currency.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,kBAAkB,EAAiC,MAAM,kBAAkB,CAAC;AAkD1F,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2SjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/Currency.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,kBAAkB,EAAiC,MAAM,kBAAkB,CAAC;AAkD1F,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+SjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"currency.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/currency.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAkE7E,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAsB/C,CAAC;AAEL,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,oBAAoB,CAQ9D,CAAC"}
1
+ {"version":3,"file":"currency.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/currency.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAqE7E,eAAO,MAAM,sBAAsB,EAAE,cAAc,EAsB/C,CAAC;AAEL,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,oBAAoB,CAQ9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2P3C,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+P3C,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const Canada: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=Canada.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Canada.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone/flags/Canada.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,+CAoBlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FlagIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone/flags/FlagIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiF/B,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CA8EtC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC1B;AAQD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA+B5C,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"FlagIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone/flags/FlagIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkF/B,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CA+EtC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC1B;AAQD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA+B5C,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAe,QAAQ,CAAC"}
@@ -12,6 +12,7 @@ export * from "./Belize";
12
12
  export * from "./Bolivia";
13
13
  export * from "./Brasil";
14
14
  export * from "./Bulgaria";
15
+ export * from "./Canada";
15
16
  export * from "./Chile";
16
17
  export * from "./China";
17
18
  export * from "./Colombia";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone/flags/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAA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{"version":3,"file":"phone.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/phone.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,SAAS;;;;GA0CrB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;GAE3B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,iBAAiB,CAQ3D,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Comparación de texto para los buscadores de los desplegables (país, moneda).
3
+ *
4
+ * El problema que resuelve: los nombres de la lista de países mezclan idiomas y
5
+ * algunos llevan tilde ("Canadá", "República Dominicana"). Un `includes` crudo
6
+ * exige que quien busca escriba la tilde, así que teclear "canada" no encontraba
7
+ * Canadá y "republica" no encontraba República Dominicana — el desplegable
8
+ * respondía "No se encontraron países" con el país delante.
9
+ */
10
+ /** Minúsculas y sin diacríticos, para comparar lo que se escribe con lo que se muestra. */
11
+ export declare const normalizeForSearch: (value: string) => string;
12
+ /**
13
+ * `true` si el término aparece en alguno de los campos, ignorando tildes y
14
+ * mayúsculas. Los campos ausentes se descartan. Un término vacío casa siempre,
15
+ * igual que el `includes` que sustituye.
16
+ */
17
+ export declare const matchesSearchTerm: (fields: (string | undefined | null)[], term: string) => boolean;
18
+ //# sourceMappingURL=text-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-search.d.ts","sourceRoot":"","sources":["../../../src/utils/text-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,MAMnC,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,EACrC,MAAM,MAAM,KACV,OAKF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beweco/aurora-ui",
3
- "version": "0.6.77",
3
+ "version": "0.6.78",
4
4
  "description": "Bewe Aurora UI Component Library",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",