@pelatform/ui 1.5.5 → 1.5.7
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/components.cjs +7 -7
- package/dist/components.d.cts +3 -1
- package/dist/components.d.ts +3 -1
- package/dist/components.js +7 -7
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/components.cjs
CHANGED
|
@@ -1916,7 +1916,7 @@ function LanguageSwitcher({
|
|
|
1916
1916
|
currentLocale,
|
|
1917
1917
|
locales,
|
|
1918
1918
|
onLocaleChange,
|
|
1919
|
-
|
|
1919
|
+
customFlagUrl = false,
|
|
1920
1920
|
Image: Image2 = DefaultImage
|
|
1921
1921
|
}) {
|
|
1922
1922
|
const [isPending, startTransition] = _react.useTransition.call(void 0, );
|
|
@@ -1966,7 +1966,7 @@ function LanguageSwitcher({
|
|
|
1966
1966
|
showFlags && lang.flag ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1967
1967
|
Image2,
|
|
1968
1968
|
{
|
|
1969
|
-
src: _chunk7472NIILcjs.getFlagUrl.call(void 0, lang.flag),
|
|
1969
|
+
src: customFlagUrl ? lang.flag : _chunk7472NIILcjs.getFlagUrl.call(void 0, lang.flag),
|
|
1970
1970
|
alt: `${lang.name} flag`,
|
|
1971
1971
|
className: "size-4 rounded-full object-cover",
|
|
1972
1972
|
width: 24,
|
|
@@ -2000,7 +2000,7 @@ function LanguageSwitcher({
|
|
|
2000
2000
|
showFlags && currentLanguage.flag && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2001
2001
|
Image2,
|
|
2002
2002
|
{
|
|
2003
|
-
src: _chunk7472NIILcjs.getFlagUrl.call(void 0, currentLanguage.flag),
|
|
2003
|
+
src: customFlagUrl ? currentLanguage.flag : _chunk7472NIILcjs.getFlagUrl.call(void 0, currentLanguage.flag),
|
|
2004
2004
|
alt: currentLanguage.name,
|
|
2005
2005
|
className: "ms-1 size-3.5 rounded-full",
|
|
2006
2006
|
width: 24,
|
|
@@ -2026,7 +2026,7 @@ function LanguageSwitcher({
|
|
|
2026
2026
|
showFlags && item.flag ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2027
2027
|
Image2,
|
|
2028
2028
|
{
|
|
2029
|
-
src: _chunk7472NIILcjs.getFlagUrl.call(void 0, item.flag),
|
|
2029
|
+
src: customFlagUrl ? item.flag : _chunk7472NIILcjs.getFlagUrl.call(void 0, item.flag),
|
|
2030
2030
|
alt: `${item.name} flag`,
|
|
2031
2031
|
className: "size-4 rounded-full object-cover",
|
|
2032
2032
|
width: 24,
|
|
@@ -2092,20 +2092,20 @@ function ModeSwitcher({
|
|
|
2092
2092
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2093
2093
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Monitor, {}),
|
|
2094
2094
|
" ",
|
|
2095
|
-
|
|
2095
|
+
withLabel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: label.system })
|
|
2096
2096
|
] });
|
|
2097
2097
|
}
|
|
2098
2098
|
if (theme === _chunkI46SELBAcjs.THEME_MODES.DARK) {
|
|
2099
2099
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2100
2100
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Moon, {}),
|
|
2101
2101
|
" ",
|
|
2102
|
-
|
|
2102
|
+
withLabel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: label.dark })
|
|
2103
2103
|
] });
|
|
2104
2104
|
}
|
|
2105
2105
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2106
2106
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Sun, {}),
|
|
2107
2107
|
" ",
|
|
2108
|
-
|
|
2108
|
+
withLabel && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: label.light })
|
|
2109
2109
|
] });
|
|
2110
2110
|
};
|
|
2111
2111
|
const isActive = (val) => theme === val;
|
package/dist/components.d.cts
CHANGED
|
@@ -2246,8 +2246,10 @@ interface LanguageSwitcherProps extends SharedImage {
|
|
|
2246
2246
|
locales: LocaleOption[];
|
|
2247
2247
|
/** Handler called when a new locale is selected */
|
|
2248
2248
|
onLocaleChange: (newLocale: string) => void | Promise<void>;
|
|
2249
|
+
/** Custom flags asset url */
|
|
2250
|
+
customFlagUrl?: boolean;
|
|
2249
2251
|
}
|
|
2250
|
-
declare function LanguageSwitcher({ className, type, variant, size, showNames, showFlags, label, i18nEnabled, currentLocale, locales, onLocaleChange, Image, }: LanguageSwitcherProps): react_jsx_runtime.JSX.Element | null;
|
|
2252
|
+
declare function LanguageSwitcher({ className, type, variant, size, showNames, showFlags, label, i18nEnabled, currentLocale, locales, onLocaleChange, customFlagUrl, Image, }: LanguageSwitcherProps): react_jsx_runtime.JSX.Element | null;
|
|
2251
2253
|
|
|
2252
2254
|
/**
|
|
2253
2255
|
* Logo Component
|
package/dist/components.d.ts
CHANGED
|
@@ -2246,8 +2246,10 @@ interface LanguageSwitcherProps extends SharedImage {
|
|
|
2246
2246
|
locales: LocaleOption[];
|
|
2247
2247
|
/** Handler called when a new locale is selected */
|
|
2248
2248
|
onLocaleChange: (newLocale: string) => void | Promise<void>;
|
|
2249
|
+
/** Custom flags asset url */
|
|
2250
|
+
customFlagUrl?: boolean;
|
|
2249
2251
|
}
|
|
2250
|
-
declare function LanguageSwitcher({ className, type, variant, size, showNames, showFlags, label, i18nEnabled, currentLocale, locales, onLocaleChange, Image, }: LanguageSwitcherProps): react_jsx_runtime.JSX.Element | null;
|
|
2252
|
+
declare function LanguageSwitcher({ className, type, variant, size, showNames, showFlags, label, i18nEnabled, currentLocale, locales, onLocaleChange, customFlagUrl, Image, }: LanguageSwitcherProps): react_jsx_runtime.JSX.Element | null;
|
|
2251
2253
|
|
|
2252
2254
|
/**
|
|
2253
2255
|
* Logo Component
|
package/dist/components.js
CHANGED
|
@@ -1916,7 +1916,7 @@ function LanguageSwitcher({
|
|
|
1916
1916
|
currentLocale,
|
|
1917
1917
|
locales,
|
|
1918
1918
|
onLocaleChange,
|
|
1919
|
-
|
|
1919
|
+
customFlagUrl = false,
|
|
1920
1920
|
Image: Image2 = DefaultImage
|
|
1921
1921
|
}) {
|
|
1922
1922
|
const [isPending, startTransition] = useTransition();
|
|
@@ -1966,7 +1966,7 @@ function LanguageSwitcher({
|
|
|
1966
1966
|
showFlags && lang.flag ? /* @__PURE__ */ jsx34(
|
|
1967
1967
|
Image2,
|
|
1968
1968
|
{
|
|
1969
|
-
src: getFlagUrl(lang.flag),
|
|
1969
|
+
src: customFlagUrl ? lang.flag : getFlagUrl(lang.flag),
|
|
1970
1970
|
alt: `${lang.name} flag`,
|
|
1971
1971
|
className: "size-4 rounded-full object-cover",
|
|
1972
1972
|
width: 24,
|
|
@@ -2000,7 +2000,7 @@ function LanguageSwitcher({
|
|
|
2000
2000
|
showFlags && currentLanguage.flag && /* @__PURE__ */ jsx34(
|
|
2001
2001
|
Image2,
|
|
2002
2002
|
{
|
|
2003
|
-
src: getFlagUrl(currentLanguage.flag),
|
|
2003
|
+
src: customFlagUrl ? currentLanguage.flag : getFlagUrl(currentLanguage.flag),
|
|
2004
2004
|
alt: currentLanguage.name,
|
|
2005
2005
|
className: "ms-1 size-3.5 rounded-full",
|
|
2006
2006
|
width: 24,
|
|
@@ -2026,7 +2026,7 @@ function LanguageSwitcher({
|
|
|
2026
2026
|
showFlags && item.flag ? /* @__PURE__ */ jsx34(
|
|
2027
2027
|
Image2,
|
|
2028
2028
|
{
|
|
2029
|
-
src: getFlagUrl(item.flag),
|
|
2029
|
+
src: customFlagUrl ? item.flag : getFlagUrl(item.flag),
|
|
2030
2030
|
alt: `${item.name} flag`,
|
|
2031
2031
|
className: "size-4 rounded-full object-cover",
|
|
2032
2032
|
width: 24,
|
|
@@ -2092,20 +2092,20 @@ function ModeSwitcher({
|
|
|
2092
2092
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
2093
2093
|
/* @__PURE__ */ jsx36(Monitor, {}),
|
|
2094
2094
|
" ",
|
|
2095
|
-
withLabel
|
|
2095
|
+
withLabel && /* @__PURE__ */ jsx36("span", { children: label.system })
|
|
2096
2096
|
] });
|
|
2097
2097
|
}
|
|
2098
2098
|
if (theme === THEME_MODES.DARK) {
|
|
2099
2099
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
2100
2100
|
/* @__PURE__ */ jsx36(Moon, {}),
|
|
2101
2101
|
" ",
|
|
2102
|
-
withLabel
|
|
2102
|
+
withLabel && /* @__PURE__ */ jsx36("span", { children: label.dark })
|
|
2103
2103
|
] });
|
|
2104
2104
|
}
|
|
2105
2105
|
return /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
2106
2106
|
/* @__PURE__ */ jsx36(Sun, {}),
|
|
2107
2107
|
" ",
|
|
2108
|
-
withLabel
|
|
2108
|
+
withLabel && /* @__PURE__ */ jsx36("span", { children: label.light })
|
|
2109
2109
|
] });
|
|
2110
2110
|
};
|
|
2111
2111
|
const isActive = (val) => theme === val;
|