@pelatform/ui 1.5.2 → 1.5.3

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 CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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; }
2
2
 
3
- var _chunkKNS6QRVBcjs = require('./chunk-KNS6QRVB.cjs');
3
+
4
+
5
+ var _chunkWI36EFUScjs = require('./chunk-WI36EFUS.cjs');
4
6
 
5
7
 
6
8
  var _chunkCJXIPSTGcjs = require('./chunk-CJXIPSTG.cjs');
@@ -134,13 +136,6 @@ function getPositionClasses(element, maxWidth) {
134
136
  return _chunkCJXIPSTGcjs.cn.call(void 0, element.customClasses && element.customClasses, `max-w-[${maxWidth}px]`);
135
137
  }
136
138
 
137
- // src/utils/flag-url.ts
138
- function getFlagUrl(flag) {
139
- const baseUrl = "https://assets.pelatform.com/media/flags";
140
- const flagCode = flag.toLowerCase();
141
- return `${baseUrl}/${flagCode}.svg`;
142
- }
143
-
144
139
  // src/utils/ip.ts
145
140
  async function getIPAddress() {
146
141
  if (typeof window === "undefined") {
@@ -231,4 +226,5 @@ var parse = (
231
226
 
232
227
 
233
228
 
234
- 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.getDotPattern = getDotPattern; exports.getFlagUrl = getFlagUrl; exports.getGradientStyle = getGradientStyle; exports.getGridPattern = getGridPattern; exports.getIPAddress = getIPAddress; exports.getMask = getMask; exports.getPatternStyle = getPatternStyle; exports.getPositionClasses = getPositionClasses; exports.googleTrackEvent = _chunkKNS6QRVBcjs.googleTrackEvent; exports.hexToRgba = hexToRgba; exports.isValidHex = isValidHex; exports.normalizePath = normalizePath; exports.parse = parse;
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;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { D as DEFAULT_THEME_MODE, M as META_THEME_COLORS, T as THEME_MODES, a as ThemeMode } from './colors-CUDWvz1g.cjs';
2
2
  import { ClassValue } from 'clsx';
3
3
  export { cva } from 'class-variance-authority';
4
- export { B as BaseProps, I as Image, L as Link } from './components-BgbIL9EW.cjs';
4
+ export { B as BaseProps, I as Image, L as Link } from './components-CidsRcc3.cjs';
5
5
  export { a as MenuConfig, M as MenuItem } from './menu-GmSRfRGB.cjs';
6
6
  import 'react';
7
7
 
@@ -155,6 +155,26 @@ declare function getPositionClasses(element: PositionedElement, maxWidth: number
155
155
  */
156
156
  declare function cn(...inputs: ClassValue[]): string;
157
157
 
158
+ /**
159
+ * Assets URL Utility
160
+ * Builds a fully-qualified CDN URL for a given assets path.
161
+ * Useful for referencing illustrations and media from the Pelatform assets CDN.
162
+ */
163
+ /**
164
+ * Build a full CDN URL for a given assets path.
165
+ *
166
+ * @param path - Relative path to the asset (e.g., "media/illustrations/29.svg")
167
+ * @returns A fully-qualified CDN URL string
168
+ *
169
+ * @example
170
+ * ```ts
171
+ * import { getAssetsUrl } from "@pelatform/ui/utils/assets-url";
172
+ *
173
+ * const url = getAssetsUrl("media/illustrations/29.svg");
174
+ * // "https://assets.pelatform.com/media/illustrations/29.svg"
175
+ * ```
176
+ */
177
+ declare function getAssetsUrl(path: string): string;
158
178
  /**
159
179
  * Build a CDN URL for a country flag SVG.
160
180
  *
@@ -295,4 +315,4 @@ interface ParsedRequest {
295
315
  */
296
316
  declare const parse: (req: any) => ParsedRequest;
297
317
 
298
- export { type AlignmentOption, type BackgroundImageLayer, type ContentLayout, type GradientDirection, type GradientLayer, type MaskDirection, type MaskLayer, type OhImgBaseTemplateProps, type ParsedRequest, type PatternLayer, type PatternType, type PositionOption, type PositionedElement, calculateMaxWidth, cn, getDotPattern, getFlagUrl, getGradientStyle, getGridPattern, getIPAddress, getMask, getPatternStyle, getPositionClasses, googleTrackEvent, hexToRgba, isValidHex, normalizePath, parse };
318
+ export { type AlignmentOption, type BackgroundImageLayer, type ContentLayout, type GradientDirection, type GradientLayer, type MaskDirection, type MaskLayer, type OhImgBaseTemplateProps, type ParsedRequest, type PatternLayer, type PatternType, type PositionOption, type PositionedElement, calculateMaxWidth, cn, getAssetsUrl, getDotPattern, getFlagUrl, getGradientStyle, getGridPattern, getIPAddress, getMask, getPatternStyle, getPositionClasses, googleTrackEvent, hexToRgba, isValidHex, normalizePath, parse };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { D as DEFAULT_THEME_MODE, M as META_THEME_COLORS, T as THEME_MODES, a as ThemeMode } from './colors-CUDWvz1g.js';
2
2
  import { ClassValue } from 'clsx';
3
3
  export { cva } from 'class-variance-authority';
4
- export { B as BaseProps, I as Image, L as Link } from './components-BgbIL9EW.js';
4
+ export { B as BaseProps, I as Image, L as Link } from './components-CidsRcc3.js';
5
5
  export { a as MenuConfig, M as MenuItem } from './menu-GmSRfRGB.js';
6
6
  import 'react';
7
7
 
@@ -155,6 +155,26 @@ declare function getPositionClasses(element: PositionedElement, maxWidth: number
155
155
  */
156
156
  declare function cn(...inputs: ClassValue[]): string;
157
157
 
158
+ /**
159
+ * Assets URL Utility
160
+ * Builds a fully-qualified CDN URL for a given assets path.
161
+ * Useful for referencing illustrations and media from the Pelatform assets CDN.
162
+ */
163
+ /**
164
+ * Build a full CDN URL for a given assets path.
165
+ *
166
+ * @param path - Relative path to the asset (e.g., "media/illustrations/29.svg")
167
+ * @returns A fully-qualified CDN URL string
168
+ *
169
+ * @example
170
+ * ```ts
171
+ * import { getAssetsUrl } from "@pelatform/ui/utils/assets-url";
172
+ *
173
+ * const url = getAssetsUrl("media/illustrations/29.svg");
174
+ * // "https://assets.pelatform.com/media/illustrations/29.svg"
175
+ * ```
176
+ */
177
+ declare function getAssetsUrl(path: string): string;
158
178
  /**
159
179
  * Build a CDN URL for a country flag SVG.
160
180
  *
@@ -295,4 +315,4 @@ interface ParsedRequest {
295
315
  */
296
316
  declare const parse: (req: any) => ParsedRequest;
297
317
 
298
- export { type AlignmentOption, type BackgroundImageLayer, type ContentLayout, type GradientDirection, type GradientLayer, type MaskDirection, type MaskLayer, type OhImgBaseTemplateProps, type ParsedRequest, type PatternLayer, type PatternType, type PositionOption, type PositionedElement, calculateMaxWidth, cn, getDotPattern, getFlagUrl, getGradientStyle, getGridPattern, getIPAddress, getMask, getPatternStyle, getPositionClasses, googleTrackEvent, hexToRgba, isValidHex, normalizePath, parse };
318
+ export { type AlignmentOption, type BackgroundImageLayer, type ContentLayout, type GradientDirection, type GradientLayer, type MaskDirection, type MaskLayer, type OhImgBaseTemplateProps, type ParsedRequest, type PatternLayer, type PatternType, type PositionOption, type PositionedElement, calculateMaxWidth, cn, getAssetsUrl, getDotPattern, getFlagUrl, getGradientStyle, getGridPattern, getIPAddress, getMask, getPatternStyle, getPositionClasses, googleTrackEvent, hexToRgba, isValidHex, normalizePath, parse };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import {
2
+ getAssetsUrl,
3
+ getFlagUrl,
2
4
  googleTrackEvent
3
- } from "./chunk-S3QFGYE6.js";
5
+ } from "./chunk-UYMAUGVA.js";
4
6
  import {
5
7
  cn
6
8
  } from "./chunk-RQHJBTEU.js";
@@ -134,13 +136,6 @@ function getPositionClasses(element, maxWidth) {
134
136
  return cn(element.customClasses && element.customClasses, `max-w-[${maxWidth}px]`);
135
137
  }
136
138
 
137
- // src/utils/flag-url.ts
138
- function getFlagUrl(flag) {
139
- const baseUrl = "https://assets.pelatform.com/media/flags";
140
- const flagCode = flag.toLowerCase();
141
- return `${baseUrl}/${flagCode}.svg`;
142
- }
143
-
144
139
  // src/utils/ip.ts
145
140
  async function getIPAddress() {
146
141
  if (typeof window === "undefined") {
@@ -218,6 +213,7 @@ export {
218
213
  calculateMaxWidth,
219
214
  cn,
220
215
  cva,
216
+ getAssetsUrl,
221
217
  getDotPattern,
222
218
  getFlagUrl,
223
219
  getGradientStyle,