@still-void/ui 1.0.0 → 1.1.1
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 +55 -0
- package/README.md +58 -7
- package/dist/article-Dl8rGW5l.d.cts +177 -0
- package/dist/article-Dl8rGW5l.d.ts +177 -0
- package/dist/index.cjs +142 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -24
- package/dist/index.d.ts +40 -24
- package/dist/index.js +136 -63
- package/dist/index.js.map +1 -1
- package/dist/react/client/index.cjs +49 -42
- package/dist/react/client/index.cjs.map +1 -1
- package/dist/react/client/index.d.cts +29 -7
- package/dist/react/client/index.d.ts +29 -7
- package/dist/react/client/index.js +49 -42
- package/dist/react/client/index.js.map +1 -1
- package/dist/react/index.cjs +99 -63
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +22 -5
- package/dist/react/index.d.ts +22 -5
- package/dist/react/index.js +98 -63
- package/dist/react/index.js.map +1 -1
- package/dist/style.css +309 -262
- package/dist/theme.css +161 -95
- package/package.json +60 -19
- package/dist/article-CNQxbFAz.d.cts +0 -120
- package/dist/article-CNQxbFAz.d.ts +0 -120
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @still-void/ui
|
|
2
|
+
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
`types` entry pointing at the ESM `.d.ts`, so anything using `require('@still-void/ui')`
|
|
9
|
+
resolved ESM type declarations against a CommonJS runtime file (attw: "Masquerading as
|
|
10
|
+
ESM"), and `@still-void/ui/react` / `@still-void/ui/react/client` resolved to nothing at
|
|
11
|
+
all under the legacy `node10` module resolution. `exports` now carries per-condition
|
|
12
|
+
`types` (`.d.ts` for `import`, the already-built `.d.cts` for `require`), plus
|
|
13
|
+
`typesVersions` for `node10` consumers and a `./package.json` export.
|
|
14
|
+
|
|
15
|
+
## 1.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- feat(react): add ThemeScript to prevent flash of wrong theme on load
|
|
20
|
+
|
|
21
|
+
feat(tokens): WCAG AA accent/semantic color layer + z-index scale
|
|
22
|
+
|
|
23
|
+
fix(security): escape < in ThemeScript's embedded JSON to prevent </script> breakout
|
|
24
|
+
|
|
25
|
+
fix(storybook): apply sv-root theme class in preview decorator
|
|
26
|
+
|
|
27
|
+
fix(a11y): keyboard-operable CategoryPill + guard color resolvers
|
|
28
|
+
|
|
29
|
+
fix(a11y): CSS accessibility & consistency pass
|
|
30
|
+
|
|
31
|
+
fix(theme): remove render-blocking Google Fonts @import
|
|
32
|
+
|
|
33
|
+
perf(behaviors): rAF-throttle reading progress, quiet ARIA spam
|
|
34
|
+
|
|
35
|
+
ci: add GitHub Actions workflow for typecheck/test/build
|
|
36
|
+
|
|
37
|
+
## 1.0.0
|
|
38
|
+
|
|
39
|
+
### Major Changes
|
|
40
|
+
|
|
41
|
+
- ds first version
|
|
42
|
+
|
|
43
|
+
## 0.1.0
|
|
44
|
+
|
|
45
|
+
Initial extraction from the `blog.kalleopinheiro.dev` prototype.
|
|
46
|
+
|
|
47
|
+
- 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)`.
|
|
48
|
+
- `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`).
|
|
49
|
+
- `style.css`: full component styles (`sv-*` classes).
|
|
50
|
+
- Framework-agnostic recipes (class-name builders) for Header, Logo, Footer, CategoryPill, PostCard, FeaturedPostCard, PostGrid, Layout, Sidebar, Hero, Skeleton, CodeBlock, Callout, TableOfContents, ReadingProgress, ArticleHeader, Prose.
|
|
51
|
+
- Vanilla behaviors: `createThemeManager`, `createScrollSpy`, `createReadingProgress`, `copyToClipboard`.
|
|
52
|
+
- 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`.
|
|
53
|
+
- Build: tsup (ESM + CJS + `.d.ts`), `'use client'` banner on the client entry, CSS exported as `./theme.css` and `./style.css`.
|
|
54
|
+
- Tests: 31 vitest tests (recipes, theme manager, scroll spy, React components incl. copy button feedback).
|
|
55
|
+
- Playground: framework-free HTML catalog under `playground/`.
|
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# @still-void/ui
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@still-void/ui)
|
|
4
|
+
[](https://github.com/KalleoPinheiro/still-void/actions/workflows/ci.yml)
|
|
5
|
+
|
|
3
6
|
**Still Void** design system as a framework-agnostic TypeScript library — extracted from the
|
|
4
7
|
`blog.kalleopinheiro.dev` prototype. Works with React, Angular, Vue, or plain HTML, with
|
|
5
8
|
first-class support for **Next.js Server Components**.
|
|
@@ -32,13 +35,18 @@ React is an **optional** peer dependency — non-React consumers install nothing
|
|
|
32
35
|
// app/layout.tsx (Server Component)
|
|
33
36
|
import '@still-void/ui/theme.css';
|
|
34
37
|
import '@still-void/ui/style.css';
|
|
35
|
-
import { Header, Logo, Footer } from '@still-void/ui/react';
|
|
38
|
+
import { Header, Logo, Footer, ThemeScript } from '@still-void/ui/react';
|
|
36
39
|
import { ThemeProvider, ThemeToggle } from '@still-void/ui/react/client';
|
|
37
40
|
|
|
38
41
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
39
42
|
return (
|
|
40
|
-
// Server-rendered attributes = correct theme
|
|
43
|
+
// Server-rendered attributes = correct theme for a first-time visitor.
|
|
44
|
+
// <ThemeScript /> runs before paint and re-applies a *returning* visitor's
|
|
45
|
+
// stored preference, so there's no flash of the wrong theme either way.
|
|
41
46
|
<html lang="en" data-theme="dark" data-accent="cyan" suppressHydrationWarning>
|
|
47
|
+
<head>
|
|
48
|
+
<ThemeScript />
|
|
49
|
+
</head>
|
|
42
50
|
<body className="sv-body">
|
|
43
51
|
<ThemeProvider>
|
|
44
52
|
<Header
|
|
@@ -113,6 +121,34 @@ theme.setAccent('violet');
|
|
|
113
121
|
See [playground/index.html](playground/index.html) for the full catalog rendered with **zero
|
|
114
122
|
framework code** — open it with `npm run playground` after `npm run build`.
|
|
115
123
|
|
|
124
|
+
## Fonts
|
|
125
|
+
|
|
126
|
+
`theme.css` sets `--sv-font-display`/`--sv-font-body`/`--sv-font-mono` to Sora, Manrope and
|
|
127
|
+
JetBrains Mono, but does **not** load them — that's a render-blocking `@import` on every
|
|
128
|
+
consumer's critical path, and a runtime dependency on a third-party CDN. Load them yourself:
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
// app/layout.tsx — next/font self-hosts and inlines the @font-face rules, no network request
|
|
132
|
+
import { Sora, Manrope, JetBrains_Mono } from 'next/font/google';
|
|
133
|
+
|
|
134
|
+
const sora = Sora({ subsets: ['latin'], weight: ['400', '600', '700'], variable: '--sv-font-display' });
|
|
135
|
+
const manrope = Manrope({ subsets: ['latin'], weight: ['400', '500', '600', '700'], variable: '--sv-font-body' });
|
|
136
|
+
const mono = JetBrains_Mono({ subsets: ['latin'], weight: ['400', '500'], variable: '--sv-font-mono' });
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<!-- any other framework: preconnect + stylesheet -->
|
|
141
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
142
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
143
|
+
<link
|
|
144
|
+
href="https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
145
|
+
rel="stylesheet"
|
|
146
|
+
/>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
System-font fallbacks (`ui-sans-serif`, `system-ui`, `ui-monospace`) already cover the gap
|
|
150
|
+
before your chosen font loads — see [Fidelity rules](#fidelity-rules-do-not-regress).
|
|
151
|
+
|
|
116
152
|
## Theming
|
|
117
153
|
|
|
118
154
|
- Mode: `data-theme="dark" | "light"` on `<html>` (dark is default).
|
|
@@ -142,16 +178,31 @@ framework code** — open it with `npm run playground` after `npm run build`.
|
|
|
142
178
|
npm run build # tsup (ESM + CJS + .d.ts) + CSS to dist/
|
|
143
179
|
npm test # vitest (31 tests)
|
|
144
180
|
npm run typecheck # tsc --noEmit (strict)
|
|
181
|
+
npm run lint:package # publint + are-the-types-wrong on the packed tarball
|
|
145
182
|
npm run playground # serve the framework-free catalog
|
|
146
183
|
npm run storybook # component catalog at localhost:6006
|
|
147
184
|
npm run build-storybook # static Storybook build → storybook-static/
|
|
148
185
|
npm run changeset # record a change for the next release
|
|
149
|
-
npm run version
|
|
150
|
-
npm run release # build + publish to npm
|
|
186
|
+
npm run version-packages # apply pending changesets, bump version, update CHANGELOG (CI does this)
|
|
187
|
+
npm run release # build + publish to npm (CI does this)
|
|
151
188
|
```
|
|
152
189
|
|
|
153
190
|
## Versioning
|
|
154
191
|
|
|
155
|
-
Releases are managed with [Changesets](https://github.com/changesets/changesets)
|
|
156
|
-
|
|
157
|
-
|
|
192
|
+
Releases are managed with [Changesets](https://github.com/changesets/changesets) and are
|
|
193
|
+
fully automated — nobody publishes from a laptop:
|
|
194
|
+
|
|
195
|
+
1. A pull request that touches `src/` or `scripts/` must carry a changeset
|
|
196
|
+
(`npm run changeset`); CI fails without one.
|
|
197
|
+
2. Merging into `main` opens a **`chore: version packages`** pull request with the version
|
|
198
|
+
bump and the generated `CHANGELOG.md`.
|
|
199
|
+
3. Merging *that* publishes to npm with
|
|
200
|
+
[provenance](https://docs.npmjs.com/generating-provenance-statements), tags `v<version>`,
|
|
201
|
+
creates the GitHub release and redeploys Storybook.
|
|
202
|
+
|
|
203
|
+
The changelog and the version are generated from changeset entries, never written by hand.
|
|
204
|
+
Unreleased changes can be tried out from a `canary` snapshot before they ship.
|
|
205
|
+
|
|
206
|
+
Bump levels for a design system (what counts as breaking, and why a corrected token is a
|
|
207
|
+
patch while a redesigned one is a major) are documented in
|
|
208
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Still Void color tokens.
|
|
3
|
+
* Values ported literally from the Still Void spec (blog.kalleopinheiro.dev).
|
|
4
|
+
* Do not round or "approximate" — fidelity rule.
|
|
5
|
+
*/
|
|
6
|
+
declare const colors: {
|
|
7
|
+
readonly dark: {
|
|
8
|
+
readonly bg: "#0A0A0C";
|
|
9
|
+
readonly bgElev: "#111114";
|
|
10
|
+
readonly surface: "#16161B";
|
|
11
|
+
readonly surface2: "#1C1C22";
|
|
12
|
+
readonly border: "rgba(255,255,255,0.08)";
|
|
13
|
+
readonly borderStrong: "rgba(255,255,255,0.14)";
|
|
14
|
+
readonly text: "#EDEDF0";
|
|
15
|
+
readonly text2: "#8B8B96";
|
|
16
|
+
readonly text3: "#83838F";
|
|
17
|
+
};
|
|
18
|
+
readonly light: {
|
|
19
|
+
readonly bg: "#F7F7F5";
|
|
20
|
+
readonly bgElev: "#FFFFFF";
|
|
21
|
+
readonly surface: "#FFFFFF";
|
|
22
|
+
readonly surface2: "#F2F2EF";
|
|
23
|
+
readonly border: "rgba(0,0,0,0.08)";
|
|
24
|
+
readonly borderStrong: "rgba(0,0,0,0.14)";
|
|
25
|
+
readonly text: "#16161B";
|
|
26
|
+
readonly text2: "#5A5A66";
|
|
27
|
+
readonly text3: "#6D6D76";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
declare const accents: {
|
|
31
|
+
readonly cyan: "oklch(0.78 0.12 210)";
|
|
32
|
+
readonly violet: "oklch(0.72 0.14 295)";
|
|
33
|
+
readonly mint: "oklch(0.78 0.10 160)";
|
|
34
|
+
readonly amber: "oklch(0.78 0.12 75)";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Text/UI-safe accent variants ("ink"). `accents` above is tuned for surface use
|
|
38
|
+
* (dots, gradient border, progress bar) and fails WCAG AA as text on light
|
|
39
|
+
* backgrounds (e.g. cyan is ~1.8:1 on white). These preserve the dark-mode
|
|
40
|
+
* values (already ≥6.9:1) and darken each hue for light mode to clear 4.5:1
|
|
41
|
+
* against both light surfaces. Used anywhere the accent colors text: prose
|
|
42
|
+
* links, active TOC state, callout labels, hero eyebrow, copy-success, focus ring.
|
|
43
|
+
*/
|
|
44
|
+
declare const accentsInk: {
|
|
45
|
+
readonly dark: {
|
|
46
|
+
readonly cyan: "oklch(0.78 0.12 210)";
|
|
47
|
+
readonly violet: "oklch(0.72 0.14 295)";
|
|
48
|
+
readonly mint: "oklch(0.78 0.10 160)";
|
|
49
|
+
readonly amber: "oklch(0.78 0.12 75)";
|
|
50
|
+
};
|
|
51
|
+
readonly light: {
|
|
52
|
+
readonly cyan: "oklch(0.525 0.09 210)";
|
|
53
|
+
readonly violet: "oklch(0.545 0.14 295)";
|
|
54
|
+
readonly mint: "oklch(0.52 0.1 160)";
|
|
55
|
+
readonly amber: "oklch(0.535 0.11 75)";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Semantic state colors — independent of the switchable `accent`, so a
|
|
60
|
+
* consumer picking `data-accent="amber"` never collides a warning with the
|
|
61
|
+
* site accent. Fixed per meaning in both surface and text/UI ("ink") forms,
|
|
62
|
+
* same split as `accents`/`accentsInk`.
|
|
63
|
+
*/
|
|
64
|
+
declare const semantic: {
|
|
65
|
+
readonly dark: {
|
|
66
|
+
readonly danger: "oklch(0.68 0.19 25)";
|
|
67
|
+
readonly success: "oklch(0.75 0.15 150)";
|
|
68
|
+
readonly info: "oklch(0.78 0.12 210)";
|
|
69
|
+
readonly warning: "oklch(0.78 0.12 75)";
|
|
70
|
+
};
|
|
71
|
+
readonly light: {
|
|
72
|
+
readonly danger: "oklch(0.68 0.19 25)";
|
|
73
|
+
readonly success: "oklch(0.75 0.15 150)";
|
|
74
|
+
readonly info: "oklch(0.78 0.12 210)";
|
|
75
|
+
readonly warning: "oklch(0.78 0.12 75)";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
declare const semanticInk: {
|
|
79
|
+
readonly dark: {
|
|
80
|
+
readonly danger: "oklch(0.68 0.19 25)";
|
|
81
|
+
readonly success: "oklch(0.75 0.15 150)";
|
|
82
|
+
readonly info: "oklch(0.78 0.12 210)";
|
|
83
|
+
readonly warning: "oklch(0.78 0.12 75)";
|
|
84
|
+
};
|
|
85
|
+
readonly light: {
|
|
86
|
+
readonly danger: "oklch(0.555 0.19 25)";
|
|
87
|
+
readonly success: "oklch(0.515 0.14 150)";
|
|
88
|
+
readonly info: "oklch(0.525 0.09 210)";
|
|
89
|
+
readonly warning: "oklch(0.535 0.11 75)";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
type ThemeMode = keyof typeof colors;
|
|
93
|
+
type AccentName = keyof typeof accents;
|
|
94
|
+
type ColorScheme = (typeof colors)[ThemeMode];
|
|
95
|
+
type SemanticName = keyof (typeof semantic)['dark'];
|
|
96
|
+
declare const themeModes: ThemeMode[];
|
|
97
|
+
declare const accentNames: AccentName[];
|
|
98
|
+
declare const DEFAULT_MODE: ThemeMode;
|
|
99
|
+
declare const DEFAULT_ACCENT: AccentName;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Blog categories from the prototype. Categories render as a colored dot + label
|
|
103
|
+
* (never an emoji). The pill also accepts any CSS color for whitelabel use.
|
|
104
|
+
*/
|
|
105
|
+
type CategoryName = 'ia' | 'prompt' | 'dev' | 'arch' | 'ts';
|
|
106
|
+
declare const defaultCategoryColors: Record<CategoryName, AccentName>;
|
|
107
|
+
/** Resolve an accent name or raw CSS color to a CSS color value. */
|
|
108
|
+
declare function resolveAccentColor(color: AccentName | (string & {})): string;
|
|
109
|
+
/** Resolve a category name, accent name, or raw CSS color to a CSS color value. */
|
|
110
|
+
declare function resolveCategoryColor(color: CategoryName | AccentName | (string & {})): string;
|
|
111
|
+
|
|
112
|
+
/** Data shape consumed by PostCard / FeaturedPostCard. The library never ships mock data. */
|
|
113
|
+
interface PostSummary {
|
|
114
|
+
title: string;
|
|
115
|
+
href: string;
|
|
116
|
+
excerpt?: string;
|
|
117
|
+
date?: string;
|
|
118
|
+
readMinutes?: number;
|
|
119
|
+
category?: {
|
|
120
|
+
label: string;
|
|
121
|
+
/** Accent token name, known category, or any CSS color. */
|
|
122
|
+
color?: AccentName | CategoryName | (string & {});
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
interface TocItem {
|
|
126
|
+
id: string;
|
|
127
|
+
label: string;
|
|
128
|
+
depth?: 2 | 3;
|
|
129
|
+
}
|
|
130
|
+
interface NavItem {
|
|
131
|
+
label: string;
|
|
132
|
+
href: string;
|
|
133
|
+
active?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Article recipes: CodeBlock, Callout, TableOfContents, ReadingProgress,
|
|
138
|
+
* ArticleHeader, Prose. Pure functions — Server Component safe.
|
|
139
|
+
*/
|
|
140
|
+
declare function codeBlock(): string;
|
|
141
|
+
declare const codeBlockClasses: {
|
|
142
|
+
readonly header: "sv-code-block__header";
|
|
143
|
+
readonly pre: "sv-code-block__pre";
|
|
144
|
+
readonly copy: "sv-code-block__copy";
|
|
145
|
+
readonly copyCopied: string;
|
|
146
|
+
};
|
|
147
|
+
type CalloutKind = 'note' | 'warn' | 'aha';
|
|
148
|
+
declare function callout(kind: CalloutKind): string;
|
|
149
|
+
declare const calloutClasses: {
|
|
150
|
+
readonly label: "sv-callout__label";
|
|
151
|
+
};
|
|
152
|
+
declare const calloutLabels: Record<CalloutKind, string>;
|
|
153
|
+
declare function tableOfContents(): string;
|
|
154
|
+
interface TocLinkOptions {
|
|
155
|
+
active?: boolean;
|
|
156
|
+
/** Heading depth, 2 (h2) or 3 (h3). Depth 3 indents. */
|
|
157
|
+
depth?: 2 | 3;
|
|
158
|
+
}
|
|
159
|
+
declare function tocLink(options?: TocLinkOptions): string;
|
|
160
|
+
declare function readingProgress(): string;
|
|
161
|
+
declare const readingProgressClasses: {
|
|
162
|
+
readonly bar: "sv-reading-progress__bar";
|
|
163
|
+
};
|
|
164
|
+
/** CSS var read by `.sv-reading-progress__bar` (0 → 1). */
|
|
165
|
+
declare const READING_PROGRESS_VAR = "--sv-reading-progress";
|
|
166
|
+
declare function articleHeader(): string;
|
|
167
|
+
declare const articleHeaderClasses: {
|
|
168
|
+
readonly title: "sv-article-header__title";
|
|
169
|
+
readonly meta: "sv-article-header__meta";
|
|
170
|
+
readonly author: "sv-article-header__author";
|
|
171
|
+
};
|
|
172
|
+
declare function prose(): string;
|
|
173
|
+
declare const proseClasses: {
|
|
174
|
+
readonly lead: "sv-prose__lead";
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { type AccentName as A, themeModes as B, type CalloutKind as C, DEFAULT_ACCENT as D, tocLink as E, type NavItem as N, type PostSummary as P, READING_PROGRESS_VAR as R, type SemanticName as S, type ThemeMode as T, type CategoryName as a, type ColorScheme as b, DEFAULT_MODE as c, type TocItem as d, type TocLinkOptions as e, accentNames as f, accents as g, accentsInk as h, articleHeader as i, articleHeaderClasses as j, callout as k, calloutClasses as l, calloutLabels as m, codeBlock as n, codeBlockClasses as o, colors as p, defaultCategoryColors as q, prose as r, proseClasses as s, readingProgress as t, readingProgressClasses as u, resolveAccentColor as v, resolveCategoryColor as w, semantic as x, semanticInk as y, tableOfContents as z };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Still Void color tokens.
|
|
3
|
+
* Values ported literally from the Still Void spec (blog.kalleopinheiro.dev).
|
|
4
|
+
* Do not round or "approximate" — fidelity rule.
|
|
5
|
+
*/
|
|
6
|
+
declare const colors: {
|
|
7
|
+
readonly dark: {
|
|
8
|
+
readonly bg: "#0A0A0C";
|
|
9
|
+
readonly bgElev: "#111114";
|
|
10
|
+
readonly surface: "#16161B";
|
|
11
|
+
readonly surface2: "#1C1C22";
|
|
12
|
+
readonly border: "rgba(255,255,255,0.08)";
|
|
13
|
+
readonly borderStrong: "rgba(255,255,255,0.14)";
|
|
14
|
+
readonly text: "#EDEDF0";
|
|
15
|
+
readonly text2: "#8B8B96";
|
|
16
|
+
readonly text3: "#83838F";
|
|
17
|
+
};
|
|
18
|
+
readonly light: {
|
|
19
|
+
readonly bg: "#F7F7F5";
|
|
20
|
+
readonly bgElev: "#FFFFFF";
|
|
21
|
+
readonly surface: "#FFFFFF";
|
|
22
|
+
readonly surface2: "#F2F2EF";
|
|
23
|
+
readonly border: "rgba(0,0,0,0.08)";
|
|
24
|
+
readonly borderStrong: "rgba(0,0,0,0.14)";
|
|
25
|
+
readonly text: "#16161B";
|
|
26
|
+
readonly text2: "#5A5A66";
|
|
27
|
+
readonly text3: "#6D6D76";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
declare const accents: {
|
|
31
|
+
readonly cyan: "oklch(0.78 0.12 210)";
|
|
32
|
+
readonly violet: "oklch(0.72 0.14 295)";
|
|
33
|
+
readonly mint: "oklch(0.78 0.10 160)";
|
|
34
|
+
readonly amber: "oklch(0.78 0.12 75)";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Text/UI-safe accent variants ("ink"). `accents` above is tuned for surface use
|
|
38
|
+
* (dots, gradient border, progress bar) and fails WCAG AA as text on light
|
|
39
|
+
* backgrounds (e.g. cyan is ~1.8:1 on white). These preserve the dark-mode
|
|
40
|
+
* values (already ≥6.9:1) and darken each hue for light mode to clear 4.5:1
|
|
41
|
+
* against both light surfaces. Used anywhere the accent colors text: prose
|
|
42
|
+
* links, active TOC state, callout labels, hero eyebrow, copy-success, focus ring.
|
|
43
|
+
*/
|
|
44
|
+
declare const accentsInk: {
|
|
45
|
+
readonly dark: {
|
|
46
|
+
readonly cyan: "oklch(0.78 0.12 210)";
|
|
47
|
+
readonly violet: "oklch(0.72 0.14 295)";
|
|
48
|
+
readonly mint: "oklch(0.78 0.10 160)";
|
|
49
|
+
readonly amber: "oklch(0.78 0.12 75)";
|
|
50
|
+
};
|
|
51
|
+
readonly light: {
|
|
52
|
+
readonly cyan: "oklch(0.525 0.09 210)";
|
|
53
|
+
readonly violet: "oklch(0.545 0.14 295)";
|
|
54
|
+
readonly mint: "oklch(0.52 0.1 160)";
|
|
55
|
+
readonly amber: "oklch(0.535 0.11 75)";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Semantic state colors — independent of the switchable `accent`, so a
|
|
60
|
+
* consumer picking `data-accent="amber"` never collides a warning with the
|
|
61
|
+
* site accent. Fixed per meaning in both surface and text/UI ("ink") forms,
|
|
62
|
+
* same split as `accents`/`accentsInk`.
|
|
63
|
+
*/
|
|
64
|
+
declare const semantic: {
|
|
65
|
+
readonly dark: {
|
|
66
|
+
readonly danger: "oklch(0.68 0.19 25)";
|
|
67
|
+
readonly success: "oklch(0.75 0.15 150)";
|
|
68
|
+
readonly info: "oklch(0.78 0.12 210)";
|
|
69
|
+
readonly warning: "oklch(0.78 0.12 75)";
|
|
70
|
+
};
|
|
71
|
+
readonly light: {
|
|
72
|
+
readonly danger: "oklch(0.68 0.19 25)";
|
|
73
|
+
readonly success: "oklch(0.75 0.15 150)";
|
|
74
|
+
readonly info: "oklch(0.78 0.12 210)";
|
|
75
|
+
readonly warning: "oklch(0.78 0.12 75)";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
declare const semanticInk: {
|
|
79
|
+
readonly dark: {
|
|
80
|
+
readonly danger: "oklch(0.68 0.19 25)";
|
|
81
|
+
readonly success: "oklch(0.75 0.15 150)";
|
|
82
|
+
readonly info: "oklch(0.78 0.12 210)";
|
|
83
|
+
readonly warning: "oklch(0.78 0.12 75)";
|
|
84
|
+
};
|
|
85
|
+
readonly light: {
|
|
86
|
+
readonly danger: "oklch(0.555 0.19 25)";
|
|
87
|
+
readonly success: "oklch(0.515 0.14 150)";
|
|
88
|
+
readonly info: "oklch(0.525 0.09 210)";
|
|
89
|
+
readonly warning: "oklch(0.535 0.11 75)";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
type ThemeMode = keyof typeof colors;
|
|
93
|
+
type AccentName = keyof typeof accents;
|
|
94
|
+
type ColorScheme = (typeof colors)[ThemeMode];
|
|
95
|
+
type SemanticName = keyof (typeof semantic)['dark'];
|
|
96
|
+
declare const themeModes: ThemeMode[];
|
|
97
|
+
declare const accentNames: AccentName[];
|
|
98
|
+
declare const DEFAULT_MODE: ThemeMode;
|
|
99
|
+
declare const DEFAULT_ACCENT: AccentName;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Blog categories from the prototype. Categories render as a colored dot + label
|
|
103
|
+
* (never an emoji). The pill also accepts any CSS color for whitelabel use.
|
|
104
|
+
*/
|
|
105
|
+
type CategoryName = 'ia' | 'prompt' | 'dev' | 'arch' | 'ts';
|
|
106
|
+
declare const defaultCategoryColors: Record<CategoryName, AccentName>;
|
|
107
|
+
/** Resolve an accent name or raw CSS color to a CSS color value. */
|
|
108
|
+
declare function resolveAccentColor(color: AccentName | (string & {})): string;
|
|
109
|
+
/** Resolve a category name, accent name, or raw CSS color to a CSS color value. */
|
|
110
|
+
declare function resolveCategoryColor(color: CategoryName | AccentName | (string & {})): string;
|
|
111
|
+
|
|
112
|
+
/** Data shape consumed by PostCard / FeaturedPostCard. The library never ships mock data. */
|
|
113
|
+
interface PostSummary {
|
|
114
|
+
title: string;
|
|
115
|
+
href: string;
|
|
116
|
+
excerpt?: string;
|
|
117
|
+
date?: string;
|
|
118
|
+
readMinutes?: number;
|
|
119
|
+
category?: {
|
|
120
|
+
label: string;
|
|
121
|
+
/** Accent token name, known category, or any CSS color. */
|
|
122
|
+
color?: AccentName | CategoryName | (string & {});
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
interface TocItem {
|
|
126
|
+
id: string;
|
|
127
|
+
label: string;
|
|
128
|
+
depth?: 2 | 3;
|
|
129
|
+
}
|
|
130
|
+
interface NavItem {
|
|
131
|
+
label: string;
|
|
132
|
+
href: string;
|
|
133
|
+
active?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Article recipes: CodeBlock, Callout, TableOfContents, ReadingProgress,
|
|
138
|
+
* ArticleHeader, Prose. Pure functions — Server Component safe.
|
|
139
|
+
*/
|
|
140
|
+
declare function codeBlock(): string;
|
|
141
|
+
declare const codeBlockClasses: {
|
|
142
|
+
readonly header: "sv-code-block__header";
|
|
143
|
+
readonly pre: "sv-code-block__pre";
|
|
144
|
+
readonly copy: "sv-code-block__copy";
|
|
145
|
+
readonly copyCopied: string;
|
|
146
|
+
};
|
|
147
|
+
type CalloutKind = 'note' | 'warn' | 'aha';
|
|
148
|
+
declare function callout(kind: CalloutKind): string;
|
|
149
|
+
declare const calloutClasses: {
|
|
150
|
+
readonly label: "sv-callout__label";
|
|
151
|
+
};
|
|
152
|
+
declare const calloutLabels: Record<CalloutKind, string>;
|
|
153
|
+
declare function tableOfContents(): string;
|
|
154
|
+
interface TocLinkOptions {
|
|
155
|
+
active?: boolean;
|
|
156
|
+
/** Heading depth, 2 (h2) or 3 (h3). Depth 3 indents. */
|
|
157
|
+
depth?: 2 | 3;
|
|
158
|
+
}
|
|
159
|
+
declare function tocLink(options?: TocLinkOptions): string;
|
|
160
|
+
declare function readingProgress(): string;
|
|
161
|
+
declare const readingProgressClasses: {
|
|
162
|
+
readonly bar: "sv-reading-progress__bar";
|
|
163
|
+
};
|
|
164
|
+
/** CSS var read by `.sv-reading-progress__bar` (0 → 1). */
|
|
165
|
+
declare const READING_PROGRESS_VAR = "--sv-reading-progress";
|
|
166
|
+
declare function articleHeader(): string;
|
|
167
|
+
declare const articleHeaderClasses: {
|
|
168
|
+
readonly title: "sv-article-header__title";
|
|
169
|
+
readonly meta: "sv-article-header__meta";
|
|
170
|
+
readonly author: "sv-article-header__author";
|
|
171
|
+
};
|
|
172
|
+
declare function prose(): string;
|
|
173
|
+
declare const proseClasses: {
|
|
174
|
+
readonly lead: "sv-prose__lead";
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { type AccentName as A, themeModes as B, type CalloutKind as C, DEFAULT_ACCENT as D, tocLink as E, type NavItem as N, type PostSummary as P, READING_PROGRESS_VAR as R, type SemanticName as S, type ThemeMode as T, type CategoryName as a, type ColorScheme as b, DEFAULT_MODE as c, type TocItem as d, type TocLinkOptions as e, accentNames as f, accents as g, accentsInk as h, articleHeader as i, articleHeaderClasses as j, callout as k, calloutClasses as l, calloutLabels as m, codeBlock as n, codeBlockClasses as o, colors as p, defaultCategoryColors as q, prose as r, proseClasses as s, readingProgress as t, readingProgressClasses as u, resolveAccentColor as v, resolveCategoryColor as w, semantic as x, semanticInk as y, tableOfContents as z };
|