@sonic-equipment/ui 0.0.91 → 0.0.92
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.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -368,6 +368,7 @@ const request = (function createRequestFunction() {
|
|
|
368
368
|
})();
|
|
369
369
|
|
|
370
370
|
const features = {
|
|
371
|
+
language: 'language',
|
|
371
372
|
pdp: 'pdpV2',
|
|
372
373
|
pdpv1: 'pdpV1',
|
|
373
374
|
plpv1: 'plpV1',
|
|
@@ -7679,7 +7680,12 @@ function CountrySelectorDialog({ countries, isOpen, onSubmit, selectedCountry, s
|
|
|
7679
7680
|
const t = useFormattedMessage();
|
|
7680
7681
|
const [currentCountry, setCurrentCountry] = useState(selectedCountry);
|
|
7681
7682
|
const [currentLanguage, setCurrentLanguage] = useState(selectedLanguage);
|
|
7682
|
-
const countryOptions = useMemo(() => countries.reduce((acc, country) => ({
|
|
7683
|
+
const countryOptions = useMemo(() => countries.reduce((acc, country) => ({
|
|
7684
|
+
...acc,
|
|
7685
|
+
[country.id]: t(`clSelector.${country.name}`),
|
|
7686
|
+
}), {}),
|
|
7687
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7688
|
+
[countries]);
|
|
7683
7689
|
const languageOptions = useMemo(() => currentCountry.languages.reduce((acc, language) => ({ ...acc, [language.id]: language.description }), {}), [currentCountry]);
|
|
7684
7690
|
useEffect(() => {
|
|
7685
7691
|
if (currentCountry.languages.some(language => language.id === currentLanguage.id))
|
|
@@ -7701,11 +7707,12 @@ function CountrySelectorDialog({ countries, isOpen, onSubmit, selectedCountry, s
|
|
|
7701
7707
|
var styles$J = {"country-selector-trigger":"country-selector-trigger-module-aioDu","flag":"country-selector-trigger-module-zOSJK","text":"country-selector-trigger-module-TE8tl","divider":"country-selector-trigger-module-GNRDD"};
|
|
7702
7708
|
|
|
7703
7709
|
function CountrySelectorTrigger({ onClick, selectedCountry, selectedLanguage, showCountry = true, }) {
|
|
7710
|
+
const t = useFormattedMessage();
|
|
7704
7711
|
if (!selectedCountry || !selectedLanguage)
|
|
7705
7712
|
return;
|
|
7706
7713
|
const abbreviation = selectedCountry.abbreviation.toLowerCase();
|
|
7707
7714
|
const flagSrc = `https://res.cloudinary.com/dkz9eknwh/image/upload/v1729678637/images/flags/${abbreviation}.svg`;
|
|
7708
|
-
return (jsxs("button", { "aria-label": "Open country selector dialog", className: styles$J['country-selector-trigger'], onClick: onClick, type: "button", children: [jsx(Image, { className: styles$J.flag, height: 24, image: { 1: flagSrc, 2: flagSrc, 3: flagSrc, altText: abbreviation }, title: abbreviation, width: 24 }), jsxs("div", { className: styles$J.text, children: [showCountry && (jsxs(Fragment, { children: [jsx("span", { children: selectedCountry.name }), jsx("span", { className: styles$J.divider, children: "-" })] })), jsx("span", { children: selectedLanguage.description })] })] }));
|
|
7715
|
+
return (jsxs("button", { "aria-label": "Open country selector dialog", className: styles$J['country-selector-trigger'], onClick: onClick, type: "button", children: [jsx(Image, { className: styles$J.flag, height: 24, image: { 1: flagSrc, 2: flagSrc, 3: flagSrc, altText: abbreviation }, title: abbreviation, width: 24 }), jsxs("div", { className: styles$J.text, children: [showCountry && (jsxs(Fragment, { children: [jsx("span", { children: t(`clSelector.${selectedCountry.name}`) }), jsx("span", { className: styles$J.divider, children: "-" })] })), jsx("span", { children: selectedLanguage.description })] })] }));
|
|
7709
7716
|
}
|
|
7710
7717
|
|
|
7711
7718
|
async function fetchCountriesLanguages() {
|