@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/dist/index.mjs DELETED
@@ -1,371 +0,0 @@
1
- // src/components/button/button.tsx
2
- import React from "react";
3
-
4
- // src/theme/glass.ts
5
- var glassVariants = {
6
- light: {
7
- background: "bg-white/5",
8
- backdropBlur: "backdrop-blur-[2px]",
9
- border: "border border-white/15",
10
- shadow: "shadow-lg",
11
- hover: "hover:bg-white/10 hover:shadow-xl",
12
- focus: "focus:outline-none focus:ring-2 focus:ring-white/10"
13
- },
14
- medium: {
15
- background: "bg-white/20",
16
- backdropBlur: "backdrop-blur-lg",
17
- border: "border border-white/30",
18
- shadow: "shadow-xl",
19
- hover: "hover:bg-white/30 hover:shadow-2xl",
20
- focus: "focus:outline-none focus:ring-2 focus:ring-white/50"
21
- },
22
- dark: {
23
- background: "bg-black/20",
24
- backdropBlur: "backdrop-blur-md",
25
- border: "border border-white/10",
26
- shadow: "shadow-lg",
27
- hover: "hover:bg-black/30 hover:shadow-xl",
28
- focus: "focus:outline-none focus:ring-2 focus:ring-white/40"
29
- },
30
- colored: {
31
- background: "bg-gradient-to-br from-white/20 to-white/10",
32
- backdropBlur: "backdrop-blur-xl",
33
- border: "border border-white/25",
34
- shadow: "shadow-2xl",
35
- hover: "hover:from-white/30 hover:to-white/20 hover:shadow-[0_8px_32px_0_rgba(255,255,255,0.37)]",
36
- focus: "focus:outline-none focus:ring-2 focus:ring-white/60"
37
- }
38
- };
39
- var aeroVariants = {
40
- light: {
41
- background: "bg-gradient-to-br from-cyan-400/20 to-blue-400/10",
42
- backdropBlur: "backdrop-blur-md",
43
- border: "border border-cyan-300/30",
44
- shadow: "shadow-aero",
45
- hover: "hover:from-cyan-400/30 hover:to-blue-400/20 hover:shadow-aero-lg",
46
- focus: "focus:outline-none focus:ring-2 focus:ring-cyan-300/50"
47
- },
48
- medium: {
49
- background: "bg-gradient-to-br from-sky-400/25 to-cyan-400/15",
50
- backdropBlur: "backdrop-blur-lg",
51
- border: "border border-sky-300/40",
52
- shadow: "shadow-aero-lg",
53
- hover: "hover:from-sky-400/35 hover:to-cyan-400/25 hover:shadow-[0_8px_32px_0_rgba(56,189,248,0.37)]",
54
- focus: "focus:outline-none focus:ring-2 focus:ring-sky-300/60"
55
- },
56
- dark: {
57
- background: "bg-gradient-to-br from-blue-500/30 to-cyan-500/20",
58
- backdropBlur: "backdrop-blur-md",
59
- border: "border border-blue-300/30",
60
- shadow: "shadow-aero",
61
- hover: "hover:from-blue-500/40 hover:to-cyan-500/30 hover:shadow-aero-lg",
62
- focus: "focus:outline-none focus:ring-2 focus:ring-blue-300/50"
63
- },
64
- colored: {
65
- background: "bg-gradient-to-br from-lime-400/25 via-cyan-400/20 to-blue-400/15",
66
- backdropBlur: "backdrop-blur-xl",
67
- border: "border border-lime-300/35",
68
- shadow: "shadow-aero-lg",
69
- 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)]",
70
- focus: "focus:outline-none focus:ring-2 focus:ring-lime-300/60"
71
- }
72
- };
73
- var getGlassClasses = (variant = "light", rounded = "rounded-xl", includeInteractions = true) => {
74
- const v = glassVariants[variant];
75
- const interactions = includeInteractions ? `transition-all duration-300 ${v.hover} ${v.focus} active:scale-95` : "";
76
- return `${v.background} ${v.backdropBlur} ${v.border} ${v.shadow} ${rounded} ${interactions}`;
77
- };
78
- var getAeroClasses = (variant = "light", rounded = "rounded-xl", includeInteractions = true) => {
79
- const v = aeroVariants[variant];
80
- const interactions = includeInteractions ? `transition-all duration-300 ${v.hover} ${v.focus} active:scale-95` : "";
81
- return `${v.background} ${v.backdropBlur} ${v.border} ${v.shadow} ${rounded} ${interactions}`;
82
- };
83
-
84
- // src/components/button/button.tsx
85
- var sizeClasses = {
86
- sm: "px-4 py-2 text-sm",
87
- md: "px-6 py-3 text-base",
88
- lg: "px-8 py-4 text-lg"
89
- };
90
- var Button = ({
91
- variant = "light",
92
- size = "md",
93
- fullWidth = false,
94
- children,
95
- className = "",
96
- disabled = false,
97
- ...props
98
- }) => {
99
- const glassClasses = getGlassClasses(variant);
100
- const sizeClass = sizeClasses[size];
101
- const widthClass = fullWidth ? "w-full" : "";
102
- const disabledClass = disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer";
103
- return /* @__PURE__ */ React.createElement(
104
- "button",
105
- {
106
- className: `
107
- ${glassClasses}
108
- ${sizeClass}
109
- ${widthClass}
110
- ${disabledClass}
111
- font-medium text-white
112
- ${className}
113
- `,
114
- disabled,
115
- ...props
116
- },
117
- children
118
- );
119
- };
120
-
121
- // src/components/card/card.tsx
122
- import React2 from "react";
123
- var paddingClasses = {
124
- none: "",
125
- sm: "p-4",
126
- md: "p-6",
127
- lg: "p-8"
128
- };
129
- var Card = ({
130
- variant = "light",
131
- padding = "md",
132
- enableInteractions = false,
133
- children,
134
- className = "",
135
- ...props
136
- }) => {
137
- const glassClasses = getGlassClasses(variant, void 0, enableInteractions);
138
- const paddingClass = paddingClasses[padding];
139
- return /* @__PURE__ */ React2.createElement(
140
- "div",
141
- {
142
- className: `
143
- ${glassClasses}
144
- ${paddingClass}
145
- ${className}
146
- `,
147
- ...props
148
- },
149
- children
150
- );
151
- };
152
-
153
- // src/components/input/input.tsx
154
- import React3 from "react";
155
- var Input = ({
156
- variant = "light",
157
- fullWidth = false,
158
- label,
159
- className = "",
160
- id,
161
- ...props
162
- }) => {
163
- const glassClasses = getGlassClasses(variant);
164
- const widthClass = fullWidth ? "w-full" : "";
165
- const inputId = id || label?.toLowerCase().replace(/\s+/g, "-");
166
- return /* @__PURE__ */ React3.createElement("div", { className: `flex flex-col gap-2 ${widthClass}` }, label && /* @__PURE__ */ React3.createElement(
167
- "label",
168
- {
169
- htmlFor: inputId,
170
- className: "text-white text-sm font-medium pl-1"
171
- },
172
- label
173
- ), /* @__PURE__ */ React3.createElement(
174
- "input",
175
- {
176
- id: inputId,
177
- className: `
178
- ${glassClasses}
179
- ${widthClass}
180
- px-4 py-3
181
- text-white placeholder-white/50
182
- transition-all duration-300
183
- focus:outline-none focus:ring-2 focus:ring-white/50
184
- ${className}
185
- `,
186
- ...props
187
- }
188
- ));
189
- };
190
-
191
- // src/components/modal/modal.tsx
192
- import React4 from "react";
193
- var sizeClasses2 = {
194
- sm: "max-w-sm",
195
- md: "max-w-md",
196
- lg: "max-w-lg",
197
- xl: "max-w-xl"
198
- };
199
- var Modal = ({
200
- isOpen,
201
- onClose,
202
- variant = "medium",
203
- title,
204
- children,
205
- size = "md"
206
- }) => {
207
- if (!isOpen) return null;
208
- const glassClasses = getGlassClasses(variant);
209
- const sizeClass = sizeClasses2[size];
210
- return /* @__PURE__ */ React4.createElement(
211
- "div",
212
- {
213
- className: "fixed inset-0 z-50 flex items-center justify-center p-4 animate-fadeIn",
214
- onClick: onClose
215
- },
216
- /* @__PURE__ */ React4.createElement("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm" }),
217
- /* @__PURE__ */ React4.createElement(
218
- "div",
219
- {
220
- className: `
221
- ${glassClasses}
222
- ${sizeClass}
223
- w-full p-6 relative z-10
224
- animate-scaleIn
225
- `,
226
- onClick: (e) => e.stopPropagation()
227
- },
228
- title && /* @__PURE__ */ React4.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React4.createElement("h2", { className: "text-2xl font-bold text-white" }, title), /* @__PURE__ */ React4.createElement(
229
- "button",
230
- {
231
- onClick: onClose,
232
- className: "text-white/70 hover:text-white transition-colors p-1",
233
- "aria-label": "Close modal"
234
- },
235
- /* @__PURE__ */ React4.createElement(
236
- "svg",
237
- {
238
- className: "w-6 h-6",
239
- fill: "none",
240
- strokeLinecap: "round",
241
- strokeLinejoin: "round",
242
- strokeWidth: "2",
243
- viewBox: "0 0 24 24",
244
- stroke: "currentColor"
245
- },
246
- /* @__PURE__ */ React4.createElement("path", { d: "M6 18L18 6M6 6l12 12" })
247
- )
248
- )),
249
- /* @__PURE__ */ React4.createElement("div", { className: "text-white" }, children)
250
- )
251
- );
252
- };
253
-
254
- // src/components/aero-bubble/aero-bubble.tsx
255
- import React5 from "react";
256
- var sizeClasses3 = {
257
- sm: "w-12 h-12",
258
- md: "w-20 h-20",
259
- lg: "w-32 h-32",
260
- xl: "w-48 h-48"
261
- };
262
- var colorClasses = {
263
- cyan: "bg-gradient-to-br from-cyan-300/40 to-cyan-500/20",
264
- blue: "bg-gradient-to-br from-blue-300/40 to-blue-500/20",
265
- lime: "bg-gradient-to-br from-lime-300/40 to-lime-500/20",
266
- sky: "bg-gradient-to-br from-sky-300/40 to-sky-500/20"
267
- };
268
- var AeroBubble = ({
269
- size = "md",
270
- color = "cyan",
271
- className = ""
272
- }) => {
273
- return /* @__PURE__ */ React5.createElement(
274
- "div",
275
- {
276
- className: `
277
- ${sizeClasses3[size]}
278
- ${colorClasses[color]}
279
- rounded-full
280
- backdrop-blur-sm
281
- border border-white/30
282
- shadow-[0_8px_32px_0_rgba(31,38,135,0.37)]
283
- relative
284
- overflow-hidden
285
- ${className}
286
- `
287
- },
288
- /* @__PURE__ */ React5.createElement("div", { className: "absolute inset-0 bg-gradient-to-br from-white/40 via-transparent to-transparent rounded-full" }),
289
- /* @__PURE__ */ React5.createElement("div", { className: "absolute bottom-2 right-2 w-1/3 h-1/3 bg-white/30 rounded-full blur-md" })
290
- );
291
- };
292
-
293
- // src/components/accordion/accordion.tsx
294
- import React6, { useState } from "react";
295
- var Accordion = ({
296
- items,
297
- variant = "light",
298
- allowMultiple = false,
299
- defaultOpen = [],
300
- className = ""
301
- }) => {
302
- const [openItems, setOpenItems] = useState(defaultOpen);
303
- const toggleItem = (id) => {
304
- if (allowMultiple) {
305
- setOpenItems(
306
- (prev) => prev.includes(id) ? prev.filter((item) => item !== id) : [...prev, id]
307
- );
308
- } else {
309
- setOpenItems((prev) => prev.includes(id) ? [] : [id]);
310
- }
311
- };
312
- const isOpen = (id) => openItems.includes(id);
313
- return /* @__PURE__ */ React6.createElement("div", { className }, items.map((item, index) => {
314
- const open = isOpen(item.id);
315
- const glassClasses = getGlassClasses(variant, "rounded-none", false);
316
- const isFirst = index === 0;
317
- const isLast = index === items.length - 1;
318
- return /* @__PURE__ */ React6.createElement(
319
- "div",
320
- {
321
- key: item.id,
322
- className: `${glassClasses} ${isFirst ? "rounded-t-lg" : ""} ${isLast ? "rounded-b-lg" : ""} ${!isLast ? "border-b border-white/10" : ""}`
323
- },
324
- /* @__PURE__ */ React6.createElement(
325
- "button",
326
- {
327
- onClick: () => toggleItem(item.id),
328
- className: "w-full px-4 py-4 flex items-center justify-between text-left text-white font-medium hover:underline transition-all duration-200"
329
- },
330
- /* @__PURE__ */ React6.createElement("div", { className: "flex items-center gap-2" }, item.icon && /* @__PURE__ */ React6.createElement("span", { className: "flex items-center text-base" }, item.icon), /* @__PURE__ */ React6.createElement("span", { className: "text-sm font-medium" }, item.title)),
331
- /* @__PURE__ */ React6.createElement(
332
- "svg",
333
- {
334
- className: `w-4 h-4 shrink-0 transition-transform duration-200 text-white/70 ${open ? "rotate-180" : ""}`,
335
- fill: "none",
336
- stroke: "currentColor",
337
- strokeWidth: "2",
338
- viewBox: "0 0 24 24"
339
- },
340
- /* @__PURE__ */ React6.createElement(
341
- "path",
342
- {
343
- strokeLinecap: "round",
344
- strokeLinejoin: "round",
345
- d: "M19 9l-7 7-7-7"
346
- }
347
- )
348
- )
349
- ),
350
- /* @__PURE__ */ React6.createElement(
351
- "div",
352
- {
353
- className: `grid transition-all duration-200 ease-in-out ${open ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`
354
- },
355
- /* @__PURE__ */ React6.createElement("div", { className: "overflow-hidden" }, /* @__PURE__ */ React6.createElement("div", { className: "px-4 pb-4 pt-0 text-sm text-white/80 leading-relaxed" }, item.content))
356
- )
357
- );
358
- }));
359
- };
360
- export {
361
- Accordion,
362
- AeroBubble,
363
- Button,
364
- Card,
365
- Input,
366
- Modal,
367
- aeroVariants,
368
- getAeroClasses,
369
- getGlassClasses,
370
- glassVariants
371
- };