@alexandretav/aleui 1.0.0 → 1.1.2
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/README.md +208 -105
- package/cli.js +142 -0
- package/package.json +10 -8
- package/src/components/accordion/accordion.tsx +103 -0
- package/src/components/accordion/index.ts +2 -0
- package/src/components/aero-bubble/aero-bubble.tsx +51 -0
- package/src/components/aero-bubble/index.ts +2 -0
- package/src/components/aero-button/aero-button.tsx +49 -0
- package/src/components/aero-button/index.ts +2 -0
- package/src/components/aero-button/shiny-button.tsx +83 -0
- package/src/components/aero-card/aero-card.tsx +43 -0
- package/src/components/aero-card/index.ts +2 -0
- package/src/components/aero-input/aero-input.tsx +41 -0
- package/src/components/aero-input/index.ts +2 -0
- package/src/components/button/button.tsx +50 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/card/card.tsx +43 -0
- package/src/components/card/index.ts +2 -0
- package/src/components/index.ts +30 -0
- package/src/components/input/index.ts +2 -0
- package/src/components/input/input.tsx +49 -0
- package/src/components/modal/index.ts +2 -0
- package/src/components/modal/modal.tsx +82 -0
- package/src/theme/glass.ts +124 -0
- package/src/utils/index.ts +39 -0
- package/dist/index.d.mts +0 -137
- package/dist/index.d.ts +0 -137
- package/dist/index.js +0 -417
- package/dist/index.mjs +0 -371
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for the glassmorphism UI library
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Combine multiple class names, filtering out falsy values
|
|
7
|
+
*/
|
|
8
|
+
export const cn = (...classes: (string | undefined | null | false)[]): string => {
|
|
9
|
+
return classes.filter(Boolean).join(' ');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generate random gradient colors for backgrounds
|
|
14
|
+
*/
|
|
15
|
+
export const getRandomGradient = (): string => {
|
|
16
|
+
const gradients = [
|
|
17
|
+
'from-purple-600 via-pink-500 to-orange-400',
|
|
18
|
+
'from-blue-600 via-cyan-500 to-teal-400',
|
|
19
|
+
'from-pink-500 via-red-500 to-yellow-500',
|
|
20
|
+
'from-indigo-600 via-purple-500 to-pink-500',
|
|
21
|
+
'from-green-500 via-teal-500 to-blue-500',
|
|
22
|
+
];
|
|
23
|
+
return gradients[Math.floor(Math.random() * gradients.length)];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Debounce function for performance optimization
|
|
28
|
+
*/
|
|
29
|
+
export const debounce = <T extends (...args: any[]) => any>(
|
|
30
|
+
func: T,
|
|
31
|
+
wait: number
|
|
32
|
+
): ((...args: Parameters<T>) => void) => {
|
|
33
|
+
let timeout: NodeJS.Timeout | null = null;
|
|
34
|
+
|
|
35
|
+
return (...args: Parameters<T>) => {
|
|
36
|
+
if (timeout) clearTimeout(timeout);
|
|
37
|
+
timeout = setTimeout(() => func(...args), wait);
|
|
38
|
+
};
|
|
39
|
+
};
|
package/dist/index.d.mts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const glassVariants: {
|
|
4
|
-
readonly light: {
|
|
5
|
-
readonly background: "bg-white/5";
|
|
6
|
-
readonly backdropBlur: "backdrop-blur-[2px]";
|
|
7
|
-
readonly border: "border border-white/15";
|
|
8
|
-
readonly shadow: "shadow-lg";
|
|
9
|
-
readonly hover: "hover:bg-white/10 hover:shadow-xl";
|
|
10
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/10";
|
|
11
|
-
};
|
|
12
|
-
readonly medium: {
|
|
13
|
-
readonly background: "bg-white/20";
|
|
14
|
-
readonly backdropBlur: "backdrop-blur-lg";
|
|
15
|
-
readonly border: "border border-white/30";
|
|
16
|
-
readonly shadow: "shadow-xl";
|
|
17
|
-
readonly hover: "hover:bg-white/30 hover:shadow-2xl";
|
|
18
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/50";
|
|
19
|
-
};
|
|
20
|
-
readonly dark: {
|
|
21
|
-
readonly background: "bg-black/20";
|
|
22
|
-
readonly backdropBlur: "backdrop-blur-md";
|
|
23
|
-
readonly border: "border border-white/10";
|
|
24
|
-
readonly shadow: "shadow-lg";
|
|
25
|
-
readonly hover: "hover:bg-black/30 hover:shadow-xl";
|
|
26
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/40";
|
|
27
|
-
};
|
|
28
|
-
readonly colored: {
|
|
29
|
-
readonly background: "bg-gradient-to-br from-white/20 to-white/10";
|
|
30
|
-
readonly backdropBlur: "backdrop-blur-xl";
|
|
31
|
-
readonly border: "border border-white/25";
|
|
32
|
-
readonly shadow: "shadow-2xl";
|
|
33
|
-
readonly hover: "hover:from-white/30 hover:to-white/20 hover:shadow-[0_8px_32px_0_rgba(255,255,255,0.37)]";
|
|
34
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/60";
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
declare const aeroVariants: {
|
|
38
|
-
readonly light: {
|
|
39
|
-
readonly background: "bg-gradient-to-br from-cyan-400/20 to-blue-400/10";
|
|
40
|
-
readonly backdropBlur: "backdrop-blur-md";
|
|
41
|
-
readonly border: "border border-cyan-300/30";
|
|
42
|
-
readonly shadow: "shadow-aero";
|
|
43
|
-
readonly hover: "hover:from-cyan-400/30 hover:to-blue-400/20 hover:shadow-aero-lg";
|
|
44
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-cyan-300/50";
|
|
45
|
-
};
|
|
46
|
-
readonly medium: {
|
|
47
|
-
readonly background: "bg-gradient-to-br from-sky-400/25 to-cyan-400/15";
|
|
48
|
-
readonly backdropBlur: "backdrop-blur-lg";
|
|
49
|
-
readonly border: "border border-sky-300/40";
|
|
50
|
-
readonly shadow: "shadow-aero-lg";
|
|
51
|
-
readonly hover: "hover:from-sky-400/35 hover:to-cyan-400/25 hover:shadow-[0_8px_32px_0_rgba(56,189,248,0.37)]";
|
|
52
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-sky-300/60";
|
|
53
|
-
};
|
|
54
|
-
readonly dark: {
|
|
55
|
-
readonly background: "bg-gradient-to-br from-blue-500/30 to-cyan-500/20";
|
|
56
|
-
readonly backdropBlur: "backdrop-blur-md";
|
|
57
|
-
readonly border: "border border-blue-300/30";
|
|
58
|
-
readonly shadow: "shadow-aero";
|
|
59
|
-
readonly hover: "hover:from-blue-500/40 hover:to-cyan-500/30 hover:shadow-aero-lg";
|
|
60
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-blue-300/50";
|
|
61
|
-
};
|
|
62
|
-
readonly colored: {
|
|
63
|
-
readonly background: "bg-gradient-to-br from-lime-400/25 via-cyan-400/20 to-blue-400/15";
|
|
64
|
-
readonly backdropBlur: "backdrop-blur-xl";
|
|
65
|
-
readonly border: "border border-lime-300/35";
|
|
66
|
-
readonly shadow: "shadow-aero-lg";
|
|
67
|
-
readonly hover: "hover:from-lime-400/35 hover:via-cyan-400/30 hover:to-blue-400/25 hover:shadow-[0_8px_32px_0_rgba(163,230,53,0.37)]";
|
|
68
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-lime-300/60";
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
type GlassVariantType = keyof typeof glassVariants;
|
|
72
|
-
type AeroVariantType = keyof typeof aeroVariants;
|
|
73
|
-
/**
|
|
74
|
-
* Generate glassmorphism class string
|
|
75
|
-
*/
|
|
76
|
-
declare const getGlassClasses: (variant?: GlassVariantType, rounded?: string, includeInteractions?: boolean) => string;
|
|
77
|
-
/**
|
|
78
|
-
* Generate Frutiger Aero class string
|
|
79
|
-
*/
|
|
80
|
-
declare const getAeroClasses: (variant?: AeroVariantType, rounded?: string, includeInteractions?: boolean) => string;
|
|
81
|
-
|
|
82
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
83
|
-
variant?: GlassVariantType;
|
|
84
|
-
size?: 'sm' | 'md' | 'lg';
|
|
85
|
-
fullWidth?: boolean;
|
|
86
|
-
children: React.ReactNode;
|
|
87
|
-
}
|
|
88
|
-
declare const Button: React.FC<ButtonProps>;
|
|
89
|
-
|
|
90
|
-
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
91
|
-
variant?: GlassVariantType;
|
|
92
|
-
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
93
|
-
enableInteractions?: boolean;
|
|
94
|
-
children: React.ReactNode;
|
|
95
|
-
}
|
|
96
|
-
declare const Card: React.FC<CardProps>;
|
|
97
|
-
|
|
98
|
-
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
99
|
-
variant?: GlassVariantType;
|
|
100
|
-
fullWidth?: boolean;
|
|
101
|
-
label?: string;
|
|
102
|
-
}
|
|
103
|
-
declare const Input: React.FC<InputProps>;
|
|
104
|
-
|
|
105
|
-
interface ModalProps {
|
|
106
|
-
isOpen: boolean;
|
|
107
|
-
onClose: () => void;
|
|
108
|
-
variant?: GlassVariantType;
|
|
109
|
-
title?: string;
|
|
110
|
-
children: React.ReactNode;
|
|
111
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
112
|
-
}
|
|
113
|
-
declare const Modal: React.FC<ModalProps>;
|
|
114
|
-
|
|
115
|
-
interface AeroBubbleProps {
|
|
116
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
117
|
-
color?: 'cyan' | 'blue' | 'lime' | 'sky';
|
|
118
|
-
className?: string;
|
|
119
|
-
}
|
|
120
|
-
declare const AeroBubble: React.FC<AeroBubbleProps>;
|
|
121
|
-
|
|
122
|
-
interface AccordionItemProps {
|
|
123
|
-
id: string;
|
|
124
|
-
title: string;
|
|
125
|
-
content: React.ReactNode;
|
|
126
|
-
icon?: React.ReactNode;
|
|
127
|
-
}
|
|
128
|
-
interface AccordionProps {
|
|
129
|
-
items: AccordionItemProps[];
|
|
130
|
-
variant?: GlassVariantType;
|
|
131
|
-
allowMultiple?: boolean;
|
|
132
|
-
defaultOpen?: string[];
|
|
133
|
-
className?: string;
|
|
134
|
-
}
|
|
135
|
-
declare const Accordion: React.FC<AccordionProps>;
|
|
136
|
-
|
|
137
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, AeroBubble, type AeroBubbleProps, type AeroVariantType, Button, type ButtonProps, Card, type CardProps, type GlassVariantType, Input, type InputProps, Modal, type ModalProps, aeroVariants, getAeroClasses, getGlassClasses, glassVariants };
|
package/dist/index.d.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const glassVariants: {
|
|
4
|
-
readonly light: {
|
|
5
|
-
readonly background: "bg-white/5";
|
|
6
|
-
readonly backdropBlur: "backdrop-blur-[2px]";
|
|
7
|
-
readonly border: "border border-white/15";
|
|
8
|
-
readonly shadow: "shadow-lg";
|
|
9
|
-
readonly hover: "hover:bg-white/10 hover:shadow-xl";
|
|
10
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/10";
|
|
11
|
-
};
|
|
12
|
-
readonly medium: {
|
|
13
|
-
readonly background: "bg-white/20";
|
|
14
|
-
readonly backdropBlur: "backdrop-blur-lg";
|
|
15
|
-
readonly border: "border border-white/30";
|
|
16
|
-
readonly shadow: "shadow-xl";
|
|
17
|
-
readonly hover: "hover:bg-white/30 hover:shadow-2xl";
|
|
18
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/50";
|
|
19
|
-
};
|
|
20
|
-
readonly dark: {
|
|
21
|
-
readonly background: "bg-black/20";
|
|
22
|
-
readonly backdropBlur: "backdrop-blur-md";
|
|
23
|
-
readonly border: "border border-white/10";
|
|
24
|
-
readonly shadow: "shadow-lg";
|
|
25
|
-
readonly hover: "hover:bg-black/30 hover:shadow-xl";
|
|
26
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/40";
|
|
27
|
-
};
|
|
28
|
-
readonly colored: {
|
|
29
|
-
readonly background: "bg-gradient-to-br from-white/20 to-white/10";
|
|
30
|
-
readonly backdropBlur: "backdrop-blur-xl";
|
|
31
|
-
readonly border: "border border-white/25";
|
|
32
|
-
readonly shadow: "shadow-2xl";
|
|
33
|
-
readonly hover: "hover:from-white/30 hover:to-white/20 hover:shadow-[0_8px_32px_0_rgba(255,255,255,0.37)]";
|
|
34
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-white/60";
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
declare const aeroVariants: {
|
|
38
|
-
readonly light: {
|
|
39
|
-
readonly background: "bg-gradient-to-br from-cyan-400/20 to-blue-400/10";
|
|
40
|
-
readonly backdropBlur: "backdrop-blur-md";
|
|
41
|
-
readonly border: "border border-cyan-300/30";
|
|
42
|
-
readonly shadow: "shadow-aero";
|
|
43
|
-
readonly hover: "hover:from-cyan-400/30 hover:to-blue-400/20 hover:shadow-aero-lg";
|
|
44
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-cyan-300/50";
|
|
45
|
-
};
|
|
46
|
-
readonly medium: {
|
|
47
|
-
readonly background: "bg-gradient-to-br from-sky-400/25 to-cyan-400/15";
|
|
48
|
-
readonly backdropBlur: "backdrop-blur-lg";
|
|
49
|
-
readonly border: "border border-sky-300/40";
|
|
50
|
-
readonly shadow: "shadow-aero-lg";
|
|
51
|
-
readonly hover: "hover:from-sky-400/35 hover:to-cyan-400/25 hover:shadow-[0_8px_32px_0_rgba(56,189,248,0.37)]";
|
|
52
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-sky-300/60";
|
|
53
|
-
};
|
|
54
|
-
readonly dark: {
|
|
55
|
-
readonly background: "bg-gradient-to-br from-blue-500/30 to-cyan-500/20";
|
|
56
|
-
readonly backdropBlur: "backdrop-blur-md";
|
|
57
|
-
readonly border: "border border-blue-300/30";
|
|
58
|
-
readonly shadow: "shadow-aero";
|
|
59
|
-
readonly hover: "hover:from-blue-500/40 hover:to-cyan-500/30 hover:shadow-aero-lg";
|
|
60
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-blue-300/50";
|
|
61
|
-
};
|
|
62
|
-
readonly colored: {
|
|
63
|
-
readonly background: "bg-gradient-to-br from-lime-400/25 via-cyan-400/20 to-blue-400/15";
|
|
64
|
-
readonly backdropBlur: "backdrop-blur-xl";
|
|
65
|
-
readonly border: "border border-lime-300/35";
|
|
66
|
-
readonly shadow: "shadow-aero-lg";
|
|
67
|
-
readonly hover: "hover:from-lime-400/35 hover:via-cyan-400/30 hover:to-blue-400/25 hover:shadow-[0_8px_32px_0_rgba(163,230,53,0.37)]";
|
|
68
|
-
readonly focus: "focus:outline-none focus:ring-2 focus:ring-lime-300/60";
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
type GlassVariantType = keyof typeof glassVariants;
|
|
72
|
-
type AeroVariantType = keyof typeof aeroVariants;
|
|
73
|
-
/**
|
|
74
|
-
* Generate glassmorphism class string
|
|
75
|
-
*/
|
|
76
|
-
declare const getGlassClasses: (variant?: GlassVariantType, rounded?: string, includeInteractions?: boolean) => string;
|
|
77
|
-
/**
|
|
78
|
-
* Generate Frutiger Aero class string
|
|
79
|
-
*/
|
|
80
|
-
declare const getAeroClasses: (variant?: AeroVariantType, rounded?: string, includeInteractions?: boolean) => string;
|
|
81
|
-
|
|
82
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
83
|
-
variant?: GlassVariantType;
|
|
84
|
-
size?: 'sm' | 'md' | 'lg';
|
|
85
|
-
fullWidth?: boolean;
|
|
86
|
-
children: React.ReactNode;
|
|
87
|
-
}
|
|
88
|
-
declare const Button: React.FC<ButtonProps>;
|
|
89
|
-
|
|
90
|
-
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
91
|
-
variant?: GlassVariantType;
|
|
92
|
-
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
93
|
-
enableInteractions?: boolean;
|
|
94
|
-
children: React.ReactNode;
|
|
95
|
-
}
|
|
96
|
-
declare const Card: React.FC<CardProps>;
|
|
97
|
-
|
|
98
|
-
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
99
|
-
variant?: GlassVariantType;
|
|
100
|
-
fullWidth?: boolean;
|
|
101
|
-
label?: string;
|
|
102
|
-
}
|
|
103
|
-
declare const Input: React.FC<InputProps>;
|
|
104
|
-
|
|
105
|
-
interface ModalProps {
|
|
106
|
-
isOpen: boolean;
|
|
107
|
-
onClose: () => void;
|
|
108
|
-
variant?: GlassVariantType;
|
|
109
|
-
title?: string;
|
|
110
|
-
children: React.ReactNode;
|
|
111
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
112
|
-
}
|
|
113
|
-
declare const Modal: React.FC<ModalProps>;
|
|
114
|
-
|
|
115
|
-
interface AeroBubbleProps {
|
|
116
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
117
|
-
color?: 'cyan' | 'blue' | 'lime' | 'sky';
|
|
118
|
-
className?: string;
|
|
119
|
-
}
|
|
120
|
-
declare const AeroBubble: React.FC<AeroBubbleProps>;
|
|
121
|
-
|
|
122
|
-
interface AccordionItemProps {
|
|
123
|
-
id: string;
|
|
124
|
-
title: string;
|
|
125
|
-
content: React.ReactNode;
|
|
126
|
-
icon?: React.ReactNode;
|
|
127
|
-
}
|
|
128
|
-
interface AccordionProps {
|
|
129
|
-
items: AccordionItemProps[];
|
|
130
|
-
variant?: GlassVariantType;
|
|
131
|
-
allowMultiple?: boolean;
|
|
132
|
-
defaultOpen?: string[];
|
|
133
|
-
className?: string;
|
|
134
|
-
}
|
|
135
|
-
declare const Accordion: React.FC<AccordionProps>;
|
|
136
|
-
|
|
137
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, AeroBubble, type AeroBubbleProps, type AeroVariantType, Button, type ButtonProps, Card, type CardProps, type GlassVariantType, Input, type InputProps, Modal, type ModalProps, aeroVariants, getAeroClasses, getGlassClasses, glassVariants };
|