cekat-ui 1.0.0 → 1.0.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.d.ts +5 -0
- package/dist/index.es.js +754 -1
- package/dist/index.umd.js +6 -1
- package/package.json +11 -4
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1 +1,754 @@
|
|
|
1
|
-
|
|
1
|
+
import * as k from "react";
|
|
2
|
+
import D from "react";
|
|
3
|
+
var C = { exports: {} }, j = {};
|
|
4
|
+
var B;
|
|
5
|
+
function ue() {
|
|
6
|
+
if (B) return j;
|
|
7
|
+
B = 1;
|
|
8
|
+
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
+
function t(a, s, l) {
|
|
10
|
+
var b = null;
|
|
11
|
+
if (l !== void 0 && (b = "" + l), s.key !== void 0 && (b = "" + s.key), "key" in s) {
|
|
12
|
+
l = {};
|
|
13
|
+
for (var c in s)
|
|
14
|
+
c !== "key" && (l[c] = s[c]);
|
|
15
|
+
} else l = s;
|
|
16
|
+
return s = l.ref, {
|
|
17
|
+
$$typeof: r,
|
|
18
|
+
type: a,
|
|
19
|
+
key: b,
|
|
20
|
+
ref: s !== void 0 ? s : null,
|
|
21
|
+
props: l
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return j.Fragment = o, j.jsx = t, j.jsxs = t, j;
|
|
25
|
+
}
|
|
26
|
+
var N = {};
|
|
27
|
+
var G;
|
|
28
|
+
function ce() {
|
|
29
|
+
return G || (G = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
+
function r(e) {
|
|
31
|
+
if (e == null) return null;
|
|
32
|
+
if (typeof e == "function")
|
|
33
|
+
return e.$$typeof === se ? null : e.displayName || e.name || null;
|
|
34
|
+
if (typeof e == "string") return e;
|
|
35
|
+
switch (e) {
|
|
36
|
+
case g:
|
|
37
|
+
return "Fragment";
|
|
38
|
+
case Q:
|
|
39
|
+
return "Profiler";
|
|
40
|
+
case Z:
|
|
41
|
+
return "StrictMode";
|
|
42
|
+
case re:
|
|
43
|
+
return "Suspense";
|
|
44
|
+
case ae:
|
|
45
|
+
return "SuspenseList";
|
|
46
|
+
case ne:
|
|
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 _:
|
|
54
|
+
return "Portal";
|
|
55
|
+
case ee:
|
|
56
|
+
return e.displayName || "Context";
|
|
57
|
+
case K:
|
|
58
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
|
+
case te:
|
|
60
|
+
var n = e.render;
|
|
61
|
+
return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
62
|
+
case oe:
|
|
63
|
+
return n = e.displayName || null, n !== null ? n : r(e.type) || "Memo";
|
|
64
|
+
case O:
|
|
65
|
+
n = e._payload, e = e._init;
|
|
66
|
+
try {
|
|
67
|
+
return r(e(n));
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function o(e) {
|
|
74
|
+
return "" + e;
|
|
75
|
+
}
|
|
76
|
+
function t(e) {
|
|
77
|
+
try {
|
|
78
|
+
o(e);
|
|
79
|
+
var n = !1;
|
|
80
|
+
} catch {
|
|
81
|
+
n = !0;
|
|
82
|
+
}
|
|
83
|
+
if (n) {
|
|
84
|
+
n = console;
|
|
85
|
+
var i = n.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
86
|
+
return i.call(
|
|
87
|
+
n,
|
|
88
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
+
d
|
|
90
|
+
), o(e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function a(e) {
|
|
94
|
+
if (e === g) return "<>";
|
|
95
|
+
if (typeof e == "object" && e !== null && e.$$typeof === O)
|
|
96
|
+
return "<...>";
|
|
97
|
+
try {
|
|
98
|
+
var n = r(e);
|
|
99
|
+
return n ? "<" + n + ">" : "<...>";
|
|
100
|
+
} catch {
|
|
101
|
+
return "<...>";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function s() {
|
|
105
|
+
var e = A.A;
|
|
106
|
+
return e === null ? null : e.getOwner();
|
|
107
|
+
}
|
|
108
|
+
function l() {
|
|
109
|
+
return Error("react-stack-top-frame");
|
|
110
|
+
}
|
|
111
|
+
function b(e) {
|
|
112
|
+
if (F.call(e, "key")) {
|
|
113
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
114
|
+
if (n && n.isReactWarning) return !1;
|
|
115
|
+
}
|
|
116
|
+
return e.key !== void 0;
|
|
117
|
+
}
|
|
118
|
+
function c(e, n) {
|
|
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
|
+
n
|
|
123
|
+
));
|
|
124
|
+
}
|
|
125
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
126
|
+
get: i,
|
|
127
|
+
configurable: !0
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function p() {
|
|
131
|
+
var e = r(this.type);
|
|
132
|
+
return z[e] || (z[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 u(e, n, i, d, S, V) {
|
|
137
|
+
var f = i.ref;
|
|
138
|
+
return e = {
|
|
139
|
+
$$typeof: w,
|
|
140
|
+
type: e,
|
|
141
|
+
key: n,
|
|
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: S
|
|
162
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
163
|
+
configurable: !1,
|
|
164
|
+
enumerable: !1,
|
|
165
|
+
writable: !0,
|
|
166
|
+
value: V
|
|
167
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
|
+
}
|
|
169
|
+
function h(e, n, i, d, S, V) {
|
|
170
|
+
var f = n.children;
|
|
171
|
+
if (f !== void 0)
|
|
172
|
+
if (d)
|
|
173
|
+
if (le(f)) {
|
|
174
|
+
for (d = 0; d < f.length; d++)
|
|
175
|
+
v(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 v(f);
|
|
182
|
+
if (F.call(n, "key")) {
|
|
183
|
+
f = r(e);
|
|
184
|
+
var E = Object.keys(n).filter(function(ie) {
|
|
185
|
+
return ie !== "key";
|
|
186
|
+
});
|
|
187
|
+
d = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", M[f + d] || (E = 0 < E.length ? "{" + E.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
|
+
E,
|
|
197
|
+
f
|
|
198
|
+
), M[f + d] = !0);
|
|
199
|
+
}
|
|
200
|
+
if (f = null, i !== void 0 && (t(i), f = "" + i), b(n) && (t(n.key), f = "" + n.key), "key" in n) {
|
|
201
|
+
i = {};
|
|
202
|
+
for (var I in n)
|
|
203
|
+
I !== "key" && (i[I] = n[I]);
|
|
204
|
+
} else i = n;
|
|
205
|
+
return f && c(
|
|
206
|
+
i,
|
|
207
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
+
), u(
|
|
209
|
+
e,
|
|
210
|
+
f,
|
|
211
|
+
i,
|
|
212
|
+
s(),
|
|
213
|
+
S,
|
|
214
|
+
V
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
function v(e) {
|
|
218
|
+
x(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === O && (e._payload.status === "fulfilled" ? x(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
219
|
+
}
|
|
220
|
+
function x(e) {
|
|
221
|
+
return typeof e == "object" && e !== null && e.$$typeof === w;
|
|
222
|
+
}
|
|
223
|
+
var y = D, w = /* @__PURE__ */ Symbol.for("react.transitional.element"), _ = /* @__PURE__ */ Symbol.for("react.portal"), g = /* @__PURE__ */ Symbol.for("react.fragment"), Z = /* @__PURE__ */ Symbol.for("react.strict_mode"), Q = /* @__PURE__ */ Symbol.for("react.profiler"), K = /* @__PURE__ */ Symbol.for("react.consumer"), ee = /* @__PURE__ */ Symbol.for("react.context"), te = /* @__PURE__ */ Symbol.for("react.forward_ref"), re = /* @__PURE__ */ Symbol.for("react.suspense"), ae = /* @__PURE__ */ Symbol.for("react.suspense_list"), oe = /* @__PURE__ */ Symbol.for("react.memo"), O = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), se = /* @__PURE__ */ Symbol.for("react.client.reference"), A = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, le = Array.isArray, P = console.createTask ? console.createTask : function() {
|
|
224
|
+
return null;
|
|
225
|
+
};
|
|
226
|
+
y = {
|
|
227
|
+
react_stack_bottom_frame: function(e) {
|
|
228
|
+
return e();
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var Y, z = {}, L = y.react_stack_bottom_frame.bind(
|
|
232
|
+
y,
|
|
233
|
+
l
|
|
234
|
+
)(), $ = P(a(l)), M = {};
|
|
235
|
+
N.Fragment = g, N.jsx = function(e, n, i) {
|
|
236
|
+
var d = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return h(
|
|
238
|
+
e,
|
|
239
|
+
n,
|
|
240
|
+
i,
|
|
241
|
+
!1,
|
|
242
|
+
d ? Error("react-stack-top-frame") : L,
|
|
243
|
+
d ? P(a(e)) : $
|
|
244
|
+
);
|
|
245
|
+
}, N.jsxs = function(e, n, i) {
|
|
246
|
+
var d = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return h(
|
|
248
|
+
e,
|
|
249
|
+
n,
|
|
250
|
+
i,
|
|
251
|
+
!0,
|
|
252
|
+
d ? Error("react-stack-top-frame") : L,
|
|
253
|
+
d ? P(a(e)) : $
|
|
254
|
+
);
|
|
255
|
+
};
|
|
256
|
+
})()), N;
|
|
257
|
+
}
|
|
258
|
+
var W;
|
|
259
|
+
function de() {
|
|
260
|
+
return W || (W = 1, process.env.NODE_ENV === "production" ? C.exports = ue() : C.exports = ce()), C.exports;
|
|
261
|
+
}
|
|
262
|
+
var m = de();
|
|
263
|
+
function q(r) {
|
|
264
|
+
var o, t, a = "";
|
|
265
|
+
if (typeof r == "string" || typeof r == "number") a += r;
|
|
266
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
267
|
+
var s = r.length;
|
|
268
|
+
for (o = 0; o < s; o++) r[o] && (t = q(r[o])) && (a && (a += " "), a += t);
|
|
269
|
+
} else for (t in r) r[t] && (a && (a += " "), a += t);
|
|
270
|
+
return a;
|
|
271
|
+
}
|
|
272
|
+
function R() {
|
|
273
|
+
for (var r, o, t = 0, a = "", s = arguments.length; t < s; t++) (r = arguments[t]) && (o = q(r)) && (a && (a += " "), a += o);
|
|
274
|
+
return a;
|
|
275
|
+
}
|
|
276
|
+
const U = (r) => typeof r == "boolean" ? `${r}` : r === 0 ? "0" : r, J = R, T = (r, o) => (t) => {
|
|
277
|
+
var a;
|
|
278
|
+
if (o?.variants == null) return J(r, t?.class, t?.className);
|
|
279
|
+
const { variants: s, defaultVariants: l } = o, b = Object.keys(s).map((u) => {
|
|
280
|
+
const h = t?.[u], v = l?.[u];
|
|
281
|
+
if (h === null) return null;
|
|
282
|
+
const x = U(h) || U(v);
|
|
283
|
+
return s[u][x];
|
|
284
|
+
}), c = t && Object.entries(t).reduce((u, h) => {
|
|
285
|
+
let [v, x] = h;
|
|
286
|
+
return x === void 0 || (u[v] = x), u;
|
|
287
|
+
}, {}), p = o == null || (a = o.compoundVariants) === null || a === void 0 ? void 0 : a.reduce((u, h) => {
|
|
288
|
+
let { class: v, className: x, ...y } = h;
|
|
289
|
+
return Object.entries(y).every((w) => {
|
|
290
|
+
let [_, g] = w;
|
|
291
|
+
return Array.isArray(g) ? g.includes({
|
|
292
|
+
...l,
|
|
293
|
+
...c
|
|
294
|
+
}[_]) : {
|
|
295
|
+
...l,
|
|
296
|
+
...c
|
|
297
|
+
}[_] === g;
|
|
298
|
+
}) ? [
|
|
299
|
+
...u,
|
|
300
|
+
v,
|
|
301
|
+
x
|
|
302
|
+
] : u;
|
|
303
|
+
}, []);
|
|
304
|
+
return J(r, b, p, t?.class, t?.className);
|
|
305
|
+
}, fe = T(["inline-flex items-center justify-center font-medium", "transition-colors duration-150", "focus-visible:outline-none", "disabled:cursor-not-allowed"], {
|
|
306
|
+
variants: {
|
|
307
|
+
size: {
|
|
308
|
+
sm: "h-[36px] px-4 gap-1 rounded-lg text-sm",
|
|
309
|
+
md: "h-[44px] px-4 gap-2 rounded-lg text-sm",
|
|
310
|
+
lg: "h-[52px] px-5 gap-2 rounded-[10px] text-base",
|
|
311
|
+
xl: "h-[60px] px-6 gap-2 rounded-[10px] text-base",
|
|
312
|
+
"2xl": "h-[68px] px-6 gap-2 rounded-[10px] text-lg"
|
|
313
|
+
},
|
|
314
|
+
tone: {
|
|
315
|
+
primary: ""
|
|
316
|
+
},
|
|
317
|
+
variant: {
|
|
318
|
+
solid: [
|
|
319
|
+
"bg-primary-500 text-white",
|
|
320
|
+
"hover:bg-primary-800",
|
|
321
|
+
"focus-visible:ring-2 focus-visible:ring-primary-400",
|
|
322
|
+
"focus-visible:ring-offset-2 focus-visible:ring-offset-white",
|
|
323
|
+
"disabled:bg-light-100 disabled:text-light-400"
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
defaultVariants: {
|
|
328
|
+
size: "md",
|
|
329
|
+
tone: "primary",
|
|
330
|
+
variant: "solid"
|
|
331
|
+
}
|
|
332
|
+
}), me = ({ children: r, className: o, tone: t, variant: a, size: s, ...l }) => /* @__PURE__ */ m.jsx("button", { className: R(fe({ tone: t, variant: a, size: s }), o), ...l, children: r }), be = ({ children: r }) => /* @__PURE__ */ m.jsx("span", { className: "flex items-center", children: r }), pe = ({ children: r }) => /* @__PURE__ */ m.jsx("span", { className: "whitespace-nowrap", children: r }), X = me;
|
|
333
|
+
X.Icon = be;
|
|
334
|
+
X.Text = pe;
|
|
335
|
+
const he = T(
|
|
336
|
+
[
|
|
337
|
+
"inline-flex items-center justify-center",
|
|
338
|
+
"border-2 transition-colors duration-150",
|
|
339
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400"
|
|
340
|
+
],
|
|
341
|
+
{
|
|
342
|
+
variants: {
|
|
343
|
+
size: {
|
|
344
|
+
sm: "h-5 w-5 rounded-[4px]",
|
|
345
|
+
md: "h-6 w-6 rounded-[6px]",
|
|
346
|
+
lg: "h-8 w-8 rounded-[8px]"
|
|
347
|
+
},
|
|
348
|
+
checked: {
|
|
349
|
+
true: "",
|
|
350
|
+
false: ""
|
|
351
|
+
},
|
|
352
|
+
disabled: {
|
|
353
|
+
true: "cursor-not-allowed",
|
|
354
|
+
false: "cursor-pointer"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
compoundVariants: [
|
|
358
|
+
{
|
|
359
|
+
checked: !1,
|
|
360
|
+
disabled: !1,
|
|
361
|
+
className: "bg-white border-[#D0D5DD]"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
checked: !0,
|
|
365
|
+
disabled: !1,
|
|
366
|
+
className: "bg-primary-500 border-primary-500 text-white"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
disabled: !0,
|
|
370
|
+
className: "bg-[#F2F4F7] border-[#E4E7EC] text-white"
|
|
371
|
+
}
|
|
372
|
+
],
|
|
373
|
+
defaultVariants: {
|
|
374
|
+
size: "md",
|
|
375
|
+
checked: !1,
|
|
376
|
+
disabled: !1
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
), xe = {
|
|
380
|
+
sm: { width: 12, height: 9 },
|
|
381
|
+
md: { width: 14, height: 10 },
|
|
382
|
+
lg: { width: 18, height: 14 }
|
|
383
|
+
}, ve = k.forwardRef(
|
|
384
|
+
({
|
|
385
|
+
id: r,
|
|
386
|
+
checked: o,
|
|
387
|
+
indeterminate: t = !1,
|
|
388
|
+
disabled: a,
|
|
389
|
+
size: s = "md",
|
|
390
|
+
onCheckedChange: l,
|
|
391
|
+
className: b
|
|
392
|
+
}, c) => {
|
|
393
|
+
const p = () => {
|
|
394
|
+
a || l?.(!o);
|
|
395
|
+
}, u = xe[s], h = a ? "text-white/80" : "text-current";
|
|
396
|
+
return /* @__PURE__ */ m.jsxs(
|
|
397
|
+
"button",
|
|
398
|
+
{
|
|
399
|
+
id: r,
|
|
400
|
+
ref: c,
|
|
401
|
+
type: "button",
|
|
402
|
+
role: "checkbox",
|
|
403
|
+
"aria-checked": t ? "mixed" : o,
|
|
404
|
+
disabled: a,
|
|
405
|
+
onClick: p,
|
|
406
|
+
className: R(
|
|
407
|
+
he({ size: s, checked: o, disabled: a }),
|
|
408
|
+
b
|
|
409
|
+
),
|
|
410
|
+
children: [
|
|
411
|
+
o && !t && /* @__PURE__ */ m.jsx(
|
|
412
|
+
"svg",
|
|
413
|
+
{
|
|
414
|
+
width: u.width,
|
|
415
|
+
height: u.height,
|
|
416
|
+
viewBox: "0 0 14 10",
|
|
417
|
+
fill: "none",
|
|
418
|
+
className: h,
|
|
419
|
+
children: /* @__PURE__ */ m.jsx(
|
|
420
|
+
"path",
|
|
421
|
+
{
|
|
422
|
+
d: "M1 5L5 9L13 1",
|
|
423
|
+
stroke: "currentColor",
|
|
424
|
+
strokeWidth: "2",
|
|
425
|
+
strokeLinecap: "round",
|
|
426
|
+
strokeLinejoin: "round"
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
}
|
|
430
|
+
),
|
|
431
|
+
t && /* @__PURE__ */ m.jsx(
|
|
432
|
+
"span",
|
|
433
|
+
{
|
|
434
|
+
className: R(
|
|
435
|
+
h,
|
|
436
|
+
"bg-current rounded-sm",
|
|
437
|
+
s === "sm" && "h-0.5 w-3",
|
|
438
|
+
s === "md" && "h-0.5 w-4",
|
|
439
|
+
s === "lg" && "h-0.5 w-5"
|
|
440
|
+
)
|
|
441
|
+
}
|
|
442
|
+
)
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
);
|
|
448
|
+
ve.displayName = "Checkbox";
|
|
449
|
+
const H = k.createContext(null), je = ({
|
|
450
|
+
value: r,
|
|
451
|
+
defaultValue: o,
|
|
452
|
+
onValueChange: t,
|
|
453
|
+
children: a,
|
|
454
|
+
className: s
|
|
455
|
+
}) => {
|
|
456
|
+
const [l, b] = k.useState(o), c = r ?? l, p = (u) => {
|
|
457
|
+
b(u), t?.(u);
|
|
458
|
+
};
|
|
459
|
+
return /* @__PURE__ */ m.jsx(
|
|
460
|
+
H.Provider,
|
|
461
|
+
{
|
|
462
|
+
value: { value: c, onValueChange: p },
|
|
463
|
+
children: /* @__PURE__ */ m.jsx("div", { role: "radiogroup", className: s, children: a })
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
}, ge = () => {
|
|
467
|
+
const r = k.useContext(H);
|
|
468
|
+
if (!r)
|
|
469
|
+
throw new Error("RadioGroupItem must be used within RadioGroup");
|
|
470
|
+
return r;
|
|
471
|
+
}, ye = T(
|
|
472
|
+
[
|
|
473
|
+
"relative inline-flex items-center justify-center",
|
|
474
|
+
"border-2 rounded-full transition-colors duration-150",
|
|
475
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400"
|
|
476
|
+
],
|
|
477
|
+
{
|
|
478
|
+
variants: {
|
|
479
|
+
size: {
|
|
480
|
+
sm: "h-5 w-5",
|
|
481
|
+
md: "h-6 w-6",
|
|
482
|
+
lg: "h-8 w-8"
|
|
483
|
+
},
|
|
484
|
+
checked: {
|
|
485
|
+
true: "",
|
|
486
|
+
false: ""
|
|
487
|
+
},
|
|
488
|
+
disabled: {
|
|
489
|
+
true: "cursor-not-allowed",
|
|
490
|
+
false: "cursor-pointer"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
compoundVariants: [
|
|
494
|
+
{
|
|
495
|
+
checked: !1,
|
|
496
|
+
disabled: !1,
|
|
497
|
+
className: "border-[#D0D5DD] bg-white"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
checked: !0,
|
|
501
|
+
disabled: !1,
|
|
502
|
+
className: "border-primary-500 bg-primary-500"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
disabled: !0,
|
|
506
|
+
className: "border-[#E4E7EC] bg-[#F2F4F7]"
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
defaultVariants: {
|
|
510
|
+
size: "md",
|
|
511
|
+
checked: !1,
|
|
512
|
+
disabled: !1
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
), we = T(
|
|
516
|
+
["rounded-full bg-white transition-all"],
|
|
517
|
+
{
|
|
518
|
+
variants: {
|
|
519
|
+
size: {
|
|
520
|
+
sm: "h-2 w-2",
|
|
521
|
+
md: "h-2.5 w-2.5",
|
|
522
|
+
lg: "h-3 w-3"
|
|
523
|
+
},
|
|
524
|
+
checked: {
|
|
525
|
+
true: "scale-100",
|
|
526
|
+
false: "scale-0"
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
defaultVariants: {
|
|
530
|
+
size: "md",
|
|
531
|
+
checked: !1
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
), _e = k.forwardRef(({ id: r, value: o, disabled: t, size: a = "md", className: s }, l) => {
|
|
535
|
+
const { value: b, onValueChange: c } = ge(), p = b === o;
|
|
536
|
+
return /* @__PURE__ */ m.jsx(
|
|
537
|
+
"button",
|
|
538
|
+
{
|
|
539
|
+
ref: l,
|
|
540
|
+
id: r,
|
|
541
|
+
type: "button",
|
|
542
|
+
role: "radio",
|
|
543
|
+
"aria-checked": p,
|
|
544
|
+
disabled: t,
|
|
545
|
+
onClick: () => {
|
|
546
|
+
t || c?.(o);
|
|
547
|
+
},
|
|
548
|
+
className: R(
|
|
549
|
+
ye({ size: a, checked: p, disabled: t }),
|
|
550
|
+
s
|
|
551
|
+
),
|
|
552
|
+
children: /* @__PURE__ */ m.jsx(
|
|
553
|
+
"span",
|
|
554
|
+
{
|
|
555
|
+
className: we({
|
|
556
|
+
size: a,
|
|
557
|
+
checked: p
|
|
558
|
+
})
|
|
559
|
+
}
|
|
560
|
+
)
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
});
|
|
564
|
+
_e.displayName = "RadioGroupItem";
|
|
565
|
+
const Ee = T(
|
|
566
|
+
"relative inline-flex shrink-0 cursor-pointer rounded-full transition-colors duration-200 focus-visible:outline-none",
|
|
567
|
+
{
|
|
568
|
+
variants: {
|
|
569
|
+
size: {
|
|
570
|
+
sm: "h-6 w-10",
|
|
571
|
+
md: "h-8 w-14",
|
|
572
|
+
lg: "h-10 w-[72px]"
|
|
573
|
+
},
|
|
574
|
+
checked: {
|
|
575
|
+
true: "bg-primary-500",
|
|
576
|
+
false: "bg-[#e4e7ec]"
|
|
577
|
+
},
|
|
578
|
+
disabled: {
|
|
579
|
+
true: "cursor-not-allowed opacity-60"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
defaultVariants: {
|
|
583
|
+
size: "md",
|
|
584
|
+
checked: !1
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
), Re = T(
|
|
588
|
+
"absolute top-1 left-1 rounded-full bg-white transition-transform duration-200 shadow",
|
|
589
|
+
{
|
|
590
|
+
variants: {
|
|
591
|
+
size: {
|
|
592
|
+
sm: "h-4 w-4",
|
|
593
|
+
md: "h-6 w-6",
|
|
594
|
+
lg: "h-8 w-8"
|
|
595
|
+
},
|
|
596
|
+
checked: {
|
|
597
|
+
true: "",
|
|
598
|
+
false: ""
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
compoundVariants: [
|
|
602
|
+
{
|
|
603
|
+
size: "sm",
|
|
604
|
+
checked: !0,
|
|
605
|
+
className: "translate-x-4"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
size: "md",
|
|
609
|
+
checked: !0,
|
|
610
|
+
className: "translate-x-6"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
size: "lg",
|
|
614
|
+
checked: !0,
|
|
615
|
+
className: "translate-x-8"
|
|
616
|
+
}
|
|
617
|
+
],
|
|
618
|
+
defaultVariants: {
|
|
619
|
+
size: "md",
|
|
620
|
+
checked: !1
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
), ke = k.forwardRef(
|
|
624
|
+
({
|
|
625
|
+
checked: r = !1,
|
|
626
|
+
size: o = "md",
|
|
627
|
+
disabled: t,
|
|
628
|
+
onCheckedChange: a,
|
|
629
|
+
className: s
|
|
630
|
+
}, l) => /* @__PURE__ */ m.jsx(
|
|
631
|
+
"button",
|
|
632
|
+
{
|
|
633
|
+
ref: l,
|
|
634
|
+
type: "button",
|
|
635
|
+
role: "switch",
|
|
636
|
+
"aria-checked": r,
|
|
637
|
+
disabled: t,
|
|
638
|
+
onClick: () => {
|
|
639
|
+
t || a?.(!r);
|
|
640
|
+
},
|
|
641
|
+
className: R(
|
|
642
|
+
Ee({ size: o, checked: r, disabled: t }),
|
|
643
|
+
s
|
|
644
|
+
),
|
|
645
|
+
children: /* @__PURE__ */ m.jsx(
|
|
646
|
+
"span",
|
|
647
|
+
{
|
|
648
|
+
className: Re({
|
|
649
|
+
size: o,
|
|
650
|
+
checked: r
|
|
651
|
+
})
|
|
652
|
+
}
|
|
653
|
+
)
|
|
654
|
+
}
|
|
655
|
+
)
|
|
656
|
+
);
|
|
657
|
+
ke.displayName = "Toggle";
|
|
658
|
+
const Ne = ({
|
|
659
|
+
label: r,
|
|
660
|
+
children: o,
|
|
661
|
+
isOpen: t,
|
|
662
|
+
position: a = "top"
|
|
663
|
+
}) => {
|
|
664
|
+
const [s, l] = D.useState(!1), b = D.useId(), c = typeof t == "boolean", p = c ? t : s;
|
|
665
|
+
function u() {
|
|
666
|
+
c || l(!0);
|
|
667
|
+
}
|
|
668
|
+
function h() {
|
|
669
|
+
c || l(!1);
|
|
670
|
+
}
|
|
671
|
+
const v = "absolute z-20 min-w-max max-w-[240px] rounded-xl bg-[#111827] px-4 py-2 text-[13px] leading-snug text-white opacity-0 invisible shadow-[0_10px_30px_rgba(2,8,23,0.2)] transition-all duration-150", x = p ? "opacity-100 visible" : "", y = c ? "" : "group-hover:opacity-100 group-hover:visible group-focus-within:opacity-100 group-focus-within:visible", w = {
|
|
672
|
+
top: "bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 translate-y-1",
|
|
673
|
+
"top-start": "bottom-[calc(100%+8px)] left-0 translate-y-1",
|
|
674
|
+
"top-end": "bottom-[calc(100%+8px)] right-0 translate-y-1",
|
|
675
|
+
bottom: "top-[calc(100%+8px)] left-1/2 -translate-x-1/2 -translate-y-1",
|
|
676
|
+
"bottom-start": "top-[calc(100%+8px)] left-0 -translate-y-1",
|
|
677
|
+
"bottom-end": "top-[calc(100%+8px)] right-0 -translate-y-1",
|
|
678
|
+
left: "right-[calc(100%+8px)] top-1/2 -translate-y-1/2 translate-x-1",
|
|
679
|
+
right: "left-[calc(100%+8px)] top-1/2 -translate-y-1/2 -translate-x-1"
|
|
680
|
+
}[a], _ = p ? {
|
|
681
|
+
top: "translate-y-0",
|
|
682
|
+
"top-start": "translate-y-0",
|
|
683
|
+
"top-end": "translate-y-0",
|
|
684
|
+
bottom: "translate-y-0",
|
|
685
|
+
"bottom-start": "translate-y-0",
|
|
686
|
+
"bottom-end": "translate-y-0",
|
|
687
|
+
left: "translate-x-0",
|
|
688
|
+
right: "translate-x-0"
|
|
689
|
+
}[a] : "", g = {
|
|
690
|
+
top: "top-full left-1/2 -translate-x-1/2 border-t-[#111827]",
|
|
691
|
+
"top-start": "top-full left-4 border-t-[#111827]",
|
|
692
|
+
"top-end": "top-full right-4 border-t-[#111827]",
|
|
693
|
+
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-[#111827]",
|
|
694
|
+
"bottom-start": "bottom-full left-4 border-b-[#111827]",
|
|
695
|
+
"bottom-end": "bottom-full right-4 border-b-[#111827]",
|
|
696
|
+
left: "left-full top-1/2 -translate-y-1/2 border-l-[#111827]",
|
|
697
|
+
right: "right-full top-1/2 -translate-y-1/2 border-r-[#111827]"
|
|
698
|
+
}[a];
|
|
699
|
+
return /* @__PURE__ */ m.jsxs(
|
|
700
|
+
"span",
|
|
701
|
+
{
|
|
702
|
+
className: "group relative inline-flex items-center justify-center font-sans",
|
|
703
|
+
onMouseEnter: u,
|
|
704
|
+
onMouseLeave: h,
|
|
705
|
+
onFocus: u,
|
|
706
|
+
onBlur: h,
|
|
707
|
+
children: [
|
|
708
|
+
/* @__PURE__ */ m.jsx(
|
|
709
|
+
"span",
|
|
710
|
+
{
|
|
711
|
+
className: "inline-flex items-center justify-center gap-1 rounded-md border border-[#d1d5db] bg-white px-2.5 py-1.5 text-sm text-[#111827] outline-none transition-shadow duration-150 focus-visible:border-[#2563eb] focus-visible:shadow-[0_0_0_3px_rgba(37,99,235,0.25)]",
|
|
712
|
+
tabIndex: 0,
|
|
713
|
+
"aria-describedby": p ? b : void 0,
|
|
714
|
+
children: o
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
/* @__PURE__ */ m.jsxs(
|
|
718
|
+
"span",
|
|
719
|
+
{
|
|
720
|
+
id: b,
|
|
721
|
+
role: "tooltip",
|
|
722
|
+
className: [
|
|
723
|
+
v,
|
|
724
|
+
w,
|
|
725
|
+
x,
|
|
726
|
+
_,
|
|
727
|
+
y
|
|
728
|
+
].filter(Boolean).join(" "),
|
|
729
|
+
children: [
|
|
730
|
+
r,
|
|
731
|
+
/* @__PURE__ */ m.jsx(
|
|
732
|
+
"span",
|
|
733
|
+
{
|
|
734
|
+
className: [
|
|
735
|
+
"absolute h-0 w-0 border-[8px] border-transparent",
|
|
736
|
+
g
|
|
737
|
+
].filter(Boolean).join(" ")
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
)
|
|
743
|
+
]
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
};
|
|
747
|
+
export {
|
|
748
|
+
X as Button,
|
|
749
|
+
ve as Checkbox,
|
|
750
|
+
je as RadioGroup,
|
|
751
|
+
_e as RadioGroupItem,
|
|
752
|
+
ke as Toggle,
|
|
753
|
+
Ne as Tooltip
|
|
754
|
+
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(x,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],w):(x=typeof globalThis<"u"?globalThis:x||self,w(x.CekatUI={},x.React))})(this,(function(x,w){"use strict";function te(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const E=te(w);var C={exports:{}},S={};var z;function re(){if(z)return S;z=1;var t=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(n,s,l){var b=null;if(l!==void 0&&(b=""+l),s.key!==void 0&&(b=""+s.key),"key"in s){l={};for(var c in s)c!=="key"&&(l[c]=s[c])}else l=s;return s=l.ref,{$$typeof:t,type:n,key:b,ref:s!==void 0?s:null,props:l}}return S.Fragment=o,S.jsx=r,S.jsxs=r,S}var O={};var $;function ne(){return $||($=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case ge:return"Profiler";case ve:return"StrictMode";case Ee:return"Suspense";case ke:return"SuspenseList";case Te:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case j:return"Portal";case we:return e.displayName||"Context";case ye:return(e._context.displayName||"Context")+".Consumer";case _e:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Re:return a=e.displayName||null,a!==null?a:t(e.type)||"Memo";case V:a=e._payload,e=e._init;try{return t(e(a))}catch{}}return null}function o(e){return""+e}function r(e){try{o(e);var a=!1}catch{a=!0}if(a){a=console;var i=a.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),o(e)}}function n(e){if(e===y)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===V)return"<...>";try{var a=t(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function s(){var e=I.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function b(e){if(X.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function c(e,a){function i(){H||(H=!0,console.error("%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)",a))}i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}function p(){var e=t(this.type);return Z[e]||(Z[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function u(e,a,i,d,P,F){var f=i.ref;return e={$$typeof:T,type:e,key:a,props:i,_owner:d},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:p}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function h(e,a,i,d,P,F){var f=a.children;if(f!==void 0)if(d)if(Ne(f)){for(d=0;d<f.length;d++)g(f[d]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(f);if(X.call(a,"key")){f=t(e);var N=Object.keys(a).filter(function(Se){return Se!=="key"});d=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",ee[f+d]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,d,f,N,f),ee[f+d]=!0)}if(f=null,i!==void 0&&(r(i),f=""+i),b(a)&&(r(a.key),f=""+a.key),"key"in a){i={};for(var Y in a)Y!=="key"&&(i[Y]=a[Y])}else i=a;return f&&c(i,typeof e=="function"?e.displayName||e.name||"Unknown":e),u(e,f,i,s(),P,F)}function g(e){v(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===V&&(e._payload.status==="fulfilled"?v(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function v(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}var _=w,T=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),ve=Symbol.for("react.strict_mode"),ge=Symbol.for("react.profiler"),ye=Symbol.for("react.consumer"),we=Symbol.for("react.context"),_e=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),Re=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),je=Symbol.for("react.client.reference"),I=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,Ne=Array.isArray,D=console.createTask?console.createTask:function(){return null};_={react_stack_bottom_frame:function(e){return e()}};var H,Z={},Q=_.react_stack_bottom_frame.bind(_,l)(),K=D(n(l)),ee={};O.Fragment=y,O.jsx=function(e,a,i){var d=1e4>I.recentlyCreatedOwnerStacks++;return h(e,a,i,!1,d?Error("react-stack-top-frame"):Q,d?D(n(e)):K)},O.jsxs=function(e,a,i){var d=1e4>I.recentlyCreatedOwnerStacks++;return h(e,a,i,!0,d?Error("react-stack-top-frame"):Q,d?D(n(e)):K)}})()),O}var L;function oe(){return L||(L=1,process.env.NODE_ENV==="production"?C.exports=re():C.exports=ne()),C.exports}var m=oe();function M(t){var o,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(o=0;o<s;o++)t[o]&&(r=M(t[o]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function k(){for(var t,o,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(o=M(t))&&(n&&(n+=" "),n+=o);return n}const G=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,B=k,R=(t,o)=>r=>{var n;if(o?.variants==null)return B(t,r?.class,r?.className);const{variants:s,defaultVariants:l}=o,b=Object.keys(s).map(u=>{const h=r?.[u],g=l?.[u];if(h===null)return null;const v=G(h)||G(g);return s[u][v]}),c=r&&Object.entries(r).reduce((u,h)=>{let[g,v]=h;return v===void 0||(u[g]=v),u},{}),p=o==null||(n=o.compoundVariants)===null||n===void 0?void 0:n.reduce((u,h)=>{let{class:g,className:v,..._}=h;return Object.entries(_).every(T=>{let[j,y]=T;return Array.isArray(y)?y.includes({...l,...c}[j]):{...l,...c}[j]===y})?[...u,g,v]:u},[]);return B(t,b,p,r?.class,r?.className)},ae=R(["inline-flex items-center justify-center font-medium","transition-colors duration-150","focus-visible:outline-none","disabled:cursor-not-allowed"],{variants:{size:{sm:"h-[36px] px-4 gap-1 rounded-lg text-sm",md:"h-[44px] px-4 gap-2 rounded-lg text-sm",lg:"h-[52px] px-5 gap-2 rounded-[10px] text-base",xl:"h-[60px] px-6 gap-2 rounded-[10px] text-base","2xl":"h-[68px] px-6 gap-2 rounded-[10px] text-lg"},tone:{primary:""},variant:{solid:["bg-primary-500 text-white","hover:bg-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400","focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-light-100 disabled:text-light-400"]}},defaultVariants:{size:"md",tone:"primary",variant:"solid"}}),se=({children:t,className:o,tone:r,variant:n,size:s,...l})=>m.jsx("button",{className:k(ae({tone:r,variant:n,size:s}),o),...l,children:t}),le=({children:t})=>m.jsx("span",{className:"flex items-center",children:t}),ie=({children:t})=>m.jsx("span",{className:"whitespace-nowrap",children:t}),A=se;A.Icon=le,A.Text=ie;const ue=R(["inline-flex items-center justify-center","border-2 transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400"],{variants:{size:{sm:"h-5 w-5 rounded-[4px]",md:"h-6 w-6 rounded-[6px]",lg:"h-8 w-8 rounded-[8px]"},checked:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{checked:!1,disabled:!1,className:"bg-white border-[#D0D5DD]"},{checked:!0,disabled:!1,className:"bg-primary-500 border-primary-500 text-white"},{disabled:!0,className:"bg-[#F2F4F7] border-[#E4E7EC] text-white"}],defaultVariants:{size:"md",checked:!1,disabled:!1}}),ce={sm:{width:12,height:9},md:{width:14,height:10},lg:{width:18,height:14}},W=E.forwardRef(({id:t,checked:o,indeterminate:r=!1,disabled:n,size:s="md",onCheckedChange:l,className:b},c)=>{const p=()=>{n||l?.(!o)},u=ce[s],h=n?"text-white/80":"text-current";return m.jsxs("button",{id:t,ref:c,type:"button",role:"checkbox","aria-checked":r?"mixed":o,disabled:n,onClick:p,className:k(ue({size:s,checked:o,disabled:n}),b),children:[o&&!r&&m.jsx("svg",{width:u.width,height:u.height,viewBox:"0 0 14 10",fill:"none",className:h,children:m.jsx("path",{d:"M1 5L5 9L13 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),r&&m.jsx("span",{className:k(h,"bg-current rounded-sm",s==="sm"&&"h-0.5 w-3",s==="md"&&"h-0.5 w-4",s==="lg"&&"h-0.5 w-5")})]})});W.displayName="Checkbox";const U=E.createContext(null),de=({value:t,defaultValue:o,onValueChange:r,children:n,className:s})=>{const[l,b]=E.useState(o),c=t??l,p=u=>{b(u),r?.(u)};return m.jsx(U.Provider,{value:{value:c,onValueChange:p},children:m.jsx("div",{role:"radiogroup",className:s,children:n})})},fe=()=>{const t=E.useContext(U);if(!t)throw new Error("RadioGroupItem must be used within RadioGroup");return t},me=R(["relative inline-flex items-center justify-center","border-2 rounded-full transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-400"],{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"},checked:{true:"",false:""},disabled:{true:"cursor-not-allowed",false:"cursor-pointer"}},compoundVariants:[{checked:!1,disabled:!1,className:"border-[#D0D5DD] bg-white"},{checked:!0,disabled:!1,className:"border-primary-500 bg-primary-500"},{disabled:!0,className:"border-[#E4E7EC] bg-[#F2F4F7]"}],defaultVariants:{size:"md",checked:!1,disabled:!1}}),be=R(["rounded-full bg-white transition-all"],{variants:{size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},checked:{true:"scale-100",false:"scale-0"}},defaultVariants:{size:"md",checked:!1}}),q=E.forwardRef(({id:t,value:o,disabled:r,size:n="md",className:s},l)=>{const{value:b,onValueChange:c}=fe(),p=b===o;return m.jsx("button",{ref:l,id:t,type:"button",role:"radio","aria-checked":p,disabled:r,onClick:()=>{r||c?.(o)},className:k(me({size:n,checked:p,disabled:r}),s),children:m.jsx("span",{className:be({size:n,checked:p})})})});q.displayName="RadioGroupItem";const pe=R("relative inline-flex shrink-0 cursor-pointer rounded-full transition-colors duration-200 focus-visible:outline-none",{variants:{size:{sm:"h-6 w-10",md:"h-8 w-14",lg:"h-10 w-[72px]"},checked:{true:"bg-primary-500",false:"bg-[#e4e7ec]"},disabled:{true:"cursor-not-allowed opacity-60"}},defaultVariants:{size:"md",checked:!1}}),he=R("absolute top-1 left-1 rounded-full bg-white transition-transform duration-200 shadow",{variants:{size:{sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},checked:{true:"",false:""}},compoundVariants:[{size:"sm",checked:!0,className:"translate-x-4"},{size:"md",checked:!0,className:"translate-x-6"},{size:"lg",checked:!0,className:"translate-x-8"}],defaultVariants:{size:"md",checked:!1}}),J=E.forwardRef(({checked:t=!1,size:o="md",disabled:r,onCheckedChange:n,className:s},l)=>m.jsx("button",{ref:l,type:"button",role:"switch","aria-checked":t,disabled:r,onClick:()=>{r||n?.(!t)},className:k(pe({size:o,checked:t,disabled:r}),s),children:m.jsx("span",{className:he({size:o,checked:t})})}));J.displayName="Toggle";const xe=({label:t,children:o,isOpen:r,position:n="top"})=>{const[s,l]=w.useState(!1),b=w.useId(),c=typeof r=="boolean",p=c?r:s;function u(){c||l(!0)}function h(){c||l(!1)}const g="absolute z-20 min-w-max max-w-[240px] rounded-xl bg-[#111827] px-4 py-2 text-[13px] leading-snug text-white opacity-0 invisible shadow-[0_10px_30px_rgba(2,8,23,0.2)] transition-all duration-150",v=p?"opacity-100 visible":"",_=c?"":"group-hover:opacity-100 group-hover:visible group-focus-within:opacity-100 group-focus-within:visible",T={top:"bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 translate-y-1","top-start":"bottom-[calc(100%+8px)] left-0 translate-y-1","top-end":"bottom-[calc(100%+8px)] right-0 translate-y-1",bottom:"top-[calc(100%+8px)] left-1/2 -translate-x-1/2 -translate-y-1","bottom-start":"top-[calc(100%+8px)] left-0 -translate-y-1","bottom-end":"top-[calc(100%+8px)] right-0 -translate-y-1",left:"right-[calc(100%+8px)] top-1/2 -translate-y-1/2 translate-x-1",right:"left-[calc(100%+8px)] top-1/2 -translate-y-1/2 -translate-x-1"}[n],j=p?{top:"translate-y-0","top-start":"translate-y-0","top-end":"translate-y-0",bottom:"translate-y-0","bottom-start":"translate-y-0","bottom-end":"translate-y-0",left:"translate-x-0",right:"translate-x-0"}[n]:"",y={top:"top-full left-1/2 -translate-x-1/2 border-t-[#111827]","top-start":"top-full left-4 border-t-[#111827]","top-end":"top-full right-4 border-t-[#111827]",bottom:"bottom-full left-1/2 -translate-x-1/2 border-b-[#111827]","bottom-start":"bottom-full left-4 border-b-[#111827]","bottom-end":"bottom-full right-4 border-b-[#111827]",left:"left-full top-1/2 -translate-y-1/2 border-l-[#111827]",right:"right-full top-1/2 -translate-y-1/2 border-r-[#111827]"}[n];return m.jsxs("span",{className:"group relative inline-flex items-center justify-center font-sans",onMouseEnter:u,onMouseLeave:h,onFocus:u,onBlur:h,children:[m.jsx("span",{className:"inline-flex items-center justify-center gap-1 rounded-md border border-[#d1d5db] bg-white px-2.5 py-1.5 text-sm text-[#111827] outline-none transition-shadow duration-150 focus-visible:border-[#2563eb] focus-visible:shadow-[0_0_0_3px_rgba(37,99,235,0.25)]",tabIndex:0,"aria-describedby":p?b:void 0,children:o}),m.jsxs("span",{id:b,role:"tooltip",className:[g,T,v,j,_].filter(Boolean).join(" "),children:[t,m.jsx("span",{className:["absolute h-0 w-0 border-[8px] border-transparent",y].filter(Boolean).join(" ")})]})]})};x.Button=A,x.Checkbox=W,x.RadioGroup=de,x.RadioGroupItem=q,x.Toggle=J,x.Tooltip=xe,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cekat-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Cekat UI Component Library",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"style": "dist/style.css",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.es.js",
|
|
12
|
+
"require": "./dist/index.umd.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./style.css": "./dist/style.css"
|
|
16
|
+
},
|
|
8
17
|
"files": [
|
|
9
18
|
"dist"
|
|
10
19
|
],
|
|
@@ -26,9 +35,7 @@
|
|
|
26
35
|
"dependencies": {
|
|
27
36
|
"@tabler/icons-react": "^3.36.1",
|
|
28
37
|
"class-variance-authority": "^0.7.1",
|
|
29
|
-
"clsx": "^2.1.1"
|
|
30
|
-
"react": "^19.2.3",
|
|
31
|
-
"react-dom": "^19.2.3"
|
|
38
|
+
"clsx": "^2.1.1"
|
|
32
39
|
},
|
|
33
40
|
"devDependencies": {
|
|
34
41
|
"@rollup/rollup-darwin-arm64": "^4.55.1",
|