@beweco/aurora-ui 0.1.64 → 0.1.65
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 +5 -2
- package/dist/index.esm.js +5 -3
- package/dist/types/components/phone/Phone.d.ts.map +1 -1
- package/dist/types/components/phone/Phone.types.d.ts +8 -0
- package/dist/types/components/phone/Phone.types.d.ts.map +1 -1
- package/dist/types/components/phone/index.d.ts +2 -1
- package/dist/types/components/phone/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3156,6 +3156,7 @@ var Phone = function (_a) {
|
|
|
3156
3156
|
var _l = React.useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
3157
3157
|
var _m = React.useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
3158
3158
|
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
3159
|
+
var getCountryName = function (country) { var _a, _b; return (_b = (_a = t.countries) === null || _a === void 0 ? void 0 : _a[country.country]) !== null && _b !== void 0 ? _b : country.name; };
|
|
3159
3160
|
var finalLabel = label || t.label;
|
|
3160
3161
|
React.useEffect(function () {
|
|
3161
3162
|
if (value) {
|
|
@@ -3225,13 +3226,14 @@ var Phone = function (_a) {
|
|
|
3225
3226
|
reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", 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) {
|
|
3226
3227
|
var searchTerm = e.target.value.toLowerCase();
|
|
3227
3228
|
var filtered = uniqueCountries.filter(function (country) {
|
|
3228
|
-
return country.
|
|
3229
|
+
return getCountryName(country).toLowerCase().includes(searchTerm) ||
|
|
3230
|
+
country.name.toLowerCase().includes(searchTerm) ||
|
|
3229
3231
|
country.code.toLowerCase().includes(searchTerm);
|
|
3230
3232
|
});
|
|
3231
3233
|
setFilteredCountries(filtered);
|
|
3232
3234
|
} }) }), 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.code === selectedCountry.code
|
|
3233
3235
|
? "bg-primary-50"
|
|
3234
|
-
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3", children: jsxRuntime.jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: country
|
|
3236
|
+
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsxRuntime.jsx("span", { className: "mr-3", children: jsxRuntime.jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsxRuntime.jsx("span", { className: "flex-1 text-left text-default-500", children: getCountryName(country) }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsxRuntime.jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
3235
3237
|
};
|
|
3236
3238
|
|
|
3237
3239
|
var defaultTranslations$5 = {
|
|
@@ -6307,6 +6309,7 @@ exports.Wizard = Wizard;
|
|
|
6307
6309
|
exports.WizardNavigation = WizardNavigation;
|
|
6308
6310
|
exports.WizardSidebar = WizardSidebar;
|
|
6309
6311
|
exports.applyCustomPrimaryColor = applyCustomPrimaryColor;
|
|
6312
|
+
exports.defaultCountries = uniqueCountries;
|
|
6310
6313
|
exports.defaultTranslations = defaultTranslations$4;
|
|
6311
6314
|
exports.generateThemeColorScale = generateThemeColorScale;
|
|
6312
6315
|
exports.getContrastForeground = getContrastForeground;
|
package/dist/index.esm.js
CHANGED
|
@@ -3157,6 +3157,7 @@ var Phone = function (_a) {
|
|
|
3157
3157
|
var _l = useState({}), dropdownPosition = _l[0], setDropdownPosition = _l[1];
|
|
3158
3158
|
var _m = useState(uniqueCountries), filteredCountries = _m[0], setFilteredCountries = _m[1];
|
|
3159
3159
|
var t = __assign(__assign({}, defaultTranslations$6), translations);
|
|
3160
|
+
var getCountryName = function (country) { var _a, _b; return (_b = (_a = t.countries) === null || _a === void 0 ? void 0 : _a[country.country]) !== null && _b !== void 0 ? _b : country.name; };
|
|
3160
3161
|
var finalLabel = label || t.label;
|
|
3161
3162
|
useEffect(function () {
|
|
3162
3163
|
if (value) {
|
|
@@ -3226,13 +3227,14 @@ var Phone = function (_a) {
|
|
|
3226
3227
|
createPortal(jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", 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) {
|
|
3227
3228
|
var searchTerm = e.target.value.toLowerCase();
|
|
3228
3229
|
var filtered = uniqueCountries.filter(function (country) {
|
|
3229
|
-
return country.
|
|
3230
|
+
return getCountryName(country).toLowerCase().includes(searchTerm) ||
|
|
3231
|
+
country.name.toLowerCase().includes(searchTerm) ||
|
|
3230
3232
|
country.code.toLowerCase().includes(searchTerm);
|
|
3231
3233
|
});
|
|
3232
3234
|
setFilteredCountries(filtered);
|
|
3233
3235
|
} }) }), 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.code === selectedCountry.code
|
|
3234
3236
|
? "bg-primary-50"
|
|
3235
|
-
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3", children: jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsx("span", { className: "flex-1 text-left text-default-500", children: country
|
|
3237
|
+
: ""), onClick: function () { return handleCountrySelect(country); }, children: [jsx("span", { className: "mr-3", children: jsx(FlagIcon, { countryCode: country.country, size: "md" }) }), jsx("span", { className: "flex-1 text-left text-default-500", children: getCountryName(country) }), jsx("span", { className: "text-xs text-default-500", children: country.code })] }, "".concat(country.code, "-").concat(country.country))); })) : (jsx("div", { className: "px-4 py-2 text-sm text-default-500", children: t.noCountriesFound })) })] }), document.body)] }));
|
|
3236
3238
|
};
|
|
3237
3239
|
|
|
3238
3240
|
var defaultTranslations$5 = {
|
|
@@ -6227,4 +6229,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
6227
6229
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
6228
6230
|
};
|
|
6229
6231
|
|
|
6230
|
-
export { AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorPicker, ColorSelector, ContentCarousel, DEFAULT_PREDEFINED_COLORS, DatePicker, DateRangePicker, DateSelector, DrawerFilters, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, TwoColumnLayoutAgent, UploadFile, VerticalSteps, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, defaultTranslations$4 as defaultTranslations, generateThemeColorScale, getContrastForeground, getSelectedKeyFromPath, hexToThemeColor, hslToCssValue, isExactThemeColor, isHexColor, removeCustomPrimaryColor, sizeMap, themeColors, useAuraToast, useMediaQuery, useNavigationLoading, useThemeContext };
|
|
6232
|
+
export { AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, BreadcrumbsComponent, Button, Card, Chip, ColorPicker, ColorSelector, ContentCarousel, DEFAULT_PREDEFINED_COLORS, DatePicker, DateRangePicker, DateSelector, DrawerFilters, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, RangeFilter, RowSteps, ScheduleRow, SearchInput, Select, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, TwoColumnLayoutAgent, UploadFile, VerticalSteps, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, uniqueCountries as defaultCountries, defaultTranslations$4 as defaultTranslations, generateThemeColorScale, getContrastForeground, getSelectedKeyFromPath, hexToThemeColor, hslToCssValue, isExactThemeColor, isHexColor, removeCustomPrimaryColor, sizeMap, themeColors, useAuraToast, useMediaQuery, useNavigationLoading, useThemeContext };
|
|
@@ -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;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkO3C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traducciones de nombres de países por código ISO (ej. { CO: "Colombia", US: "Estados Unidos" }).
|
|
3
|
+
* Si se define, los nombres de la lista de países se muestran según este objeto.
|
|
4
|
+
*/
|
|
5
|
+
export type PhoneCountryNames = Record<string, string>;
|
|
1
6
|
export interface PhoneTranslations {
|
|
2
7
|
label?: string;
|
|
3
8
|
placeholder?: string;
|
|
@@ -5,6 +10,8 @@ export interface PhoneTranslations {
|
|
|
5
10
|
selectCountryAriaLabel?: string;
|
|
6
11
|
expandListAriaLabel?: string;
|
|
7
12
|
noCountriesFound?: string;
|
|
13
|
+
/** Nombres de países por código ISO (country). Clave = código (ej. "CO"), valor = nombre traducido */
|
|
14
|
+
countries?: PhoneCountryNames;
|
|
8
15
|
}
|
|
9
16
|
export interface Country {
|
|
10
17
|
code: string;
|
|
@@ -27,6 +34,7 @@ export interface PhoneInputProps {
|
|
|
27
34
|
onBlur?: () => void;
|
|
28
35
|
disabled?: boolean;
|
|
29
36
|
name?: string;
|
|
37
|
+
/** Traducciones del componente (textos de UI y opcionalmente nombres de países en translations.countries) */
|
|
30
38
|
translations?: PhoneTranslations;
|
|
31
39
|
}
|
|
32
40
|
//# sourceMappingURL=Phone.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Phone.types.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Phone.types.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sGAAsG;IACtG,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6GAA6G;IAC7G,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACjC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Phone } from "./Phone";
|
|
2
|
-
export type { PhoneInputProps, PhoneTranslations, PhoneValue, } from "./Phone.types";
|
|
2
|
+
export type { Country, PhoneCountryNames, PhoneInputProps, PhoneTranslations, PhoneValue, } from "./Phone.types";
|
|
3
|
+
export { uniqueCountries as defaultCountries } from "./phone.constants";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACX,eAAe,EACf,iBAAiB,EACjB,UAAU,GACV,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACX,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,UAAU,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|