@moontra/moonui-pro 2.2.2 → 2.2.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.mjs +3 -3
- package/package.json +1 -1
- package/src/components/ui/label.tsx +2 -2
- package/src/utils/cn.ts +2 -65
package/dist/index.mjs
CHANGED
|
@@ -3373,18 +3373,18 @@ var MoonUIInputPro = React16.forwardRef(
|
|
|
3373
3373
|
}
|
|
3374
3374
|
);
|
|
3375
3375
|
MoonUIInputPro.displayName = "MoonUIInputPro";
|
|
3376
|
-
cva(
|
|
3376
|
+
var moonUILabelVariantsPro = cva(
|
|
3377
3377
|
"text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"
|
|
3378
3378
|
);
|
|
3379
3379
|
var MoonUILabelPro2 = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3380
3380
|
LabelPrimitive.Root,
|
|
3381
3381
|
{
|
|
3382
3382
|
ref,
|
|
3383
|
-
className: cn(
|
|
3383
|
+
className: cn(moonUILabelVariantsPro(), className),
|
|
3384
3384
|
...props
|
|
3385
3385
|
}
|
|
3386
3386
|
));
|
|
3387
|
-
|
|
3387
|
+
MoonUILabelPro2.displayName = LabelPrimitive.Root.displayName;
|
|
3388
3388
|
var MoonUITextareaPro = React16__default.forwardRef(
|
|
3389
3389
|
({ className, ...props }, ref) => {
|
|
3390
3390
|
return /* @__PURE__ */ jsx(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -17,11 +17,11 @@ const MoonUILabelPro = React.forwardRef<
|
|
|
17
17
|
>(({ className, ...props }, ref) => (
|
|
18
18
|
<LabelPrimitive.Root
|
|
19
19
|
ref={ref}
|
|
20
|
-
className={cn(
|
|
20
|
+
className={cn(moonUILabelVariantsPro(), className)}
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
23
|
))
|
|
24
|
-
|
|
24
|
+
MoonUILabelPro.displayName = LabelPrimitive.Root.displayName
|
|
25
25
|
|
|
26
26
|
export { MoonUILabelPro };
|
|
27
27
|
|
package/src/utils/cn.ts
CHANGED
|
@@ -1,69 +1,6 @@
|
|
|
1
|
-
import { type ClassValue, clsx } from
|
|
2
|
-
import { twMerge } from
|
|
1
|
+
import { type ClassValue, clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
|
|
4
|
-
// Utility function using clsx and tailwind-merge
|
|
5
4
|
export function cn(...inputs: ClassValue[]) {
|
|
6
5
|
return twMerge(clsx(inputs));
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
// Date formatting utility
|
|
10
|
-
export function formatDate(date: Date): string {
|
|
11
|
-
if (isNaN(date.getTime())) {
|
|
12
|
-
return 'Invalid Date'
|
|
13
|
-
}
|
|
14
|
-
return date.toLocaleDateString('en-US', {
|
|
15
|
-
year: 'numeric',
|
|
16
|
-
month: 'short',
|
|
17
|
-
day: 'numeric'
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Currency formatting utility
|
|
22
|
-
export function formatCurrency(amount: number): string {
|
|
23
|
-
return new Intl.NumberFormat('en-US', {
|
|
24
|
-
style: 'currency',
|
|
25
|
-
currency: 'USD'
|
|
26
|
-
}).format(amount)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Text truncation utility
|
|
30
|
-
export function truncateText(text: string, maxLength: number): string {
|
|
31
|
-
if (text.length <= maxLength) {
|
|
32
|
-
return text
|
|
33
|
-
}
|
|
34
|
-
return text.slice(0, maxLength) + '...'
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// ID generation utility
|
|
38
|
-
export function generateId(length: number = 8): string {
|
|
39
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
40
|
-
let result = ''
|
|
41
|
-
for (let i = 0; i < length; i++) {
|
|
42
|
-
result += chars.charAt(Math.floor(Math.random() * chars.length))
|
|
43
|
-
}
|
|
44
|
-
return result
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Get client IP address from request
|
|
48
|
-
export function getClientIP(request: Request): string {
|
|
49
|
-
// Check various headers for IP address
|
|
50
|
-
const forwarded = request.headers.get('x-forwarded-for')
|
|
51
|
-
const realIP = request.headers.get('x-real-ip')
|
|
52
|
-
const remoteAddr = request.headers.get('x-remote-addr')
|
|
53
|
-
|
|
54
|
-
if (forwarded) {
|
|
55
|
-
// x-forwarded-for can contain multiple IPs, take the first one
|
|
56
|
-
return forwarded.split(',')[0].trim()
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (realIP) {
|
|
60
|
-
return realIP
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (remoteAddr) {
|
|
64
|
-
return remoteAddr
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Fallback to a default IP if none found
|
|
68
|
-
return '127.0.0.1'
|
|
69
|
-
}
|