@inkubio/ui 0.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@inkubio/ui",
3
+ "version": "0.0.0-alpha.8",
4
+ "license": "MIT",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/inkubio/nettisivut.git",
8
+ "directory": "packages/ui"
9
+ },
10
+ "files": [
11
+ "dist/**",
12
+ "lib/global.css"
13
+ ],
14
+ "type": "commonjs",
15
+ "sideEffects": [
16
+ "*.css"
17
+ ],
18
+ "main": "./dist/index.cjs",
19
+ "module": "./dist/index.mjs",
20
+ "types": "./dist/index.d.cts",
21
+ "typesVersions": {
22
+ "*": {
23
+ "*": [
24
+ "./dist/*"
25
+ ]
26
+ }
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "import": {
31
+ "types": "./dist/index.d.mts",
32
+ "default": "./dist/index.mjs"
33
+ },
34
+ "require": {
35
+ "types": "./dist/index.d.cts",
36
+ "default": "./dist/index.cjs"
37
+ }
38
+ },
39
+ "./global.css": "./lib/global.css",
40
+ "./preset": {
41
+ "import": {
42
+ "types": "./dist/preset.d.mts",
43
+ "default": "./dist/preset.mjs"
44
+ },
45
+ "require": {
46
+ "types": "./dist/preset.d.cts",
47
+ "default": "./dist/preset.cjs"
48
+ }
49
+ },
50
+ "./*": {
51
+ "types": "./dist/*",
52
+ "import": "./dist/*",
53
+ "require": "./dist/*"
54
+ }
55
+ },
56
+ "publishConfig": {
57
+ "access": "public",
58
+ "registry": "https://registry.npmjs.org/"
59
+ },
60
+ "dependencies": {
61
+ "@phosphor-icons/react": "^2.1.10",
62
+ "@radix-ui/react-collapsible": "^1.1.12",
63
+ "@radix-ui/react-dialog": "^1.1.15",
64
+ "@radix-ui/react-navigation-menu": "^1.2.14",
65
+ "@radix-ui/react-progress": "^1.1.8",
66
+ "@radix-ui/react-scroll-area": "^1.2.10",
67
+ "@radix-ui/react-separator": "^1.1.8",
68
+ "@radix-ui/react-slot": "^1.2.4",
69
+ "@radix-ui/react-tabs": "^1.1.13",
70
+ "class-variance-authority": "^0.7.1",
71
+ "clsx": "^2.1.1",
72
+ "lucide-react": "^0.577.0",
73
+ "tailwind-merge": "^3.6.0"
74
+ },
75
+ "devDependencies": {
76
+ "@types/node": "^20",
77
+ "@types/react": "^19",
78
+ "@types/react-dom": "^19",
79
+ "react": "19.2.3",
80
+ "react-dom": "19.2.3",
81
+ "tsdown": "^0.21.7",
82
+ "typescript": "^5"
83
+ },
84
+ "peerDependencies": {
85
+ "@tailwindcss/postcss": "^4",
86
+ "@tailwindcss/typography": "^0.5.20",
87
+ "postcss": "^8",
88
+ "react": "^19",
89
+ "react-dom": "^19",
90
+ "tailwindcss": "^4",
91
+ "tailwindcss-animate": "^1.0.7"
92
+ },
93
+ "scripts": {
94
+ "build": "tsdown lib/index.tsx lib/preset.ts --format esm,cjs --dts",
95
+ "clean": "rm -rf dist",
96
+ "dev": "tsdown lib/index.tsx --format esm,cjs --watch --dts --no-clean",
97
+ "typecheck": "tsc --noEmit"
98
+ }
99
+ }
package/readme.md ADDED
@@ -0,0 +1,136 @@
1
+ # `@inkubio/ui`
2
+
3
+ Reusable React UI components built with Tailwind CSS and shadcn/ui. Designed to drop into any React + Tailwind project.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ # with pnpm
9
+ pnpm add @inkubio/ui react react-dom
10
+
11
+ # Tailwind + PostCSS peers (dev)
12
+ pnpm add -D tailwindcss postcss @tailwindcss/postcss tailwindcss-animate @tailwindcss/typography
13
+ ```
14
+
15
+ Required peer dependencies:
16
+
17
+ - `react`, `react-dom`
18
+ - `tailwindcss`, `postcss`, `@tailwindcss/postcss`
19
+ - `tailwindcss-animate`, `@tailwindcss/typography`
20
+
21
+ ## Tailwind setup
22
+
23
+ Use the included preset for automatic configuration, or manually configure if you need more control.
24
+
25
+ ### Option 1: Using the preset (recommended)
26
+
27
+ ```js
28
+ // tailwind.config.js
29
+ import { preset } from "@inkubio/ui/preset";
30
+
31
+ /** @type {import('tailwindcss').Config} */
32
+ export default {
33
+ presets: [preset],
34
+ content: ["./src/**/*.{ts,tsx,js,jsx}"],
35
+ // Your customizations automatically extend the preset
36
+ };
37
+ ```
38
+
39
+ ### Option 2: Manual configuration
40
+
41
+ ```js
42
+ // tailwind.config.js
43
+ import { plugin as inkubioUI } from "@inkubio/ui";
44
+
45
+ /** @type {import('tailwindcss').Config} */
46
+ export default {
47
+ content: [
48
+ "./src/**/*.{ts,tsx,js,jsx}",
49
+ "./node_modules/@inkubio/ui/dist/**/*.{js,cjs,mjs}",
50
+ ],
51
+ plugins: [
52
+ inkubioUI,
53
+ require("@tailwindcss/typography"),
54
+ require("tailwindcss-animate"),
55
+ ],
56
+ };
57
+ ```
58
+
59
+ Notes:
60
+
61
+ - The preset automatically includes component paths and the custom plugin
62
+ - The plugin adds utilities like `content-alt` and `content-alt-empty`
63
+ - Design tokens: the package ships default CSS variables (colors, shadows, fonts) in its global stylesheet. You only need to define your own `--color-*` / `--box-shadow-*` variables if you want to customize the theme
64
+
65
+ ## Global CSS
66
+
67
+ Include Tailwind and the package styles in your global CSS file.
68
+
69
+ ```css
70
+ /* src/styles/globals.css */
71
+ @import "tailwindcss";
72
+
73
+ /* UI package global styles (includes default design tokens) */
74
+ @import "@inkubio/ui/global.css";
75
+
76
+ /* Optional: override tokens to match your brand */
77
+ :root {
78
+ /* Example: change primary color */
79
+ /* --color-primary-500: #2563eb; */
80
+ }
81
+ ```
82
+
83
+ ## Usage
84
+
85
+ ```tsx
86
+ import { Button } from "@inkubio/ui";
87
+
88
+ export default function Example() {
89
+ return (
90
+ <div className="p-4">
91
+ <Button variant="primary">Hello from UI</Button>
92
+ </div>
93
+ );
94
+ }
95
+ ```
96
+
97
+ ## Components
98
+
99
+ | Component | Description | Key Props/Variants |
100
+ | ------------------ | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101
+ | **Button** | Versatile button with multiple style variants | `variant`: default, destructive, outline, secondary, ghost, link, backLink, outlineLink<br/>`size`: default, sm, lg<br/>`asChild`: use with Slot for custom elements |
102
+ | **Card** | Container component with consistent styling | `asChild`: render as child component |
103
+ | **Input** | Form text input | Standard HTML input attributes |
104
+ | **Checkbox** | Checkbox input | Standard HTML input attributes (without type) |
105
+ | **Radio** | Radio button input | Standard HTML input attributes (without type) |
106
+ | **Textarea** | Multi-line text input | Standard HTML textarea attributes |
107
+ | **Tabs** | Tabbed interface components | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` |
108
+ | **Sheet** | Slide-out panel/drawer (based on Dialog) | `side`: top, bottom, left, right<br/>Components: `Sheet`, `SheetTrigger`, `SheetContent`, `SheetHeader`, `SheetTitle`, `SheetDescription`, `SheetFooter`, `SheetClose` |
109
+ | **Collapsible** | Collapsible content container | `Collapsible`, `CollapsibleTrigger`, `CollapsibleContent` |
110
+ | **NavigationMenu** | Accessible navigation menu | `NavigationMenu`, `NavigationMenuList`, `NavigationMenuItem`, `NavigationMenuTrigger`, `NavigationMenuContent`, `NavigationMenuLink`, `NavigationMenuViewport`, `NavigationMenuIndicator` |
111
+ | **ScrollArea** | Custom scrollable area | `ScrollArea`, `ScrollBar` |
112
+ | **Separator** | Visual divider | `orientation`: horizontal, vertical |
113
+ | **Progress** | Progress indicator | `value`: 0-100 |
114
+
115
+ ### Icons
116
+
117
+ The package re-exports icons from Lucide React and Phosphor Icons:
118
+
119
+ ```tsx
120
+ import {
121
+ ChevronDownIcon,
122
+ MenuIcon,
123
+ XIcon,
124
+ FacebookIcon,
125
+ GithubIcon,
126
+ // ... and many more
127
+ } from "@inkubio/ui";
128
+ ```
129
+
130
+ See the full list in the TypeScript definitions.
131
+
132
+ ## Troubleshooting
133
+
134
+ - Missing styles: ensure `content` includes your app code and `node_modules/@inkubio/ui/dist`.
135
+ - Unknown CSS variables: define the `--color-*` and `--box-shadow-*` tokens in global CSS.
136
+ - Type errors: install `@types/react`/`@types/react-dom` if using TypeScript.