kablui 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ajility
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,207 @@
1
+ # kablui
2
+
3
+ A Tailwind CSS–based UI component library for Vue 3.
4
+
5
+ Components are authored with Tailwind utility classes. The library builds a
6
+ precompiled stylesheet for those classes and publishes it as `kablui/style.css`.
7
+
8
+ ## Requirements
9
+
10
+ - Vue `^3.5.0`
11
+ - Node.js 20+
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install kablui
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Import the built stylesheet once in your app entry (or root layout):
22
+
23
+ ```ts
24
+ import { createApp } from 'vue'
25
+ import App from './App.vue'
26
+ import 'kablui/style.css'
27
+
28
+ createApp(App).mount('#app')
29
+ ```
30
+
31
+ Import components from the package root:
32
+
33
+ ```ts
34
+ import {
35
+ Button,
36
+ Text,
37
+ Icon,
38
+ Link,
39
+ Badge,
40
+ Separator,
41
+ Field,
42
+ Label,
43
+ FieldHint,
44
+ FieldError,
45
+ Input,
46
+ Textarea,
47
+ Checkbox,
48
+ RadioGroup,
49
+ Radio,
50
+ Switch,
51
+ Select,
52
+ SelectItem,
53
+ Stack,
54
+ Cluster,
55
+ Container,
56
+ Alert,
57
+ Spinner,
58
+ Progress,
59
+ Skeleton,
60
+ Empty,
61
+ Dialog,
62
+ Popover,
63
+ PopoverTrigger,
64
+ PopoverContent,
65
+ Tooltip,
66
+ Toast,
67
+ ToastProvider,
68
+ useToast,
69
+ Card,
70
+ CardHeader,
71
+ CardTitle,
72
+ CardDescription,
73
+ CardBody,
74
+ CardFooter,
75
+ Accordion,
76
+ AccordionItem,
77
+ AccordionTrigger,
78
+ AccordionContent,
79
+ Tabs,
80
+ TabList,
81
+ Tab,
82
+ TabPanel,
83
+ Menu,
84
+ MenuTrigger,
85
+ MenuContent,
86
+ MenuItem,
87
+ MenuSeparator,
88
+ Pagination,
89
+ } from 'kablui'
90
+ ```
91
+
92
+ ### Styling model
93
+
94
+ | Approach | When to use |
95
+ | --- | --- |
96
+ | **Import `kablui/style.css`** (recommended default) | You want kablui styles without configuring Tailwind yourself. The published CSS includes the utilities used by kablui components. |
97
+ | **Compose with your own Tailwind** | Your app already uses Tailwind v4. Keep importing `kablui/style.css` for component styles, **or** scan kablui for classes in your own CSS (see below). |
98
+
99
+ **If your app also uses Tailwind**
100
+
101
+ - Prefer a single Preflight/base reset. kablui’s stylesheet includes Tailwind’s base styles; if you also `@import "tailwindcss"`, you may see duplicate resets. Either rely on kablui’s CSS for base styles, or compile Tailwind yourself and treat kablui as a class source (advanced).
102
+ - To detect classes from kablui when you compile Tailwind in the consumer app, register the package as a source (paths relative to your CSS file):
103
+
104
+ ```css
105
+ @import 'tailwindcss';
106
+ @source '../node_modules/kablui/dist';
107
+ ```
108
+
109
+ Theme tokens live in `@theme static` / CSS variables in `src/styles/index.css` (and the published `kablui/style.css`). Override those variables in your app when you need to re-skin kablui without forking components.
110
+
111
+ ## Documentation
112
+
113
+ Consumer docs live in [`docs/`](docs/) (VitePress), alongside the playground:
114
+
115
+ ```bash
116
+ npm run docs:dev
117
+ npm run docs:build
118
+ npm run docs:preview
119
+ ```
120
+
121
+ Start with [Getting started](docs/guides/getting-started.md). Deeper guides cover [theming](docs/guides/theming.md), [Tailwind composition](docs/guides/tailwind.md), and [tree-shaking](docs/guides/tree-shaking.md). Component API pages are under [`docs/components/`](docs/components/).
122
+
123
+ This README keeps install/usage short; use the docs site for full guidance.
124
+
125
+ ## Development
126
+
127
+ ```bash
128
+ npm install
129
+ npm run dev # playground at http://localhost:5173
130
+ npm run docs:dev # VitePress docs
131
+ npm run build # emit dist/ for publishing
132
+ npm run typecheck
133
+ npm test
134
+ ```
135
+
136
+ Stack for local work: Vue 3, Vite (library mode), TypeScript, **Tailwind CSS v4** via `@tailwindcss/vite`. Docs: VitePress under `docs/`.
137
+
138
+ ### Project layout
139
+
140
+ ```
141
+ src/
142
+ components/ # Vue SFCs + barrel export (use Tailwind utilities)
143
+ styles/ # Tailwind entry (`index.css` → dist/kablui.css)
144
+ index.ts # package public API
145
+ playground/ # local app for developing components
146
+ docs/ # VitePress consumer documentation
147
+ ```
148
+
149
+ Add a component under `src/components/`, export it from `src/components/index.ts`, style it with Tailwind classes, and try it in `playground/App.vue`. Library sources under `src/` are scanned for class names; the playground has its own CSS entry that also scans `playground/`.
150
+
151
+ ## Development roadmap
152
+
153
+ High-level phases for building kablui. Each phase should produce something usable before the next begins; details will be broken down later.
154
+
155
+ ### 1. Foundations
156
+
157
+ - Establish design tokens (color, type, space, radius, elevation) in Tailwind `@theme` / CSS variables, with a theming model that supports light/dark and consumer overrides.
158
+ - Define component conventions: Composition API + `<script setup>`, Tailwind utilities for styling, prop/event naming, slots, `defineExpose`, and public TypeScript types.
159
+ - Set accessibility baselines (focus visibility, keyboard expectations, ARIA patterns) and keep CSS tree-shake friendly via Tailwind’s content scanning + the existing Vite library build (`kablui/style.css`).
160
+ - Lock package API shape: named exports, style entry (`kablui/style.css`), and playground usage as the local source of truth.
161
+
162
+ ### 2. Core primitives
163
+
164
+ - Ship the smallest visual building blocks (e.g. Button, Text/Typography, Icon, Link, Badge, Separator) with consistent variants and sizes expressed as Tailwind class maps.
165
+ - Prove the token/theming system end-to-end in the playground; refine APIs before wider surface area grows.
166
+ - Prefer composable, single-responsibility components over early “kitchen sink” APIs.
167
+
168
+ ### 3. Forms & interactive controls
169
+
170
+ - Add form-oriented controls (Input, Textarea, Checkbox, Radio, Switch, Select, and related labels/helpers) with clear `v-model` and disabled/invalid states.
171
+ - Align keyboard behavior, focus management, and labeling so controls are usable without mouse.
172
+ - Keep styling and behavior consistent with primitives so forms feel like one system, not a second library.
173
+
174
+ ### 4. Layout, overlays & feedback
175
+
176
+ - Introduce layout helpers (stack/cluster/container-style primitives as needed) and feedback surfaces (Alert, Spinner/Progress, empty/skeleton states).
177
+ - Build overlay patterns (Dialog/Modal, Popover/Dropdown, Tooltip, Toast) with focus traps, dismiss behavior, and stacking/portal rules.
178
+ - Ensure overlays and feedback work with the token system and do not fight consumer app layout.
179
+
180
+ ### 5. Composition & higher-level patterns
181
+
182
+ - Compose primitives into common product patterns (e.g. Card regions, Menu, Tabs, Accordion, Pagination) where reuse justifies a dedicated component.
183
+ - Document recommended composition recipes in the playground when a full component is not warranted.
184
+ - Resist scope creep: only promote patterns that show repeated need and stable APIs.
185
+
186
+ ### 6. Documentation & developer experience — done
187
+
188
+ - [x] VitePress site under [`docs/`](docs/) with consumer guides (install, theming, Tailwind composition, tree-shaking).
189
+ - [x] Component API pages (examples, props tables, accessibility) from SFCs + playground demos.
190
+ - [x] Public Props types exported for compound parts; TypeScript surfaces support editor autocomplete.
191
+
192
+ Run `npm run docs:dev` for the docs site; playground remains the live sandbox (`npm run dev`).
193
+
194
+ ### 7. Hardening & release — done
195
+
196
+ - [x] Add unit/component tests for critical behavior and visual/regression coverage where it pays off; run automated a11y checks on key components.
197
+ - [x] Define versioning, changelog, and release process (semver, breaking-change policy)—see [`CHANGELOG.md`](CHANGELOG.md) and [Releasing](docs/guides/releasing.md).
198
+ - [x] Cut a first public release (`0.1.0`) once foundations, a useful primitive + form set, docs, and quality gates are in place—then iterate.
199
+
200
+ ## Publish
201
+
202
+ Requires `npm login` (verify with `npm whoami`). Publish may still need 2FA (`--otp`) or a granular token with bypass 2FA—see [Releasing](docs/guides/releasing.md).
203
+
204
+ ```bash
205
+ npm run build # also runs via prepublishOnly
206
+ npm publish
207
+ ```