Add a combined stylesheet entry for package consumers

This commit is contained in:
2026-03-20 11:40:53 +08:00
parent 1958fd3686
commit 010638503f
7 changed files with 43 additions and 5 deletions
+18
View File
@@ -72,6 +72,24 @@ pnpm lint
pnpm typecheck
```
## Package consumption
For package-style consumers, prefer a single CSS entrypoint from `@ai-ui/ui`:
```tsx
import { Button } from "@ai-ui/ui";
```
```css
@import "tailwindcss";
@import "@ai-ui/ui/styles.css";
@source "../node_modules/@ai-ui/ui/src";
```
This keeps the app on one UI package import path while still pulling in token and skin
styles together. Consumers that want lower-level control can still import
`@ai-ui/tokens/styles.css` and `@ai-ui/ui/skins.css` separately.
Install source-owned components into another project:
```bash
+1 -2
View File
@@ -1,6 +1,5 @@
@import "tailwindcss";
@import "@ai-ui/tokens/styles.css";
@import "@ai-ui/ui/skins.css";
@import "@ai-ui/ui/styles.css";
@source "../../../packages/ui/src";
:root {
+5
View File
@@ -107,6 +107,11 @@ At minimum, the consumer app should import:
- `src/cadence-ui/tokens/styles.css` from its global app stylesheet or entry module
For package consumers instead of source-copy installs, the equivalent convenience import
is:
- `@ai-ui/ui/styles.css`
If the consumer wants the theme helpers, they can also import from:
- `src/cadence-ui/tokens/index.ts`
+10
View File
@@ -27,6 +27,16 @@ Changesets should currently be used for:
- `@ai-ui/ui`
- `@ai-ui/tokens`
Package consumers should now prefer:
- `@ai-ui/ui` for component imports
- `@ai-ui/ui/styles.css` for the combined token + skin stylesheet
The lower-level entries remain available when needed:
- `@ai-ui/tokens/styles.css`
- `@ai-ui/ui/skins.css`
Changes to the docs app alone usually do not need a changeset.
## When to create a changeset
+6 -3
View File
@@ -546,7 +546,7 @@ Deliverables:
Status:
- not started
- completed
## Acceptance Criteria For The First Real Milestone
@@ -609,6 +609,9 @@ As of 2026-03-20, the project is at this point:
- scoped `data-motion="reduced"` now works for nested docs wrappers
- shared skin-aware treatment now extends across the broader component library surface,
including controls, menus, overlays, feedback, and data-heavy patterns
- package consumers can now import a single combined stylesheet from
`@ai-ui/ui/styles.css`
The next implementation task should be Phase 5: improve packaging and consumer
ergonomics for style consumption.
The original Phase 0-5 implementation sequence is now complete. Further work should be
treated as iteration: refining skins, expanding motion packs, or hardening package and
registry distribution.
+1
View File
@@ -8,6 +8,7 @@
],
"exports": {
".": "./src/index.ts",
"./styles.css": "./src/styles.css",
"./skins.css": "./src/skins.css"
},
"files": [
+2
View File
@@ -0,0 +1,2 @@
@import "@ai-ui/tokens/styles.css";
@import "./skins.css";