@sudobility/design-components 1.0.8
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/aurora-background.d.ts +33 -0
- package/dist/aurora-background.d.ts.map +1 -0
- package/dist/badge-designer.d.ts +33 -0
- package/dist/badge-designer.d.ts.map +1 -0
- package/dist/color-picker-advanced.d.ts +8 -0
- package/dist/color-picker-advanced.d.ts.map +1 -0
- package/dist/color-picker.d.ts +42 -0
- package/dist/color-picker.d.ts.map +1 -0
- package/dist/color-swatch.d.ts +41 -0
- package/dist/color-swatch.d.ts.map +1 -0
- package/dist/gradient-banner.d.ts +47 -0
- package/dist/gradient-banner.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +638 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +7 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/neumorphic-button.d.ts +33 -0
- package/dist/neumorphic-button.d.ts.map +1 -0
- package/dist/theme-switcher.d.ts +33 -0
- package/dist/theme-switcher.d.ts.map +1 -0
- package/package.json +52 -0
- package/src/aurora-background.tsx +60 -0
- package/src/badge-designer.tsx +60 -0
- package/src/color-picker-advanced.tsx +51 -0
- package/src/color-picker.tsx +188 -0
- package/src/color-swatch.tsx +151 -0
- package/src/gradient-banner.tsx +106 -0
- package/src/index.ts +16 -0
- package/src/neumorphic-button.tsx +60 -0
- package/src/theme-switcher.tsx +60 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
import te, { useState as D } from "react";
|
|
2
|
+
import { cn as h } from "@sudobility/components";
|
|
3
|
+
var T = { exports: {} }, C = {};
|
|
4
|
+
var W;
|
|
5
|
+
function ae() {
|
|
6
|
+
if (W) return C;
|
|
7
|
+
W = 1;
|
|
8
|
+
var a = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
9
|
+
function o(c, u, g) {
|
|
10
|
+
var m = null;
|
|
11
|
+
if (g !== void 0 && (m = "" + g), u.key !== void 0 && (m = "" + u.key), "key" in u) {
|
|
12
|
+
g = {};
|
|
13
|
+
for (var b in u)
|
|
14
|
+
b !== "key" && (g[b] = u[b]);
|
|
15
|
+
} else g = u;
|
|
16
|
+
return u = g.ref, {
|
|
17
|
+
$$typeof: a,
|
|
18
|
+
type: c,
|
|
19
|
+
key: m,
|
|
20
|
+
ref: u !== void 0 ? u : null,
|
|
21
|
+
props: g
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return C.Fragment = l, C.jsx = o, C.jsxs = o, C;
|
|
25
|
+
}
|
|
26
|
+
var R = {};
|
|
27
|
+
var z;
|
|
28
|
+
function oe() {
|
|
29
|
+
return z || (z = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
+
function a(e) {
|
|
31
|
+
if (e == null) return null;
|
|
32
|
+
if (typeof e == "function")
|
|
33
|
+
return e.$$typeof === K ? null : e.displayName || e.name || null;
|
|
34
|
+
if (typeof e == "string") return e;
|
|
35
|
+
switch (e) {
|
|
36
|
+
case x:
|
|
37
|
+
return "Fragment";
|
|
38
|
+
case A:
|
|
39
|
+
return "Profiler";
|
|
40
|
+
case _:
|
|
41
|
+
return "StrictMode";
|
|
42
|
+
case X:
|
|
43
|
+
return "Suspense";
|
|
44
|
+
case H:
|
|
45
|
+
return "SuspenseList";
|
|
46
|
+
case Q:
|
|
47
|
+
return "Activity";
|
|
48
|
+
}
|
|
49
|
+
if (typeof e == "object")
|
|
50
|
+
switch (typeof e.tag == "number" && console.error(
|
|
51
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
|
+
), e.$$typeof) {
|
|
53
|
+
case s:
|
|
54
|
+
return "Portal";
|
|
55
|
+
case J:
|
|
56
|
+
return e.displayName || "Context";
|
|
57
|
+
case P:
|
|
58
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
|
+
case G:
|
|
60
|
+
var t = e.render;
|
|
61
|
+
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
62
|
+
case Z:
|
|
63
|
+
return t = e.displayName || null, t !== null ? t : a(e.type) || "Memo";
|
|
64
|
+
case S:
|
|
65
|
+
t = e._payload, e = e._init;
|
|
66
|
+
try {
|
|
67
|
+
return a(e(t));
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function l(e) {
|
|
74
|
+
return "" + e;
|
|
75
|
+
}
|
|
76
|
+
function o(e) {
|
|
77
|
+
try {
|
|
78
|
+
l(e);
|
|
79
|
+
var t = !1;
|
|
80
|
+
} catch {
|
|
81
|
+
t = !0;
|
|
82
|
+
}
|
|
83
|
+
if (t) {
|
|
84
|
+
t = console;
|
|
85
|
+
var i = t.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
86
|
+
return i.call(
|
|
87
|
+
t,
|
|
88
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
+
d
|
|
90
|
+
), l(e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function c(e) {
|
|
94
|
+
if (e === x) return "<>";
|
|
95
|
+
if (typeof e == "object" && e !== null && e.$$typeof === S)
|
|
96
|
+
return "<...>";
|
|
97
|
+
try {
|
|
98
|
+
var t = a(e);
|
|
99
|
+
return t ? "<" + t + ">" : "<...>";
|
|
100
|
+
} catch {
|
|
101
|
+
return "<...>";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function u() {
|
|
105
|
+
var e = O.A;
|
|
106
|
+
return e === null ? null : e.getOwner();
|
|
107
|
+
}
|
|
108
|
+
function g() {
|
|
109
|
+
return Error("react-stack-top-frame");
|
|
110
|
+
}
|
|
111
|
+
function m(e) {
|
|
112
|
+
if (I.call(e, "key")) {
|
|
113
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
114
|
+
if (t && t.isReactWarning) return !1;
|
|
115
|
+
}
|
|
116
|
+
return e.key !== void 0;
|
|
117
|
+
}
|
|
118
|
+
function b(e, t) {
|
|
119
|
+
function i() {
|
|
120
|
+
Y || (Y = !0, console.error(
|
|
121
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
+
t
|
|
123
|
+
));
|
|
124
|
+
}
|
|
125
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
126
|
+
get: i,
|
|
127
|
+
configurable: !0
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function p() {
|
|
131
|
+
var e = a(this.type);
|
|
132
|
+
return L[e] || (L[e] = !0, console.error(
|
|
133
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
135
|
+
}
|
|
136
|
+
function v(e, t, i, d, N, F) {
|
|
137
|
+
var f = i.ref;
|
|
138
|
+
return e = {
|
|
139
|
+
$$typeof: k,
|
|
140
|
+
type: e,
|
|
141
|
+
key: t,
|
|
142
|
+
props: i,
|
|
143
|
+
_owner: d
|
|
144
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
145
|
+
enumerable: !1,
|
|
146
|
+
get: p
|
|
147
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
148
|
+
configurable: !1,
|
|
149
|
+
enumerable: !1,
|
|
150
|
+
writable: !0,
|
|
151
|
+
value: 0
|
|
152
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
153
|
+
configurable: !1,
|
|
154
|
+
enumerable: !1,
|
|
155
|
+
writable: !0,
|
|
156
|
+
value: null
|
|
157
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
158
|
+
configurable: !1,
|
|
159
|
+
enumerable: !1,
|
|
160
|
+
writable: !0,
|
|
161
|
+
value: N
|
|
162
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
163
|
+
configurable: !1,
|
|
164
|
+
enumerable: !1,
|
|
165
|
+
writable: !0,
|
|
166
|
+
value: F
|
|
167
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
|
+
}
|
|
169
|
+
function y(e, t, i, d, N, F) {
|
|
170
|
+
var f = t.children;
|
|
171
|
+
if (f !== void 0)
|
|
172
|
+
if (d)
|
|
173
|
+
if (ee(f)) {
|
|
174
|
+
for (d = 0; d < f.length; d++)
|
|
175
|
+
w(f[d]);
|
|
176
|
+
Object.freeze && Object.freeze(f);
|
|
177
|
+
} else
|
|
178
|
+
console.error(
|
|
179
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
|
+
);
|
|
181
|
+
else w(f);
|
|
182
|
+
if (I.call(t, "key")) {
|
|
183
|
+
f = a(e);
|
|
184
|
+
var j = Object.keys(t).filter(function(re) {
|
|
185
|
+
return re !== "key";
|
|
186
|
+
});
|
|
187
|
+
d = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", V[f + d] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
189
|
+
let props = %s;
|
|
190
|
+
<%s {...props} />
|
|
191
|
+
React keys must be passed directly to JSX without using spread:
|
|
192
|
+
let props = %s;
|
|
193
|
+
<%s key={someKey} {...props} />`,
|
|
194
|
+
d,
|
|
195
|
+
f,
|
|
196
|
+
j,
|
|
197
|
+
f
|
|
198
|
+
), V[f + d] = !0);
|
|
199
|
+
}
|
|
200
|
+
if (f = null, i !== void 0 && (o(i), f = "" + i), m(t) && (o(t.key), f = "" + t.key), "key" in t) {
|
|
201
|
+
i = {};
|
|
202
|
+
for (var $ in t)
|
|
203
|
+
$ !== "key" && (i[$] = t[$]);
|
|
204
|
+
} else i = t;
|
|
205
|
+
return f && b(
|
|
206
|
+
i,
|
|
207
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
+
), v(
|
|
209
|
+
e,
|
|
210
|
+
f,
|
|
211
|
+
i,
|
|
212
|
+
u(),
|
|
213
|
+
N,
|
|
214
|
+
F
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
function w(e) {
|
|
218
|
+
E(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === S && (e._payload.status === "fulfilled" ? E(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
219
|
+
}
|
|
220
|
+
function E(e) {
|
|
221
|
+
return typeof e == "object" && e !== null && e.$$typeof === k;
|
|
222
|
+
}
|
|
223
|
+
var n = te, k = Symbol.for("react.transitional.element"), s = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), J = Symbol.for("react.context"), G = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), O = n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = Object.prototype.hasOwnProperty, ee = Array.isArray, U = console.createTask ? console.createTask : function() {
|
|
224
|
+
return null;
|
|
225
|
+
};
|
|
226
|
+
n = {
|
|
227
|
+
react_stack_bottom_frame: function(e) {
|
|
228
|
+
return e();
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var Y, L = {}, B = n.react_stack_bottom_frame.bind(
|
|
232
|
+
n,
|
|
233
|
+
g
|
|
234
|
+
)(), M = U(c(g)), V = {};
|
|
235
|
+
R.Fragment = x, R.jsx = function(e, t, i) {
|
|
236
|
+
var d = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return y(
|
|
238
|
+
e,
|
|
239
|
+
t,
|
|
240
|
+
i,
|
|
241
|
+
!1,
|
|
242
|
+
d ? Error("react-stack-top-frame") : B,
|
|
243
|
+
d ? U(c(e)) : M
|
|
244
|
+
);
|
|
245
|
+
}, R.jsxs = function(e, t, i) {
|
|
246
|
+
var d = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return y(
|
|
248
|
+
e,
|
|
249
|
+
t,
|
|
250
|
+
i,
|
|
251
|
+
!0,
|
|
252
|
+
d ? Error("react-stack-top-frame") : B,
|
|
253
|
+
d ? U(c(e)) : M
|
|
254
|
+
);
|
|
255
|
+
};
|
|
256
|
+
})()), R;
|
|
257
|
+
}
|
|
258
|
+
var q;
|
|
259
|
+
function ne() {
|
|
260
|
+
return q || (q = 1, process.env.NODE_ENV === "production" ? T.exports = ae() : T.exports = oe()), T.exports;
|
|
261
|
+
}
|
|
262
|
+
var r = ne();
|
|
263
|
+
const ie = ({
|
|
264
|
+
className: a,
|
|
265
|
+
children: l,
|
|
266
|
+
disabled: o = !1,
|
|
267
|
+
onClick: c
|
|
268
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
269
|
+
"div",
|
|
270
|
+
{
|
|
271
|
+
className: h(
|
|
272
|
+
"p-4 rounded-lg border transition-colors",
|
|
273
|
+
"bg-white dark:bg-gray-900",
|
|
274
|
+
"border-gray-200 dark:border-gray-700",
|
|
275
|
+
"text-gray-900 dark:text-white",
|
|
276
|
+
o && "opacity-50 cursor-not-allowed",
|
|
277
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
278
|
+
a
|
|
279
|
+
),
|
|
280
|
+
onClick: o ? void 0 : c,
|
|
281
|
+
role: "region",
|
|
282
|
+
"aria-label": "UauroraUbackground",
|
|
283
|
+
children: l || "UauroraUbackground Component"
|
|
284
|
+
}
|
|
285
|
+
), ce = ({
|
|
286
|
+
className: a,
|
|
287
|
+
children: l,
|
|
288
|
+
disabled: o = !1,
|
|
289
|
+
onClick: c
|
|
290
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
291
|
+
"div",
|
|
292
|
+
{
|
|
293
|
+
className: h(
|
|
294
|
+
"p-4 rounded-lg border transition-colors",
|
|
295
|
+
"bg-white dark:bg-gray-900",
|
|
296
|
+
"border-gray-200 dark:border-gray-700",
|
|
297
|
+
"text-gray-900 dark:text-white",
|
|
298
|
+
o && "opacity-50 cursor-not-allowed",
|
|
299
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
300
|
+
a
|
|
301
|
+
),
|
|
302
|
+
onClick: o ? void 0 : c,
|
|
303
|
+
role: "region",
|
|
304
|
+
"aria-label": "UbadgeUdesigner",
|
|
305
|
+
children: l || "UbadgeUdesigner Component"
|
|
306
|
+
}
|
|
307
|
+
), ue = ({
|
|
308
|
+
value: a,
|
|
309
|
+
onChange: l,
|
|
310
|
+
presets: o,
|
|
311
|
+
className: c
|
|
312
|
+
}) => {
|
|
313
|
+
const g = o || [
|
|
314
|
+
"#000000",
|
|
315
|
+
"#ffffff",
|
|
316
|
+
"#ff0000",
|
|
317
|
+
"#00ff00",
|
|
318
|
+
"#0000ff",
|
|
319
|
+
"#ffff00",
|
|
320
|
+
"#ff00ff",
|
|
321
|
+
"#00ffff"
|
|
322
|
+
];
|
|
323
|
+
return /* @__PURE__ */ r.jsxs("div", { className: h("space-y-3", c), children: [
|
|
324
|
+
/* @__PURE__ */ r.jsx(
|
|
325
|
+
"input",
|
|
326
|
+
{
|
|
327
|
+
type: "color",
|
|
328
|
+
value: a,
|
|
329
|
+
onChange: (m) => l(m.target.value),
|
|
330
|
+
className: "w-full h-12 rounded cursor-pointer"
|
|
331
|
+
}
|
|
332
|
+
),
|
|
333
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-8 gap-2", children: g.map((m) => /* @__PURE__ */ r.jsx(
|
|
334
|
+
"button",
|
|
335
|
+
{
|
|
336
|
+
onClick: () => l(m),
|
|
337
|
+
className: h(
|
|
338
|
+
"w-8 h-8 rounded border-2",
|
|
339
|
+
a === m ? "border-blue-500" : "border-transparent"
|
|
340
|
+
),
|
|
341
|
+
style: { backgroundColor: m }
|
|
342
|
+
},
|
|
343
|
+
m
|
|
344
|
+
)) })
|
|
345
|
+
] });
|
|
346
|
+
}, de = ({
|
|
347
|
+
value: a,
|
|
348
|
+
onChange: l,
|
|
349
|
+
presets: o = [
|
|
350
|
+
"#000000",
|
|
351
|
+
"#FFFFFF",
|
|
352
|
+
"#FF6B6B",
|
|
353
|
+
"#4ECDC4",
|
|
354
|
+
"#45B7D1",
|
|
355
|
+
"#FFA07A",
|
|
356
|
+
"#F7DC6F",
|
|
357
|
+
"#BB8FCE",
|
|
358
|
+
"#85C1E2",
|
|
359
|
+
"#F8B500",
|
|
360
|
+
"#52B788",
|
|
361
|
+
"#E63946",
|
|
362
|
+
"#1D3557",
|
|
363
|
+
"#457B9D",
|
|
364
|
+
"#A8DADC",
|
|
365
|
+
"#F4A261",
|
|
366
|
+
"#264653",
|
|
367
|
+
"#2A9D8F"
|
|
368
|
+
],
|
|
369
|
+
showInput: c = !0,
|
|
370
|
+
showOpacity: u = !1,
|
|
371
|
+
className: g
|
|
372
|
+
}) => {
|
|
373
|
+
const [m, b] = D(a), [p, v] = D(100), y = (s) => {
|
|
374
|
+
l(s), b(s);
|
|
375
|
+
}, w = (s) => {
|
|
376
|
+
const x = s.target.value;
|
|
377
|
+
b(x), /^#[0-9A-F]{6}$/i.test(x) && l(x);
|
|
378
|
+
}, E = (s) => {
|
|
379
|
+
v(Number(s.target.value));
|
|
380
|
+
}, k = u ? ((s, x) => {
|
|
381
|
+
const _ = parseInt(s.slice(1, 3), 16), A = parseInt(s.slice(3, 5), 16), P = parseInt(s.slice(5, 7), 16);
|
|
382
|
+
return `rgba(${_}, ${A}, ${P}, ${x / 100})`;
|
|
383
|
+
})(a, p) : a;
|
|
384
|
+
return /* @__PURE__ */ r.jsxs("div", { className: h("bg-white dark:bg-gray-900 rounded-lg p-4", g), children: [
|
|
385
|
+
/* @__PURE__ */ r.jsx("div", { className: "mb-4", children: /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
386
|
+
/* @__PURE__ */ r.jsx(
|
|
387
|
+
"div",
|
|
388
|
+
{
|
|
389
|
+
className: "w-16 h-16 rounded-lg border-2 border-gray-200 dark:border-gray-700 shadow-sm",
|
|
390
|
+
style: { backgroundColor: k }
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex-1", children: [
|
|
394
|
+
/* @__PURE__ */ r.jsx("p", { className: "text-sm font-medium text-gray-900 dark:text-white", children: "Selected Color" }),
|
|
395
|
+
/* @__PURE__ */ r.jsxs("p", { className: "text-xs text-gray-600 dark:text-gray-400 mt-1 font-mono", children: [
|
|
396
|
+
a,
|
|
397
|
+
u && ` (${p}%)`
|
|
398
|
+
] })
|
|
399
|
+
] })
|
|
400
|
+
] }) }),
|
|
401
|
+
/* @__PURE__ */ r.jsxs("div", { className: "mb-4", children: [
|
|
402
|
+
/* @__PURE__ */ r.jsx("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Preset Colors" }),
|
|
403
|
+
/* @__PURE__ */ r.jsx("div", { className: "grid grid-cols-6 gap-2", children: o.map((s) => /* @__PURE__ */ r.jsx(
|
|
404
|
+
"button",
|
|
405
|
+
{
|
|
406
|
+
onClick: () => y(s),
|
|
407
|
+
className: h(
|
|
408
|
+
"w-full aspect-square rounded-md border-2 transition-all hover:scale-110",
|
|
409
|
+
s === a ? "border-blue-500 dark:border-blue-400 ring-2 ring-blue-200 dark:ring-blue-800" : "border-gray-200 dark:border-gray-700"
|
|
410
|
+
),
|
|
411
|
+
style: { backgroundColor: s },
|
|
412
|
+
"aria-label": `Select color ${s}`
|
|
413
|
+
},
|
|
414
|
+
s
|
|
415
|
+
)) })
|
|
416
|
+
] }),
|
|
417
|
+
c && /* @__PURE__ */ r.jsxs("div", { className: "mb-4", children: [
|
|
418
|
+
/* @__PURE__ */ r.jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Custom Color (Hex)" }),
|
|
419
|
+
/* @__PURE__ */ r.jsxs("div", { className: "flex gap-2", children: [
|
|
420
|
+
/* @__PURE__ */ r.jsx(
|
|
421
|
+
"input",
|
|
422
|
+
{
|
|
423
|
+
type: "text",
|
|
424
|
+
value: m,
|
|
425
|
+
onChange: w,
|
|
426
|
+
placeholder: "#000000",
|
|
427
|
+
className: "flex-1 px-3 py-2 text-sm font-mono bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400"
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
/* @__PURE__ */ r.jsx(
|
|
431
|
+
"input",
|
|
432
|
+
{
|
|
433
|
+
type: "color",
|
|
434
|
+
value: a,
|
|
435
|
+
onChange: (s) => y(s.target.value),
|
|
436
|
+
className: "w-12 h-10 rounded-md cursor-pointer"
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
] })
|
|
440
|
+
] }),
|
|
441
|
+
u && /* @__PURE__ */ r.jsxs("div", { children: [
|
|
442
|
+
/* @__PURE__ */ r.jsxs("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: [
|
|
443
|
+
"Opacity: ",
|
|
444
|
+
p,
|
|
445
|
+
"%"
|
|
446
|
+
] }),
|
|
447
|
+
/* @__PURE__ */ r.jsx(
|
|
448
|
+
"input",
|
|
449
|
+
{
|
|
450
|
+
type: "range",
|
|
451
|
+
min: "0",
|
|
452
|
+
max: "100",
|
|
453
|
+
value: p,
|
|
454
|
+
onChange: E,
|
|
455
|
+
className: "w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer"
|
|
456
|
+
}
|
|
457
|
+
)
|
|
458
|
+
] })
|
|
459
|
+
] });
|
|
460
|
+
}, fe = ({
|
|
461
|
+
colors: a,
|
|
462
|
+
selectedColor: l,
|
|
463
|
+
onColorSelect: o,
|
|
464
|
+
size: c = "md",
|
|
465
|
+
showNames: u = !1,
|
|
466
|
+
showCopy: g = !1,
|
|
467
|
+
className: m
|
|
468
|
+
}) => {
|
|
469
|
+
const [b, p] = D(null), v = {
|
|
470
|
+
sm: "w-8 h-8",
|
|
471
|
+
md: "w-12 h-12",
|
|
472
|
+
lg: "w-16 h-16"
|
|
473
|
+
}, y = () => a.map(
|
|
474
|
+
(n) => typeof n == "string" ? { hex: n } : n
|
|
475
|
+
), w = async (n, k) => {
|
|
476
|
+
k.stopPropagation(), await navigator.clipboard.writeText(n), p(n), setTimeout(() => p(null), 2e3);
|
|
477
|
+
}, E = y();
|
|
478
|
+
return /* @__PURE__ */ r.jsx("div", { className: h("flex flex-wrap gap-3", m), children: E.map((n, k) => {
|
|
479
|
+
const s = l === n.hex, x = b === n.hex;
|
|
480
|
+
return /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
481
|
+
/* @__PURE__ */ r.jsx(
|
|
482
|
+
"button",
|
|
483
|
+
{
|
|
484
|
+
onClick: () => o?.(n.hex),
|
|
485
|
+
className: h(
|
|
486
|
+
"rounded-lg transition-all relative group",
|
|
487
|
+
v[c],
|
|
488
|
+
s && "ring-2 ring-blue-500 ring-offset-2 dark:ring-offset-gray-900",
|
|
489
|
+
!s && "hover:scale-110"
|
|
490
|
+
),
|
|
491
|
+
style: { backgroundColor: n.hex },
|
|
492
|
+
"aria-label": n.name || n.hex,
|
|
493
|
+
children: g && /* @__PURE__ */ r.jsx(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
className: "absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/50 rounded-lg",
|
|
497
|
+
onClick: (_) => w(n.hex, _),
|
|
498
|
+
children: x ? /* @__PURE__ */ r.jsx(
|
|
499
|
+
"svg",
|
|
500
|
+
{
|
|
501
|
+
className: "w-4 h-4 text-white",
|
|
502
|
+
fill: "none",
|
|
503
|
+
stroke: "currentColor",
|
|
504
|
+
viewBox: "0 0 24 24",
|
|
505
|
+
children: /* @__PURE__ */ r.jsx(
|
|
506
|
+
"path",
|
|
507
|
+
{
|
|
508
|
+
strokeLinecap: "round",
|
|
509
|
+
strokeLinejoin: "round",
|
|
510
|
+
strokeWidth: 2,
|
|
511
|
+
d: "M5 13l4 4L19 7"
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
}
|
|
515
|
+
) : /* @__PURE__ */ r.jsx(
|
|
516
|
+
"svg",
|
|
517
|
+
{
|
|
518
|
+
className: "w-4 h-4 text-white",
|
|
519
|
+
fill: "none",
|
|
520
|
+
stroke: "currentColor",
|
|
521
|
+
viewBox: "0 0 24 24",
|
|
522
|
+
children: /* @__PURE__ */ r.jsx(
|
|
523
|
+
"path",
|
|
524
|
+
{
|
|
525
|
+
strokeLinecap: "round",
|
|
526
|
+
strokeLinejoin: "round",
|
|
527
|
+
strokeWidth: 2,
|
|
528
|
+
d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
}
|
|
536
|
+
),
|
|
537
|
+
u && /* @__PURE__ */ r.jsxs("div", { className: "text-center", children: [
|
|
538
|
+
n.name && /* @__PURE__ */ r.jsx("p", { className: "text-xs font-medium text-gray-900 dark:text-white", children: n.name }),
|
|
539
|
+
/* @__PURE__ */ r.jsx("p", { className: "text-xs text-gray-600 dark:text-gray-400 font-mono", children: n.hex })
|
|
540
|
+
] })
|
|
541
|
+
] }, k);
|
|
542
|
+
}) });
|
|
543
|
+
}, ge = ({
|
|
544
|
+
children: a,
|
|
545
|
+
variant: l = "blue-purple",
|
|
546
|
+
gradientClasses: o,
|
|
547
|
+
size: c = "md",
|
|
548
|
+
rounded: u = "2xl",
|
|
549
|
+
bordered: g = !1,
|
|
550
|
+
borderClasses: m = "border border-white/20",
|
|
551
|
+
className: b
|
|
552
|
+
}) => {
|
|
553
|
+
const p = {
|
|
554
|
+
"blue-purple": "bg-gradient-to-r from-blue-600 to-purple-600 text-white",
|
|
555
|
+
"green-blue": "bg-gradient-to-r from-green-600 to-blue-600 text-white",
|
|
556
|
+
"orange-red": "bg-gradient-to-r from-orange-600 to-red-600 text-white",
|
|
557
|
+
gray: "bg-gradient-to-r from-gray-600 to-gray-800 dark:from-gray-700 dark:to-gray-900 text-white",
|
|
558
|
+
light: "bg-gradient-to-r from-blue-50 to-purple-50 dark:from-blue-900/20 dark:to-purple-900/20 text-gray-900 dark:text-gray-100",
|
|
559
|
+
custom: o || "bg-gradient-to-r from-blue-600 to-purple-600 text-white"
|
|
560
|
+
}, v = {
|
|
561
|
+
sm: "p-4",
|
|
562
|
+
md: "p-6",
|
|
563
|
+
lg: "p-8"
|
|
564
|
+
}, y = {
|
|
565
|
+
md: "rounded-md",
|
|
566
|
+
lg: "rounded-lg",
|
|
567
|
+
xl: "rounded-xl",
|
|
568
|
+
"2xl": "rounded-2xl"
|
|
569
|
+
};
|
|
570
|
+
return /* @__PURE__ */ r.jsx(
|
|
571
|
+
"div",
|
|
572
|
+
{
|
|
573
|
+
className: h(
|
|
574
|
+
p[l],
|
|
575
|
+
v[c],
|
|
576
|
+
y[u],
|
|
577
|
+
g && m,
|
|
578
|
+
b
|
|
579
|
+
),
|
|
580
|
+
children: a
|
|
581
|
+
}
|
|
582
|
+
);
|
|
583
|
+
}, me = ({
|
|
584
|
+
className: a,
|
|
585
|
+
children: l,
|
|
586
|
+
disabled: o = !1,
|
|
587
|
+
onClick: c
|
|
588
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
className: h(
|
|
592
|
+
"p-4 rounded-lg border transition-colors",
|
|
593
|
+
"bg-white dark:bg-gray-900",
|
|
594
|
+
"border-gray-200 dark:border-gray-700",
|
|
595
|
+
"text-gray-900 dark:text-white",
|
|
596
|
+
o && "opacity-50 cursor-not-allowed",
|
|
597
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
598
|
+
a
|
|
599
|
+
),
|
|
600
|
+
onClick: o ? void 0 : c,
|
|
601
|
+
role: "region",
|
|
602
|
+
"aria-label": "UneumorphicUbutton",
|
|
603
|
+
children: l || "UneumorphicUbutton Component"
|
|
604
|
+
}
|
|
605
|
+
), be = ({
|
|
606
|
+
className: a,
|
|
607
|
+
children: l,
|
|
608
|
+
disabled: o = !1,
|
|
609
|
+
onClick: c
|
|
610
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
611
|
+
"div",
|
|
612
|
+
{
|
|
613
|
+
className: h(
|
|
614
|
+
"p-4 rounded-lg border transition-colors",
|
|
615
|
+
"bg-white dark:bg-gray-900",
|
|
616
|
+
"border-gray-200 dark:border-gray-700",
|
|
617
|
+
"text-gray-900 dark:text-white",
|
|
618
|
+
o && "opacity-50 cursor-not-allowed",
|
|
619
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800",
|
|
620
|
+
a
|
|
621
|
+
),
|
|
622
|
+
onClick: o ? void 0 : c,
|
|
623
|
+
role: "region",
|
|
624
|
+
"aria-label": "UthemeUswitcher",
|
|
625
|
+
children: l || "UthemeUswitcher Component"
|
|
626
|
+
}
|
|
627
|
+
);
|
|
628
|
+
export {
|
|
629
|
+
de as ColorPicker,
|
|
630
|
+
ue as ColorPickerAdvanced,
|
|
631
|
+
fe as ColorSwatch,
|
|
632
|
+
ge as GradientBanner,
|
|
633
|
+
ie as UauroraUbackground,
|
|
634
|
+
ce as UbadgeUdesigner,
|
|
635
|
+
me as UneumorphicUbutton,
|
|
636
|
+
be as UthemeUswitcher
|
|
637
|
+
};
|
|
638
|
+
//# sourceMappingURL=index.esm.js.map
|