unicornial-ui 0.0.7 → 0.0.9
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/types/components/Background.d.ts +3 -1
- package/dist/types/components/Background.d.ts.map +1 -1
- package/dist/types/components/Card.d.ts +2 -0
- package/dist/types/components/Card.d.ts.map +1 -0
- package/dist/types/components/Desktop.d.ts +7 -0
- package/dist/types/components/Desktop.d.ts.map +1 -0
- package/dist/types/components/Header.d.ts +4 -1
- package/dist/types/components/Header.d.ts.map +1 -1
- package/dist/types/components/Mobile.d.ts +7 -0
- package/dist/types/components/Mobile.d.ts.map +1 -0
- package/dist/types/components/Surface.d.ts +3 -0
- package/dist/types/components/Surface.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/main.d.ts.map +1 -1
- package/dist/types/theme/ThemeProvider.d.ts +1 -26
- package/dist/types/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/types/theme/types.d.ts +36 -0
- package/dist/types/theme/types.d.ts.map +1 -0
- package/dist/types/utils/typeUtils.d.ts +2 -0
- package/dist/types/utils/typeUtils.d.ts.map +1 -0
- package/dist/types/utils/utils.d.ts +9 -0
- package/dist/types/utils/utils.d.ts.map +1 -0
- package/dist/unicornial-ui.css +1 -1
- package/dist/unicornial-ui.es.js +283 -183
- package/dist/unicornial-ui.es.js.map +1 -1
- package/dist/unicornial-ui.umd.js +61 -6
- package/dist/unicornial-ui.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/unicornial-ui.es.js
CHANGED
|
@@ -1,43 +1,71 @@
|
|
|
1
1
|
import "./unicornial-ui.css";
|
|
2
2
|
import { createContext as e, forwardRef as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
3
|
-
import {
|
|
4
|
-
var
|
|
3
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
|
+
var u = {
|
|
5
5
|
colors: {
|
|
6
6
|
primary: "#aa3bff",
|
|
7
|
-
secondary: "#f4f3ec"
|
|
7
|
+
secondary: "#f4f3ec",
|
|
8
|
+
text: "#000000",
|
|
9
|
+
background: "#ffffff",
|
|
10
|
+
border: "#e5e4e7",
|
|
11
|
+
header: {
|
|
12
|
+
background: "#ffffff",
|
|
13
|
+
border: "#e5e4e7"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
darkColors: {
|
|
17
|
+
primary: "#aa3bff",
|
|
18
|
+
secondary: "#f4f3ec",
|
|
19
|
+
text: "#ffffff",
|
|
20
|
+
background: "#0b0912",
|
|
21
|
+
border: "#2a2535",
|
|
22
|
+
header: {
|
|
23
|
+
background: "#0b0912",
|
|
24
|
+
border: "#2a2535"
|
|
25
|
+
}
|
|
8
26
|
},
|
|
9
27
|
darkMode: !1,
|
|
10
28
|
text: {
|
|
11
29
|
title: "text-3xl font-bold text-text-h",
|
|
12
30
|
subtitle: "text-xl font-semibold text-text-h",
|
|
13
|
-
normal: "text-base font-normal text-text"
|
|
31
|
+
normal: "text-base font-normal text-text",
|
|
32
|
+
color: "text-text",
|
|
33
|
+
darkColor: "text-text-d"
|
|
14
34
|
}
|
|
15
|
-
},
|
|
35
|
+
}, d = (e, t) => {
|
|
16
36
|
let n = { ...e };
|
|
17
37
|
for (let r of Object.keys(t)) {
|
|
18
38
|
let i = t[r];
|
|
19
39
|
i && typeof i == "object" && !Array.isArray(i) && e[r] && typeof e[r] == "object" && !Array.isArray(e[r]) ? n[r] = d(e[r], i) : i !== void 0 && (n[r] = i);
|
|
20
40
|
}
|
|
21
41
|
return n;
|
|
22
|
-
};
|
|
23
|
-
function
|
|
24
|
-
let r = a(() => d(
|
|
25
|
-
|
|
42
|
+
}, f = e(null);
|
|
43
|
+
function p({ children: e, config: t }) {
|
|
44
|
+
let r = a(() => d(u, t ?? {}), [t]), [s, l] = o(r.colors), [p, m] = o(r.darkColors), [h, g] = o(r.darkMode), [_, v] = o(r.text), y = n((e) => {
|
|
45
|
+
l((t) => ({
|
|
26
46
|
...t,
|
|
27
47
|
...e
|
|
28
48
|
}));
|
|
29
|
-
}, []),
|
|
30
|
-
m(
|
|
31
|
-
}, []), y = n((e) => {
|
|
32
|
-
g((t) => ({
|
|
49
|
+
}, []), b = n((e) => {
|
|
50
|
+
m((t) => ({
|
|
33
51
|
...t,
|
|
34
52
|
...e
|
|
35
53
|
}));
|
|
36
|
-
}, []),
|
|
37
|
-
e
|
|
54
|
+
}, []), x = n((e) => {
|
|
55
|
+
g(e);
|
|
56
|
+
}, []), S = n((e) => {
|
|
57
|
+
v((t) => ({
|
|
58
|
+
...t,
|
|
59
|
+
...e
|
|
60
|
+
}));
|
|
61
|
+
}, []), C = n((e) => {
|
|
62
|
+
e.colors && l((t) => ({
|
|
38
63
|
...t,
|
|
39
64
|
...e.colors
|
|
40
|
-
})), e.
|
|
65
|
+
})), e.darkColors && m((t) => ({
|
|
66
|
+
...t,
|
|
67
|
+
...e.darkColors
|
|
68
|
+
})), e.darkMode !== void 0 && g(e.darkMode), e.text && v((t) => ({
|
|
41
69
|
...t,
|
|
42
70
|
...e.text
|
|
43
71
|
}));
|
|
@@ -45,63 +73,67 @@ function f({ children: e, config: t }) {
|
|
|
45
73
|
i(() => {
|
|
46
74
|
if (typeof document > "u") return;
|
|
47
75
|
let e = document.documentElement;
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
let
|
|
76
|
+
h ? e.classList.add("dark") : e.classList.remove("dark"), e.style.setProperty("--theme-primary", h ? p.primary : s.primary), e.style.setProperty("--theme-secondary", h ? p.secondary : s.secondary);
|
|
77
|
+
}, [s, h]);
|
|
78
|
+
let w = a(() => ({
|
|
51
79
|
enabled: !0,
|
|
52
|
-
colors:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
colors: s,
|
|
81
|
+
darkColors: p,
|
|
82
|
+
darkMode: h,
|
|
83
|
+
text: _,
|
|
84
|
+
setColors: y,
|
|
85
|
+
setDarkColors: b,
|
|
86
|
+
setDarkMode: x,
|
|
87
|
+
setText: S,
|
|
88
|
+
setTheme: C
|
|
59
89
|
}), [
|
|
60
|
-
|
|
61
|
-
p,
|
|
90
|
+
s,
|
|
62
91
|
h,
|
|
63
92
|
_,
|
|
64
|
-
v,
|
|
65
93
|
y,
|
|
66
|
-
|
|
94
|
+
x,
|
|
95
|
+
S,
|
|
96
|
+
C
|
|
67
97
|
]);
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
value:
|
|
98
|
+
return /* @__PURE__ */ c(f.Provider, {
|
|
99
|
+
value: w,
|
|
70
100
|
children: e
|
|
71
101
|
});
|
|
72
102
|
}
|
|
73
|
-
function
|
|
74
|
-
return r(
|
|
103
|
+
function m() {
|
|
104
|
+
return r(f) || {
|
|
75
105
|
enabled: !1,
|
|
76
|
-
colors:
|
|
77
|
-
|
|
78
|
-
|
|
106
|
+
colors: u.colors,
|
|
107
|
+
darkColors: u.darkColors,
|
|
108
|
+
darkMode: u.darkMode,
|
|
109
|
+
text: u.text,
|
|
79
110
|
setColors: () => {},
|
|
80
111
|
setDarkMode: () => {},
|
|
81
112
|
setText: () => {},
|
|
82
|
-
setTheme: () => {}
|
|
113
|
+
setTheme: () => {},
|
|
114
|
+
setDarkColors: () => {}
|
|
83
115
|
};
|
|
84
116
|
}
|
|
85
117
|
//#endregion
|
|
86
118
|
//#region src/components/Button.tsx
|
|
87
|
-
var
|
|
119
|
+
var h = {
|
|
88
120
|
primary: "bg-accent text-white hover:bg-accent/90 focus-visible:ring-accent/50",
|
|
89
121
|
secondary: "bg-code-bg text-text-h hover:bg-code-bg/80 focus-visible:ring-code-bg/50",
|
|
90
122
|
outline: "border border-border bg-transparent text-text-h hover:bg-accent-bg hover:border-accent-border focus-visible:ring-accent/50",
|
|
91
123
|
ghost: "bg-transparent text-text-h hover:bg-accent-bg focus-visible:ring-accent/50"
|
|
92
|
-
},
|
|
124
|
+
}, g = {
|
|
93
125
|
sm: "px-3 py-1.5 text-sm gap-1.5",
|
|
94
126
|
md: "px-5 py-2.5 text-base gap-2",
|
|
95
127
|
lg: "px-7 py-3 text-lg gap-2.5"
|
|
96
128
|
};
|
|
97
|
-
function
|
|
129
|
+
function _(e, t) {
|
|
98
130
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n, i = parseInt(r, 16);
|
|
99
131
|
return `rgba(${i >> 16 & 255}, ${i >> 8 & 255}, ${i & 255}, ${t})`;
|
|
100
132
|
}
|
|
101
|
-
var
|
|
102
|
-
let
|
|
103
|
-
if (!
|
|
104
|
-
let t =
|
|
133
|
+
var v = t(function({ variant: e = "primary", size: t = "md", className: n = "", style: r, ...i }, o) {
|
|
134
|
+
let s = m(), l = a(() => {
|
|
135
|
+
if (!s.enabled) return;
|
|
136
|
+
let t = s.colors.primary, n = s.colors.secondary, r = _(t, .1), i = _(t, .5), a = _(t, .5);
|
|
105
137
|
switch (e) {
|
|
106
138
|
case "primary": return {
|
|
107
139
|
backgroundColor: t,
|
|
@@ -127,8 +159,8 @@ var _ = t(function({ variant: e = "primary", size: t = "md", className: n = "",
|
|
|
127
159
|
"--tw-ring-color": a
|
|
128
160
|
};
|
|
129
161
|
}
|
|
130
|
-
}, [
|
|
131
|
-
return /* @__PURE__ */
|
|
162
|
+
}, [s, e]), u = s.enabled && e === "primary" ? "hover:brightness-110" : s.enabled && e === "outline" ? "hover:bg-[var(--hover-bg)] hover:border-[var(--hover-border)]" : s.enabled ? "hover:bg-[var(--hover-bg)]" : "";
|
|
163
|
+
return /* @__PURE__ */ c("button", {
|
|
132
164
|
ref: o,
|
|
133
165
|
className: [
|
|
134
166
|
"inline-flex items-center justify-center font-medium rounded-lg",
|
|
@@ -136,8 +168,8 @@ var _ = t(function({ variant: e = "primary", size: t = "md", className: n = "",
|
|
|
136
168
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
137
169
|
"disabled:opacity-50 disabled:pointer-events-none",
|
|
138
170
|
"select-none",
|
|
139
|
-
|
|
140
|
-
|
|
171
|
+
h[e],
|
|
172
|
+
g[t],
|
|
141
173
|
u,
|
|
142
174
|
n
|
|
143
175
|
].join(" "),
|
|
@@ -147,73 +179,80 @@ var _ = t(function({ variant: e = "primary", size: t = "md", className: n = "",
|
|
|
147
179
|
},
|
|
148
180
|
...i
|
|
149
181
|
});
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
blur: "sticky top-0 z-50 transition-all duration-300"
|
|
154
|
-
};
|
|
182
|
+
});
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/utils/utils.ts
|
|
155
185
|
function y(e, t) {
|
|
156
186
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n, i = parseInt(r, 16);
|
|
157
|
-
return
|
|
187
|
+
return [
|
|
188
|
+
i >> 16 & 255,
|
|
189
|
+
i >> 8 & 255,
|
|
190
|
+
i & 255,
|
|
191
|
+
t
|
|
192
|
+
];
|
|
158
193
|
}
|
|
159
|
-
|
|
160
|
-
|
|
194
|
+
function b(e) {
|
|
195
|
+
return `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]})`;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/components/Header.tsx
|
|
199
|
+
var x = {
|
|
200
|
+
default: "",
|
|
201
|
+
sticky: "sticky top-0 z-50",
|
|
202
|
+
hide: "transition-transform duration-300 absolute top-0 left-0"
|
|
203
|
+
}, S = {
|
|
204
|
+
default: "",
|
|
205
|
+
blur: "bg-white/10 backdrop-blur-sm"
|
|
206
|
+
}, C = t(function({ behaviour: e = "default", className: t = "", style: n, children: r, variant: s = "default", ...l }, u) {
|
|
207
|
+
let d = m(), [f, p] = o(!1), h = e === "hide" && f ? "-100%" : "0";
|
|
161
208
|
i(() => {
|
|
162
|
-
if (e !== "
|
|
209
|
+
if (e !== "hide") return;
|
|
163
210
|
let t = () => {
|
|
164
|
-
|
|
211
|
+
p(window.scrollY > 10);
|
|
165
212
|
};
|
|
166
213
|
return t(), window.addEventListener("scroll", t, { passive: !0 }), () => window.removeEventListener("scroll", t);
|
|
167
214
|
}, [e]);
|
|
168
|
-
let
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
borderBottom: `1px solid ${n}`,
|
|
174
|
-
boxShadow: i,
|
|
175
|
-
color: u.darkMode ? "#e8e4f0" : "#08060d"
|
|
176
|
-
} : {
|
|
177
|
-
backgroundColor: t,
|
|
178
|
-
borderBottom: e === "default" ? void 0 : `1px solid ${n}`,
|
|
179
|
-
color: u.darkMode ? "#e8e4f0" : "#08060d"
|
|
215
|
+
let g = a(() => {
|
|
216
|
+
if (d.enabled) return {
|
|
217
|
+
backgroundColor: d.darkMode ? d.darkColors.header.background : d.colors.header.background,
|
|
218
|
+
borderBottom: `1px solid ${d.darkMode ? d.darkColors.header.border : d.colors.header.border}`,
|
|
219
|
+
color: d.darkMode ? d.darkColors.text : d.colors.text
|
|
180
220
|
};
|
|
181
|
-
}, [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
d
|
|
185
|
-
]);
|
|
186
|
-
return /* @__PURE__ */ s("header", {
|
|
187
|
-
ref: l,
|
|
221
|
+
}, [d]);
|
|
222
|
+
return /* @__PURE__ */ c("header", {
|
|
223
|
+
ref: u,
|
|
188
224
|
className: [
|
|
189
|
-
"w-full px-
|
|
190
|
-
|
|
191
|
-
|
|
225
|
+
"w-full h-16 px-12 py-2 flex items-center justify-between shadow-md shadow-gray-500/25",
|
|
226
|
+
x[e],
|
|
227
|
+
S[s],
|
|
192
228
|
t
|
|
193
229
|
].join(" "),
|
|
194
230
|
style: {
|
|
195
|
-
...
|
|
196
|
-
...n
|
|
231
|
+
...g,
|
|
232
|
+
...n,
|
|
233
|
+
transform: `translateY(${h})`
|
|
197
234
|
},
|
|
198
|
-
...
|
|
235
|
+
...l,
|
|
199
236
|
children: r
|
|
200
237
|
});
|
|
201
|
-
}),
|
|
202
|
-
|
|
238
|
+
}), w = t(function({ className: e = "", style: t, alt: n = "", darkSrc: r, ...i }, a) {
|
|
239
|
+
let o = m().darkMode && r ? r : i.src;
|
|
240
|
+
return /* @__PURE__ */ c("div", {
|
|
203
241
|
className: "h-full flex items-center justify-center shrink-0",
|
|
204
|
-
children: /* @__PURE__ */
|
|
205
|
-
ref:
|
|
242
|
+
children: /* @__PURE__ */ c("img", {
|
|
243
|
+
ref: a,
|
|
206
244
|
alt: n,
|
|
207
|
-
className: "h-full max-h-
|
|
245
|
+
className: "h-full max-h-12 w-auto object-contain",
|
|
208
246
|
style: {
|
|
209
247
|
aspectRatio: "auto",
|
|
210
248
|
...t
|
|
211
249
|
},
|
|
212
|
-
...
|
|
250
|
+
...i,
|
|
251
|
+
src: o
|
|
213
252
|
})
|
|
214
253
|
});
|
|
215
|
-
}),
|
|
216
|
-
let o =
|
|
254
|
+
}), T = t(function({ className: e = "", style: t, children: n, ...r }, i) {
|
|
255
|
+
let o = m(), s = a(() => {
|
|
217
256
|
if (!o.enabled) return;
|
|
218
257
|
let e = y(o.colors.primary, .5);
|
|
219
258
|
return {
|
|
@@ -222,7 +261,7 @@ var b = t(function({ behaviour: e = "default", className: t = "", style: n, chil
|
|
|
222
261
|
"--hover-color": o.colors.primary
|
|
223
262
|
};
|
|
224
263
|
}, [o]), l = o.enabled ? "hover:text-[var(--hover-color)]" : "";
|
|
225
|
-
return /* @__PURE__ */
|
|
264
|
+
return /* @__PURE__ */ c("a", {
|
|
226
265
|
ref: i,
|
|
227
266
|
className: [
|
|
228
267
|
"inline-flex items-center justify-center",
|
|
@@ -236,99 +275,142 @@ var b = t(function({ behaviour: e = "default", className: t = "", style: n, chil
|
|
|
236
275
|
e
|
|
237
276
|
].join(" "),
|
|
238
277
|
style: {
|
|
239
|
-
...
|
|
278
|
+
...s,
|
|
240
279
|
...t
|
|
241
280
|
},
|
|
242
281
|
...r,
|
|
243
282
|
children: n
|
|
244
283
|
});
|
|
245
|
-
}),
|
|
246
|
-
Logo:
|
|
247
|
-
NavButton:
|
|
248
|
-
})
|
|
249
|
-
//#endregion
|
|
250
|
-
//#region src/components/Background.tsx
|
|
251
|
-
function w(e, t) {
|
|
252
|
-
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n, i = parseInt(r, 16);
|
|
253
|
-
return `rgba(${i >> 16 & 255}, ${i >> 8 & 255}, ${i & 255}, ${t})`;
|
|
254
|
-
}
|
|
255
|
-
var T = {
|
|
284
|
+
}), E = Object.assign(C, {
|
|
285
|
+
Logo: w,
|
|
286
|
+
NavButton: T
|
|
287
|
+
}), D = {
|
|
256
288
|
"dots-grid": (e, t) => ({
|
|
257
|
-
backgroundImage: `radial-gradient(${e}
|
|
289
|
+
backgroundImage: `radial-gradient(${e} 1.5px, transparent 1.5px)`,
|
|
258
290
|
backgroundSize: `${t}px ${t}px`
|
|
259
291
|
}),
|
|
260
|
-
"isometric
|
|
261
|
-
backgroundImage: `
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
292
|
+
"dots-isometric": (e, t) => ({
|
|
293
|
+
backgroundImage: `
|
|
294
|
+
radial-gradient(circle, ${e} 1px, transparent 1px),
|
|
295
|
+
radial-gradient(circle, ${e} 1px, transparent 1px)
|
|
296
|
+
`,
|
|
297
|
+
backgroundSize: `${t}px ${t * .866}px`,
|
|
298
|
+
backgroundPosition: `
|
|
299
|
+
0 0,
|
|
300
|
+
${t / 2}px ${t * .433}px
|
|
301
|
+
`
|
|
268
302
|
}),
|
|
269
|
-
|
|
270
|
-
backgroundImage: `linear-gradient(
|
|
303
|
+
grid: (e, t) => ({
|
|
304
|
+
backgroundImage: `linear-gradient(${e} 2px, transparent 2px), linear-gradient(90deg, ${e} 2px, transparent 2px)`,
|
|
271
305
|
backgroundSize: `${t}px ${t}px`
|
|
272
306
|
}),
|
|
273
|
-
|
|
274
|
-
|
|
307
|
+
diamond: (e, t) => {
|
|
308
|
+
let n = 2.2, r = `
|
|
309
|
+
<svg xmlns="http://www.w3.org/2000/svg"
|
|
310
|
+
width="${t}"
|
|
311
|
+
height="${t * .866}"
|
|
312
|
+
viewBox="0 0 ${t} ${t * .866}">
|
|
313
|
+
<polygon
|
|
314
|
+
points="
|
|
315
|
+
${t / 2},0
|
|
316
|
+
${t / 2 + n},${n}
|
|
317
|
+
${t / 2},${n * 2}
|
|
318
|
+
${t / 2 - n},${n}
|
|
319
|
+
"
|
|
320
|
+
fill="${e}"
|
|
321
|
+
/>
|
|
322
|
+
</svg>
|
|
323
|
+
`;
|
|
324
|
+
return {
|
|
325
|
+
backgroundImage: `url("data:image/svg+xml,${encodeURIComponent(r)}")`,
|
|
326
|
+
backgroundSize: `${t}px ${t * .866}px`
|
|
327
|
+
};
|
|
328
|
+
},
|
|
329
|
+
"grid-45": (e, t) => ({
|
|
330
|
+
backgroundImage: `
|
|
331
|
+
linear-gradient(
|
|
332
|
+
45deg,
|
|
333
|
+
transparent 49%,
|
|
334
|
+
${e} 49%,
|
|
335
|
+
${e} 51%,
|
|
336
|
+
transparent 51%
|
|
337
|
+
),
|
|
338
|
+
linear-gradient(
|
|
339
|
+
-45deg,
|
|
340
|
+
transparent 49%,
|
|
341
|
+
${e} 49%,
|
|
342
|
+
${e} 51%,
|
|
343
|
+
transparent 51%
|
|
344
|
+
)
|
|
345
|
+
`,
|
|
275
346
|
backgroundSize: `${t}px ${t}px`
|
|
276
347
|
}),
|
|
277
348
|
lines: (e, t) => ({
|
|
278
349
|
backgroundImage: `linear-gradient(${e} 1px, transparent 1px)`,
|
|
279
350
|
backgroundSize: `${t}px ${t}px`
|
|
280
|
-
}),
|
|
281
|
-
"falling-stars": (e, t) => ({
|
|
282
|
-
backgroundImage: `
|
|
283
|
-
radial-gradient(${e} 1px, transparent 1px),
|
|
284
|
-
radial-gradient(${e} 1px, transparent 1px),
|
|
285
|
-
radial-gradient(${e} 1.5px, transparent 1.5px),
|
|
286
|
-
radial-gradient(${e} 1px, transparent 1px)
|
|
287
|
-
`,
|
|
288
|
-
backgroundSize: `${t * 5}px ${t * 5}px, ${t * 3}px ${t * 3}px, ${t * 7}px ${t * 7}px, ${t * 4}px ${t * 4}px`,
|
|
289
|
-
backgroundPosition: `0 0, ${t}px ${t * 2}px, ${t * 3}px ${t}px, ${t * 2}px ${t * 4}px`,
|
|
290
|
-
animation: "falling-stars 20s linear infinite"
|
|
291
351
|
})
|
|
292
|
-
},
|
|
293
|
-
|
|
352
|
+
}, O = {
|
|
353
|
+
"fade-in": () => ({
|
|
354
|
+
maskImage: "\n radial-gradient(\n ellipse at center,\n rgba(0, 0, 0, 0.7) 0%,\n rgba(0, 0, 0, 0) 75%\n )\n ",
|
|
355
|
+
WebkitMaskImage: "\n radial-gradient(\n ellipse at center,\n rgba(0, 0, 0, 0.7) 0%,\n rgba(0, 0, 0, 0) 75%\n )\n ",
|
|
356
|
+
maskSize: "100% 100%",
|
|
357
|
+
WebkitMaskSize: "100% 100%",
|
|
358
|
+
maskRepeat: "no-repeat",
|
|
359
|
+
WebkitMaskRepeat: "no-repeat"
|
|
360
|
+
}),
|
|
361
|
+
"fade-out": () => ({
|
|
362
|
+
maskImage: "\n radial-gradient(\n ellipse at center,\n rgba(0, 0, 0, 0) 40%,\n rgba(0, 0, 0, 0.6) 100%\n )\n ",
|
|
363
|
+
WebkitMaskImage: "\n radial-gradient(\n ellipse at center,\n rgba(0, 0, 0, 0) 40%,\n rgba(0, 0, 0, 0.6) 100%\n )\n ",
|
|
364
|
+
maskSize: "100% 100%",
|
|
365
|
+
WebkitMaskSize: "100% 100%",
|
|
366
|
+
maskRepeat: "no-repeat",
|
|
367
|
+
WebkitMaskRepeat: "no-repeat"
|
|
368
|
+
}),
|
|
369
|
+
none: () => ({})
|
|
370
|
+
}, k = t(function({ variant: e = "dots-grid", mask: t = "none", color: n, size: r = 24, className: i = "", style: o, children: s, ...u }, d) {
|
|
371
|
+
let f = m(), p = a(() => n || (f.enabled ? b(y(f.colors.primary, .25)) : "rgba(170, 59, 255, 0.25)"), [n, f]), h = a(() => ({
|
|
372
|
+
...D[e](p, r),
|
|
373
|
+
...O[t]()
|
|
374
|
+
}), [
|
|
294
375
|
e,
|
|
295
|
-
|
|
296
|
-
|
|
376
|
+
t,
|
|
377
|
+
p,
|
|
378
|
+
r
|
|
297
379
|
]);
|
|
298
|
-
return /* @__PURE__ */
|
|
299
|
-
ref:
|
|
300
|
-
className: ["w-full h-full relative overflow-hidden",
|
|
301
|
-
style:
|
|
302
|
-
...
|
|
303
|
-
children: [/* @__PURE__ */
|
|
380
|
+
return /* @__PURE__ */ l("div", {
|
|
381
|
+
ref: d,
|
|
382
|
+
className: ["w-full h-full relative overflow-hidden flex flex-col", i].join(" "),
|
|
383
|
+
style: o,
|
|
384
|
+
...u,
|
|
385
|
+
children: [/* @__PURE__ */ c("div", {
|
|
304
386
|
"aria-hidden": !0,
|
|
305
387
|
className: "absolute inset-0 -z-10 pointer-events-none",
|
|
306
|
-
style:
|
|
307
|
-
}),
|
|
388
|
+
style: h
|
|
389
|
+
}), s]
|
|
308
390
|
});
|
|
309
|
-
}),
|
|
310
|
-
let d =
|
|
391
|
+
}), A = t(function({ variant: e = "line", orientation: t = "horizontal", color: n, thickness: r = 1, spacing: i = 16, className: o = "", style: s, ...l }, u) {
|
|
392
|
+
let d = m(), f = a(() => n || (d.enabled && d.darkMode ? "#2a2535" : "#e5e4e7"), [n, d]), p = t === "horizontal";
|
|
311
393
|
if (e === "point") {
|
|
312
|
-
let e =
|
|
394
|
+
let e = p ? {
|
|
313
395
|
paddingTop: i,
|
|
314
396
|
paddingBottom: i
|
|
315
397
|
} : {
|
|
316
398
|
paddingLeft: i,
|
|
317
399
|
paddingRight: i
|
|
318
400
|
};
|
|
319
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ c("div", {
|
|
320
402
|
ref: u,
|
|
321
403
|
className: [
|
|
322
404
|
"flex items-center justify-center shrink-0",
|
|
323
|
-
|
|
405
|
+
p ? "w-full" : "h-full",
|
|
324
406
|
o
|
|
325
407
|
].join(" "),
|
|
326
408
|
style: {
|
|
327
409
|
...e,
|
|
328
|
-
...
|
|
410
|
+
...s
|
|
329
411
|
},
|
|
330
412
|
...l,
|
|
331
|
-
children: /* @__PURE__ */
|
|
413
|
+
children: /* @__PURE__ */ c("span", {
|
|
332
414
|
"aria-hidden": !0,
|
|
333
415
|
className: "rounded-full shrink-0",
|
|
334
416
|
style: {
|
|
@@ -339,7 +421,7 @@ var T = {
|
|
|
339
421
|
})
|
|
340
422
|
});
|
|
341
423
|
}
|
|
342
|
-
let h =
|
|
424
|
+
let h = p ? {
|
|
343
425
|
height: r,
|
|
344
426
|
backgroundColor: f,
|
|
345
427
|
marginTop: i,
|
|
@@ -350,52 +432,52 @@ var T = {
|
|
|
350
432
|
marginLeft: i,
|
|
351
433
|
marginRight: i
|
|
352
434
|
};
|
|
353
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ c("div", {
|
|
354
436
|
ref: u,
|
|
355
437
|
role: "separator",
|
|
356
438
|
"aria-orientation": t,
|
|
357
439
|
className: [
|
|
358
440
|
"shrink-0",
|
|
359
|
-
|
|
441
|
+
p ? "w-full" : "h-full",
|
|
360
442
|
o
|
|
361
443
|
].join(" "),
|
|
362
444
|
style: {
|
|
363
445
|
...h,
|
|
364
|
-
...
|
|
446
|
+
...s
|
|
365
447
|
},
|
|
366
448
|
...l
|
|
367
449
|
});
|
|
368
|
-
}),
|
|
450
|
+
}), j = {
|
|
369
451
|
sm: "h-8 px-3 text-sm",
|
|
370
452
|
md: "h-10 px-4 text-base",
|
|
371
453
|
lg: "h-12 px-5 text-lg"
|
|
372
|
-
},
|
|
454
|
+
}, M = {
|
|
373
455
|
sm: "pl-9 pr-3",
|
|
374
456
|
md: "pl-11 pr-4",
|
|
375
457
|
lg: "pl-13 pr-5"
|
|
376
|
-
},
|
|
458
|
+
}, N = {
|
|
377
459
|
sm: "pl-3 pr-9",
|
|
378
460
|
md: "pl-4 pr-11",
|
|
379
461
|
lg: "pl-5 pr-13"
|
|
380
|
-
},
|
|
462
|
+
}, P = {
|
|
381
463
|
sm: "pl-9 pr-9",
|
|
382
464
|
md: "pl-11 pr-11",
|
|
383
465
|
lg: "pl-13 pr-13"
|
|
384
|
-
},
|
|
466
|
+
}, F = {
|
|
385
467
|
sm: "w-4 h-4 left-2.5",
|
|
386
468
|
md: "w-5 h-5 left-3",
|
|
387
469
|
lg: "w-6 h-6 left-4"
|
|
388
|
-
},
|
|
470
|
+
}, I = {
|
|
389
471
|
sm: "w-4 h-4 right-2.5",
|
|
390
472
|
md: "w-5 h-5 right-3",
|
|
391
473
|
lg: "w-6 h-6 right-4"
|
|
392
474
|
};
|
|
393
|
-
function
|
|
475
|
+
function L(e, t) {
|
|
394
476
|
let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n, i = parseInt(r, 16);
|
|
395
477
|
return `rgba(${i >> 16 & 255}, ${i >> 8 & 255}, ${i & 255}, ${t})`;
|
|
396
478
|
}
|
|
397
|
-
var
|
|
398
|
-
let h =
|
|
479
|
+
var R = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, leftIcon: r, rightIcon: i, className: o = "", wrapperClassName: s = "", style: u, disabled: d, ...f }, p) {
|
|
480
|
+
let h = m(), g = a(() => {
|
|
399
481
|
if (!h.enabled) return;
|
|
400
482
|
let t = h.colors.primary, r = h.darkMode ? "#2a2535" : "#e5e4e7", i = h.darkMode ? "#14111f" : "#f5f5f7", a = "#ef4444", o = { borderRadius: e === "underline" ? 0 : 8 };
|
|
401
483
|
switch (e) {
|
|
@@ -404,21 +486,21 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
404
486
|
backgroundColor: i,
|
|
405
487
|
borderBottom: `2px solid ${n ? a : "transparent"}`,
|
|
406
488
|
"--focus-border": n ? a : t,
|
|
407
|
-
"--ring-color":
|
|
489
|
+
"--ring-color": L(n ? a : t, .5)
|
|
408
490
|
};
|
|
409
491
|
case "underline": return {
|
|
410
492
|
...o,
|
|
411
493
|
backgroundColor: "transparent",
|
|
412
494
|
borderBottom: `1.5px solid ${n ? a : r}`,
|
|
413
495
|
"--focus-border": n ? a : t,
|
|
414
|
-
"--ring-color":
|
|
496
|
+
"--ring-color": L(n ? a : t, .5)
|
|
415
497
|
};
|
|
416
498
|
default: return {
|
|
417
499
|
...o,
|
|
418
500
|
backgroundColor: h.darkMode ? "#0b0912" : "#ffffff",
|
|
419
501
|
border: `1px solid ${n ? a : r}`,
|
|
420
502
|
"--focus-border": n ? a : t,
|
|
421
|
-
"--ring-color":
|
|
503
|
+
"--ring-color": L(n ? a : t, .5)
|
|
422
504
|
};
|
|
423
505
|
}
|
|
424
506
|
}, [
|
|
@@ -437,27 +519,27 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
437
519
|
h,
|
|
438
520
|
e,
|
|
439
521
|
n
|
|
440
|
-
]), v = r && i ?
|
|
522
|
+
]), v = r && i ? P[t] : r ? M[t] : i ? N[t] : j[t], y = e === "underline" ? "bg-transparent rounded-none" : "rounded-lg", b = a(() => h.enabled ? {
|
|
441
523
|
color: h.darkMode ? "#e8e4f0" : "#08060d",
|
|
442
|
-
"--placeholder-color":
|
|
524
|
+
"--placeholder-color": L(h.darkMode ? "#908a9e" : "#706a7c", 1),
|
|
443
525
|
backgroundColor: "transparent"
|
|
444
526
|
} : void 0, [h]), x = h.enabled ? "placeholder:text-[color:var(--placeholder-color)]" : "placeholder:text-text-muted";
|
|
445
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ l("div", {
|
|
446
528
|
className: [
|
|
447
529
|
"relative w-full flex items-center",
|
|
448
530
|
_,
|
|
449
531
|
d ? "opacity-50 cursor-not-allowed" : "",
|
|
450
|
-
|
|
532
|
+
s
|
|
451
533
|
].join(" "),
|
|
452
534
|
style: g,
|
|
453
535
|
children: [
|
|
454
|
-
r && /* @__PURE__ */
|
|
536
|
+
r && /* @__PURE__ */ c("span", {
|
|
455
537
|
"aria-hidden": !0,
|
|
456
|
-
className: ["absolute text-text-muted pointer-events-none shrink-0",
|
|
538
|
+
className: ["absolute text-text-muted pointer-events-none shrink-0", F[t]].join(" "),
|
|
457
539
|
children: r
|
|
458
540
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
ref:
|
|
541
|
+
/* @__PURE__ */ c("input", {
|
|
542
|
+
ref: p,
|
|
461
543
|
disabled: d,
|
|
462
544
|
className: [
|
|
463
545
|
"w-full h-full outline-none bg-transparent font-normal",
|
|
@@ -474,14 +556,14 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
474
556
|
},
|
|
475
557
|
...f
|
|
476
558
|
}),
|
|
477
|
-
i && /* @__PURE__ */
|
|
559
|
+
i && /* @__PURE__ */ c("span", {
|
|
478
560
|
"aria-hidden": !0,
|
|
479
|
-
className: ["absolute text-text-muted pointer-events-none shrink-0",
|
|
561
|
+
className: ["absolute text-text-muted pointer-events-none shrink-0", I[t]].join(" "),
|
|
480
562
|
children: i
|
|
481
563
|
})
|
|
482
564
|
]
|
|
483
565
|
});
|
|
484
|
-
}),
|
|
566
|
+
}), z = (e) => typeof e == "string" && e.trim() !== "" && !isNaN(Number(e)), B = (e) => typeof e == "number" ? isNaN(e) ? null : e : z(e) ? Number(e) : null, V = {
|
|
485
567
|
email: () => (e) => {
|
|
486
568
|
let t = String(e ?? "");
|
|
487
569
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t) ? {
|
|
@@ -503,7 +585,7 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
503
585
|
};
|
|
504
586
|
},
|
|
505
587
|
min: (e) => (t) => {
|
|
506
|
-
let n =
|
|
588
|
+
let n = B(t);
|
|
507
589
|
return n === null ? String(t ?? "").length >= e ? {
|
|
508
590
|
valid: !0,
|
|
509
591
|
message: ""
|
|
@@ -519,7 +601,7 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
519
601
|
};
|
|
520
602
|
},
|
|
521
603
|
max: (e) => (t) => {
|
|
522
|
-
let n =
|
|
604
|
+
let n = B(t);
|
|
523
605
|
return n === null ? String(t ?? "").length <= e ? {
|
|
524
606
|
valid: !0,
|
|
525
607
|
message: ""
|
|
@@ -534,7 +616,7 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
534
616
|
message: `El valor debe ser menor o igual a ${e}`
|
|
535
617
|
};
|
|
536
618
|
}
|
|
537
|
-
},
|
|
619
|
+
}, H = class e {
|
|
538
620
|
checks = [];
|
|
539
621
|
add(e) {
|
|
540
622
|
return this.checks.push(e), this;
|
|
@@ -552,16 +634,16 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
552
634
|
return new e().max(t);
|
|
553
635
|
}
|
|
554
636
|
email() {
|
|
555
|
-
return this.add(
|
|
637
|
+
return this.add(V.email());
|
|
556
638
|
}
|
|
557
639
|
onlyNumbers() {
|
|
558
|
-
return this.add(
|
|
640
|
+
return this.add(V.onlyNumbers());
|
|
559
641
|
}
|
|
560
642
|
min(e) {
|
|
561
|
-
return this.add(
|
|
643
|
+
return this.add(V.min(e));
|
|
562
644
|
}
|
|
563
645
|
max(e) {
|
|
564
|
-
return this.add(
|
|
646
|
+
return this.add(V.max(e));
|
|
565
647
|
}
|
|
566
648
|
validate(e) {
|
|
567
649
|
for (let t of this.checks) {
|
|
@@ -573,8 +655,26 @@ var F = t(function({ variant: e = "default", Isize: t = "md", error: n = !1, lef
|
|
|
573
655
|
message: ""
|
|
574
656
|
};
|
|
575
657
|
}
|
|
658
|
+
}, U = ({ children: e }) => {
|
|
659
|
+
let [t, n] = o(!1);
|
|
660
|
+
return i(() => {
|
|
661
|
+
let e = () => {
|
|
662
|
+
let e = window.innerHeight > window.innerWidth;
|
|
663
|
+
n(e);
|
|
664
|
+
};
|
|
665
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
666
|
+
}, []), t ? /* @__PURE__ */ c(s, { children: e }) : null;
|
|
667
|
+
}, W = ({ children: e }) => {
|
|
668
|
+
let [t, n] = o(!1);
|
|
669
|
+
return i(() => {
|
|
670
|
+
let e = () => {
|
|
671
|
+
let e = window.innerHeight > window.innerWidth;
|
|
672
|
+
n(!e);
|
|
673
|
+
};
|
|
674
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
675
|
+
}, []), t ? /* @__PURE__ */ c(s, { children: e }) : null;
|
|
576
676
|
};
|
|
577
677
|
//#endregion
|
|
578
|
-
export {
|
|
678
|
+
export { k as Background, v as Button, W as DesktopOnly, E as Header, R as Input, U as MobileOnly, A as Separator, p as ThemeProvider, H as Validate, u as themeConfig, m as useTheme, V as validators };
|
|
579
679
|
|
|
580
680
|
//# sourceMappingURL=unicornial-ui.es.js.map
|