@tan-ahmed/tan-ui-kit 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -33,8 +33,6 @@ See [INSTALLATION_TROUBLESHOOTING.md](./INSTALLATION_TROUBLESHOOTING.md) for mor
33
33
 
34
34
  ## Usage
35
35
 
36
- The package includes pre-generated CSS with all utility classes, so **no Tailwind configuration is needed** - it works out of the box!
37
-
38
36
  ### 1. Import styles in your entry file
39
37
 
40
38
  Import the styles once in your main entry point file:
@@ -47,7 +45,7 @@ Import the styles once in your main entry point file:
47
45
 
48
46
  ```tsx
49
47
  // In your main entry point file (e.g., src/main.tsx, app.tsx, etc.)
50
- import "@tan-ahmed/tan-ui-kit/styles"; // ⚠️ Import this at the top of your entry file
48
+ import "@tan-ahmed/tan-ui-kit/styles";
51
49
  ```
52
50
 
53
51
  ### 2. Use components anywhere
@@ -62,14 +60,22 @@ function MyComponent() {
62
60
  }
63
61
  ```
64
62
 
65
- ## Peer Dependencies
63
+ ### Next.js App Router
66
64
 
67
- This package requires the following peer dependencies:
65
+ This library is fully compatible with Next.js App Router. Components are automatically marked as Client Components, so you don't need to add `"use client"` directives when importing them:
68
66
 
69
- - `react`: ^18.0.0 || ^19.0.0
70
- - `react-dom`: ^18.0.0 || ^19.0.0
67
+ ```tsx
68
+ // app/page.tsx - No "use client" needed!
69
+ import { Button } from "@tan-ahmed/tan-ui-kit";
71
70
 
72
- All other dependencies (base-ui, class-variance-authority, clsx, tailwind-merge) are bundled with the library, so you don't need to install them separately.
71
+ export default function Home() {
72
+ return (
73
+ <div>
74
+ <Button variant="destructive">Click me</Button>
75
+ </div>
76
+ );
77
+ }
78
+ ```
73
79
 
74
80
  ## License
75
81
 
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EA4BnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,2CAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EA4BnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,2CAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tan-ahmed/tan-ui-kit",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "A React component library built with Tailwind CSS v4 and base-ui components",
5
5
  "type": "module",
6
6
  "module": "./dist/tan-ui-kit.es.js",
@@ -18,6 +18,9 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
+ "src/components",
22
+ "src/lib",
23
+ "src/index.ts",
21
24
  "README.md"
22
25
  ],
23
26
  "repository": {
@@ -0,0 +1,53 @@
1
+ "use client"
2
+
3
+ import { Button as ButtonPrimitive } from "@base-ui/react/button"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const buttonVariants = cva(
9
+ "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
14
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs",
15
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
+ ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
17
+ destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
18
+ link: "text-primary underline-offset-4 hover:underline",
19
+ },
20
+ size: {
21
+ default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
22
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
23
+ sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
24
+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
25
+ icon: "size-9",
26
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
27
+ "icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
28
+ "icon-lg": "size-10",
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ variant: "default",
33
+ size: "default",
34
+ },
35
+ }
36
+ )
37
+
38
+ function Button({
39
+ className,
40
+ variant = "default",
41
+ size = "default",
42
+ ...props
43
+ }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
44
+ return (
45
+ <ButtonPrimitive
46
+ data-slot="button"
47
+ className={cn(buttonVariants({ variant, size, className }))}
48
+ {...props}
49
+ />
50
+ )
51
+ }
52
+
53
+ export { Button, buttonVariants }
package/src/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ // Note: index.css is NOT imported here - it's pre-generated during build
2
+ // The CSS is included in dist/tan-ui-kit.css via the build:css script
3
+
4
+ // Export shadcn button
5
+ export { Button, buttonVariants } from "./components/ui/button";
6
+ // export type { ButtonProps } from "./components/ui/button";
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx"
2
+ import { twMerge } from "tailwind-merge"
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }