tailuicss 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,83 @@
1
+ # Changelog
2
+
3
+ All notable changes to TailUI will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.1.0] — 2025-06-20
9
+
10
+ ### Added
11
+
12
+ - **`tailui migrate` command** — automatically convert Tailwind utility classes to semantic `.ui-*` classes
13
+ - **Tag-first detection**: HTML tag is the primary signal (`<button>` → `ui-button`, `<input>` → `ui-input`). No guessing.
14
+ - **Attribute resolution**: ARIA attributes disambiguate generic tags (`role="alert"` → `ui-alert`, `role="dialog"` → `ui-modal`)
15
+ - **Class-based fallback**: for `<div>`, `<span>`, etc. — requires high class confidence
16
+ - **Variant detection**: automatically detects color/style variants (`ui-primary`, `ui-danger`, `ui-elevated`, etc.)
17
+ - **Structural class preservation**: spacing, layout, sizing, and positioning classes are kept alongside `.ui-*` classes
18
+ - **Dynamic class skipping**: `cn()`, `clsx()`, `cva()`, `twMerge()`, template literal interpolations, and ternaries are safely skipped
19
+ - **Dry-run mode** (`--dry-run`): preview all changes without modifying files
20
+ - **Interactive mode** (`-i`): confirm each migration individually
21
+ - **Force mode** (`--force`): apply all migrations without confirmation
22
+ - **Confidence threshold** (`--threshold <0-100>`): control minimum match score (default: 60)
23
+ - **Backup & undo**: timestamped backups in `.tailui-backup/`, restore with `--undo`
24
+ - **Single file** (`-f <path>`) or **directory** (`--all <dir>`) migration
25
+ - **Dev-only architecture**: the migrate module is lazy-loaded by the CLI and never imported by the Tailwind or PostCSS plugins — zero production bundle impact
26
+
27
+ ### Changed
28
+
29
+ - CLI now has **7 commands** (added `migrate`)
30
+
31
+ ---
32
+
33
+ ## [1.0.0] — 2026-02-11
34
+
35
+ ### Added
36
+
37
+ - **20 production-ready components**: accordion, alert, avatar, badge, button, card, carousel, dropdown, file-input, input, list, modal, progress, radio, rate, select, textarea, toast, toggle, tooltip
38
+ - **AI component generation** — `tailui generate <component>` creates typed, accessible framework components using OpenAI, Claude, Gemini, or Mistral
39
+ - **Zero-config PostCSS plugin** — auto-injects styles before `@tailwind components`, no manual import order needed
40
+ - **Tailwind plugin** — auto-registers content paths, prevents tree-shaking
41
+ - **CLI** with 6 commands:
42
+ - `tailui init` — interactive scaffold with stack selection, directory name, AI config
43
+ - `tailui create <component>` — generate component CSS with variants
44
+ - `tailui add <component> <token>` — add tokens to existing components
45
+ - `tailui list` — display all registered components and tokens
46
+ - `tailui generate <component>` — AI-powered framework component generation
47
+ - `tailui config` — view or update configuration (stack, AI provider, API key)
48
+ - **Stack-aware init** — choose React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Angular, Astro, or HTML
49
+ - **Flexible directory naming** — choose `ui/`, `components/`, `design-system/`, or any name; stored in `ui.config.json`
50
+ - **Centralized config** — `ui.config.json` stores directory path, stack, AI settings; all CLI commands and plugins resolve it automatically
51
+ - **`.ui-*` class selectors** — standard CSS classes for maximum compatibility
52
+ - **`@style` directive** — CSS custom properties alongside `@apply`
53
+ - **Dark mode** via `[data-theme="dark"]` selectors on all 20 components
54
+ - **Free composition** — tokens combine without hierarchy (`class="ui-card ui-elevated ui-hoverable"`)
55
+ - **Token types**: component, modifier, slot, state, size
56
+ - **CSS variable convention**: `--ui-<component>-<property>`
57
+ - **Framework agnostic**: HTML, React, Vue, Svelte, Angular, Astro, Web Components
58
+ - **SSR & CSR** compatible — zero JavaScript runtime
59
+
60
+ ### Components
61
+
62
+ | Component | Key Tokens |
63
+ |---|---|
64
+ | **Accordion** | `flush`, `separated` |
65
+ | **Alert** | `info`, `success`, `warning`, `danger`, `outlined`, `filled` |
66
+ | **Avatar** | `xs`, `sm`, `lg`, `xl`, `square`, `ring` + status indicators |
67
+ | **Badge** | `primary`, `secondary`, `success`, `danger`, `warning`, `dot`, `square` |
68
+ | **Button** | `primary`, `secondary`, `danger`, `ghost`, `outline`, `sm`–`xl`, `disabled`, `loading`, `full`, `icon` |
69
+ | **Card** | `elevated`, `outlined`, `flat`, `hoverable`, `interactive`, `compact` |
70
+ | **Carousel** | `fade` + navigation dots/arrows |
71
+ | **Dropdown** | `right`, `up` + menu items, dividers, headers |
72
+ | **File Input** | `compact`, `error`, `disabled`, drag-and-drop zone |
73
+ | **Input** | `error`, `success`, `disabled`, `sm`, `lg` + label, helper |
74
+ | **List** | `interactive`, `flush`, `compact` + leading/trailing slots |
75
+ | **Modal** | `sm`–`full`, `centered` + overlay |
76
+ | **Progress** | `success`, `warning`, `danger`, `sm`–`xl`, `striped`, `animated`, `labeled` |
77
+ | **Radio** | `horizontal`, `disabled`, `sm`, `lg` |
78
+ | **Rate** | `readonly`, `sm`, `lg`, `half`, `disabled` |
79
+ | **Select** | `error`, `disabled`, `sm`, `lg`, `multi` + search input |
80
+ | **Textarea** | `error`, `success`, `disabled`, `noresize`, `auto`, `sm`, `lg` |
81
+ | **Toast** | `success`, `danger`, `warning`, `info` + positioning |
82
+ | **Toggle** | `success`, `danger`, `disabled`, `sm`, `lg` |
83
+ | **Tooltip** | `bottom`, `left`, `right` + arrow positioning |
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hosby
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ <div align="center">
2
+
3
+ <img src="https://tailuicss.com/TailUI.png" alt="TailUI" width="120" />
4
+
5
+ # TailUI
6
+
7
+ **The semantic CSS layer for Tailwind CSS**
8
+
9
+ Stop writing 40 utility classes per element. Write `ui-button ui-primary` instead.
10
+
11
+ [![npm version](https://img.shields.io/npm/v/@tailuicss/core.svg?style=flat-square&color=0284c7)](https://www.npmjs.com/package/@tailuicss/core)
12
+ [![license](https://img.shields.io/npm/l/@tailuicss/core.svg?style=flat-square&color=0284c7)](https://github.com/tailuicss/tailui/blob/main/LICENSE)
13
+ [![tailwindcss](https://img.shields.io/badge/tailwindcss-%3E%3D3.4-0284c7?style=flat-square)](https://tailwindcss.com)
14
+ [![zero runtime](https://img.shields.io/badge/JS_runtime-0kb-10b981?style=flat-square)](.)
15
+
16
+ [Documentation](https://tailuicss.com/docs) · [Components](https://tailuicss.com/components) · [Examples](https://tailuicss.com/examples)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ ## Why TailUI?
23
+
24
+ ```html
25
+ <!-- ❌ Before: Tailwind at scale -->
26
+ <button class="px-4 py-2 bg-blue-600 text-white rounded-lg font-medium
27
+ transition-all hover:bg-blue-700 active:bg-blue-800 shadow-sm
28
+ disabled:opacity-50 disabled:cursor-not-allowed">
29
+ Save
30
+ </button>
31
+
32
+ <!-- ✅ After: TailUI -->
33
+ <button class="ui-button ui-primary">Save</button>
34
+ ```
35
+
36
+ **Same output. 80% less code. Zero runtime. Pure CSS.**
37
+
38
+ ---
39
+
40
+ ## Quick Start
41
+
42
+ ```bash
43
+ npm install @tailuicss/core
44
+ ```
45
+
46
+ ```js
47
+ // tailwind.config.js
48
+ plugins: [require('@tailuicss/core')()]
49
+ ```
50
+
51
+ ```js
52
+ // postcss.config.js
53
+ plugins: {
54
+ '@tailuicss/core/postcss': {},
55
+ tailwindcss: {},
56
+ }
57
+ ```
58
+
59
+ **That's it.** Start using `ui-button`, `ui-card`, `ui-input`, and [20 more components](https://tailuicss.com/components).
60
+
61
+ ---
62
+
63
+ ## Features
64
+
65
+ - 🎨 **20 production-ready components** — Button, Card, Modal, Input, Toast, and more
66
+ - 🌙 **Dark mode built-in** — One `data-theme="dark"` attribute switches everything
67
+ - 🔧 **Full Tailwind power** — Use `@apply`, CSS variables, and all Tailwind utilities
68
+ - 📦 **Framework agnostic** — React, Vue, Svelte, Angular, Astro, plain HTML
69
+ - 🤖 **AI generation** — Generate typed components with OpenAI, Claude, Gemini, or Mistral
70
+ - 🔄 **Migration CLI** — Convert existing Tailwind code to TailUI automatically
71
+ - ⚡ **Zero JS runtime** — Pure CSS, no bundle bloat
72
+
73
+ ---
74
+
75
+ ## Documentation
76
+
77
+ 👉 **[Read the full documentation →](https://tailuicss.com/docs)**
78
+
79
+ - [Installation](https://tailuicss.com/docs/installation)
80
+ - [Configuration](https://tailuicss.com/docs/configuration)
81
+ - [Components](https://tailuicss.com/components)
82
+ - [Dark Mode](https://tailuicss.com/docs/dark-mode)
83
+ - [CLI Commands](https://tailuicss.com/docs/cli)
84
+ - [AI Generation](https://tailuicss.com/docs/ai-generation)
85
+ - [Migration Guide](https://tailuicss.com/docs/migration)
86
+
87
+ ---
88
+
89
+ ## AI & Editor Integration
90
+
91
+ TailUI provides a `llms.txt` file for AI assistants and code editors:
92
+
93
+ ```
94
+ https://tailuicss.com/llms.txt
95
+ ```
96
+
97
+ Add this to your Cursor rules, Windsurf, or any AI-powered editor for perfect TailUI code generation.
98
+
99
+ ---
100
+
101
+ ## License
102
+
103
+ [MIT](LICENSE)
package/package.json ADDED
@@ -0,0 +1,104 @@
1
+ {
2
+ "name": "tailuicss",
3
+ "version": "1.0.2",
4
+ "description": "A semantic CSS-first layer on top of Tailwind CSS. Write class=\"ui-button ui-primary\" instead of 40 utility classes.",
5
+ "main": "src/plugin/index.js",
6
+ "types": "src/plugin/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./src/plugin/index.d.ts",
10
+ "default": "./src/plugin/index.js"
11
+ },
12
+ "./postcss": {
13
+ "types": "./postcss.d.ts",
14
+ "default": "./postcss.js"
15
+ },
16
+ "./cli": "./src/cli/index.js"
17
+ },
18
+ "bin": {
19
+ "tailui": "./src/cli/index.js"
20
+ },
21
+ "files": [
22
+ "src/",
23
+ "ui/",
24
+ "postcss.js",
25
+ "postcss.d.ts",
26
+ "README.md",
27
+ "CHANGELOG.md",
28
+ "LICENSE"
29
+ ],
30
+ "scripts": {
31
+ "dev": "npx tailwindcss -i ./demo/src/input.css -o ./demo/dist/output.css --postcss --watch",
32
+ "build": "npx tailwindcss -i ./demo/src/input.css -o ./demo/dist/output.css --postcss",
33
+ "demo": "npx tailwindcss -i ./demo/src/input.css -o ./demo/dist/output.css --postcss && open demo/index.html"
34
+ },
35
+ "keywords": [
36
+ "tailwindcss",
37
+ "tailwind",
38
+ "css",
39
+ "design-system",
40
+ "ui",
41
+ "semantic",
42
+ "components",
43
+ "postcss",
44
+ "plugin",
45
+ "utility-first",
46
+ "css-framework",
47
+ "tailwind",
48
+ "tailwindcss",
49
+ "csstailwind",
50
+ "reacttailwind",
51
+ "nextjstailwind",
52
+ "tailwind plugin",
53
+ "tailwind vue",
54
+ "tailwind astro",
55
+ "tailwind svelte",
56
+ "tailwind nuxt",
57
+ "tailwind laravel",
58
+ "tailwind rails",
59
+ "front-end",
60
+ "theme",
61
+ "nextjs",
62
+ "vue",
63
+ "component",
64
+ "framework",
65
+ "library",
66
+ "astro",
67
+ "svelte",
68
+ "nuxt",
69
+ "laravel",
70
+ "rails"
71
+ ],
72
+ "author": "TailUI CSS",
73
+ "license": "MIT",
74
+ "repository": {
75
+ "type": "git",
76
+ "url": "git+https://github.com/tailuicss/tailui.git"
77
+ },
78
+ "homepage": "https://tailuicss.com",
79
+ "bugs": {
80
+ "url": "https://github.com/tailuicss/tailui/issues"
81
+ },
82
+ "publishConfig": {
83
+ "access": "public"
84
+ },
85
+ "sideEffects": false,
86
+ "engines": {
87
+ "node": ">=16.0.0"
88
+ },
89
+ "funding": {
90
+ "type": "github",
91
+ "url": "https://github.com/sponsors/tailuicss"
92
+ },
93
+ "dependencies": {
94
+ "commander": "^12.1.0"
95
+ },
96
+ "peerDependencies": {
97
+ "postcss": "^8.4.0",
98
+ "tailwindcss": "^3.4.0"
99
+ },
100
+ "devDependencies": {
101
+ "postcss": "^8.4.38",
102
+ "tailwindcss": "^3.4.17"
103
+ }
104
+ }
package/postcss.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import type { PluginCreator } from 'postcss';
2
+
3
+ interface TailUIPostCSSOptions {
4
+ /** Override the styles directory path */
5
+ path?: string;
6
+ }
7
+
8
+ /**
9
+ * TailUI PostCSS Plugin
10
+ *
11
+ * Auto-injects all ui.*.css component styles before @tailwind components
12
+ * so the dev never has to manage CSS import order manually.
13
+ *
14
+ * @example
15
+ * // postcss.config.js
16
+ * plugins: { '@tailuicss/core/postcss': {}, tailwindcss: {} }
17
+ */
18
+ declare const tailuiPostCSS: PluginCreator<TailUIPostCSSOptions>;
19
+ export = tailuiPostCSS;
package/postcss.js ADDED
@@ -0,0 +1,2 @@
1
+ // Entry point for require('@tailuicss/core/postcss')
2
+ module.exports = require('./src/postcss');