@pelatform/ui 1.6.0 → 2.0.0
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/css/source.css +20 -0
- package/css/theme.css +1 -2
- package/dist/animation.d.ts +4 -379
- package/dist/animation.js +2 -1752
- package/dist/aria.d.ts +1 -31
- package/dist/aria.js +2 -139
- package/dist/base.d.ts +1 -651
- package/dist/base.js +2 -5556
- package/dist/chunk-UEVIEY7W.js +51 -0
- package/dist/{components.cjs → chunk-VZEE3GOC.js} +81 -2344
- package/dist/components.d.ts +224 -181
- package/dist/components.js +364 -765
- package/dist/default.d.ts +1 -1322
- package/dist/default.js +2 -8931
- package/dist/hooks.d.ts +4 -1083
- package/dist/hooks.js +5 -662
- package/dist/index.d.ts +58 -308
- package/dist/index.js +5 -226
- package/package.json +25 -105
- package/dist/animation.cjs +0 -1752
- package/dist/animation.d.cts +0 -379
- package/dist/aria.cjs +0 -139
- package/dist/aria.d.cts +0 -31
- package/dist/badge-BtI4BMea.d.cts +0 -33
- package/dist/badge-BtI4BMea.d.ts +0 -33
- package/dist/base.cjs +0 -5556
- package/dist/base.d.cts +0 -651
- package/dist/chunk-3N75YA6Q.cjs +0 -60
- package/dist/chunk-7472NIIL.cjs +0 -40
- package/dist/chunk-BXUKTDPN.cjs +0 -576
- package/dist/chunk-CD2BCCQU.js +0 -180
- package/dist/chunk-CJXIPSTG.cjs +0 -10
- package/dist/chunk-CTHRAJQZ.js +0 -1522
- package/dist/chunk-D373YKDA.js +0 -196
- package/dist/chunk-EZW5GNS4.js +0 -6
- package/dist/chunk-HILACSFA.cjs +0 -1522
- package/dist/chunk-HR3R6KKM.js +0 -40
- package/dist/chunk-HW52LCWN.js +0 -22
- package/dist/chunk-I46SELBA.cjs +0 -22
- package/dist/chunk-J4JGE3U5.cjs +0 -180
- package/dist/chunk-RQHJBTEU.js +0 -10
- package/dist/chunk-SK6SSJHC.js +0 -9
- package/dist/chunk-T74DBLYY.js +0 -60
- package/dist/chunk-TB6DU23O.js +0 -576
- package/dist/chunk-UP53DCYH.cjs +0 -6
- package/dist/chunk-ZBO5IAMA.cjs +0 -196
- package/dist/chunk-ZDR3OZ7Z.cjs +0 -9
- package/dist/colors-CUDWvz1g.d.cts +0 -42
- package/dist/colors-CUDWvz1g.d.ts +0 -42
- package/dist/components-CidsRcc3.d.cts +0 -46
- package/dist/components-CidsRcc3.d.ts +0 -46
- package/dist/components.d.cts +0 -2944
- package/dist/default.cjs +0 -8931
- package/dist/default.d.cts +0 -1322
- package/dist/hooks.cjs +0 -666
- package/dist/hooks.d.cts +0 -1172
- package/dist/index.cjs +0 -230
- package/dist/index.d.cts +0 -318
- package/dist/input-AwYIskrX.d.cts +0 -22
- package/dist/input-AwYIskrX.d.ts +0 -22
- package/dist/menu-GmSRfRGB.d.cts +0 -43
- package/dist/menu-GmSRfRGB.d.ts +0 -43
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/re-export/cva.cjs +0 -6
- package/dist/re-export/cva.d.cts +0 -10
- package/dist/re-export/cva.d.ts +0 -10
- package/dist/re-export/cva.js +0 -6
- package/dist/re-export/motion.cjs +0 -2
- package/dist/re-export/motion.d.cts +0 -1
- package/dist/re-export/motion.d.ts +0 -1
- package/dist/re-export/motion.js +0 -2
- package/dist/re-export/next-themes.cjs +0 -2
- package/dist/re-export/next-themes.d.cts +0 -1
- package/dist/re-export/next-themes.d.ts +0 -1
- package/dist/re-export/next-themes.js +0 -2
- package/dist/re-export/react-day-picker.cjs +0 -2
- package/dist/re-export/react-day-picker.d.cts +0 -1
- package/dist/re-export/react-day-picker.d.ts +0 -1
- package/dist/re-export/react-day-picker.js +0 -2
- package/dist/re-export/react-hook-form.cjs +0 -2
- package/dist/re-export/react-hook-form.d.cts +0 -1
- package/dist/re-export/react-hook-form.d.ts +0 -1
- package/dist/re-export/react-hook-form.js +0 -2
- package/dist/re-export/resolver.cjs +0 -2
- package/dist/re-export/resolver.d.cts +0 -1
- package/dist/re-export/resolver.d.ts +0 -1
- package/dist/re-export/resolver.js +0 -2
- package/dist/re-export/sonner.cjs +0 -2
- package/dist/re-export/sonner.d.cts +0 -1
- package/dist/re-export/sonner.d.ts +0 -1
- package/dist/re-export/sonner.js +0 -2
- package/dist/re-export/tanstack-query.cjs +0 -2
- package/dist/re-export/tanstack-query.d.cts +0 -1
- package/dist/re-export/tanstack-query.d.ts +0 -1
- package/dist/re-export/tanstack-query.js +0 -2
- package/dist/re-export/tanstack-table.cjs +0 -2
- package/dist/re-export/tanstack-table.d.cts +0 -1
- package/dist/re-export/tanstack-table.d.ts +0 -1
- package/dist/re-export/tanstack-table.js +0 -2
- package/dist/re-export/zod.cjs +0 -2
- package/dist/re-export/zod.d.cts +0 -1
- package/dist/re-export/zod.d.ts +0 -1
- package/dist/re-export/zod.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,318 +1,68 @@
|
|
|
1
|
-
export
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export { B as BaseProps, I as Image, L as Link } from './components-CidsRcc3.js';
|
|
5
|
-
export { a as MenuConfig, M as MenuItem } from './menu-GmSRfRGB.js';
|
|
6
|
-
import 'react';
|
|
1
|
+
export * from '@pelatform/ui.core';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import React__default from 'react';
|
|
7
4
|
|
|
8
5
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* Props interface for icon components
|
|
7
|
+
* Extends standard HTML SVG element attributes for full customization
|
|
11
8
|
*/
|
|
12
|
-
|
|
13
|
-
/** Event name to be tracked (required, non-empty string) */
|
|
14
|
-
name: string;
|
|
15
|
-
/** Optional properties/attributes for the event */
|
|
16
|
-
properties?: Record<string, string | number | boolean>;
|
|
17
|
-
}
|
|
9
|
+
type IconProps = React__default.HTMLAttributes<SVGElement>;
|
|
18
10
|
/**
|
|
19
|
-
*
|
|
20
|
-
* This extends the Window interface to include the gtag function
|
|
21
|
-
* that's injected by the Google Analytics script
|
|
22
|
-
*/
|
|
23
|
-
declare global {
|
|
24
|
-
interface Window {
|
|
25
|
-
gtag?: (command: 'event' | 'config' | 'set', targetId: string, config?: Record<string, string | number | boolean | object | null | undefined>) => void;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Tracks an event in Google Analytics with proper error handling and validation.
|
|
30
|
-
*
|
|
31
|
-
* @param params - Event parameters
|
|
32
|
-
* @param params.name - Event name (required, non-empty string)
|
|
33
|
-
* @param params.properties - Optional event properties
|
|
34
|
-
*/
|
|
35
|
-
declare const googleTrackEvent: ({ name, properties }: EventProps) => void;
|
|
36
|
-
|
|
37
|
-
type PatternType = 'none' | 'grid' | 'dots';
|
|
38
|
-
type GradientDirection = 'none' | 'to right' | 'to left' | 'to bottom' | 'to top' | 'to bottom right' | 'to bottom left' | 'to top right' | 'to top left';
|
|
39
|
-
type MaskDirection = 'none' | 'circle at center' | 'circle at center top' | 'circle at top right' | 'circle at center right' | 'circle at bottom right' | 'circle at center bottom' | 'circle at bottom left' | 'circle at center left' | 'circle at top left';
|
|
40
|
-
type PositionOption = 'start' | 'center' | 'end';
|
|
41
|
-
type AlignmentOption = 'left' | 'center' | 'right';
|
|
42
|
-
interface BackgroundImageLayer {
|
|
43
|
-
imageSrc?: string;
|
|
44
|
-
}
|
|
45
|
-
interface MaskLayer {
|
|
46
|
-
enabled?: boolean;
|
|
47
|
-
direction?: MaskDirection;
|
|
48
|
-
visibleRadius?: number;
|
|
49
|
-
fadeWidth?: number;
|
|
50
|
-
}
|
|
51
|
-
interface PatternLayer {
|
|
52
|
-
type?: PatternType;
|
|
53
|
-
color?: string;
|
|
54
|
-
opacity?: number;
|
|
55
|
-
size?: number;
|
|
56
|
-
backgroundSize?: number;
|
|
57
|
-
lineThickness?: number;
|
|
58
|
-
mask?: MaskLayer;
|
|
59
|
-
}
|
|
60
|
-
interface GradientLayer {
|
|
61
|
-
startColor?: string;
|
|
62
|
-
endColor?: string;
|
|
63
|
-
opacity?: number;
|
|
64
|
-
direction?: GradientDirection;
|
|
65
|
-
mask?: MaskLayer;
|
|
66
|
-
}
|
|
67
|
-
interface PositionedElement {
|
|
68
|
-
customClasses?: string;
|
|
69
|
-
textColor?: string;
|
|
70
|
-
bgColor?: string;
|
|
71
|
-
fontSize?: string;
|
|
72
|
-
fontWeight?: string;
|
|
73
|
-
width?: string;
|
|
74
|
-
height?: string;
|
|
75
|
-
hPosition?: PositionOption;
|
|
76
|
-
vPosition?: PositionOption;
|
|
77
|
-
alignment?: AlignmentOption;
|
|
78
|
-
autoMargin?: boolean;
|
|
79
|
-
}
|
|
80
|
-
interface ContentLayout {
|
|
81
|
-
layoutContainer?: string;
|
|
82
|
-
logoContainer?: string;
|
|
83
|
-
logo?: string;
|
|
84
|
-
tagContainer?: string;
|
|
85
|
-
contentContainer?: string;
|
|
86
|
-
tag?: string;
|
|
87
|
-
title?: string;
|
|
88
|
-
description?: string;
|
|
89
|
-
website?: string;
|
|
90
|
-
}
|
|
91
|
-
interface OhImgBaseTemplateProps {
|
|
92
|
-
content: {
|
|
93
|
-
title: string;
|
|
94
|
-
description?: string;
|
|
95
|
-
tags?: string[];
|
|
96
|
-
website?: string;
|
|
97
|
-
logoSrc?: string;
|
|
98
|
-
};
|
|
99
|
-
background?: BackgroundImageLayer;
|
|
100
|
-
pattern?: PatternLayer;
|
|
101
|
-
gradient?: GradientLayer;
|
|
102
|
-
layout?: ContentLayout;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Converts hex color to rgba format with specified opacity
|
|
107
|
-
*/
|
|
108
|
-
declare const isValidHex: (color: string) => boolean;
|
|
109
|
-
declare const hexToRgba: (color: string, opacity: number) => string;
|
|
110
|
-
declare const getMask: ({ direction, visibleRadius, fadeWidth }: {
|
|
111
|
-
direction?: string | undefined;
|
|
112
|
-
visibleRadius?: number | undefined;
|
|
113
|
-
fadeWidth?: number | undefined;
|
|
114
|
-
}) => {
|
|
115
|
-
maskImage: string;
|
|
116
|
-
WebkitMaskImage: string;
|
|
117
|
-
};
|
|
118
|
-
declare const getDotPattern: ({ color, opacity, size, backgroundSize, }: {
|
|
119
|
-
color?: string | undefined;
|
|
120
|
-
opacity?: number | undefined;
|
|
121
|
-
size?: number | undefined;
|
|
122
|
-
backgroundSize?: number | undefined;
|
|
123
|
-
}) => {
|
|
124
|
-
backgroundImage: string;
|
|
125
|
-
backgroundSize: string;
|
|
126
|
-
backgroundPosition: string;
|
|
127
|
-
};
|
|
128
|
-
declare const getGridPattern: ({ color, opacity, size, lineThickness, }: {
|
|
129
|
-
color?: string;
|
|
130
|
-
opacity?: number;
|
|
131
|
-
size?: number;
|
|
132
|
-
lineThickness?: number;
|
|
133
|
-
}) => {
|
|
134
|
-
backgroundImage: string;
|
|
135
|
-
backgroundSize: string;
|
|
136
|
-
};
|
|
137
|
-
declare const getPatternStyle: (props: PatternLayer) => {};
|
|
138
|
-
declare const getGradientStyle: (props: GradientLayer) => {};
|
|
139
|
-
declare function calculateMaxWidth(paddingX: string | undefined): number;
|
|
140
|
-
declare function getPositionClasses(element: PositionedElement, maxWidth: number): string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Utility functions for CSS class name management
|
|
144
|
-
* Provides optimized class name merging with Tailwind CSS conflict resolution
|
|
145
|
-
* Essential for component styling and conditional class application
|
|
146
|
-
*/
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Merges Tailwind class names, resolving any conflicts.
|
|
150
|
-
* This utility combines clsx for conditional classes with tailwind-merge
|
|
151
|
-
* to properly handle Tailwind CSS class conflicts.
|
|
152
|
-
*
|
|
153
|
-
* @param inputs - An array of class names, objects, or arrays to merge
|
|
154
|
-
* @returns A string of merged and optimized class names
|
|
155
|
-
*/
|
|
156
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
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;
|
|
178
|
-
/**
|
|
179
|
-
* Build a CDN URL for a country flag SVG.
|
|
180
|
-
*
|
|
181
|
-
* The function lowercases the given ISO country code and returns a
|
|
182
|
-
* fully-qualified URL pointing to the SVG flag hosted on the Pelatform
|
|
183
|
-
* assets CDN.
|
|
11
|
+
* Collection of brand and service icons
|
|
184
12
|
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
13
|
+
* This object contains SVG icons for popular brands, services, and technologies.
|
|
14
|
+
* All icons are designed to be scalable and themeable using CSS currentColor.
|
|
187
15
|
*
|
|
188
16
|
* @example
|
|
189
|
-
* ```
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* //
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* //
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // Basic usage
|
|
19
|
+
* <Icons.google className="w-6 h-6" />
|
|
20
|
+
*
|
|
21
|
+
* // With custom styling
|
|
22
|
+
* <Icons.github
|
|
23
|
+
* className="w-8 h-8 text-gray-600 hover:text-gray-900"
|
|
24
|
+
* onClick={handleGitHubClick}
|
|
25
|
+
* />
|
|
26
|
+
*
|
|
27
|
+
* // Colorful variants
|
|
28
|
+
* <Icons.googleColorful className="w-10 h-10" />
|
|
29
|
+
* <Icons.facebookColorful className="w-10 h-10" />
|
|
200
30
|
* ```
|
|
201
31
|
*/
|
|
202
|
-
declare
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
* - Ensures it always starts with '/'
|
|
238
|
-
* - Collapses multiple slashes (e.g., `'//a///b'` becomes `'/a/b'`)
|
|
239
|
-
* - Removes trailing slash except for root path (e.g., `'/login/'` becomes `'/login'`)
|
|
240
|
-
*
|
|
241
|
-
* @param input - Any path-like string
|
|
242
|
-
* @returns A normalized path beginning with '/'
|
|
243
|
-
*
|
|
244
|
-
* @example
|
|
245
|
-
* ```ts
|
|
246
|
-
* import { normalizePath } from "@pelatform/ui/utils/parse";
|
|
247
|
-
*
|
|
248
|
-
* normalizePath("dashboard"); // "/dashboard"
|
|
249
|
-
* normalizePath("//a///b"); // "/a/b"
|
|
250
|
-
* normalizePath("/login/"); // "/login"
|
|
251
|
-
* normalizePath(""); // "/"
|
|
252
|
-
* ```
|
|
253
|
-
*/
|
|
254
|
-
declare function normalizePath(input: string): string;
|
|
255
|
-
/**
|
|
256
|
-
* Interface for parsed request data
|
|
257
|
-
*/
|
|
258
|
-
interface ParsedRequest {
|
|
259
|
-
/** Normalized domain name (lowercase, without www) */
|
|
260
|
-
domain: string;
|
|
261
|
-
/** URL pathname (e.g., '/dashboard/users') */
|
|
262
|
-
path: string;
|
|
263
|
-
/** Full path including query parameters (e.g., '/dashboard/users?page=1') */
|
|
264
|
-
fullPath: string;
|
|
265
|
-
/** First path segment (e.g., 'dashboard' from '/dashboard/users') */
|
|
266
|
-
key: string;
|
|
267
|
-
/** Full path without leading slash (e.g., 'dashboard/users') */
|
|
268
|
-
fullKey: string;
|
|
269
|
-
/** Query parameters as object */
|
|
270
|
-
searchParamsObj: Record<string, string>;
|
|
271
|
-
/** Query parameters as string (e.g., '?page=1&limit=10') */
|
|
272
|
-
searchParamsString: string;
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Parse and normalize a Next.js `NextRequest`.
|
|
276
|
-
*
|
|
277
|
-
* Extracts domain, normalized path, first segment key, full path, and
|
|
278
|
-
* query parameters (both as object and as string). Handles international
|
|
279
|
-
* characters via `decodeURIComponent` and normalizes the host by removing
|
|
280
|
-
* a leading `www.`.
|
|
281
|
-
*
|
|
282
|
-
* @param req - The incoming Next.js `NextRequest`
|
|
283
|
-
* @returns Parsed request data with normalized components
|
|
284
|
-
*
|
|
285
|
-
* @example
|
|
286
|
-
* ```ts
|
|
287
|
-
* import type { NextRequest } from "next/server";
|
|
288
|
-
* import { parse } from "@pelatform/ui/utils/parse";
|
|
289
|
-
*
|
|
290
|
-
* export function middleware(req: NextRequest) {
|
|
291
|
-
* const { domain, path, fullPath, key } = parse(req);
|
|
292
|
-
*
|
|
293
|
-
* console.log(domain); // e.g., "api.pelatform.com"
|
|
294
|
-
* console.log(path); // e.g., "/v1/users"
|
|
295
|
-
* console.log(fullPath); // e.g., "/v1/users?page=1"
|
|
296
|
-
* console.log(key); // e.g., "v1"
|
|
297
|
-
* }
|
|
298
|
-
* ```
|
|
299
|
-
*
|
|
300
|
-
* @example
|
|
301
|
-
* ```ts
|
|
302
|
-
* // Handling international URLs
|
|
303
|
-
* const { key, fullKey } = parse(req);
|
|
304
|
-
* console.log(key); // Decoded first path segment
|
|
305
|
-
* console.log(fullKey); // Decoded full path
|
|
306
|
-
* ```
|
|
307
|
-
*
|
|
308
|
-
* @example
|
|
309
|
-
* ```ts
|
|
310
|
-
* // Working with query parameters
|
|
311
|
-
* const { searchParamsObj, searchParamsString } = parse(req);
|
|
312
|
-
* // searchParamsObj -> { page: "1", limit: "10" }
|
|
313
|
-
* // searchParamsString -> "?page=1&limit=10"
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
declare const parse: (req: any) => ParsedRequest;
|
|
32
|
+
declare const Icons: {
|
|
33
|
+
anthropic: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
apple: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
aria: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
facebook: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
facebookColorful: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
38
|
+
github: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
39
|
+
google: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
40
|
+
googleColorful: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
41
|
+
instagram: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
linkedin: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
43
|
+
linkedinColorful: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
microsoft: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
45
|
+
nextjs: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
46
|
+
npm: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
47
|
+
openai: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
48
|
+
paypal: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
49
|
+
pelatform: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
50
|
+
pnpm: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
51
|
+
postgresql: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
prisma: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
53
|
+
radix: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
radixui: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
react: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
56
|
+
scira: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
scribble: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
58
|
+
supabaseColorful: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
tailwind: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
telegram: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
61
|
+
twitter: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
62
|
+
whatsApp: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
x: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
64
|
+
yarn: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
65
|
+
youtube: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
66
|
+
};
|
|
317
67
|
|
|
318
|
-
export {
|
|
68
|
+
export { Icons };
|
package/dist/index.js
CHANGED
|
@@ -1,230 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
googleTrackEvent
|
|
5
|
-
} from "./chunk-HR3R6KKM.js";
|
|
6
|
-
import {
|
|
7
|
-
cn
|
|
8
|
-
} from "./chunk-RQHJBTEU.js";
|
|
9
|
-
import {
|
|
10
|
-
DEFAULT_THEME_MODE,
|
|
11
|
-
META_THEME_COLORS,
|
|
12
|
-
THEME_MODES
|
|
13
|
-
} from "./chunk-HW52LCWN.js";
|
|
14
|
-
import {
|
|
15
|
-
cva
|
|
16
|
-
} from "./chunk-EZW5GNS4.js";
|
|
17
|
-
|
|
18
|
-
// src/lib/ohimg.ts
|
|
19
|
-
var isValidHex = (color) => {
|
|
20
|
-
const hexPattern = /^#[0-9A-Fa-f]{6}$/;
|
|
21
|
-
return hexPattern.test(color);
|
|
22
|
-
};
|
|
23
|
-
var hexToRgba = (color, opacity) => {
|
|
24
|
-
const defaultColor = "#000000";
|
|
25
|
-
let normalizedColor = color?.startsWith("#") ? color : `#${color}`;
|
|
26
|
-
if (!isValidHex(normalizedColor)) {
|
|
27
|
-
console.warn(`Invalid hex color: ${color}, using default black`);
|
|
28
|
-
normalizedColor = defaultColor;
|
|
29
|
-
}
|
|
30
|
-
const r = parseInt(normalizedColor.slice(1, 3), 16);
|
|
31
|
-
const g = parseInt(normalizedColor.slice(3, 5), 16);
|
|
32
|
-
const b = parseInt(normalizedColor.slice(5, 7), 16);
|
|
33
|
-
const safeOpacity = Math.max(0, Math.min(1, opacity ?? 1));
|
|
34
|
-
return `rgba(${r}, ${g}, ${b}, ${safeOpacity})`;
|
|
35
|
-
};
|
|
36
|
-
var getMask = ({ direction = "circle at center", visibleRadius = 30, fadeWidth = 20 }) => {
|
|
37
|
-
const outerRadius = visibleRadius + fadeWidth;
|
|
38
|
-
return {
|
|
39
|
-
maskImage: `radial-gradient(${direction}, black ${visibleRadius}%, transparent ${outerRadius}%)`,
|
|
40
|
-
WebkitMaskImage: `radial-gradient(${direction}, black ${visibleRadius}%, transparent ${outerRadius}%)`
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
var getDotPattern = ({
|
|
44
|
-
color = "#000000",
|
|
45
|
-
opacity = 0.5,
|
|
46
|
-
size = 25,
|
|
47
|
-
backgroundSize = 20
|
|
48
|
-
}) => {
|
|
49
|
-
const dotColor = hexToRgba(color, opacity);
|
|
50
|
-
return {
|
|
51
|
-
backgroundImage: `radial-gradient(${dotColor} ${size}%, transparent ${size + 1}%), radial-gradient(${dotColor} ${size - 0.5}%, transparent ${size + 0.5}%)`,
|
|
52
|
-
backgroundSize: `${backgroundSize}px ${backgroundSize}px, ${backgroundSize}px ${backgroundSize}px`,
|
|
53
|
-
backgroundPosition: `0 0, ${backgroundSize / 2}px ${backgroundSize / 2}px`
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
var getGridPattern = ({
|
|
57
|
-
color = "#000000",
|
|
58
|
-
opacity = 0.5,
|
|
59
|
-
size = 20,
|
|
60
|
-
lineThickness = 1
|
|
61
|
-
}) => {
|
|
62
|
-
const colorWithOpacity = hexToRgba(color, opacity);
|
|
63
|
-
return {
|
|
64
|
-
backgroundImage: `
|
|
65
|
-
linear-gradient(to right, ${colorWithOpacity} ${lineThickness}px, transparent ${lineThickness}px),
|
|
66
|
-
linear-gradient(to bottom, ${colorWithOpacity} ${lineThickness}px, transparent ${lineThickness}px)
|
|
67
|
-
`,
|
|
68
|
-
backgroundSize: `${size}px ${size}px`
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
var getPatternStyle = (props) => {
|
|
72
|
-
switch (props.type) {
|
|
73
|
-
case "dots":
|
|
74
|
-
return {
|
|
75
|
-
...getDotPattern({
|
|
76
|
-
color: props.color,
|
|
77
|
-
opacity: props.opacity,
|
|
78
|
-
size: props.size,
|
|
79
|
-
backgroundSize: props.backgroundSize
|
|
80
|
-
}),
|
|
81
|
-
...props.mask && props.mask.enabled === true && getMask({
|
|
82
|
-
direction: props.mask.direction,
|
|
83
|
-
visibleRadius: props.mask.visibleRadius,
|
|
84
|
-
fadeWidth: props.mask.fadeWidth
|
|
85
|
-
})
|
|
86
|
-
};
|
|
87
|
-
case "grid":
|
|
88
|
-
return {
|
|
89
|
-
...getGridPattern({
|
|
90
|
-
color: props.color,
|
|
91
|
-
opacity: props.opacity,
|
|
92
|
-
size: props.size,
|
|
93
|
-
lineThickness: props.lineThickness
|
|
94
|
-
}),
|
|
95
|
-
...props.mask && props.mask.enabled === true && getMask({
|
|
96
|
-
direction: props.mask.direction,
|
|
97
|
-
visibleRadius: props.mask.visibleRadius,
|
|
98
|
-
fadeWidth: props.mask.fadeWidth
|
|
99
|
-
})
|
|
100
|
-
};
|
|
101
|
-
default:
|
|
102
|
-
return {};
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var getGradientStyle = (props) => {
|
|
106
|
-
if (!props.direction || props.direction === "none") {
|
|
107
|
-
return {};
|
|
108
|
-
}
|
|
109
|
-
const baseGradient = {
|
|
110
|
-
background: `linear-gradient(${props.direction || "to bottom"}, ${props.startColor || "#000000"}, ${props.endColor || "#000000"})`,
|
|
111
|
-
opacity: props.opacity ?? 0.7
|
|
112
|
-
};
|
|
113
|
-
return {
|
|
114
|
-
...baseGradient,
|
|
115
|
-
...props.mask && props.mask.enabled === true && getMask({
|
|
116
|
-
direction: props.mask.direction,
|
|
117
|
-
visibleRadius: props.mask.visibleRadius,
|
|
118
|
-
fadeWidth: props.mask.fadeWidth
|
|
119
|
-
})
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
function calculateMaxWidth(paddingX) {
|
|
123
|
-
const baseWidth = 1200;
|
|
124
|
-
if (!paddingX) {
|
|
125
|
-
return baseWidth;
|
|
126
|
-
}
|
|
127
|
-
const paddingValue = parseInt(paddingX.replace("px", ""), 10);
|
|
128
|
-
if (Number.isNaN(paddingValue)) {
|
|
129
|
-
return baseWidth;
|
|
130
|
-
}
|
|
131
|
-
const adjustedWidth = baseWidth - 2 * paddingValue;
|
|
132
|
-
const finalWidth = Math.min(adjustedWidth, baseWidth);
|
|
133
|
-
return finalWidth;
|
|
134
|
-
}
|
|
135
|
-
function getPositionClasses(element, maxWidth) {
|
|
136
|
-
return cn(element.customClasses && element.customClasses, `max-w-[${maxWidth}px]`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// src/utils/ip.ts
|
|
140
|
-
async function getIPAddress() {
|
|
141
|
-
if (typeof window === "undefined") {
|
|
142
|
-
return "unknown";
|
|
143
|
-
}
|
|
144
|
-
try {
|
|
145
|
-
const services = [
|
|
146
|
-
"https://api.ipify.org?format=json",
|
|
147
|
-
"https://ipapi.co/json/",
|
|
148
|
-
"https://api.ip.sb/jsonip"
|
|
149
|
-
];
|
|
150
|
-
for (const service of services) {
|
|
151
|
-
try {
|
|
152
|
-
const response = await fetch(service, {
|
|
153
|
-
method: "GET",
|
|
154
|
-
headers: {
|
|
155
|
-
Accept: "application/json"
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
if (response.ok) {
|
|
159
|
-
const data = await response.json();
|
|
160
|
-
const ip = data.ip || data.query || data.ipAddress;
|
|
161
|
-
if (ip && typeof ip === "string") {
|
|
162
|
-
return ip;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
} catch (serviceError) {
|
|
166
|
-
console.warn(`IP service ${service} failed:`, serviceError);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return "unknown";
|
|
170
|
-
} catch (error) {
|
|
171
|
-
console.error("Failed to get client IP:", error);
|
|
172
|
-
return "unknown";
|
|
173
|
-
}
|
|
174
|
-
}
|
|
2
|
+
Icons
|
|
3
|
+
} from "./chunk-VZEE3GOC.js";
|
|
175
4
|
|
|
176
|
-
// src/
|
|
177
|
-
|
|
178
|
-
if (!input) return "/";
|
|
179
|
-
let p = input.trim();
|
|
180
|
-
if (!p.startsWith("/")) p = `/${p}`;
|
|
181
|
-
p = p.replace(/\/{2,}/g, "/");
|
|
182
|
-
if (p.length > 1 && p.endsWith("/")) p = p.slice(0, -1);
|
|
183
|
-
return p;
|
|
184
|
-
}
|
|
185
|
-
var parse = (
|
|
186
|
-
// biome-ignore lint/suspicious/noExplicitAny: disable
|
|
187
|
-
(req) => {
|
|
188
|
-
let domain = req.headers.get("host");
|
|
189
|
-
domain = domain.replace(/^www\./, "").toLowerCase();
|
|
190
|
-
const path = req.nextUrl.pathname;
|
|
191
|
-
const searchParams = req.nextUrl.searchParams.toString();
|
|
192
|
-
const searchParamsObj = Object.fromEntries(req.nextUrl.searchParams);
|
|
193
|
-
const searchParamsString = searchParams.length > 0 ? `?${searchParams}` : "";
|
|
194
|
-
const fullPath = `${path}${searchParamsString}`;
|
|
195
|
-
const pathSegments = path.split("/").filter(Boolean);
|
|
196
|
-
const key = pathSegments.length > 0 ? decodeURIComponent(pathSegments[0]) : "";
|
|
197
|
-
const fullKey = path.length > 1 ? decodeURIComponent(path.slice(1)) : "";
|
|
198
|
-
return {
|
|
199
|
-
domain,
|
|
200
|
-
path,
|
|
201
|
-
fullPath,
|
|
202
|
-
key,
|
|
203
|
-
fullKey,
|
|
204
|
-
searchParamsObj,
|
|
205
|
-
searchParamsString
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
);
|
|
5
|
+
// src/index.ts
|
|
6
|
+
export * from "@pelatform/ui.core";
|
|
209
7
|
export {
|
|
210
|
-
|
|
211
|
-
META_THEME_COLORS,
|
|
212
|
-
THEME_MODES,
|
|
213
|
-
calculateMaxWidth,
|
|
214
|
-
cn,
|
|
215
|
-
cva,
|
|
216
|
-
getAssetsUrl,
|
|
217
|
-
getDotPattern,
|
|
218
|
-
getFlagUrl,
|
|
219
|
-
getGradientStyle,
|
|
220
|
-
getGridPattern,
|
|
221
|
-
getIPAddress,
|
|
222
|
-
getMask,
|
|
223
|
-
getPatternStyle,
|
|
224
|
-
getPositionClasses,
|
|
225
|
-
googleTrackEvent,
|
|
226
|
-
hexToRgba,
|
|
227
|
-
isValidHex,
|
|
228
|
-
normalizePath,
|
|
229
|
-
parse
|
|
8
|
+
Icons
|
|
230
9
|
};
|