@equal-experts/kuat-react 0.2.4 → 0.2.5

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/README.md CHANGED
@@ -42,6 +42,42 @@ pnpm add lucide-react
42
42
 
43
43
  **Note:** `@equal-experts/kuat-core` is bundled with this package - you don't need to install it separately. Only install the Radix UI packages for the components you actually use.
44
44
 
45
+ ### Recommended: Use Subpath Imports
46
+
47
+ To avoid installing all peer dependencies when you only need specific components, use **subpath imports**. This allows you to import only the components you need and only install their required peer dependencies.
48
+
49
+ **Example: Only using Button**
50
+
51
+ ```bash
52
+ # Only install peer dependencies for Button
53
+ pnpm add react react-dom @radix-ui/react-slot
54
+ ```
55
+
56
+ ```tsx
57
+ // Import from subpath - only Button and its dependencies are required
58
+ import { Button } from "@equal-experts/kuat-react/button";
59
+ ```
60
+
61
+ **Component Peer Dependencies:**
62
+
63
+ - **Button**: `react`, `react-dom`, `@radix-ui/react-slot`
64
+ - **Accordion**: `react`, `react-dom`, `@radix-ui/react-accordion`, `lucide-react`
65
+ - **AlertDialog**: `react`, `react-dom`, `@radix-ui/react-alert-dialog`
66
+ - **Badge**: `react`, `react-dom` (no additional Radix UI dependencies)
67
+
68
+ **Using Main Export (All Components):**
69
+
70
+ If you import from the main package, you'll need all peer dependencies:
71
+
72
+ ```tsx
73
+ // This requires ALL peer dependencies to be installed
74
+ import { Button, Accordion, AlertDialog } from "@equal-experts/kuat-react";
75
+ ```
76
+
77
+ **lucide-react Version Support:**
78
+
79
+ The package supports `lucide-react` versions `^0.344.0 || >=0.400.0`, including the latest versions (0.562.0+).
80
+
45
81
  ---
46
82
 
47
83
  ## Setup
@@ -148,14 +184,30 @@ If you want to use different fonts or load them differently, you can override th
148
184
 
149
185
  ### Import Components
150
186
 
187
+ You can import components in two ways:
188
+
189
+ **Option 1: Subpath Import (Recommended for single components)**
190
+
151
191
  ```typescript
192
+ // Import only Button - only requires Button's peer dependencies
193
+ import { Button } from "@equal-experts/kuat-react/button";
194
+ ```
195
+
196
+ **Option 2: Main Package Import**
197
+
198
+ ```typescript
199
+ // Import from main package - requires all peer dependencies
152
200
  import { Button } from "@equal-experts/kuat-react";
153
201
  ```
154
202
 
155
203
  ### Use in Your App
156
204
 
157
205
  ```tsx
158
- import { Button } from "@equal-experts/kuat-react";
206
+ // Recommended: Subpath import
207
+ import { Button } from "@equal-experts/kuat-react/button";
208
+
209
+ // Or: Main package import
210
+ // import { Button } from "@equal-experts/kuat-react";
159
211
 
160
212
  function App() {
161
213
  return (
@@ -0,0 +1,46 @@
1
+ import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import * as a from "@radix-ui/react-accordion";
4
+ import { ChevronDown as d } from "lucide-react";
5
+ import { c as i } from "./styles-qaFjX9_3.js";
6
+ const w = a.Root, m = s.forwardRef(({ className: e, ...o }, r) => /* @__PURE__ */ t(
7
+ a.Item,
8
+ {
9
+ ref: r,
10
+ className: i("border-b", e),
11
+ ...o
12
+ }
13
+ ));
14
+ m.displayName = "AccordionItem";
15
+ const l = s.forwardRef(({ className: e, children: o, ...r }, n) => /* @__PURE__ */ t(a.Header, { className: "flex", children: /* @__PURE__ */ c(
16
+ a.Trigger,
17
+ {
18
+ ref: n,
19
+ className: i(
20
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180 ",
21
+ e
22
+ ),
23
+ ...r,
24
+ children: [
25
+ o,
26
+ /* @__PURE__ */ t(d, { className: "h-4 w-4 shrink-0 transition-transform duration-200" })
27
+ ]
28
+ }
29
+ ) }));
30
+ l.displayName = a.Trigger.displayName;
31
+ const f = s.forwardRef(({ className: e, children: o, ...r }, n) => /* @__PURE__ */ t(
32
+ a.Content,
33
+ {
34
+ ref: n,
35
+ className: "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
36
+ ...r,
37
+ children: /* @__PURE__ */ t("div", { className: i("pb-4 pt-0", e), children: o })
38
+ }
39
+ ));
40
+ f.displayName = a.Content.displayName;
41
+ export {
42
+ w as A,
43
+ m as a,
44
+ l as b,
45
+ f as c
46
+ };
@@ -0,0 +1,2 @@
1
+ export { cn } from './lib/utils';
2
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from './components/ui/accordion';
@@ -0,0 +1,9 @@
1
+ import { c as r } from "./styles-qaFjX9_3.js";
2
+ import { A as a, c as e, a as i, b as s } from "./accordion-Da2BsKRK.js";
3
+ export {
4
+ a as Accordion,
5
+ e as AccordionContent,
6
+ i as AccordionItem,
7
+ s as AccordionTrigger,
8
+ r as cn
9
+ };
@@ -0,0 +1,113 @@
1
+ import { jsx as s, jsxs as n } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import * as t from "@radix-ui/react-alert-dialog";
4
+ import { c as l } from "./styles-qaFjX9_3.js";
5
+ import { b as r } from "./button-X-yV4Iwq.js";
6
+ const w = t.Root, b = t.Trigger, m = t.Portal, d = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s(
7
+ t.Overlay,
8
+ {
9
+ className: l(
10
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
11
+ a
12
+ ),
13
+ ...e,
14
+ ref: o
15
+ }
16
+ ));
17
+ d.displayName = t.Overlay.displayName;
18
+ const c = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ n(m, { children: [
19
+ /* @__PURE__ */ s(d, {}),
20
+ /* @__PURE__ */ s(
21
+ t.Content,
22
+ {
23
+ ref: o,
24
+ className: l(
25
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
26
+ a
27
+ ),
28
+ ...e
29
+ }
30
+ )
31
+ ] }));
32
+ c.displayName = t.Content.displayName;
33
+ const f = ({
34
+ className: a,
35
+ ...e
36
+ }) => /* @__PURE__ */ s(
37
+ "div",
38
+ {
39
+ className: l(
40
+ "flex flex-col space-y-2 text-center sm:text-left",
41
+ a
42
+ ),
43
+ ...e
44
+ }
45
+ );
46
+ f.displayName = "AlertDialogHeader";
47
+ const p = ({
48
+ className: a,
49
+ ...e
50
+ }) => /* @__PURE__ */ s(
51
+ "div",
52
+ {
53
+ className: l(
54
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
55
+ a
56
+ ),
57
+ ...e
58
+ }
59
+ );
60
+ p.displayName = "AlertDialogFooter";
61
+ const g = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s(
62
+ t.Title,
63
+ {
64
+ ref: o,
65
+ className: l("text-lg font-semibold", a),
66
+ ...e
67
+ }
68
+ ));
69
+ g.displayName = t.Title.displayName;
70
+ const N = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s(
71
+ t.Description,
72
+ {
73
+ ref: o,
74
+ className: l("text-sm text-muted-foreground", a),
75
+ ...e
76
+ }
77
+ ));
78
+ N.displayName = t.Description.displayName;
79
+ const y = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s(
80
+ t.Action,
81
+ {
82
+ ref: o,
83
+ className: l(r(), a),
84
+ ...e
85
+ }
86
+ ));
87
+ y.displayName = t.Action.displayName;
88
+ const x = i.forwardRef(({ className: a, ...e }, o) => /* @__PURE__ */ s(
89
+ t.Cancel,
90
+ {
91
+ ref: o,
92
+ className: l(
93
+ r({ variant: "outline" }),
94
+ "mt-2 sm:mt-0",
95
+ a
96
+ ),
97
+ ...e
98
+ }
99
+ ));
100
+ x.displayName = t.Cancel.displayName;
101
+ export {
102
+ w as A,
103
+ m as a,
104
+ d as b,
105
+ b as c,
106
+ c as d,
107
+ f as e,
108
+ p as f,
109
+ g,
110
+ N as h,
111
+ y as i,
112
+ x as j
113
+ };
@@ -0,0 +1,2 @@
1
+ export { cn } from './lib/utils';
2
+ export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, } from './components/ui/alert-dialog';
@@ -0,0 +1,16 @@
1
+ import { c as e } from "./styles-qaFjX9_3.js";
2
+ import { A as o, i as t, j as i, d as g, h as s, f as A, e as D, b as c, a as n, g as f, c as p } from "./alert-dialog-C769FFOM.js";
3
+ export {
4
+ o as AlertDialog,
5
+ t as AlertDialogAction,
6
+ i as AlertDialogCancel,
7
+ g as AlertDialogContent,
8
+ s as AlertDialogDescription,
9
+ A as AlertDialogFooter,
10
+ D as AlertDialogHeader,
11
+ c as AlertDialogOverlay,
12
+ n as AlertDialogPortal,
13
+ f as AlertDialogTitle,
14
+ p as AlertDialogTrigger,
15
+ e as cn
16
+ };
@@ -0,0 +1,26 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { c as o } from "./index-D5fkjZ2l.js";
3
+ import { c as a } from "./styles-qaFjX9_3.js";
4
+ const s = o(
5
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
6
+ {
7
+ variants: {
8
+ variant: {
9
+ default: "border-transparent bg-primary text-primary-foreground",
10
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
11
+ destructive: "border-transparent bg-destructive text-destructive-foreground",
12
+ outline: "text-foreground"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ variant: "default"
17
+ }
18
+ }
19
+ );
20
+ function u({ className: r, variant: t, ...e }) {
21
+ return /* @__PURE__ */ n("div", { className: a(s({ variant: t }), r), ...e });
22
+ }
23
+ export {
24
+ u as B,
25
+ s as b
26
+ };
@@ -0,0 +1,3 @@
1
+ export { cn } from './lib/utils';
2
+ export { Badge, badgeVariants } from './components/ui/badge';
3
+ export type { BadgeProps } from './components/ui/badge';
package/dist/badge.js ADDED
@@ -0,0 +1,7 @@
1
+ import { c as e } from "./styles-qaFjX9_3.js";
2
+ import { B as s, b as t } from "./badge-BXjC4NYJ.js";
3
+ export {
4
+ s as Badge,
5
+ t as badgeVariants,
6
+ e as cn
7
+ };
@@ -0,0 +1,44 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { Slot as d } from "@radix-ui/react-slot";
4
+ import { c } from "./index-D5fkjZ2l.js";
5
+ import { c as u } from "./styles-qaFjX9_3.js";
6
+ const f = c(
7
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
12
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
13
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
14
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ ghost: "hover:bg-accent hover:text-accent-foreground",
16
+ link: "text-primary underline-offset-4 hover:underline"
17
+ },
18
+ size: {
19
+ default: "h-10 px-4 py-2",
20
+ sm: "h-9 rounded-md px-3",
21
+ lg: "h-11 rounded-md px-8",
22
+ icon: "h-10 w-10"
23
+ }
24
+ },
25
+ defaultVariants: {
26
+ variant: "default",
27
+ size: "default"
28
+ }
29
+ }
30
+ ), g = a.forwardRef(
31
+ ({ className: e, variant: r, size: t, asChild: o = !1, ...n }, i) => /* @__PURE__ */ s(
32
+ o ? d : "button",
33
+ {
34
+ className: u(f({ variant: r, size: t, className: e })),
35
+ ref: i,
36
+ ...n
37
+ }
38
+ )
39
+ );
40
+ g.displayName = "Button";
41
+ export {
42
+ g as B,
43
+ f as b
44
+ };
@@ -0,0 +1,3 @@
1
+ export { cn } from './lib/utils';
2
+ export { Button, buttonVariants } from './components/ui/button';
3
+ export type { ButtonProps } from './components/ui/button';
package/dist/button.js ADDED
@@ -0,0 +1,7 @@
1
+ import { c as a } from "./styles-qaFjX9_3.js";
2
+ import { B as n, b as s } from "./button-X-yV4Iwq.js";
3
+ export {
4
+ n as Button,
5
+ s as buttonVariants,
6
+ a as cn
7
+ };
@@ -0,0 +1,34 @@
1
+ import { a as O } from "./styles-qaFjX9_3.js";
2
+ const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
3
+ var u;
4
+ if ((l == null ? void 0 : l.variants) == null) return y(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
5
+ const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
6
+ const a = n == null ? void 0 : n[t], s = d == null ? void 0 : d[t];
7
+ if (a === null) return null;
8
+ const i = m(a) || m(s);
9
+ return r[t][i];
10
+ }), v = n && Object.entries(n).reduce((t, a) => {
11
+ let [s, i] = a;
12
+ return i === void 0 || (t[s] = i), t;
13
+ }, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
14
+ let { class: s, className: i, ...f } = a;
15
+ return Object.entries(f).every((C) => {
16
+ let [c, o] = C;
17
+ return Array.isArray(o) ? o.includes({
18
+ ...d,
19
+ ...v
20
+ }[c]) : {
21
+ ...d,
22
+ ...v
23
+ }[c] === o;
24
+ }) ? [
25
+ ...t,
26
+ s,
27
+ i
28
+ ] : t;
29
+ }, []);
30
+ return y(e, V, N, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
31
+ };
32
+ export {
33
+ j as c
34
+ };