cekat-ui 1.0.6 → 1.0.7

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.
@@ -0,0 +1,4 @@
1
+ import { CheckboxProps } from './checkbox.types';
2
+ import * as React from 'react';
3
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
4
+ export default Checkbox;
@@ -0,0 +1,5 @@
1
+ export declare const checkboxBoxStyles: (props?: {
2
+ size?: "sm" | "md" | "lg";
3
+ checked?: boolean;
4
+ disabled?: boolean;
5
+ } & import('class-variance-authority/types').ClassProp) => string;
@@ -0,0 +1,10 @@
1
+ export type CheckboxSize = 'sm' | 'md' | 'lg';
2
+ export interface CheckboxProps {
3
+ id?: string;
4
+ checked: boolean;
5
+ indeterminate?: boolean;
6
+ disabled?: boolean;
7
+ size?: CheckboxSize;
8
+ onCheckedChange?: (value: boolean) => void;
9
+ className?: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ import { default as Checkbox } from './Checkbox';
2
+ export { Checkbox };
3
+ export type { CheckboxProps } from './checkbox.types';
@@ -0,0 +1,6 @@
1
+ import { RadioGroupProps } from './radio.types';
2
+ export declare const RadioGroup: ({ value, defaultValue, onValueChange, children, className, }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const useRadioGroup: () => {
4
+ value?: string;
5
+ onValueChange?: (value: string) => void;
6
+ };
@@ -0,0 +1,3 @@
1
+ import { RadioGroupItemProps } from './radio.types';
2
+ import * as React from 'react';
3
+ export declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,3 @@
1
+ export { RadioGroup } from './RadioGroup';
2
+ export { RadioGroupItem } from './RadioGroupItem';
3
+ export type { RadioGroupProps, RadioGroupItemProps, } from './radio.types';
@@ -0,0 +1,9 @@
1
+ export declare const radioOuterStyles: (props?: {
2
+ size?: "sm" | "md" | "lg";
3
+ checked?: boolean;
4
+ disabled?: boolean;
5
+ } & import('class-variance-authority/types').ClassProp) => string;
6
+ export declare const radioInnerStyles: (props?: {
7
+ size?: "sm" | "md" | "lg";
8
+ checked?: boolean;
9
+ } & import('class-variance-authority/types').ClassProp) => string;
@@ -0,0 +1,15 @@
1
+ export type RadioSize = 'sm' | 'md' | 'lg';
2
+ export interface RadioGroupProps {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onValueChange?: (value: string) => void;
6
+ children: React.ReactNode;
7
+ className?: string;
8
+ }
9
+ export interface RadioGroupItemProps {
10
+ id?: string;
11
+ value: string;
12
+ disabled?: boolean;
13
+ size?: RadioSize;
14
+ className?: string;
15
+ }
@@ -0,0 +1,4 @@
1
+ import { ToggleProps } from './toggle.types';
2
+ import * as React from 'react';
3
+ declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
4
+ export default Toggle;
@@ -0,0 +1,3 @@
1
+ import { default as Toggle } from './Toggle';
2
+ export { Toggle };
3
+ export type { ToggleProps } from './toggle.types';
@@ -0,0 +1,9 @@
1
+ export declare const toggleTrackStyles: (props?: {
2
+ size?: "sm" | "md" | "lg";
3
+ checked?: boolean;
4
+ disabled?: boolean;
5
+ } & import('class-variance-authority/types').ClassProp) => string;
6
+ export declare const toggleThumbStyles: (props?: {
7
+ size?: "sm" | "md" | "lg";
8
+ checked?: boolean;
9
+ } & import('class-variance-authority/types').ClassProp) => string;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export type ToggleSize = 'sm' | 'md' | 'lg';
3
+ export interface ToggleProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
4
+ checked?: boolean;
5
+ size?: ToggleSize;
6
+ onCheckedChange?: (checked: boolean) => void;
7
+ }
@@ -0,0 +1,6 @@
1
+ import { TooltipProps } from './tooltip.types';
2
+ declare const Tooltip: {
3
+ ({ content, side, open, defaultOpen, disabled, delay, className, children, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Tooltip;
@@ -0,0 +1,2 @@
1
+ export { default as Tooltip } from './Tooltip';
2
+ export type { TooltipProps } from './tooltip.types';
@@ -0,0 +1,6 @@
1
+ export declare const tooltipContentStyles: (props?: {
2
+ side?: "top" | "bottom" | "left" | "right";
3
+ } & import('class-variance-authority/types').ClassProp) => string;
4
+ export declare const tooltipArrowStyles: (props?: {
5
+ side?: "top" | "bottom" | "left" | "right";
6
+ } & import('class-variance-authority/types').ClassProp) => string;
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export type TooltipSide = 'top' | 'bottom' | 'left' | 'right';
3
+ export interface TooltipProps {
4
+ content: React.ReactNode;
5
+ children: React.ReactElement;
6
+ side?: TooltipSide;
7
+ open?: boolean;
8
+ defaultOpen?: boolean;
9
+ disabled?: boolean;
10
+ delay?: number;
11
+ className?: string;
12
+ }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './components/Button';
2
- export * from '../src/components/Checkbox';
2
+ export * from './components/Checkbox';
3
3
  export * from './components/Radio';
4
4
  export * from './components/Toggle';
5
5
  export * from './components/Tooltip';
package/dist/index.es.js CHANGED
@@ -1,308 +1,49 @@
1
- import * as R from "react";
2
- import D from "react";
3
- var C = { exports: {} }, T = {};
4
- var B;
5
- function ce() {
6
- if (B) return T;
7
- B = 1;
8
- var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.fragment");
9
- function t(o, n, i) {
10
- var m = null;
11
- if (i !== void 0 && (m = "" + i), n.key !== void 0 && (m = "" + n.key), "key" in n) {
12
- i = {};
13
- for (var u in n)
14
- u !== "key" && (i[u] = n[u]);
15
- } else i = n;
16
- return n = i.ref, {
17
- $$typeof: r,
18
- type: o,
19
- key: m,
20
- ref: n !== void 0 ? n : null,
21
- props: i
22
- };
23
- }
24
- return T.Fragment = s, T.jsx = t, T.jsxs = t, T;
25
- }
26
- var N = {};
27
- var G;
28
- function ue() {
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 === ne ? null : e.displayName || e.name || null;
34
- if (typeof e == "string") return e;
35
- switch (e) {
36
- case x:
37
- return "Fragment";
38
- case Q:
39
- return "Profiler";
40
- case Z:
41
- return "StrictMode";
42
- case re:
43
- return "Suspense";
44
- case oe:
45
- return "SuspenseList";
46
- case ae:
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 a = e.render;
61
- return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
62
- case se:
63
- return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
64
- case O:
65
- a = e._payload, e = e._init;
66
- try {
67
- return r(e(a));
68
- } catch {
69
- }
70
- }
71
- return null;
72
- }
73
- function s(e) {
74
- return "" + e;
75
- }
76
- function t(e) {
77
- try {
78
- s(e);
79
- var a = !1;
80
- } catch {
81
- a = !0;
82
- }
83
- if (a) {
84
- a = console;
85
- var l = a.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
86
- return l.call(
87
- a,
88
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
- d
90
- ), s(e);
91
- }
92
- }
93
- function o(e) {
94
- if (e === x) return "<>";
95
- if (typeof e == "object" && e !== null && e.$$typeof === O)
96
- return "<...>";
97
- try {
98
- var a = r(e);
99
- return a ? "<" + a + ">" : "<...>";
100
- } catch {
101
- return "<...>";
102
- }
103
- }
104
- function n() {
105
- var e = A.A;
106
- return e === null ? null : e.getOwner();
107
- }
108
- function i() {
109
- return Error("react-stack-top-frame");
110
- }
111
- function m(e) {
112
- if (F.call(e, "key")) {
113
- var a = Object.getOwnPropertyDescriptor(e, "key").get;
114
- if (a && a.isReactWarning) return !1;
115
- }
116
- return e.key !== void 0;
117
- }
118
- function u(e, a) {
119
- function l() {
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
- a
123
- ));
124
- }
125
- l.isReactWarning = !0, Object.defineProperty(e, "key", {
126
- get: l,
127
- configurable: !0
128
- });
129
- }
130
- function h() {
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 c(e, a, l, d, S, V) {
137
- var f = l.ref;
138
- return e = {
139
- $$typeof: w,
140
- type: e,
141
- key: a,
142
- props: l,
143
- _owner: d
144
- }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
145
- enumerable: !1,
146
- get: h
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 p(e, a, l, d, S, V) {
170
- var f = a.children;
171
- if (f !== void 0)
172
- if (d)
173
- if (ie(f)) {
174
- for (d = 0; d < f.length; d++)
175
- g(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 g(f);
182
- if (F.call(a, "key")) {
183
- f = r(e);
184
- var E = Object.keys(a).filter(function(le) {
185
- return le !== "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, l !== void 0 && (t(l), f = "" + l), m(a) && (t(a.key), f = "" + a.key), "key" in a) {
201
- l = {};
202
- for (var I in a)
203
- I !== "key" && (l[I] = a[I]);
204
- } else l = a;
205
- return f && u(
206
- l,
207
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
208
- ), c(
209
- e,
210
- f,
211
- l,
212
- n(),
213
- S,
214
- V
215
- );
216
- }
217
- function g(e) {
218
- v(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === O && (e._payload.status === "fulfilled" ? v(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
219
- }
220
- function v(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"), x = /* @__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"), oe = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), O = /* @__PURE__ */ Symbol.for("react.lazy"), ae = /* @__PURE__ */ Symbol.for("react.activity"), ne = /* @__PURE__ */ Symbol.for("react.client.reference"), A = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, ie = 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
- i
234
- )(), $ = P(o(i)), M = {};
235
- N.Fragment = x, N.jsx = function(e, a, l) {
236
- var d = 1e4 > A.recentlyCreatedOwnerStacks++;
237
- return p(
238
- e,
239
- a,
240
- l,
241
- !1,
242
- d ? Error("react-stack-top-frame") : L,
243
- d ? P(o(e)) : $
244
- );
245
- }, N.jsxs = function(e, a, l) {
246
- var d = 1e4 > A.recentlyCreatedOwnerStacks++;
247
- return p(
248
- e,
249
- a,
250
- l,
251
- !0,
252
- d ? Error("react-stack-top-frame") : L,
253
- d ? P(o(e)) : $
254
- );
255
- };
256
- })()), N;
257
- }
258
- var W;
259
- function de() {
260
- return W || (W = 1, process.env.NODE_ENV === "production" ? C.exports = ce() : C.exports = ue()), C.exports;
261
- }
262
- var b = de();
263
- function q(r) {
264
- var s, t, o = "";
265
- if (typeof r == "string" || typeof r == "number") o += r;
266
- else if (typeof r == "object") if (Array.isArray(r)) {
267
- var n = r.length;
268
- for (s = 0; s < n; s++) r[s] && (t = q(r[s])) && (o && (o += " "), o += t);
269
- } else for (t in r) r[t] && (o && (o += " "), o += t);
270
- return o;
1
+ import * as s from "react";
2
+ import E from "react";
3
+ import { createPortal as z } from "react-dom";
4
+ function R(t) {
5
+ var r, e, i = "";
6
+ if (typeof t == "string" || typeof t == "number") i += t;
7
+ else if (typeof t == "object") if (Array.isArray(t)) {
8
+ var o = t.length;
9
+ for (r = 0; r < o; r++) t[r] && (e = R(t[r])) && (i && (i += " "), i += e);
10
+ } else for (e in t) t[e] && (i && (i += " "), i += e);
11
+ return i;
271
12
  }
272
- function k() {
273
- for (var r, s, t = 0, o = "", n = arguments.length; t < n; t++) (r = arguments[t]) && (s = q(r)) && (o && (o += " "), o += s);
274
- return o;
13
+ function g() {
14
+ for (var t, r, e = 0, i = "", o = arguments.length; e < o; e++) (t = arguments[e]) && (r = R(t)) && (i && (i += " "), i += r);
15
+ return i;
275
16
  }
276
- const U = (r) => typeof r == "boolean" ? `${r}` : r === 0 ? "0" : r, J = k, j = (r, s) => (t) => {
277
- var o;
278
- if (s?.variants == null) return J(r, t?.class, t?.className);
279
- const { variants: n, defaultVariants: i } = s, m = Object.keys(n).map((c) => {
280
- const p = t?.[c], g = i?.[c];
281
- if (p === null) return null;
282
- const v = U(p) || U(g);
283
- return n[c][v];
284
- }), u = t && Object.entries(t).reduce((c, p) => {
285
- let [g, v] = p;
286
- return v === void 0 || (c[g] = v), c;
287
- }, {}), h = s == null || (o = s.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((c, p) => {
288
- let { class: g, className: v, ...y } = p;
289
- return Object.entries(y).every((w) => {
290
- let [_, x] = w;
17
+ const V = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, j = g, h = (t, r) => (e) => {
18
+ var i;
19
+ if (r?.variants == null) return j(t, e?.class, e?.className);
20
+ const { variants: o, defaultVariants: a } = r, b = Object.keys(o).map((n) => {
21
+ const l = e?.[n], m = a?.[n];
22
+ if (l === null) return null;
23
+ const f = V(l) || V(m);
24
+ return o[n][f];
25
+ }), d = e && Object.entries(e).reduce((n, l) => {
26
+ let [m, f] = l;
27
+ return f === void 0 || (n[m] = f), n;
28
+ }, {}), u = r == null || (i = r.compoundVariants) === null || i === void 0 ? void 0 : i.reduce((n, l) => {
29
+ let { class: m, className: f, ...v } = l;
30
+ return Object.entries(v).every((k) => {
31
+ let [p, x] = k;
291
32
  return Array.isArray(x) ? x.includes({
292
- ...i,
293
- ...u
294
- }[_]) : {
295
- ...i,
296
- ...u
297
- }[_] === x;
33
+ ...a,
34
+ ...d
35
+ }[p]) : {
36
+ ...a,
37
+ ...d
38
+ }[p] === x;
298
39
  }) ? [
299
- ...c,
300
- g,
301
- v
302
- ] : c;
40
+ ...n,
41
+ m,
42
+ f
43
+ ] : n;
303
44
  }, []);
304
- return J(r, m, h, t?.class, t?.className);
305
- }, fe = j(["inline-flex items-center justify-center font-bold", "transition-colors duration-150", "focus-visible:outline-none", "disabled:cursor-not-allowed"], {
45
+ return j(t, b, u, e?.class, e?.className);
46
+ }, F = h(["inline-flex items-center justify-center font-bold", "transition-colors duration-150", "focus-visible:outline-none", "disabled:cursor-not-allowed"], {
306
47
  variants: {
307
48
  size: {
308
49
  sm: "h-[36px] px-4 gap-1 rounded-lg text-sm",
@@ -403,10 +144,10 @@ const U = (r) => typeof r == "boolean" ? `${r}` : r === 0 ? "0" : r, J = k, j =
403
144
  tone: "primary",
404
145
  variant: "solid"
405
146
  }
406
- }), be = ({ children: r, className: s, tone: t, variant: o, size: n, ...i }) => /* @__PURE__ */ b.jsx("button", { className: k(fe({ tone: t, variant: o, size: n }), s), ...i, children: r }), me = ({ children: r }) => /* @__PURE__ */ b.jsx("span", { className: "flex items-center", children: r }), he = ({ children: r }) => /* @__PURE__ */ b.jsx("span", { className: "whitespace-nowrap", children: r }), X = be;
407
- X.Icon = me;
408
- X.Text = he;
409
- const pe = j(
147
+ }), I = ({ children: t, className: r, tone: e, variant: i, size: o, ...a }) => /* @__PURE__ */ E.createElement("button", { className: g(F({ tone: e, variant: i, size: o }), r), ...a }, t), B = ({ children: t }) => /* @__PURE__ */ E.createElement("span", { className: "flex items-center" }, t), D = ({ children: t }) => /* @__PURE__ */ E.createElement("span", { className: "whitespace-nowrap" }, t), S = I;
148
+ S.Icon = B;
149
+ S.Text = D;
150
+ const O = h(
410
151
  [
411
152
  "inline-flex items-center justify-center",
412
153
  "border-2 transition-colors duration-150",
@@ -450,99 +191,97 @@ const pe = j(
450
191
  disabled: !1
451
192
  }
452
193
  }
453
- ), ve = {
194
+ ), _ = {
454
195
  sm: { width: 12, height: 9 },
455
196
  md: { width: 14, height: 10 },
456
197
  lg: { width: 18, height: 14 }
457
- }, ge = R.forwardRef(
198
+ }, G = s.forwardRef(
458
199
  ({
459
- id: r,
460
- checked: s,
461
- indeterminate: t = !1,
462
- disabled: o,
463
- size: n = "md",
464
- onCheckedChange: i,
465
- className: m
466
- }, u) => {
467
- const h = () => {
468
- o || i?.(!s);
469
- }, c = ve[n], p = o ? "text-white/80" : "text-current";
470
- return /* @__PURE__ */ b.jsxs(
200
+ id: t,
201
+ checked: r,
202
+ indeterminate: e = !1,
203
+ disabled: i,
204
+ size: o = "md",
205
+ onCheckedChange: a,
206
+ className: b
207
+ }, d) => {
208
+ const u = () => {
209
+ i || a?.(!r);
210
+ }, n = _[o], l = i ? "text-white/80" : "text-current";
211
+ return /* @__PURE__ */ s.createElement(
471
212
  "button",
472
213
  {
473
- id: r,
474
- ref: u,
214
+ id: t,
215
+ ref: d,
475
216
  type: "button",
476
217
  role: "checkbox",
477
- "aria-checked": t ? "mixed" : s,
478
- disabled: o,
479
- onClick: h,
480
- className: k(
481
- pe({ size: n, checked: s, disabled: o }),
482
- m
483
- ),
484
- children: [
485
- s && !t && /* @__PURE__ */ b.jsx(
486
- "svg",
487
- {
488
- width: c.width,
489
- height: c.height,
490
- viewBox: "0 0 14 10",
491
- fill: "none",
492
- className: p,
493
- children: /* @__PURE__ */ b.jsx(
494
- "path",
495
- {
496
- d: "M1 5L5 9L13 1",
497
- stroke: "currentColor",
498
- strokeWidth: "2",
499
- strokeLinecap: "round",
500
- strokeLinejoin: "round"
501
- }
502
- )
503
- }
504
- ),
505
- t && /* @__PURE__ */ b.jsx(
506
- "span",
507
- {
508
- className: k(
509
- p,
510
- "bg-current rounded-sm",
511
- n === "sm" && "h-0.5 w-3",
512
- n === "md" && "h-0.5 w-4",
513
- n === "lg" && "h-0.5 w-5"
514
- )
515
- }
218
+ "aria-checked": e ? "mixed" : r,
219
+ disabled: i,
220
+ onClick: u,
221
+ className: g(
222
+ O({ size: o, checked: r, disabled: i }),
223
+ b
224
+ )
225
+ },
226
+ r && !e && /* @__PURE__ */ s.createElement(
227
+ "svg",
228
+ {
229
+ width: n.width,
230
+ height: n.height,
231
+ viewBox: "0 0 14 10",
232
+ fill: "none",
233
+ className: l
234
+ },
235
+ /* @__PURE__ */ s.createElement(
236
+ "path",
237
+ {
238
+ d: "M1 5L5 9L13 1",
239
+ stroke: "currentColor",
240
+ strokeWidth: "2",
241
+ strokeLinecap: "round",
242
+ strokeLinejoin: "round"
243
+ }
244
+ )
245
+ ),
246
+ e && /* @__PURE__ */ s.createElement(
247
+ "span",
248
+ {
249
+ className: g(
250
+ l,
251
+ "bg-current rounded-sm",
252
+ o === "sm" && "h-0.5 w-3",
253
+ o === "md" && "h-0.5 w-4",
254
+ o === "lg" && "h-0.5 w-5"
516
255
  )
517
- ]
518
- }
256
+ }
257
+ )
519
258
  );
520
259
  }
521
260
  );
522
- ge.displayName = "Checkbox";
523
- const H = R.createContext(null), Te = ({
524
- value: r,
525
- defaultValue: s,
526
- onValueChange: t,
527
- children: o,
528
- className: n
261
+ G.displayName = "Checkbox";
262
+ const T = s.createContext(null), Q = ({
263
+ value: t,
264
+ defaultValue: r,
265
+ onValueChange: e,
266
+ children: i,
267
+ className: o
529
268
  }) => {
530
- const [i, m] = R.useState(s), u = r ?? i, h = (c) => {
531
- m(c), t?.(c);
269
+ const [a, b] = s.useState(r), d = t ?? a, u = (n) => {
270
+ b(n), e?.(n);
532
271
  };
533
- return /* @__PURE__ */ b.jsx(
534
- H.Provider,
272
+ return /* @__PURE__ */ s.createElement(
273
+ T.Provider,
535
274
  {
536
- value: { value: u, onValueChange: h },
537
- children: /* @__PURE__ */ b.jsx("div", { role: "radiogroup", className: n, children: o })
538
- }
275
+ value: { value: d, onValueChange: u }
276
+ },
277
+ /* @__PURE__ */ s.createElement("div", { role: "radiogroup", className: o }, i)
539
278
  );
540
- }, xe = () => {
541
- const r = R.useContext(H);
542
- if (!r)
279
+ }, A = () => {
280
+ const t = s.useContext(T);
281
+ if (!t)
543
282
  throw new Error("RadioGroupItem must be used within RadioGroup");
544
- return r;
545
- }, ye = j(
283
+ return t;
284
+ }, L = h(
546
285
  [
547
286
  "relative inline-flex items-center justify-center",
548
287
  "border-2 rounded-full transition-colors duration-150",
@@ -586,7 +325,7 @@ const H = R.createContext(null), Te = ({
586
325
  disabled: !1
587
326
  }
588
327
  }
589
- ), we = j(
328
+ ), P = h(
590
329
  ["rounded-full bg-white transition-all"],
591
330
  {
592
331
  variants: {
@@ -605,38 +344,38 @@ const H = R.createContext(null), Te = ({
605
344
  checked: !1
606
345
  }
607
346
  }
608
- ), _e = R.forwardRef(({ id: r, value: s, disabled: t, size: o = "md", className: n }, i) => {
609
- const { value: m, onValueChange: u } = xe(), h = m === s;
610
- return /* @__PURE__ */ b.jsx(
347
+ ), M = s.forwardRef(({ id: t, value: r, disabled: e, size: i = "md", className: o }, a) => {
348
+ const { value: b, onValueChange: d } = A(), u = b === r;
349
+ return /* @__PURE__ */ s.createElement(
611
350
  "button",
612
351
  {
613
- ref: i,
614
- id: r,
352
+ ref: a,
353
+ id: t,
615
354
  type: "button",
616
355
  role: "radio",
617
- "aria-checked": h,
618
- disabled: t,
356
+ "aria-checked": u,
357
+ disabled: e,
619
358
  onClick: () => {
620
- t || u?.(s);
359
+ e || d?.(r);
621
360
  },
622
- className: k(
623
- ye({ size: o, checked: h, disabled: t }),
624
- n
625
- ),
626
- children: /* @__PURE__ */ b.jsx(
627
- "span",
628
- {
629
- className: we({
630
- size: o,
631
- checked: h
632
- })
633
- }
361
+ className: g(
362
+ L({ size: i, checked: u, disabled: e }),
363
+ o
634
364
  )
635
- }
365
+ },
366
+ /* @__PURE__ */ s.createElement(
367
+ "span",
368
+ {
369
+ className: P({
370
+ size: i,
371
+ checked: u
372
+ })
373
+ }
374
+ )
636
375
  );
637
376
  });
638
- _e.displayName = "RadioGroupItem";
639
- const Ee = j(
377
+ M.displayName = "RadioGroupItem";
378
+ const W = h(
640
379
  "relative inline-flex shrink-0 cursor-pointer rounded-full transition-colors duration-200 focus-visible:outline-none",
641
380
  {
642
381
  variants: {
@@ -658,7 +397,7 @@ const Ee = j(
658
397
  checked: !1
659
398
  }
660
399
  }
661
- ), ke = j(
400
+ ), K = h(
662
401
  "absolute top-1 left-1 rounded-full bg-white transition-transform duration-200 shadow",
663
402
  {
664
403
  variants: {
@@ -694,135 +433,160 @@ const Ee = j(
694
433
  checked: !1
695
434
  }
696
435
  }
697
- ), Re = R.forwardRef(
436
+ ), U = s.forwardRef(
698
437
  ({
699
- checked: r = !1,
700
- size: s = "md",
701
- disabled: t,
702
- onCheckedChange: o,
703
- className: n
704
- }, i) => /* @__PURE__ */ b.jsx(
438
+ checked: t = !1,
439
+ size: r = "md",
440
+ disabled: e,
441
+ onCheckedChange: i,
442
+ className: o
443
+ }, a) => /* @__PURE__ */ s.createElement(
705
444
  "button",
706
445
  {
707
- ref: i,
446
+ ref: a,
708
447
  type: "button",
709
448
  role: "switch",
710
- "aria-checked": r,
711
- disabled: t,
449
+ "aria-checked": t,
450
+ disabled: e,
712
451
  onClick: () => {
713
- t || o?.(!r);
452
+ e || i?.(!t);
714
453
  },
715
- className: k(
716
- Ee({ size: s, checked: r, disabled: t }),
717
- n
718
- ),
719
- children: /* @__PURE__ */ b.jsx(
720
- "span",
721
- {
722
- className: ke({
723
- size: s,
724
- checked: r
725
- })
726
- }
454
+ className: g(
455
+ W({ size: r, checked: t, disabled: e }),
456
+ o
727
457
  )
728
- }
458
+ },
459
+ /* @__PURE__ */ s.createElement(
460
+ "span",
461
+ {
462
+ className: K({
463
+ size: r,
464
+ checked: t
465
+ })
466
+ }
467
+ )
729
468
  )
730
469
  );
731
- Re.displayName = "Toggle";
732
- const Ne = ({
733
- label: r,
734
- children: s,
735
- isOpen: t,
736
- position: o = "top"
737
- }) => {
738
- const [n, i] = D.useState(!1), m = D.useId(), u = typeof t == "boolean", h = u ? t : n;
739
- function c() {
740
- u || i(!0);
470
+ U.displayName = "Toggle";
471
+ const Z = h(
472
+ [
473
+ "relative rounded-xl px-4 py-2 text-sm text-white",
474
+ "bg-[#020b1c]",
475
+ "shadow-[0_10px_30px_rgba(2,8,23,0.25)]",
476
+ "pointer-events-none",
477
+ "select-none"
478
+ ],
479
+ {
480
+ variants: {
481
+ side: {
482
+ top: "",
483
+ bottom: "",
484
+ left: "",
485
+ right: ""
486
+ }
487
+ },
488
+ defaultVariants: {
489
+ side: "top"
490
+ }
741
491
  }
742
- function p() {
743
- u || i(!1);
492
+ ), $ = h(
493
+ [
494
+ "absolute w-2 h-2 rotate-45",
495
+ "bg-[#020b1c]"
496
+ ],
497
+ {
498
+ variants: {
499
+ side: {
500
+ top: "bottom-[-4px] left-1/2 -translate-x-1/2",
501
+ bottom: "top-[-4px] left-1/2 -translate-x-1/2",
502
+ left: "right-[-4px] top-1/2 -translate-y-1/2",
503
+ right: "left-[-4px] top-1/2 -translate-y-1/2"
504
+ }
505
+ },
506
+ defaultVariants: {
507
+ side: "top"
508
+ }
744
509
  }
745
- 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 = h ? "opacity-100 visible" : "", y = u ? "" : "group-hover:opacity-100 group-hover:visible group-focus-within:opacity-100 group-focus-within:visible", w = {
746
- top: "bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 translate-y-1",
747
- "top-start": "bottom-[calc(100%+8px)] left-0 translate-y-1",
748
- "top-end": "bottom-[calc(100%+8px)] right-0 translate-y-1",
749
- bottom: "top-[calc(100%+8px)] left-1/2 -translate-x-1/2 -translate-y-1",
750
- "bottom-start": "top-[calc(100%+8px)] left-0 -translate-y-1",
751
- "bottom-end": "top-[calc(100%+8px)] right-0 -translate-y-1",
752
- left: "right-[calc(100%+8px)] top-1/2 -translate-y-1/2 translate-x-1",
753
- right: "left-[calc(100%+8px)] top-1/2 -translate-y-1/2 -translate-x-1"
754
- }[o], _ = h ? {
755
- top: "translate-y-0",
756
- "top-start": "translate-y-0",
757
- "top-end": "translate-y-0",
758
- bottom: "translate-y-0",
759
- "bottom-start": "translate-y-0",
760
- "bottom-end": "translate-y-0",
761
- left: "translate-x-0",
762
- right: "translate-x-0"
763
- }[o] : "", x = {
764
- top: "top-full left-1/2 -translate-x-1/2 border-t-[#111827]",
765
- "top-start": "top-full left-4 border-t-[#111827]",
766
- "top-end": "top-full right-4 border-t-[#111827]",
767
- bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-[#111827]",
768
- "bottom-start": "bottom-full left-4 border-b-[#111827]",
769
- "bottom-end": "bottom-full right-4 border-b-[#111827]",
770
- left: "left-full top-1/2 -translate-y-1/2 border-l-[#111827]",
771
- right: "right-full top-1/2 -translate-y-1/2 border-r-[#111827]"
772
- }[o];
773
- return /* @__PURE__ */ b.jsxs(
510
+ ), N = 12, q = ({
511
+ content: t,
512
+ side: r = "top",
513
+ open: e,
514
+ defaultOpen: i = !1,
515
+ disabled: o = !1,
516
+ delay: a = 0,
517
+ className: b,
518
+ children: d
519
+ }) => {
520
+ const [u, n] = s.useState(i), [l, m] = s.useState(null), f = s.useRef(null), v = s.useRef(null), k = () => {
521
+ if (o || !f.current) return;
522
+ const c = f.current.getBoundingClientRect();
523
+ let y = 0, w = 0;
524
+ switch (r) {
525
+ case "top":
526
+ y = c.top - N, w = c.left + c.width / 2;
527
+ break;
528
+ case "bottom":
529
+ y = c.bottom + N, w = c.left + c.width / 2;
530
+ break;
531
+ case "left":
532
+ y = c.top + c.height / 2, w = c.left - N;
533
+ break;
534
+ case "right":
535
+ y = c.top + c.height / 2, w = c.right + N;
536
+ break;
537
+ }
538
+ const C = () => {
539
+ m({ top: y, left: w }), n(!0);
540
+ };
541
+ a > 0 ? v.current = window.setTimeout(C, a) : C();
542
+ }, p = () => {
543
+ v.current && (clearTimeout(v.current), v.current = null), n(!1);
544
+ }, x = e ?? u;
545
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
774
546
  "span",
775
547
  {
776
- className: "group relative inline-flex items-center justify-center font-sans",
777
- onMouseEnter: c,
548
+ ref: f,
549
+ className: "inline-flex",
550
+ onMouseEnter: k,
778
551
  onMouseLeave: p,
779
- onFocus: c,
552
+ onFocus: k,
780
553
  onBlur: p,
781
- children: [
782
- /* @__PURE__ */ b.jsx(
783
- "span",
784
- {
785
- 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)]",
786
- tabIndex: 0,
787
- "aria-describedby": h ? m : void 0,
788
- children: s
789
- }
790
- ),
791
- /* @__PURE__ */ b.jsxs(
792
- "span",
793
- {
794
- id: m,
795
- role: "tooltip",
796
- className: [
797
- g,
798
- w,
799
- v,
800
- _,
801
- y
802
- ].filter(Boolean).join(" "),
803
- children: [
804
- r,
805
- /* @__PURE__ */ b.jsx(
806
- "span",
807
- {
808
- className: [
809
- "absolute h-0 w-0 border-[8px] border-transparent",
810
- x
811
- ].filter(Boolean).join(" ")
812
- }
813
- )
814
- ]
815
- }
816
- )
817
- ]
818
- }
819
- );
554
+ tabIndex: 0
555
+ },
556
+ d
557
+ ), x && l && z(
558
+ /* @__PURE__ */ s.createElement(
559
+ "div",
560
+ {
561
+ role: "tooltip",
562
+ className: "fixed z-[9999] pointer-events-none",
563
+ style: {
564
+ top: l.top,
565
+ left: l.left,
566
+ transform: r === "top" ? "translate(-50%, -100%)" : r === "bottom" ? "translate(-50%, 0)" : r === "left" ? "translate(-100%, -50%)" : "translate(0, -50%)"
567
+ }
568
+ },
569
+ /* @__PURE__ */ s.createElement(
570
+ "div",
571
+ {
572
+ className: g(
573
+ Z({ side: r }),
574
+ b
575
+ )
576
+ },
577
+ t,
578
+ /* @__PURE__ */ s.createElement("span", { className: $({ side: r }) })
579
+ )
580
+ ),
581
+ document.body
582
+ ));
820
583
  };
584
+ q.displayName = "Tooltip";
821
585
  export {
822
- X as Button,
823
- ge as Checkbox,
824
- Te as RadioGroup,
825
- _e as RadioGroupItem,
826
- Re as Toggle,
827
- Ne as Tooltip
586
+ S as Button,
587
+ G as Checkbox,
588
+ Q as RadioGroup,
589
+ M as RadioGroupItem,
590
+ U as Toggle,
591
+ q as Tooltip
828
592
  };
package/dist/index.umd.js CHANGED
@@ -1,6 +1 @@
1
- (function(g,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],w):(g=typeof globalThis<"u"?globalThis:g||self,w(g.CekatUI={},g.React))})(this,(function(g,w){"use strict";function te(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}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"),n=Symbol.for("react.fragment");function r(o,a,i){var m=null;if(i!==void 0&&(m=""+i),a.key!==void 0&&(m=""+a.key),"key"in a){i={};for(var c in a)c!=="key"&&(i[c]=a[c])}else i=a;return a=i.ref,{$$typeof:t,type:o,key:m,ref:a!==void 0?a:null,props:i}}return S.Fragment=n,S.jsx=r,S.jsxs=r,S}var O={};var $;function oe(){return $||($=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case xe:return"Profiler";case ve:return"StrictMode";case Ee:return"Suspense";case ke:return"SuspenseList";case Re: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 T:return"Portal";case we:return e.displayName||"Context";case ye:return(e._context.displayName||"Context")+".Consumer";case _e:var s=e.render;return e=e.displayName,e||(e=s.displayName||s.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case je:return s=e.displayName||null,s!==null?s:t(e.type)||"Memo";case V:s=e._payload,e=e._init;try{return t(e(s))}catch{}}return null}function n(e){return""+e}function r(e){try{n(e);var s=!1}catch{s=!0}if(s){s=console;var l=s.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),n(e)}}function o(e){if(e===y)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===V)return"<...>";try{var s=t(e);return s?"<"+s+">":"<...>"}catch{return"<...>"}}function a(){var e=I.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function m(e){if(X.call(e,"key")){var s=Object.getOwnPropertyDescriptor(e,"key").get;if(s&&s.isReactWarning)return!1}return e.key!==void 0}function c(e,s){function l(){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)",s))}l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,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,s,l,d,P,F){var f=l.ref;return e={$$typeof:R,type:e,key:s,props:l,_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,s,l,d,P,F){var f=s.children;if(f!==void 0)if(d)if(Ne(f)){for(d=0;d<f.length;d++)x(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 x(f);if(X.call(s,"key")){f=t(e);var N=Object.keys(s).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,l!==void 0&&(r(l),f=""+l),m(s)&&(r(s.key),f=""+s.key),"key"in s){l={};for(var Y in s)Y!=="key"&&(l[Y]=s[Y])}else l=s;return f&&c(l,typeof e=="function"?e.displayName||e.name||"Unknown":e),u(e,f,l,a(),P,F)}function x(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===R}var _=w,R=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),ve=Symbol.for("react.strict_mode"),xe=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"),je=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Re=Symbol.for("react.activity"),Te=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(_,i)(),K=D(o(i)),ee={};O.Fragment=y,O.jsx=function(e,s,l){var d=1e4>I.recentlyCreatedOwnerStacks++;return h(e,s,l,!1,d?Error("react-stack-top-frame"):Q,d?D(o(e)):K)},O.jsxs=function(e,s,l){var d=1e4>I.recentlyCreatedOwnerStacks++;return h(e,s,l,!0,d?Error("react-stack-top-frame"):Q,d?D(o(e)):K)}})()),O}var L;function ne(){return L||(L=1,process.env.NODE_ENV==="production"?C.exports=re():C.exports=oe()),C.exports}var b=ne();function M(t){var n,r,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=M(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function k(){for(var t,n,r=0,o="",a=arguments.length;r<a;r++)(t=arguments[r])&&(n=M(t))&&(o&&(o+=" "),o+=n);return o}const G=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,B=k,j=(t,n)=>r=>{var o;if(n?.variants==null)return B(t,r?.class,r?.className);const{variants:a,defaultVariants:i}=n,m=Object.keys(a).map(u=>{const h=r?.[u],x=i?.[u];if(h===null)return null;const v=G(h)||G(x);return a[u][v]}),c=r&&Object.entries(r).reduce((u,h)=>{let[x,v]=h;return v===void 0||(u[x]=v),u},{}),p=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,h)=>{let{class:x,className:v,..._}=h;return Object.entries(_).every(R=>{let[T,y]=R;return Array.isArray(y)?y.includes({...i,...c}[T]):{...i,...c}[T]===y})?[...u,x,v]:u},[]);return B(t,m,p,r?.class,r?.className)},se=j(["inline-flex items-center justify-center font-bold","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-body-sm",xl:"h-[60px] px-6 gap-2 rounded-[10px] text-body-lg","2xl":"h-[68px] px-6 gap-2 rounded-[10px] text-body-lg"},tone:{primary:"",destructive:""},variant:{solid:["text-white","disabled:bg-light-100 disabled:text-light-400"],outline:["bg-white border","disabled:bg-white disabled:text-light-400 disabled:border-light-200"],ghost:["bg-white","disabled:text-light-400"],"outline-primary":["bg-white border border-primary-500 text-primary-500","hover:bg-primary-100 hover:border-primary-300 hover:text-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-white disabled:text-light-400 disabled:border-light-200"],"ghost-primary":["bg-white text-primary-500","hover:bg-primary-50 hover:text-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:text-light-400"],plain:["bg-transparent !rounded-md","disabled:text-light-400 h-auto !px-2"],"plain-black":["bg-transparent !rounded-md","disabled:text-light-400 h-auto !px-2 "]}},compoundVariants:[{tone:"primary",variant:"solid",class:["bg-primary-500","hover:bg-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"primary",variant:"outline",class:["border-light-200 text-light-900","hover:bg-light-50","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"primary",variant:"ghost",class:["text-light-800","hover:bg-light-50","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"primary",variant:"plain",class:["text-primary-500","hover:text-primary-800 hover:bg-transparent","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2"].join(" ")},{tone:"primary",variant:"plain-black",class:["text-light-900","hover:text-light-900 hover:bg-transparent","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2"].join(" ")},{tone:"destructive",variant:"solid",class:["bg-error-500 text-white","hover:bg-error-800","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-light-100"].join(" ")},{tone:"destructive",variant:"outline",class:["border-error-500 text-error-500","hover:border-error-300 hover:bg-error-50 hover:text-error-800","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"destructive",variant:"ghost",class:["text-error-500","hover:bg-error-50 hover:text-error-800","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-white disabled:text-light-400"].join(" ")},{tone:"destructive",variant:"plain",class:["text-error-500","hover:text-error-800 hover:bg-transparent","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2"].join(" ")}],defaultVariants:{size:"md",tone:"primary",variant:"solid"}}),ae=({children:t,className:n,tone:r,variant:o,size:a,...i})=>b.jsx("button",{className:k(se({tone:r,variant:o,size:a}),n),...i,children:t}),ie=({children:t})=>b.jsx("span",{className:"flex items-center",children:t}),le=({children:t})=>b.jsx("span",{className:"whitespace-nowrap",children:t}),A=ae;A.Icon=ie,A.Text=le;const ue=j(["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:n,indeterminate:r=!1,disabled:o,size:a="md",onCheckedChange:i,className:m},c)=>{const p=()=>{o||i?.(!n)},u=ce[a],h=o?"text-white/80":"text-current";return b.jsxs("button",{id:t,ref:c,type:"button",role:"checkbox","aria-checked":r?"mixed":n,disabled:o,onClick:p,className:k(ue({size:a,checked:n,disabled:o}),m),children:[n&&!r&&b.jsx("svg",{width:u.width,height:u.height,viewBox:"0 0 14 10",fill:"none",className:h,children:b.jsx("path",{d:"M1 5L5 9L13 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),r&&b.jsx("span",{className:k(h,"bg-current rounded-sm",a==="sm"&&"h-0.5 w-3",a==="md"&&"h-0.5 w-4",a==="lg"&&"h-0.5 w-5")})]})});W.displayName="Checkbox";const U=E.createContext(null),de=({value:t,defaultValue:n,onValueChange:r,children:o,className:a})=>{const[i,m]=E.useState(n),c=t??i,p=u=>{m(u),r?.(u)};return b.jsx(U.Provider,{value:{value:c,onValueChange:p},children:b.jsx("div",{role:"radiogroup",className:a,children:o})})},fe=()=>{const t=E.useContext(U);if(!t)throw new Error("RadioGroupItem must be used within RadioGroup");return t},be=j(["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}}),me=j(["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:n,disabled:r,size:o="md",className:a},i)=>{const{value:m,onValueChange:c}=fe(),p=m===n;return b.jsx("button",{ref:i,id:t,type:"button",role:"radio","aria-checked":p,disabled:r,onClick:()=>{r||c?.(n)},className:k(be({size:o,checked:p,disabled:r}),a),children:b.jsx("span",{className:me({size:o,checked:p})})})});q.displayName="RadioGroupItem";const pe=j("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=j("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:n="md",disabled:r,onCheckedChange:o,className:a},i)=>b.jsx("button",{ref:i,type:"button",role:"switch","aria-checked":t,disabled:r,onClick:()=>{r||o?.(!t)},className:k(pe({size:n,checked:t,disabled:r}),a),children:b.jsx("span",{className:he({size:n,checked:t})})}));J.displayName="Toggle";const ge=({label:t,children:n,isOpen:r,position:o="top"})=>{const[a,i]=w.useState(!1),m=w.useId(),c=typeof r=="boolean",p=c?r:a;function u(){c||i(!0)}function h(){c||i(!1)}const x="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",R={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"}[o],T=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"}[o]:"",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]"}[o];return b.jsxs("span",{className:"group relative inline-flex items-center justify-center font-sans",onMouseEnter:u,onMouseLeave:h,onFocus:u,onBlur:h,children:[b.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?m:void 0,children:n}),b.jsxs("span",{id:m,role:"tooltip",className:[x,R,v,T,_].filter(Boolean).join(" "),children:[t,b.jsx("span",{className:["absolute h-0 w-0 border-[8px] border-transparent",y].filter(Boolean).join(" ")})]})]})};g.Button=A,g.Checkbox=W,g.RadioGroup=de,g.RadioGroupItem=q,g.Toggle=J,g.Tooltip=ge,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(l,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],h):(l=typeof globalThis<"u"?globalThis:l||self,h(l.CekatUI={},l.React,l.reactDom))})(this,(function(l,h,F){"use strict";function G(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=G(h);function j(t){var r,e,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(e=j(t[r]))&&(i&&(i+=" "),i+=e)}else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function v(){for(var t,r,e=0,i="",s=arguments.length;e<s;e++)(t=arguments[e])&&(r=j(t))&&(i&&(i+=" "),i+=r);return i}const S=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,T=v,m=(t,r)=>e=>{var i;if(r?.variants==null)return T(t,e?.class,e?.className);const{variants:s,defaultVariants:a}=r,g=Object.keys(s).map(n=>{const c=e?.[n],p=a?.[n];if(c===null)return null;const b=S(c)||S(p);return s[n][b]}),f=e&&Object.entries(e).reduce((n,c)=>{let[p,b]=c;return b===void 0||(n[p]=b),n},{}),d=r==null||(i=r.compoundVariants)===null||i===void 0?void 0:i.reduce((n,c)=>{let{class:p,className:b,...x}=c;return Object.entries(x).every(C=>{let[y,w]=C;return Array.isArray(w)?w.includes({...a,...f}[y]):{...a,...f}[y]===w})?[...n,p,b]:n},[]);return T(t,g,d,e?.class,e?.className)},_=m(["inline-flex items-center justify-center font-bold","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-body-sm",xl:"h-[60px] px-6 gap-2 rounded-[10px] text-body-lg","2xl":"h-[68px] px-6 gap-2 rounded-[10px] text-body-lg"},tone:{primary:"",destructive:""},variant:{solid:["text-white","disabled:bg-light-100 disabled:text-light-400"],outline:["bg-white border","disabled:bg-white disabled:text-light-400 disabled:border-light-200"],ghost:["bg-white","disabled:text-light-400"],"outline-primary":["bg-white border border-primary-500 text-primary-500","hover:bg-primary-100 hover:border-primary-300 hover:text-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-white disabled:text-light-400 disabled:border-light-200"],"ghost-primary":["bg-white text-primary-500","hover:bg-primary-50 hover:text-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:text-light-400"],plain:["bg-transparent !rounded-md","disabled:text-light-400 h-auto !px-2"],"plain-black":["bg-transparent !rounded-md","disabled:text-light-400 h-auto !px-2 "]}},compoundVariants:[{tone:"primary",variant:"solid",class:["bg-primary-500","hover:bg-primary-800","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"primary",variant:"outline",class:["border-light-200 text-light-900","hover:bg-light-50","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"primary",variant:"ghost",class:["text-light-800","hover:bg-light-50","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"primary",variant:"plain",class:["text-primary-500","hover:text-primary-800 hover:bg-transparent","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2"].join(" ")},{tone:"primary",variant:"plain-black",class:["text-light-900","hover:text-light-900 hover:bg-transparent","focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:ring-offset-2"].join(" ")},{tone:"destructive",variant:"solid",class:["bg-error-500 text-white","hover:bg-error-800","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-light-100"].join(" ")},{tone:"destructive",variant:"outline",class:["border-error-500 text-error-500","hover:border-error-300 hover:bg-error-50 hover:text-error-800","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white"].join(" ")},{tone:"destructive",variant:"ghost",class:["text-error-500","hover:bg-error-50 hover:text-error-800","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2 focus-visible:ring-offset-white","disabled:bg-white disabled:text-light-400"].join(" ")},{tone:"destructive",variant:"plain",class:["text-error-500","hover:text-error-800 hover:bg-transparent","focus-visible:ring-2 focus-visible:ring-error-300 focus-visible:ring-offset-2"].join(" ")}],defaultVariants:{size:"md",tone:"primary",variant:"solid"}}),P=({children:t,className:r,tone:e,variant:i,size:s,...a})=>h.createElement("button",{className:v(_({tone:e,variant:i,size:s}),r),...a},t),A=({children:t})=>h.createElement("span",{className:"flex items-center"},t),L=({children:t})=>h.createElement("span",{className:"whitespace-nowrap"},t),V=P;V.Icon=A,V.Text=L;const M=m(["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}}),q={sm:{width:12,height:9},md:{width:14,height:10},lg:{width:18,height:14}},R=o.forwardRef(({id:t,checked:r,indeterminate:e=!1,disabled:i,size:s="md",onCheckedChange:a,className:g},f)=>{const d=()=>{i||a?.(!r)},n=q[s],c=i?"text-white/80":"text-current";return o.createElement("button",{id:t,ref:f,type:"button",role:"checkbox","aria-checked":e?"mixed":r,disabled:i,onClick:d,className:v(M({size:s,checked:r,disabled:i}),g)},r&&!e&&o.createElement("svg",{width:n.width,height:n.height,viewBox:"0 0 14 10",fill:"none",className:c},o.createElement("path",{d:"M1 5L5 9L13 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),e&&o.createElement("span",{className:v(c,"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")}))});R.displayName="Checkbox";const O=o.createContext(null),U=({value:t,defaultValue:r,onValueChange:e,children:i,className:s})=>{const[a,g]=o.useState(r),f=t??a,d=n=>{g(n),e?.(n)};return o.createElement(O.Provider,{value:{value:f,onValueChange:d}},o.createElement("div",{role:"radiogroup",className:s},i))},W=()=>{const t=o.useContext(O);if(!t)throw new Error("RadioGroupItem must be used within RadioGroup");return t},K=m(["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}}),Z=m(["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}}),z=o.forwardRef(({id:t,value:r,disabled:e,size:i="md",className:s},a)=>{const{value:g,onValueChange:f}=W(),d=g===r;return o.createElement("button",{ref:a,id:t,type:"button",role:"radio","aria-checked":d,disabled:e,onClick:()=>{e||f?.(r)},className:v(K({size:i,checked:d,disabled:e}),s)},o.createElement("span",{className:Z({size:i,checked:d})}))});z.displayName="RadioGroupItem";const $=m("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}}),H=m("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}}),I=o.forwardRef(({checked:t=!1,size:r="md",disabled:e,onCheckedChange:i,className:s},a)=>o.createElement("button",{ref:a,type:"button",role:"switch","aria-checked":t,disabled:e,onClick:()=>{e||i?.(!t)},className:v($({size:r,checked:t,disabled:e}),s)},o.createElement("span",{className:H({size:r,checked:t})})));I.displayName="Toggle";const J=m(["relative rounded-xl px-4 py-2 text-sm text-white","bg-[#020b1c]","shadow-[0_10px_30px_rgba(2,8,23,0.25)]","pointer-events-none","select-none"],{variants:{side:{top:"",bottom:"",left:"",right:""}},defaultVariants:{side:"top"}}),Q=m(["absolute w-2 h-2 rotate-45","bg-[#020b1c]"],{variants:{side:{top:"bottom-[-4px] left-1/2 -translate-x-1/2",bottom:"top-[-4px] left-1/2 -translate-x-1/2",left:"right-[-4px] top-1/2 -translate-y-1/2",right:"left-[-4px] top-1/2 -translate-y-1/2"}},defaultVariants:{side:"top"}}),E=12,D=({content:t,side:r="top",open:e,defaultOpen:i=!1,disabled:s=!1,delay:a=0,className:g,children:f})=>{const[d,n]=o.useState(i),[c,p]=o.useState(null),b=o.useRef(null),x=o.useRef(null),C=()=>{if(s||!b.current)return;const u=b.current.getBoundingClientRect();let k=0,N=0;switch(r){case"top":k=u.top-E,N=u.left+u.width/2;break;case"bottom":k=u.bottom+E,N=u.left+u.width/2;break;case"left":k=u.top+u.height/2,N=u.left-E;break;case"right":k=u.top+u.height/2,N=u.right+E;break}const B=()=>{p({top:k,left:N}),n(!0)};a>0?x.current=window.setTimeout(B,a):B()},y=()=>{x.current&&(clearTimeout(x.current),x.current=null),n(!1)},w=e??d;return o.createElement(o.Fragment,null,o.createElement("span",{ref:b,className:"inline-flex",onMouseEnter:C,onMouseLeave:y,onFocus:C,onBlur:y,tabIndex:0},f),w&&c&&F.createPortal(o.createElement("div",{role:"tooltip",className:"fixed z-[9999] pointer-events-none",style:{top:c.top,left:c.left,transform:r==="top"?"translate(-50%, -100%)":r==="bottom"?"translate(-50%, 0)":r==="left"?"translate(-100%, -50%)":"translate(0, -50%)"}},o.createElement("div",{className:v(J({side:r}),g)},t,o.createElement("span",{className:Q({side:r})}))),document.body))};D.displayName="Tooltip",l.Button=V,l.Checkbox=R,l.RadioGroup=U,l.RadioGroupItem=z,l.Toggle=I,l.Tooltip=D,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cekat-ui",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Cekat UI Component Library",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "sideEffects": false,
21
21
  "peerDependencies": {
22
- "react": ">=18 <19",
23
- "react-dom": ">=18 <19"
22
+ "react": "^18.3.1",
23
+ "react-dom": "^18.3.1"
24
24
  },
25
25
  "scripts": {
26
26
  "dev": "storybook dev -p 6006",
@@ -36,15 +36,15 @@
36
36
  "@tabler/icons-react": "^3.36.1",
37
37
  "class-variance-authority": "^0.7.1",
38
38
  "clsx": "^2.1.1",
39
- "react": "^18.2.0",
40
- "react-dom": "^18.2.0"
39
+ "react": "18.3.1",
40
+ "react-dom": "18.3.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@rollup/rollup-darwin-arm64": "^4.55.1",
44
44
  "@storybook/react-vite": "^10.1.9",
45
45
  "@types/node": "^25.0.8",
46
- "@types/react": "^18.2.79",
47
- "@types/react-dom": "^18.2.25",
46
+ "@types/react": "^18",
47
+ "@types/react-dom": "^18",
48
48
  "@vitejs/plugin-react": "^5.1.2",
49
49
  "autoprefixer": "^10.4.23",
50
50
  "postcss": "^8.5.6",
@@ -1,2 +0,0 @@
1
- export { RadioGroup, RadioGroupItem } from '../../src/components/Radio';
2
- export type { RadioGroupProps, RadioGroupItemProps, } from '../../src/components/Radio/radio.types';
@@ -1,2 +0,0 @@
1
- export { Toggle } from '../../src/components/Toggle';
2
- export type { ToggleProps } from '../../src/components/Toggle/toggle.types';
@@ -1,2 +0,0 @@
1
- export { Tooltip } from '../../stories/Tooltip';
2
- export type { TooltipProps } from '../../src/components/Tooltip/tooltip.types';