@pelatform/ui 1.5.4 → 1.5.6

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/utils/assets-url.ts
2
2
  function getAssetsUrl(path) {
3
- const baseUrl = "https://assets.pelatform.com/";
3
+ const baseUrl = "https://assets.pelatform.com";
4
4
  return `${baseUrl}/${path}`;
5
5
  }
6
6
  function getFlagUrl(flag) {
@@ -1,6 +1,6 @@
1
1
  // src/utils/assets-url.ts
2
2
  function getAssetsUrl(path) {
3
- const baseUrl = "https://assets.pelatform.com/";
3
+ const baseUrl = "https://assets.pelatform.com";
4
4
  return `${baseUrl}/${path}`;
5
5
  }
6
6
  function getFlagUrl(flag) {
@@ -58,7 +58,7 @@ var _chunkJ4JGE3U5cjs = require('./chunk-J4JGE3U5.cjs');
58
58
 
59
59
 
60
60
 
61
- var _chunkWI36EFUScjs = require('./chunk-WI36EFUS.cjs');
61
+ var _chunk7472NIILcjs = require('./chunk-7472NIIL.cjs');
62
62
 
63
63
 
64
64
  var _chunkCJXIPSTGcjs = require('./chunk-CJXIPSTG.cjs');
@@ -345,7 +345,7 @@ function ErrorComponents({
345
345
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
346
346
  "img",
347
347
  {
348
- src: _chunkWI36EFUScjs.getAssetsUrl.call(void 0, "media/illustrations/19.svg"),
348
+ src: _chunk7472NIILcjs.getAssetsUrl.call(void 0, "media/illustrations/19.svg"),
349
349
  className: "max-h-40 dark:hidden",
350
350
  alt: "illustrations"
351
351
  }
@@ -353,7 +353,7 @@ function ErrorComponents({
353
353
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
354
354
  "img",
355
355
  {
356
- src: _chunkWI36EFUScjs.getAssetsUrl.call(void 0, "media/illustrations/19-dark.svg"),
356
+ src: _chunk7472NIILcjs.getAssetsUrl.call(void 0, "media/illustrations/19-dark.svg"),
357
357
  className: "hidden max-h-40 dark:block",
358
358
  alt: "illustrations"
359
359
  }
@@ -370,7 +370,7 @@ function ErrorComponents({
370
370
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
371
371
  "img",
372
372
  {
373
- src: _chunkWI36EFUScjs.getAssetsUrl.call(void 0, "media/illustrations/20.svg"),
373
+ src: _chunk7472NIILcjs.getAssetsUrl.call(void 0, "media/illustrations/20.svg"),
374
374
  className: "max-h-40 dark:hidden",
375
375
  alt: "illustrations"
376
376
  }
@@ -378,7 +378,7 @@ function ErrorComponents({
378
378
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
379
379
  "img",
380
380
  {
381
- src: _chunkWI36EFUScjs.getAssetsUrl.call(void 0, "media/illustrations/20-dark.svg"),
381
+ src: _chunk7472NIILcjs.getAssetsUrl.call(void 0, "media/illustrations/20-dark.svg"),
382
382
  className: "hidden max-h-40 dark:block",
383
383
  alt: "illustrations"
384
384
  }
@@ -395,7 +395,7 @@ function ErrorComponents({
395
395
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
396
396
  "img",
397
397
  {
398
- src: _chunkWI36EFUScjs.getAssetsUrl.call(void 0, "media/illustrations/29.svg"),
398
+ src: _chunk7472NIILcjs.getAssetsUrl.call(void 0, "media/illustrations/29.svg"),
399
399
  className: "max-h-40 dark:hidden",
400
400
  alt: "illustrations"
401
401
  }
@@ -403,7 +403,7 @@ function ErrorComponents({
403
403
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
404
404
  "img",
405
405
  {
406
- src: _chunkWI36EFUScjs.getAssetsUrl.call(void 0, "media/illustrations/29-dark.svg"),
406
+ src: _chunk7472NIILcjs.getAssetsUrl.call(void 0, "media/illustrations/29-dark.svg"),
407
407
  className: "hidden max-h-40 dark:block",
408
408
  alt: "illustrations"
409
409
  }
@@ -643,7 +643,7 @@ function CommandMenu({
643
643
  setOpen((currentOpen) => {
644
644
  const newState = !currentOpen;
645
645
  if (newState) {
646
- _chunkWI36EFUScjs.googleTrackEvent.call(void 0, {
646
+ _chunk7472NIILcjs.googleTrackEvent.call(void 0, {
647
647
  name: "site_header_search_trigger_shortcut",
648
648
  properties: {
649
649
  method: e.key === "/" ? "slash" : "cmd_k",
@@ -661,7 +661,7 @@ function CommandMenu({
661
661
  return () => document.removeEventListener("keydown", handleKeyDown);
662
662
  }, []);
663
663
  const handleButtonClick = React.useCallback(() => {
664
- _chunkWI36EFUScjs.googleTrackEvent.call(void 0, {
664
+ _chunk7472NIILcjs.googleTrackEvent.call(void 0, {
665
665
  name: "site_header_search_trigger_click",
666
666
  properties: {
667
667
  method: "button_click",
@@ -836,7 +836,7 @@ function ChildNavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
836
836
  ) });
837
837
  }
838
838
  function handleMenuClick(item) {
839
- _chunkWI36EFUScjs.googleTrackEvent.call(void 0, {
839
+ _chunk7472NIILcjs.googleTrackEvent.call(void 0, {
840
840
  name: `site_header_menu_${item.title.toLowerCase().replace(/\s+/g, "_")}_link_click`,
841
841
  properties: {
842
842
  menu_item: item.title,
@@ -1916,7 +1916,7 @@ function LanguageSwitcher({
1916
1916
  currentLocale,
1917
1917
  locales,
1918
1918
  onLocaleChange,
1919
- // flagsBasePath = '/flags',
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: _chunkWI36EFUScjs.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: _chunkWI36EFUScjs.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: _chunkWI36EFUScjs.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,
@@ -2436,7 +2436,7 @@ function Subscribe({
2436
2436
  setLoading(true);
2437
2437
  setShowRecaptcha(false);
2438
2438
  try {
2439
- _chunkWI36EFUScjs.googleTrackEvent.call(void 0, {
2439
+ _chunk7472NIILcjs.googleTrackEvent.call(void 0, {
2440
2440
  name: "site_newsletter_subscribe_submit",
2441
2441
  properties: {
2442
2442
  category: "conversion",
@@ -2463,7 +2463,7 @@ function Subscribe({
2463
2463
  position: "top-center"
2464
2464
  }
2465
2465
  );
2466
- _chunkWI36EFUScjs.googleTrackEvent.call(void 0, {
2466
+ _chunk7472NIILcjs.googleTrackEvent.call(void 0, {
2467
2467
  name: "site_newsletter_subscribe_success",
2468
2468
  properties: {
2469
2469
  category: "conversion",
@@ -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
@@ -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
@@ -58,7 +58,7 @@ import {
58
58
  getAssetsUrl,
59
59
  getFlagUrl,
60
60
  googleTrackEvent
61
- } from "./chunk-UYMAUGVA.js";
61
+ } from "./chunk-HR3R6KKM.js";
62
62
  import {
63
63
  cn
64
64
  } from "./chunk-RQHJBTEU.js";
@@ -1916,7 +1916,7 @@ function LanguageSwitcher({
1916
1916
  currentLocale,
1917
1917
  locales,
1918
1918
  onLocaleChange,
1919
- // flagsBasePath = '/flags',
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,
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWI36EFUScjs = require('./chunk-WI36EFUS.cjs');
5
+ var _chunk7472NIILcjs = require('./chunk-7472NIIL.cjs');
6
6
 
7
7
 
8
8
  var _chunkCJXIPSTGcjs = require('./chunk-CJXIPSTG.cjs');
@@ -227,4 +227,4 @@ var parse = (
227
227
 
228
228
 
229
229
 
230
- exports.DEFAULT_THEME_MODE = _chunkI46SELBAcjs.DEFAULT_THEME_MODE; exports.META_THEME_COLORS = _chunkI46SELBAcjs.META_THEME_COLORS; exports.THEME_MODES = _chunkI46SELBAcjs.THEME_MODES; exports.calculateMaxWidth = calculateMaxWidth; exports.cn = _chunkCJXIPSTGcjs.cn; exports.cva = _chunkUP53DCYHcjs.cva; exports.getAssetsUrl = _chunkWI36EFUScjs.getAssetsUrl; exports.getDotPattern = getDotPattern; exports.getFlagUrl = _chunkWI36EFUScjs.getFlagUrl; exports.getGradientStyle = getGradientStyle; exports.getGridPattern = getGridPattern; exports.getIPAddress = getIPAddress; exports.getMask = getMask; exports.getPatternStyle = getPatternStyle; exports.getPositionClasses = getPositionClasses; exports.googleTrackEvent = _chunkWI36EFUScjs.googleTrackEvent; exports.hexToRgba = hexToRgba; exports.isValidHex = isValidHex; exports.normalizePath = normalizePath; exports.parse = parse;
230
+ exports.DEFAULT_THEME_MODE = _chunkI46SELBAcjs.DEFAULT_THEME_MODE; exports.META_THEME_COLORS = _chunkI46SELBAcjs.META_THEME_COLORS; exports.THEME_MODES = _chunkI46SELBAcjs.THEME_MODES; exports.calculateMaxWidth = calculateMaxWidth; exports.cn = _chunkCJXIPSTGcjs.cn; exports.cva = _chunkUP53DCYHcjs.cva; exports.getAssetsUrl = _chunk7472NIILcjs.getAssetsUrl; exports.getDotPattern = getDotPattern; exports.getFlagUrl = _chunk7472NIILcjs.getFlagUrl; exports.getGradientStyle = getGradientStyle; exports.getGridPattern = getGridPattern; exports.getIPAddress = getIPAddress; exports.getMask = getMask; exports.getPatternStyle = getPatternStyle; exports.getPositionClasses = getPositionClasses; exports.googleTrackEvent = _chunk7472NIILcjs.googleTrackEvent; exports.hexToRgba = hexToRgba; exports.isValidHex = isValidHex; exports.normalizePath = normalizePath; exports.parse = parse;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  getAssetsUrl,
3
3
  getFlagUrl,
4
4
  googleTrackEvent
5
- } from "./chunk-UYMAUGVA.js";
5
+ } from "./chunk-HR3R6KKM.js";
6
6
  import {
7
7
  cn
8
8
  } from "./chunk-RQHJBTEU.js";