@still-void/ui 1.1.0 → 2.0.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/CHANGELOG.md +67 -0
- package/README.md +99 -32
- package/dist/react/client/index.cjs +492 -3
- package/dist/react/client/index.cjs.map +1 -1
- package/dist/react/client/index.d.cts +141 -7
- package/dist/react/client/index.d.ts +141 -7
- package/dist/react/client/index.js +434 -3
- package/dist/react/client/index.js.map +1 -1
- package/dist/react/index.cjs +467 -2
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +401 -23
- package/dist/react/index.d.ts +401 -23
- package/dist/react/index.js +387 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +70 -34
- package/dist/article-Dl8rGW5l.d.cts +0 -177
- package/dist/article-Dl8rGW5l.d.ts +0 -177
- package/dist/index.cjs +0 -639
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -248
- package/dist/index.d.ts +0 -248
- package/dist/index.js +0 -551
- package/dist/index.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @still-void/ui
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#5](https://github.com/KalleoPinheiro/still-void/pull/5) [`9d5fdc8`](https://github.com/KalleoPinheiro/still-void/commit/9d5fdc86eba6d04ed568b2fc821f71d3c91aac50) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - **Breaking:** removes the framework-agnostic core entry point (`import ... from '@still-void/ui'`). The package is now React/Next.js-only. Tokens and recipes moved to `@still-void/ui/react`; DOM behaviors (`createThemeManager`, `createScrollSpy`, `createReadingProgress`, `copyToClipboard`) moved to `@still-void/ui/react/client`. `react`/`react-dom` (>=18) are now required peer dependencies instead of optional. No token/design values changed. See `docs/migration-v1-to-v2.md` for the full import map; non-React consumers have no migration path and should stay on `^1`.
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- [#5](https://github.com/KalleoPinheiro/still-void/pull/5) [`9d5fdc8`](https://github.com/KalleoPinheiro/still-void/commit/9d5fdc86eba6d04ed568b2fc821f71d3c91aac50) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add Tailwind config extending Still Void tokens and shadcn/ui theme integration infrastructure. Includes `tailwind.config.ts` mapping Still Void colors, typography, spacing, and border radii as Tailwind utilities for use with shadcn/ui components.
|
|
12
|
+
|
|
13
|
+
- [#5](https://github.com/KalleoPinheiro/still-void/pull/5) [`9d5fdc8`](https://github.com/KalleoPinheiro/still-void/commit/9d5fdc86eba6d04ed568b2fc821f71d3c91aac50) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Add shadcn/ui components with Still Void theming. Exports ~40 components from `@still-void/ui/react` (server-safe) and `@still-void/ui/react/client` (client-only). Tailwind config extends Still Void tokens; CSS override layer removes shadows per design spec.
|
|
14
|
+
|
|
15
|
+
## 1.1.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#2](https://github.com/KalleoPinheiro/still-void/pull/2) [`7001676`](https://github.com/KalleoPinheiro/still-void/commit/7001676e20e9dd72269d347826d0546d25fefde8) Thanks [@KalleoPinheiro](https://github.com/KalleoPinheiro)! - Fix the types shipped to CommonJS consumers. Every export subpath advertised a single
|
|
20
|
+
`types` entry pointing at the ESM `.d.ts`, so anything using `require('@still-void/ui')`
|
|
21
|
+
resolved ESM type declarations against a CommonJS runtime file (attw: "Masquerading as
|
|
22
|
+
ESM"), and `@still-void/ui/react` / `@still-void/ui/react/client` resolved to nothing at
|
|
23
|
+
all under the legacy `node10` module resolution. `exports` now carries per-condition
|
|
24
|
+
`types` (`.d.ts` for `import`, the already-built `.d.cts` for `require`), plus
|
|
25
|
+
`typesVersions` for `node10` consumers and a `./package.json` export.
|
|
26
|
+
|
|
27
|
+
## 1.1.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- feat(react): add ThemeScript to prevent flash of wrong theme on load
|
|
32
|
+
|
|
33
|
+
feat(tokens): WCAG AA accent/semantic color layer + z-index scale
|
|
34
|
+
|
|
35
|
+
fix(security): escape < in ThemeScript's embedded JSON to prevent </script> breakout
|
|
36
|
+
|
|
37
|
+
fix(storybook): apply sv-root theme class in preview decorator
|
|
38
|
+
|
|
39
|
+
fix(a11y): keyboard-operable CategoryPill + guard color resolvers
|
|
40
|
+
|
|
41
|
+
fix(a11y): CSS accessibility & consistency pass
|
|
42
|
+
|
|
43
|
+
fix(theme): remove render-blocking Google Fonts @import
|
|
44
|
+
|
|
45
|
+
perf(behaviors): rAF-throttle reading progress, quiet ARIA spam
|
|
46
|
+
|
|
47
|
+
ci: add GitHub Actions workflow for typecheck/test/build
|
|
48
|
+
|
|
49
|
+
## 1.0.0
|
|
50
|
+
|
|
51
|
+
### Major Changes
|
|
52
|
+
|
|
53
|
+
- ds first version
|
|
54
|
+
|
|
55
|
+
## 0.1.0
|
|
56
|
+
|
|
57
|
+
Initial extraction from the `blog.kalleopinheiro.dev` prototype.
|
|
58
|
+
|
|
59
|
+
- Typed design tokens: colors (dark/light + 4 oklch accents), typography (Sora/Manrope/JetBrains Mono), spacing 4–72px, radii 6/8/12/16/full, motion easing `cubic-bezier(.3,.7,.4,1)`.
|
|
60
|
+
- `theme.css`: CSS vars with `data-theme` / `data-accent` switching (Server Component safe) and signature utilities (`.sv-gradient-border`, `.sv-card-hover`, `.sv-skeleton`, `.sv-glass`).
|
|
61
|
+
- `style.css`: full component styles (`sv-*` classes).
|
|
62
|
+
- Framework-agnostic recipes (class-name builders) for Header, Logo, Footer, CategoryPill, PostCard, FeaturedPostCard, PostGrid, Layout, Sidebar, Hero, Skeleton, CodeBlock, Callout, TableOfContents, ReadingProgress, ArticleHeader, Prose.
|
|
63
|
+
- Vanilla behaviors: `createThemeManager`, `createScrollSpy`, `createReadingProgress`, `copyToClipboard`.
|
|
64
|
+
- React adapter: server-safe components (`@still-void/ui/react`) + client bundle (`@still-void/ui/react/client`) with `ThemeProvider`, `ThemeToggle`, `CopyButton`, `TableOfContents`, `ReadingProgress`, `useScrollSpy`, `useReadingProgress`, `useTheme`.
|
|
65
|
+
- Build: tsup (ESM + CJS + `.d.ts`), `'use client'` banner on the client entry, CSS exported as `./theme.css` and `./style.css`.
|
|
66
|
+
- Tests: 31 vitest tests (recipes, theme manager, scroll spy, React components incl. copy button feedback).
|
|
67
|
+
- Playground: framework-free HTML catalog under `playground/`.
|
package/README.md
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
# @still-void/ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
first-class support for **Next.js Server Components**.
|
|
3
|
+
[](https://www.npmjs.com/package/@still-void/ui)
|
|
4
|
+
[](https://github.com/KalleoPinheiro/still-void/actions/workflows/ci.yml)
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
**Still Void** design system for **React and Next.js** — extracted from the
|
|
7
|
+
`blog.kalleopinheiro.dev` prototype. Ships as two entry points: a server-safe entry that
|
|
8
|
+
renders inside Next.js Server Components with zero hydration cost, and a `'use client'`
|
|
9
|
+
entry for interactive pieces. See [docs/design-system.md](docs/design-system.md) for the
|
|
10
|
+
full architecture and component catalog, and
|
|
11
|
+
[docs/migration-v1-to-v2.md](docs/migration-v1-to-v2.md) if you're upgrading from the
|
|
12
|
+
framework-agnostic `1.x` line.
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
## Architecture
|
|
10
15
|
|
|
11
16
|
| Layer | Entry | Runs where | What it is |
|
|
12
17
|
|---|---|---|---|
|
|
13
|
-
| **Tokens** | `@still-void/ui` | anywhere | Typed constants: colors (hex + oklch), typography, spacing, radii, motion |
|
|
14
18
|
| **Theme CSS** | `@still-void/ui/theme.css` | browser | CSS vars (`--sv-*`), dark/light via `data-theme`, accents via `data-accent`, signature utilities |
|
|
15
19
|
| **Component CSS** | `@still-void/ui/style.css` | browser | All component classes (`sv-*`) |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
18
|
-
| **React (server-safe)** | `@still-void/ui/react` | server or client | Components without hooks — render inside Server Components |
|
|
19
|
-
| **React (client)** | `@still-void/ui/react/client` | client | `'use client'` bundle: `ThemeProvider`, `ThemeToggle`, `CopyButton`, `TableOfContents`, `ReadingProgress`, hooks |
|
|
20
|
+
| **React (server-safe)** | `@still-void/ui/react` | server or client | Tokens, recipes, and components without hooks — render inside Server Components |
|
|
21
|
+
| **React (client)** | `@still-void/ui/react/client` | client | `'use client'` bundle: DOM behaviors (`createThemeManager`, `createScrollSpy`, `createReadingProgress`, `copyToClipboard`), `ThemeProvider`, `ThemeToggle`, `CopyButton`, `TableOfContents`, `ReadingProgress`, hooks |
|
|
20
22
|
|
|
21
23
|
## Install
|
|
22
24
|
|
|
@@ -24,7 +26,7 @@ The library is layered so the core never depends on any framework:
|
|
|
24
26
|
npm install @still-void/ui
|
|
25
27
|
```
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
`react` and `react-dom` (>=18) are required peer dependencies.
|
|
28
30
|
|
|
29
31
|
## Usage — Next.js (App Router, Server Components)
|
|
30
32
|
|
|
@@ -94,30 +96,21 @@ import { CopyButton } from '@still-void/ui/react/client';
|
|
|
94
96
|
Syntax highlighting is bring-your-own (by design — the prototype tokenizer was demo-only):
|
|
95
97
|
render with Shiki on the server and pass the markup via `rendered`.
|
|
96
98
|
|
|
97
|
-
##
|
|
99
|
+
## Recipes and behaviors
|
|
98
100
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
```html
|
|
104
|
-
<!-- Angular -->
|
|
105
|
-
<article [class]="postCard({ dense: true })">
|
|
106
|
-
<h3 [class]="postCardClasses.title">{{ post.title }}</h3>
|
|
107
|
-
</article>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Behaviors are plain DOM and return a `destroy()`:
|
|
101
|
+
Recipes are pure class-name builders (server-safe, exported from `@still-void/ui/react`);
|
|
102
|
+
behaviors are plain DOM and return a `destroy()` (client-only, exported from
|
|
103
|
+
`@still-void/ui/react/client`):
|
|
111
104
|
|
|
112
105
|
```ts
|
|
106
|
+
import { postCard, postCardClasses } from '@still-void/ui/react';
|
|
107
|
+
import { createThemeManager } from '@still-void/ui/react/client';
|
|
108
|
+
|
|
113
109
|
const theme = createThemeManager(); // drives data-theme / data-accent, persists to localStorage
|
|
114
110
|
theme.toggleMode();
|
|
115
111
|
theme.setAccent('violet');
|
|
116
112
|
```
|
|
117
113
|
|
|
118
|
-
See [playground/index.html](playground/index.html) for the full catalog rendered with **zero
|
|
119
|
-
framework code** — open it with `npm run playground` after `npm run build`.
|
|
120
|
-
|
|
121
114
|
## Fonts
|
|
122
115
|
|
|
123
116
|
`theme.css` sets `--sv-font-display`/`--sv-font-body`/`--sv-font-mono` to Sora, Manrope and
|
|
@@ -153,6 +146,65 @@ before your chosen font loads — see [Fidelity rules](#fidelity-rules-do-not-re
|
|
|
153
146
|
Server Components with no JS.
|
|
154
147
|
- Everything is overridable via CSS vars (`--sv-accent`, `--sv-bg`, …). No `!important` anywhere.
|
|
155
148
|
|
|
149
|
+
## shadcn/ui Components
|
|
150
|
+
|
|
151
|
+
A selection of **shadcn/ui** components has been ported to Still Void with the design system's palette, typography, and spacing applied. Both server-safe and client-only variants are available:
|
|
152
|
+
|
|
153
|
+
**Server-safe components** (import from `@still-void/ui/react`):
|
|
154
|
+
- `Button` — with variants (default, destructive, outline, secondary, ghost, link) and sizes (sm, default, lg, icon)
|
|
155
|
+
- `Card` — with header, title, description, content, footer
|
|
156
|
+
- `Input` — text input with placeholder, disabled, and focus states
|
|
157
|
+
- `Alert` — with optional title and description
|
|
158
|
+
- `Badge` — with variants (default, secondary, destructive, outline)
|
|
159
|
+
|
|
160
|
+
**Client-only components** (import from `@still-void/ui/react/client`):
|
|
161
|
+
- `Dialog` — modal with trigger, content, header, footer, title, description
|
|
162
|
+
- `Select` — dropdown with groups, labels, and scroll
|
|
163
|
+
- `Dropdown` — menu with items, checkboxes, radio groups, labels, separators
|
|
164
|
+
- `Tabs` — tabbed interface with triggers and content
|
|
165
|
+
- `Tooltip` — positioned tooltip with provider
|
|
166
|
+
|
|
167
|
+
### Usage
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
// Server Component
|
|
171
|
+
import { Button, Card, CardHeader, CardTitle, CardContent } from '@still-void/ui/react';
|
|
172
|
+
|
|
173
|
+
export default function MyPage() {
|
|
174
|
+
return (
|
|
175
|
+
<Card>
|
|
176
|
+
<CardHeader>
|
|
177
|
+
<CardTitle>Settings</CardTitle>
|
|
178
|
+
</CardHeader>
|
|
179
|
+
<CardContent>
|
|
180
|
+
<Button>Save</Button>
|
|
181
|
+
</CardContent>
|
|
182
|
+
</Card>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
// Client Component ('use client')
|
|
189
|
+
import { Dialog, DialogTrigger, DialogContent } from '@still-void/ui/react/client';
|
|
190
|
+
import { Button } from '@still-void/ui/react';
|
|
191
|
+
|
|
192
|
+
export function SettingsDialog() {
|
|
193
|
+
return (
|
|
194
|
+
<Dialog>
|
|
195
|
+
<DialogTrigger asChild>
|
|
196
|
+
<Button>Open Settings</Button>
|
|
197
|
+
</DialogTrigger>
|
|
198
|
+
<DialogContent>
|
|
199
|
+
{/* modal content */}
|
|
200
|
+
</DialogContent>
|
|
201
|
+
</Dialog>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Note:** Tailwind CSS is now a peer dependency when using shadcn/ui components. Configure your `tailwind.config.ts` to extend Still Void's tokens (see [DESIGN.md](DESIGN.md) for the full config).
|
|
207
|
+
|
|
156
208
|
## Fidelity rules (do not regress)
|
|
157
209
|
|
|
158
210
|
- Color values (hex/oklch) are literal from the spec — never rounded.
|
|
@@ -175,16 +227,31 @@ before your chosen font loads — see [Fidelity rules](#fidelity-rules-do-not-re
|
|
|
175
227
|
npm run build # tsup (ESM + CJS + .d.ts) + CSS to dist/
|
|
176
228
|
npm test # vitest (31 tests)
|
|
177
229
|
npm run typecheck # tsc --noEmit (strict)
|
|
230
|
+
npm run lint:package # publint + are-the-types-wrong on the packed tarball
|
|
178
231
|
npm run playground # serve the framework-free catalog
|
|
179
232
|
npm run storybook # component catalog at localhost:6006
|
|
180
233
|
npm run build-storybook # static Storybook build → storybook-static/
|
|
181
234
|
npm run changeset # record a change for the next release
|
|
182
|
-
npm run version
|
|
183
|
-
npm run release # build + publish to npm
|
|
235
|
+
npm run version-packages # apply pending changesets, bump version, update CHANGELOG (CI does this)
|
|
236
|
+
npm run release # build + publish to npm (CI does this)
|
|
184
237
|
```
|
|
185
238
|
|
|
186
239
|
## Versioning
|
|
187
240
|
|
|
188
|
-
Releases are managed with [Changesets](https://github.com/changesets/changesets)
|
|
189
|
-
|
|
190
|
-
|
|
241
|
+
Releases are managed with [Changesets](https://github.com/changesets/changesets) and are
|
|
242
|
+
fully automated — nobody publishes from a laptop:
|
|
243
|
+
|
|
244
|
+
1. A pull request that touches `src/` or `scripts/` must carry a changeset
|
|
245
|
+
(`npm run changeset`); CI fails without one.
|
|
246
|
+
2. Merging into `main` opens a **`chore: version packages`** pull request with the version
|
|
247
|
+
bump and the generated `CHANGELOG.md`.
|
|
248
|
+
3. Merging *that* publishes to npm with
|
|
249
|
+
[provenance](https://docs.npmjs.com/generating-provenance-statements), tags `v<version>`,
|
|
250
|
+
creates the GitHub release and redeploys Storybook.
|
|
251
|
+
|
|
252
|
+
The changelog and the version are generated from changeset entries, never written by hand.
|
|
253
|
+
Unreleased changes can be tried out from a `canary` snapshot before they ship.
|
|
254
|
+
|
|
255
|
+
Bump levels for a design system (what counts as breaking, and why a corrected token is a
|
|
256
|
+
patch while a redesigned one is a major) are documented in
|
|
257
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|