Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions .agents/skills/panda-v2-migration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: panda-v2-migration
description: >-
Migrate a consumer project that uses @fyrst/ui or the fyrst design preset
from Panda CSS 1.x to Panda CSS 2.x, and from @fyrst/ui 0.2.x
(panda.buildinfo.json in include) to 0.3.x (designSystem: '@fyrst/ui').
(panda.buildinfo.json in include) to 0.3.x / 0.4.x (designSystem: '@fyrst/ui').
Use when the app still depends on @pandacss/dev 1.x, panda ship,
containerSizes, Styles from styled-system/css, styled-system/css/index.mjs,
or @pandacss/studio; when it still includes @fyrst/ui/panda.buildinfo.json
Expand Down Expand Up @@ -44,7 +44,8 @@ Do not invent Panda APIs. If this skill and upstream disagree on a Panda-only de
- Keep the **consumer contract** for `@fyrst/ui` **0.3.x**: `designSystem: '@fyrst/ui'`. Do **not** add `@fyrst/ui/preset` / `@fyrst/ui/design-preset` to `presets`, and do **not** `include` `@fyrst/ui` or `@fyrst/ui/panda.buildinfo.json`. Listing the package in `include` errors with `design_system_in_include`.
- `@fyrst/ui/design-preset` (and `@fyrst/ui/preset`) still exist for **token-only** apps that do not render the Vue components and do not set `designSystem`. Do not combine that preset with `designSystem`.
- Align **every** `@pandacss/*` package on the **same 2.x version**. Never mix 1.x and 2.x in one lockfile.
- List `@pandacss/preset-base` only when you are **not** using `designSystem` (token-only / vendored-preset apps). `designSystem` already loads the library theme.
- On `@fyrst/ui` **0.4.0+** with `designSystem: '@fyrst/ui'`, do **not** add `@pandacss/preset-base`. The package depends on it and inlines the module into `dist/panda/preset.mjs`. `@pandacss/dev` stays a peer. A string preset name would be resolved from the app ([Publishing](https://panda-css.com/docs/design-systems/publishing)); that is why 0.3.0 apps had to install it themselves.
- On **0.3.x**, or on a token-only config that still writes `presets: ['@pandacss/preset-base', preset]`, install `@pandacss/preset-base` in the app. 0.4.0 token-only configs can use `presets: [preset]` — the preset imports the base module, and `@fyrst/ui`'s dependency resolves it.
- Do not ship compiled Panda CSS from `@fyrst/ui`. `@fyrst/ui/style.css` is Iconify icons only. The app generates styles locally.
- Public-repo hygiene: no customer names, client domains, internal consumer repo names, screenshots of customer UIs, or secrets in commits, skills, or PRs.

Expand Down Expand Up @@ -79,6 +80,20 @@ v2 keeps `css()`, recipes, tokens, conditions, and JSX props. It rewrites the co
| Vue entry CSS imports | `styled-system/css` (bundled or aliased) | published JS imports `@fyrst/ui/css` so stale-buildinfo fallback can re-extract |
| Inline `style=` | Card/Loader/Progress/FormPrompt used CSS variables on `style=` | variants are classes; SSR HTML has no `style=` from those components |

### 0.4.0 (consumer patches) — additive on 0.3.x

| Area | 0.3.x | 0.4.0 |
| --- | --- | --- |
| `@pandacss/preset-base` | peer; `designSystem` apps still installed it so Panda could resolve the string from the app | dependency of `@fyrst/ui`; inlined into `dist/panda/preset.mjs`. Do not add it on a `designSystem` app |
| `Button` | `size` `sm` \| `md` \| `lg` only; no `font-family` | `fullWidth` boolean (default `false`); `fontFamily: 'inherit'` |
| Fields | input / textarea / select trigger used the user-agent font when preflight was off | `fontFamily: 'inherit'` on those controls. Field URL already had `font: inherit` |
| `AlertRoot` | `#icon` only replaces the default icon | `hideIcon` omits the icon and its gap |
| Fonts | no `fonts.sans` / `serif` / `mono` on this preset | Figtree sans stack, system serif and mono, semantic `fonts.body`. Load the face in the app (root README). The package does not ship font files |
| `*.lucid.700`, `*.lucid.900`, `brand.pale.lucid` | absent (dropped when `*.subtle` was added, still absent in 0.3.0) | restored with the previous values. `*.subtle` remains the muted fill. `primary.subtle` / `primary.subtle.light` / `primary.text` added |
| Required asterisk | `danger.subtle` (grey wash in dark mode) | `danger` again |

No props were removed. `fullWidth` and `hideIcon` default to `false`.

# Switch 0.2.x include/buildinfo to designSystem

Run this on every `panda.config.ts` / `panda.config.mjs` in the consumer (apps, playgrounds, fixtures).
Expand Down Expand Up @@ -171,9 +186,11 @@ If the app already has Playwright or visual tests, note that baseline. Do not co
In **every** workspace package that mentions Panda:

```bash
bun add -d @pandacss/dev@^2.4.0 @pandacss/preset-base@^2.4.0 @pandacss/types@^2.4.0
bun add -d @pandacss/dev@^2.4.0 @pandacss/types@^2.4.0
```

Add `@pandacss/preset-base@^2.4.0` only for a **0.3.x** `designSystem` app, a token-only config that still lists the string `'@pandacss/preset-base'`, or a vendored preset. `@fyrst/ui` **0.4.0** `designSystem` apps do not.

Also bump any integration to the **same** 2.x line: `@pandacss/postcss`, `@pandacss/vite`, `@pandacss/webpack`, `@pandacss/rollup`, `@pandacss/bun`.

Remove v1-only packages:
Expand All @@ -193,15 +210,15 @@ If any `1.x` remains, find the dependent (`bun why @pandacss/studio`, `bun why @

## 3. Upgrade @fyrst/ui

**npm consumer:** bump `@fyrst/ui` to **0.3.x** (or later). Then apply [Switch 0.2.x include/buildinfo to designSystem](#switch-02x-includebuildinfo-to-designsystem).
**npm consumer:** bump `@fyrst/ui` to **0.4.x** (or **0.3.x** if you are not taking the font, token, and preset-base fixes yet). Then apply [Switch 0.2.x include/buildinfo to designSystem](#switch-02x-includebuildinfo-to-designsystem). On 0.4.0, remove a direct `@pandacss/preset-base` dependency that was only there so `designSystem` could resolve.

**Vendored preset:** see [Vendored copy of the preset](#vendored-copy-of-the-preset). Copy source from a 0.3.x commit or later; do not leave a Panda 1 snapshot of `packages/preset/src`. If the app also uses **published** `@fyrst/ui` components, the app still needs `designSystem: '@fyrst/ui'` — vendoring the preset does not replace `panda lib`.

## 4. Rewrite `panda.config.ts`

Use the 0.3.x snippet above for any app that renders `@fyrst/ui` components.

v1 injected `@pandacss/preset-base` unless `eject: true`. v2 injects **nothing**. Token-only configs that do not use `designSystem` must still list `['@pandacss/preset-base', preset]` or they lose base utilities/conditions (`unknown_condition`).
v1 injected `@pandacss/preset-base` unless `eject: true`. v2 injects **nothing**. On `@fyrst/ui` 0.4.0 the fyrst preset already imports that module, so `presets: [preset]` is enough for a token-only app. On 0.2.x / 0.3.x, token-only configs must still list `['@pandacss/preset-base', preset]` or they lose base utilities/conditions (`unknown_condition`). A string `'@pandacss/preset-base'` is always resolved from the app, even in 0.4.0.

Remove gone config keys if present: `studio`, `eject`, `emitTokensOnly`, `gitignore`, `clean`, `watch`, `poll`, `lightningcss`, `browserslist`. Replace `forceConsistentTypeExtension` with `forceImportExtension` (different semantics — read the upgrade guide). Drop `syntax` / template-literal mode. Convert array conditions to the nested object form ending in `'@slot'`.

Expand Down Expand Up @@ -372,9 +389,9 @@ Look for a local `definePreset` named `fyrst-design-preset`, a `tokens/` tree th
2. Fetch [github.com/fyrst-dev/ui](https://github.com/fyrst-dev/ui) at a **0.3.x** commit **or later** on `master`.
3. Replace the vendored files with `packages/preset/src/**` from that commit. Do not copy `styled-system/` or other codegen folders.
4. If the consumer applied local patches on top of the preset, **re-apply them** on the new tree.
5. In the vendored `definePreset`, ensure `presets: ['@pandacss/preset-base']` and `theme.extend.containers` (not `containerSizes`).
6. Add `@pandacss/dev`, `@pandacss/preset-base`, and `@pandacss/types` `^2.4.0` to that vendored package (dev + peer) and to the app that loads `panda.config.ts`.
7. If the app only needs tokens (no `@fyrst/ui` Vue components), point `presets` at `['@pandacss/preset-base', vendoredPreset]`.
5. In the vendored `definePreset`, import `@pandacss/preset-base` and pass that module on `presets` (0.4.0). A string `'@pandacss/preset-base'` still works if the app installs the package (0.3.x). Keep `theme.extend.containers` (not `containerSizes`).
6. Add `@pandacss/dev` and `@pandacss/types` `^2.4.0` to the package that owns `panda.config.ts`. On 0.4.0, `@pandacss/preset-base` is a dependency of the vendored preset (it imports the module); the app does not add it again. On 0.3.x, the app installs `@pandacss/preset-base` because a string preset is resolved from the app.
7. If the app only needs tokens (no `@fyrst/ui` Vue components), point `presets` at `[vendoredPreset]` on 0.4.0. On 0.3.x, use `['@pandacss/preset-base', vendoredPreset]`.
8. If the app still uses **published** `@fyrst/ui` components, set `designSystem: '@fyrst/ui'` and do **not** also list the vendored preset. Vendoring the preset does not replace `panda lib`.
9. Rebuild the vendored package. Fix TS2742 with the annotations in section 8.
10. Run the verification section. Diff tokens against the before-snapshot.
Expand Down Expand Up @@ -415,7 +432,8 @@ Stop and fix before declaring done if token names disappeared, container queries
| --- | --- | --- |
| `TS2742` on `preset` / `keyframes` during `tsup --dts` | Inferred type points at nested `@pandacss/types` | Annotate `Preset`, `CssKeyframes`, `AnimationStyles`; add `@pandacss/types` `^2.4` as a real dependency |
| `Cannot find module '@pandacss/types'` | Types came from a nested install only | Direct dep on `@pandacss/types` in the emitting package |
| `unknown_condition` / missing `Flex` or other patterns | `preset-base` not listed / not installed (token-only config) | `presets: ['@pandacss/preset-base', preset]` and install the package in the app that loads config |
| `unknown_condition` / missing `Flex` or other patterns | `preset-base` not listed / not installed (token-only config on 0.3.x, or a string preset the app cannot resolve) | 0.4.0: `presets: [preset]`. 0.3.x: `presets: ['@pandacss/preset-base', preset]` and install the package in the app |
| `preset_resolution_failed` for `@pandacss/preset-base` on a `designSystem` app | 0.3.0 published a string preset resolved from the app | upgrade to 0.4.0 and remove the direct dependency. Do not add the string back |
| Utilities exist in one package, gone in another | Mixed 1.x / 2.x lockfile, or a workspace package still on 1.x | Same `^2.4` everywhere |
| Install pulls `@pandacss/dev@1.12` back | `@pandacss/studio` or another v1-only package | Remove `studio` and any `@pandacss/*@1` |
| `panda: command not found: ship` | v2 dropped `ship` | Consumers: `designSystem`. Library authors: `panda lib` |
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,6 @@ describe('ssr', async () => {
1. Token changes: add to both `tokens.ts` and `semantic-tokens.ts`
2. New packages: register in root `package.json` under `workspaces`
3. Build order: Nuxt module requires preset built first (automatic)
4. Peer dependencies: `vue`, `reka-ui`, `@pandacss/dev`, and `@pandacss/preset-base` are required. `nuxt` and `@nuxt/kit` are optional (only `@fyrst/ui/nuxt`). Do not put `@nuxt/kit` in published `dependencies`.
4. Peer dependencies: `vue`, `reka-ui`, and `@pandacss/dev` are required. `@pandacss/preset-base` is a published `dependency` (the design-system preset inlines the module; apps on `designSystem` do not install it). `nuxt` and `@nuxt/kit` are optional (only `@fyrst/ui/nuxt`). Do not put `@nuxt/kit` in published `dependencies`.
5. No Prettier: ESLint used for formatting (stylistic rules)
6. Do not ship compiled Panda CSS (`panda cssgen`, `styles.css`, `panda.css`). Publish only the root `@fyrst/ui` package. Consuming apps must depend on `@pandacss/dev`, keep their own `panda.config.ts`, and set `designSystem: '@fyrst/ui'` (no fyrst preset, no `include` into the package). The library build runs `panda lib --outdir dist --files './**/*.{js,mjs}' --panda '^2.4.0'` after assembling `dist/`. That command owns `./panda/*`, `./css`, `./tokens`, `./types`, and other generated subpaths — do not hand-edit them. Custom exports (`./design-preset`, `./preset`, `./nuxt`, `./vue/*`, `./style.css`) stay in `package.json`. `@fyrst/ui/style.css` is Iconify icons only. Pack root `dist/` only (assembled from workspace build outputs, including `dist/panda/` and `dist/styled-system/`) — do not include nested `packages/*/dist`.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0] - 2026-10-30

Additive release for apps already on 0.3.0 (`designSystem: '@fyrst/ui'`, Panda 2.4). No prop was removed or renamed.

### Added

- `Button` `fullWidth` (boolean, default `false`). The button keeps `inline-flex` sizing until `fullWidth` sets `width: 100%` and `box-sizing: border-box`.
- `AlertRoot` `hideIcon` (boolean, default `false`). The icon, including a custom `#icon` slot, is not rendered, so the flex gap collapses.
- Font tokens: `fonts.sans` (Figtree, then the system sans), `fonts.serif`, `fonts.mono`, and semantic `fonts.body` → `{fonts.sans}`. The package does not ship font files. Load the Figtree face in the app (see the root README).
- `primary.subtle`, `primary.subtle.light`, and `primary.text`, matching the other status colors.
- Restored semantic tokens that 0.3.0 still did not ship: `brand.pale.lucid`, and `primary` / `danger` / `success` / `warning` / `info` `.lucid.700` and `.lucid.900`. Values match the definitions from before the muted `*.subtle` mixes. `*.subtle` stays the preferred muted fill for new UI. `brand.pale` itself is unchanged (`{colors.brand.100}`).

### Fixed

- `Button`, field inputs, textareas, and select triggers set `font-family: inherit`, so with preflight off they follow the app font instead of the user-agent face. The same inherit is set on the prompt textarea, the flyout trigger, and the carousel's default prev/next buttons. Field URL already used `font: inherit`.
- The required-field asterisk uses `color: 'danger'` again (solid red). It had been switched to `danger.subtle`, which reads as a grey wash in dark mode.
- `@pandacss/preset-base` is a dependency of `@fyrst/ui`, and the published design-system preset inlines that module. Apps on `designSystem: '@fyrst/ui'` no longer add `@pandacss/preset-base` themselves. `@pandacss/dev` stays a peer. [Publishing](https://panda-css.com/docs/design-systems/publishing) keeps Panda itself as a peer; a string preset name is resolved from the app, so the library passes the module through `panda lib` instead.

### Token mapping

If a local patch recreated the old washes, you can drop it and use the restored tokens, or move to the muted mixes:

| Previous token | Restored in 0.4.0 | Preferred muted fill |
| --- | --- | --- |
| `brand.pale.lucid` | `brand.pale.lucid` (`brand.100` at 25%) | — |
| `primary.lucid.700` / `.900` | same paths | `primary.subtle` |
| `danger.lucid.700` / `.900` | same paths | `danger.subtle` |
| `success.lucid.700` / `.900` | same paths | `success.subtle` |
| `warning.lucid.700` / `.900` | same paths | `warning.subtle` |
| `info.lucid.700` / `.900` | same paths | `info.subtle` |

`*.lucid.700` is a 25% wash in dark mode and 40% in light mode. `*.lucid.900` is 10% / 25%. `*.subtle` is a grey mix, not the same wash.

## [0.3.0] - 2026-10-30

Official Panda 2 **library** consumption (`panda lib` / `designSystem`) plus CSP-safe SSR. This is a **breaking** upgrade from 0.2.0 for consuming apps. Follow [`.agents/skills/panda-v2-migration/SKILL.md`](.agents/skills/panda-v2-migration/SKILL.md) and the official [Build a design system](https://panda-css.com/docs/design-systems/build-a-design-system) guide.
Expand Down Expand Up @@ -60,7 +93,8 @@ Public export names are unchanged: `preset`, `breakpoints`, `@fyrst/ui/design-pr

- Initial `@fyrst/ui` design system: Panda CSS preset, Vue 3 components, and Nuxt module.

[unreleased]: https://github.com/fyrst-dev/ui/compare/v0.3.0...HEAD
[unreleased]: https://github.com/fyrst-dev/ui/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/fyrst-dev/ui/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/fyrst-dev/ui/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/fyrst-dev/ui/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/fyrst-dev/ui/releases/tag/v0.1.0
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ This library does **not** ship compiled Panda CSS. Consuming apps depend on `@pa

## Install

Required peers: `vue`, `reka-ui`, `@pandacss/dev`, `@pandacss/preset-base`. `nuxt` and `@nuxt/kit` are optional and only needed for `@fyrst/ui/nuxt` (a Nuxt app already provides both).
Required peers: `vue`, `reka-ui`, `@pandacss/dev`. `@pandacss/preset-base` is a normal dependency: `panda lib` inlines it into the design-system preset, so apps that set `designSystem: '@fyrst/ui'` do not install it. `nuxt` and `@nuxt/kit` are optional and only needed for `@fyrst/ui/nuxt` (a Nuxt app already provides both).

**Nuxt**

```bash
bun add @fyrst/ui reka-ui @pandacss/dev @pandacss/preset-base
bun add @fyrst/ui reka-ui @pandacss/dev
```

```ts
Expand Down Expand Up @@ -59,7 +59,7 @@ Components are auto-imported with a `Fyrst` prefix (`FyrstButton`, `FyrstAlertRo
**Vue (Vite)**

```bash
bun add @fyrst/ui vue reka-ui @pandacss/dev @pandacss/preset-base
bun add @fyrst/ui vue reka-ui @pandacss/dev
```

```ts
Expand Down Expand Up @@ -102,6 +102,34 @@ Nuxt tags, the Vue plugin, and `@fyrst/ui/vue/*` use the same canonical names:

`Alert.Root` is the same component as named `AlertRoot`. There is no `FyrstAlert` / `FyrstBadge` / `FyrstTab` alias. Form controls are `Field.*` / `FyrstField*` — `Control*` is not a public export.

## Fonts

The preset defines `fonts.sans`, `fonts.serif`, and `fonts.mono`. `fonts.sans` is **Figtree**, then the system sans (`ui-sans-serif, system-ui, sans-serif`, plus emoji fonts). `fonts.serif` and `fonts.mono` are those same system stacks. Semantic `fonts.body` aliases `fonts.sans`.

The npm package does not include font files. Load the Figtree **variable** face so intermediate weights (450, 750) resolve. [Fontsource](https://fontsource.org/fonts/figtree) is one way:

```bash
bun add @fontsource-variable/figtree
```

```css
@import '@fontsource-variable/figtree';
```

Self-hosting works the same way. Figtree is under the [SIL Open Font License](https://openfontlicense.org/). The `@font-face` `font-family` must be `Figtree`.

`Button`, text inputs, textareas, and select triggers set `font-family: inherit`, so they follow the document face when preflight is off. With preflight on, Panda's reset already sets `font: inherit` on those controls. Preflight sets the document face to `--global-font-body`, which falls back to Panda's built-in system stack. It does not apply `fonts.sans` on its own. Point the document at the sans token:

```ts
globalCss: {
html: {
fontFamily: 'sans',
},
},
```

Until the face is loaded, `fonts.sans` falls through to the system sans.

## Development

This repo is a Bun workspace. Internal package names (`@fyrst/design-preset`, `@fyrst/ui-components`, `@fyrst/ui-nuxt`) stay private and are not published.
Expand Down
Loading
Loading