@still-void/ui 1.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/LICENSE +21 -0
- package/README.md +157 -0
- package/dist/article-CNQxbFAz.d.cts +120 -0
- package/dist/article-CNQxbFAz.d.ts +120 -0
- package/dist/index.cjs +561 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +232 -0
- package/dist/index.d.ts +232 -0
- package/dist/index.js +478 -0
- package/dist/index.js.map +1 -0
- package/dist/react/client/index.cjs +430 -0
- package/dist/react/client/index.cjs.map +1 -0
- package/dist/react/client/index.d.cts +105 -0
- package/dist/react/client/index.d.ts +105 -0
- package/dist/react/client/index.js +404 -0
- package/dist/react/client/index.js.map +1 -0
- package/dist/react/index.cjs +409 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +112 -0
- package/dist/react/index.d.ts +112 -0
- package/dist/react/index.js +365 -0
- package/dist/react/index.js.map +1 -0
- package/dist/style.css +550 -0
- package/dist/theme.css +188 -0
- package/package.json +94 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { T as ThemeMode, A as AccentName } from './article-CNQxbFAz.cjs';
|
|
2
|
+
export { C as CalloutKind, a as CategoryName, b as ColorScheme, D as DEFAULT_ACCENT, c as DEFAULT_MODE, N as NavItem, P as PostSummary, R as READING_PROGRESS_VAR, d as TocItem, e as TocLinkOptions, f as accentNames, g as accents, h as articleHeader, i as articleHeaderClasses, j as callout, k as calloutClasses, l as calloutLabels, m as codeBlock, n as codeBlockClasses, o as colors, p as defaultCategoryColors, q as prose, r as proseClasses, s as readingProgress, t as readingProgressClasses, u as resolveAccentColor, v as resolveCategoryColor, w as tableOfContents, x as themeModes, y as tocLink } from './article-CNQxbFAz.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Quiet Tech typography tokens.
|
|
6
|
+
* Families are fixed by the spec: Sora (display), Manrope (body), JetBrains Mono (code).
|
|
7
|
+
* System fallbacks are loading fallbacks only — the final family must be the correct one.
|
|
8
|
+
*/
|
|
9
|
+
declare const fontFamilies: {
|
|
10
|
+
readonly display: "'Sora', ui-sans-serif, system-ui, sans-serif";
|
|
11
|
+
readonly body: "'Manrope', ui-sans-serif, system-ui, sans-serif";
|
|
12
|
+
readonly mono: "'JetBrains Mono', ui-monospace, 'SF Mono', monospace";
|
|
13
|
+
};
|
|
14
|
+
declare const fontWeights: {
|
|
15
|
+
readonly regular: 400;
|
|
16
|
+
readonly medium: 500;
|
|
17
|
+
readonly semibold: 600;
|
|
18
|
+
readonly bold: 700;
|
|
19
|
+
};
|
|
20
|
+
declare const fontSizes: {
|
|
21
|
+
readonly xs: "0.75rem";
|
|
22
|
+
readonly sm: "0.8125rem";
|
|
23
|
+
readonly base: "0.9375rem";
|
|
24
|
+
readonly md: "1rem";
|
|
25
|
+
readonly lg: "1.125rem";
|
|
26
|
+
readonly xl: "1.375rem";
|
|
27
|
+
readonly '2xl': "1.75rem";
|
|
28
|
+
readonly '3xl': "2.25rem";
|
|
29
|
+
readonly '4xl': "2.75rem";
|
|
30
|
+
};
|
|
31
|
+
declare const lineHeights: {
|
|
32
|
+
readonly tight: 1.15;
|
|
33
|
+
readonly snug: 1.3;
|
|
34
|
+
readonly normal: 1.5;
|
|
35
|
+
readonly relaxed: 1.7;
|
|
36
|
+
};
|
|
37
|
+
declare const letterSpacings: {
|
|
38
|
+
readonly display: "-0.02em";
|
|
39
|
+
readonly normal: "0";
|
|
40
|
+
readonly wide: "0.08em";
|
|
41
|
+
};
|
|
42
|
+
type FontFamily = keyof typeof fontFamilies;
|
|
43
|
+
type FontSize = keyof typeof fontSizes;
|
|
44
|
+
type FontWeight = keyof typeof fontWeights;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Quiet Tech spacing scale (4→72px) and radii (6/8/12/16/full).
|
|
48
|
+
*/
|
|
49
|
+
declare const spacing: {
|
|
50
|
+
readonly 1: "4px";
|
|
51
|
+
readonly 2: "8px";
|
|
52
|
+
readonly 3: "12px";
|
|
53
|
+
readonly 4: "16px";
|
|
54
|
+
readonly 5: "20px";
|
|
55
|
+
readonly 6: "24px";
|
|
56
|
+
readonly 8: "32px";
|
|
57
|
+
readonly 10: "40px";
|
|
58
|
+
readonly 12: "48px";
|
|
59
|
+
readonly 14: "56px";
|
|
60
|
+
readonly 16: "64px";
|
|
61
|
+
readonly 18: "72px";
|
|
62
|
+
};
|
|
63
|
+
declare const radii: {
|
|
64
|
+
readonly sm: "6px";
|
|
65
|
+
readonly md: "8px";
|
|
66
|
+
readonly lg: "12px";
|
|
67
|
+
readonly xl: "16px";
|
|
68
|
+
readonly full: "9999px";
|
|
69
|
+
};
|
|
70
|
+
type SpacingStep = keyof typeof spacing;
|
|
71
|
+
type Radius = keyof typeof radii;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Quiet Tech motion tokens.
|
|
75
|
+
* Hover transitions use the signature easing; the reading progress bar is linear.
|
|
76
|
+
*/
|
|
77
|
+
declare const easings: {
|
|
78
|
+
readonly hover: "cubic-bezier(.3,.7,.4,1)";
|
|
79
|
+
readonly linear: "linear";
|
|
80
|
+
};
|
|
81
|
+
declare const durations: {
|
|
82
|
+
readonly fast: "120ms";
|
|
83
|
+
readonly base: "200ms";
|
|
84
|
+
readonly slow: "320ms";
|
|
85
|
+
};
|
|
86
|
+
type Easing = keyof typeof easings;
|
|
87
|
+
type Duration = keyof typeof durations;
|
|
88
|
+
|
|
89
|
+
/** Minimal class-name joiner. Falsy values are dropped. */
|
|
90
|
+
declare function cx(...parts: Array<string | false | null | undefined>): string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Shell recipes: Header, Logo, Footer.
|
|
94
|
+
* Recipes are pure functions returning class strings — no DOM, no framework.
|
|
95
|
+
* Safe in Next.js Server Components; usable via [class] in Angular, :class in Vue.
|
|
96
|
+
*/
|
|
97
|
+
interface HeaderOptions {
|
|
98
|
+
/** Frosted glass background (sticky headers). */
|
|
99
|
+
glass?: boolean;
|
|
100
|
+
}
|
|
101
|
+
declare function header(options?: HeaderOptions): string;
|
|
102
|
+
declare const headerClasses: {
|
|
103
|
+
readonly nav: "qt-header__nav";
|
|
104
|
+
readonly link: "qt-header__link";
|
|
105
|
+
readonly linkActive: string;
|
|
106
|
+
readonly actions: "qt-header__actions";
|
|
107
|
+
};
|
|
108
|
+
declare function logo(): string;
|
|
109
|
+
declare const logoClasses: {
|
|
110
|
+
readonly dot: "qt-logo__dot";
|
|
111
|
+
};
|
|
112
|
+
declare function footer(): string;
|
|
113
|
+
declare const footerClasses: {
|
|
114
|
+
readonly links: "qt-footer__links";
|
|
115
|
+
readonly link: "qt-footer__link";
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Content recipes: CategoryPill, PostCard, FeaturedPostCard, PostGrid,
|
|
120
|
+
* Sidebar, Hero, Skeleton. Pure functions — Server Component safe.
|
|
121
|
+
*/
|
|
122
|
+
interface CategoryPillOptions {
|
|
123
|
+
interactive?: boolean;
|
|
124
|
+
active?: boolean;
|
|
125
|
+
}
|
|
126
|
+
declare function categoryPill(options?: CategoryPillOptions): string;
|
|
127
|
+
declare const categoryPillClasses: {
|
|
128
|
+
readonly dot: "qt-pill__dot";
|
|
129
|
+
};
|
|
130
|
+
interface PostCardOptions {
|
|
131
|
+
dense?: boolean;
|
|
132
|
+
hover?: boolean;
|
|
133
|
+
}
|
|
134
|
+
declare function postCard(options?: PostCardOptions): string;
|
|
135
|
+
declare const postCardClasses: {
|
|
136
|
+
readonly meta: "qt-post-card__meta";
|
|
137
|
+
readonly title: "qt-post-card__title";
|
|
138
|
+
readonly excerpt: "qt-post-card__excerpt";
|
|
139
|
+
};
|
|
140
|
+
declare function featuredPostCard(): string;
|
|
141
|
+
declare const featuredPostCardClasses: {
|
|
142
|
+
readonly body: "qt-featured-card__body";
|
|
143
|
+
readonly title: "qt-featured-card__title";
|
|
144
|
+
readonly visual: "qt-featured-card__visual";
|
|
145
|
+
};
|
|
146
|
+
declare function postGrid(): string;
|
|
147
|
+
interface LayoutOptions {
|
|
148
|
+
withSidebar?: boolean;
|
|
149
|
+
}
|
|
150
|
+
declare function layout(options?: LayoutOptions): string;
|
|
151
|
+
declare function sidebar(): string;
|
|
152
|
+
declare const sidebarClasses: {
|
|
153
|
+
readonly sectionTitle: "qt-sidebar__section-title";
|
|
154
|
+
};
|
|
155
|
+
declare function hero(): string;
|
|
156
|
+
declare const heroClasses: {
|
|
157
|
+
readonly eyebrow: "qt-hero__eyebrow";
|
|
158
|
+
readonly title: "qt-hero__title";
|
|
159
|
+
readonly description: "qt-hero__description";
|
|
160
|
+
};
|
|
161
|
+
interface SkeletonOptions {
|
|
162
|
+
small?: boolean;
|
|
163
|
+
}
|
|
164
|
+
declare function skeletonLine(options?: SkeletonOptions): string;
|
|
165
|
+
declare function cardSkeleton(): string;
|
|
166
|
+
|
|
167
|
+
interface ThemeState {
|
|
168
|
+
mode: ThemeMode;
|
|
169
|
+
accent: AccentName;
|
|
170
|
+
}
|
|
171
|
+
interface ThemeManagerOptions {
|
|
172
|
+
/** Element receiving data-theme / data-accent. Defaults to <html>. */
|
|
173
|
+
root?: HTMLElement;
|
|
174
|
+
defaultMode?: ThemeMode;
|
|
175
|
+
defaultAccent?: AccentName;
|
|
176
|
+
/** localStorage key. Pass null to disable persistence. */
|
|
177
|
+
storageKey?: string | null;
|
|
178
|
+
}
|
|
179
|
+
interface ThemeManager {
|
|
180
|
+
getState: () => ThemeState;
|
|
181
|
+
setMode: (mode: ThemeMode) => void;
|
|
182
|
+
setAccent: (accent: AccentName) => void;
|
|
183
|
+
toggleMode: () => void;
|
|
184
|
+
subscribe: (listener: (state: ThemeState) => void) => () => void;
|
|
185
|
+
destroy: () => void;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Framework-agnostic theme controller. Applies `data-theme` and `data-accent`
|
|
189
|
+
* attributes; theme.css does the rest via CSS vars. If the server already
|
|
190
|
+
* rendered the attributes (RSC/SSR), those win over defaults, so there is
|
|
191
|
+
* no flash of wrong theme.
|
|
192
|
+
*/
|
|
193
|
+
declare function createThemeManager(options?: ThemeManagerOptions): ThemeManager;
|
|
194
|
+
|
|
195
|
+
interface ScrollSpyOptions {
|
|
196
|
+
/** Called whenever the active heading changes. `null` when none is visible. */
|
|
197
|
+
onChange: (activeId: string | null) => void;
|
|
198
|
+
/** Forwarded to IntersectionObserver. Default biases toward the reading line. */
|
|
199
|
+
rootMargin?: string;
|
|
200
|
+
threshold?: number | number[];
|
|
201
|
+
}
|
|
202
|
+
interface ScrollSpy {
|
|
203
|
+
destroy: () => void;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Watches headings by id and reports which one is active.
|
|
207
|
+
* Framework-agnostic core used by the React TableOfContents.
|
|
208
|
+
*/
|
|
209
|
+
declare function createScrollSpy(ids: readonly string[], options: ScrollSpyOptions): ScrollSpy;
|
|
210
|
+
|
|
211
|
+
interface ReadingProgressOptions {
|
|
212
|
+
/** Element whose scroll extent defines 100%. Defaults to the document. */
|
|
213
|
+
target?: HTMLElement;
|
|
214
|
+
/** Receives progress in [0, 1]. */
|
|
215
|
+
onChange?: (percent: number) => void;
|
|
216
|
+
/** Element that receives the CSS var (default: <html>). Pass null to skip. */
|
|
217
|
+
varTarget?: HTMLElement | null;
|
|
218
|
+
}
|
|
219
|
+
interface ReadingProgress {
|
|
220
|
+
getPercent: () => number;
|
|
221
|
+
destroy: () => void;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Tracks document (or element) reading progress. Writes the
|
|
225
|
+
* `--qt-reading-progress` CSS var consumed by `.qt-reading-progress__bar`.
|
|
226
|
+
*/
|
|
227
|
+
declare function createReadingProgress(options?: ReadingProgressOptions): ReadingProgress;
|
|
228
|
+
|
|
229
|
+
/** Copy text to the clipboard. Returns false when the Clipboard API is unavailable or denied. */
|
|
230
|
+
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
231
|
+
|
|
232
|
+
export { AccentName, type CategoryPillOptions, type Duration, type Easing, type FontFamily, type FontSize, type FontWeight, type HeaderOptions, type LayoutOptions, type PostCardOptions, type Radius, type ReadingProgress, type ReadingProgressOptions, type ScrollSpy, type ScrollSpyOptions, type SkeletonOptions, type SpacingStep, type ThemeManager, type ThemeManagerOptions, ThemeMode, type ThemeState, cardSkeleton, categoryPill, categoryPillClasses, copyToClipboard, createReadingProgress, createScrollSpy, createThemeManager, cx, durations, easings, featuredPostCard, featuredPostCardClasses, fontFamilies, fontSizes, fontWeights, footer, footerClasses, header, headerClasses, hero, heroClasses, layout, letterSpacings, lineHeights, logo, logoClasses, postCard, postCardClasses, postGrid, radii, sidebar, sidebarClasses, skeletonLine, spacing };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { T as ThemeMode, A as AccentName } from './article-CNQxbFAz.js';
|
|
2
|
+
export { C as CalloutKind, a as CategoryName, b as ColorScheme, D as DEFAULT_ACCENT, c as DEFAULT_MODE, N as NavItem, P as PostSummary, R as READING_PROGRESS_VAR, d as TocItem, e as TocLinkOptions, f as accentNames, g as accents, h as articleHeader, i as articleHeaderClasses, j as callout, k as calloutClasses, l as calloutLabels, m as codeBlock, n as codeBlockClasses, o as colors, p as defaultCategoryColors, q as prose, r as proseClasses, s as readingProgress, t as readingProgressClasses, u as resolveAccentColor, v as resolveCategoryColor, w as tableOfContents, x as themeModes, y as tocLink } from './article-CNQxbFAz.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Quiet Tech typography tokens.
|
|
6
|
+
* Families are fixed by the spec: Sora (display), Manrope (body), JetBrains Mono (code).
|
|
7
|
+
* System fallbacks are loading fallbacks only — the final family must be the correct one.
|
|
8
|
+
*/
|
|
9
|
+
declare const fontFamilies: {
|
|
10
|
+
readonly display: "'Sora', ui-sans-serif, system-ui, sans-serif";
|
|
11
|
+
readonly body: "'Manrope', ui-sans-serif, system-ui, sans-serif";
|
|
12
|
+
readonly mono: "'JetBrains Mono', ui-monospace, 'SF Mono', monospace";
|
|
13
|
+
};
|
|
14
|
+
declare const fontWeights: {
|
|
15
|
+
readonly regular: 400;
|
|
16
|
+
readonly medium: 500;
|
|
17
|
+
readonly semibold: 600;
|
|
18
|
+
readonly bold: 700;
|
|
19
|
+
};
|
|
20
|
+
declare const fontSizes: {
|
|
21
|
+
readonly xs: "0.75rem";
|
|
22
|
+
readonly sm: "0.8125rem";
|
|
23
|
+
readonly base: "0.9375rem";
|
|
24
|
+
readonly md: "1rem";
|
|
25
|
+
readonly lg: "1.125rem";
|
|
26
|
+
readonly xl: "1.375rem";
|
|
27
|
+
readonly '2xl': "1.75rem";
|
|
28
|
+
readonly '3xl': "2.25rem";
|
|
29
|
+
readonly '4xl': "2.75rem";
|
|
30
|
+
};
|
|
31
|
+
declare const lineHeights: {
|
|
32
|
+
readonly tight: 1.15;
|
|
33
|
+
readonly snug: 1.3;
|
|
34
|
+
readonly normal: 1.5;
|
|
35
|
+
readonly relaxed: 1.7;
|
|
36
|
+
};
|
|
37
|
+
declare const letterSpacings: {
|
|
38
|
+
readonly display: "-0.02em";
|
|
39
|
+
readonly normal: "0";
|
|
40
|
+
readonly wide: "0.08em";
|
|
41
|
+
};
|
|
42
|
+
type FontFamily = keyof typeof fontFamilies;
|
|
43
|
+
type FontSize = keyof typeof fontSizes;
|
|
44
|
+
type FontWeight = keyof typeof fontWeights;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Quiet Tech spacing scale (4→72px) and radii (6/8/12/16/full).
|
|
48
|
+
*/
|
|
49
|
+
declare const spacing: {
|
|
50
|
+
readonly 1: "4px";
|
|
51
|
+
readonly 2: "8px";
|
|
52
|
+
readonly 3: "12px";
|
|
53
|
+
readonly 4: "16px";
|
|
54
|
+
readonly 5: "20px";
|
|
55
|
+
readonly 6: "24px";
|
|
56
|
+
readonly 8: "32px";
|
|
57
|
+
readonly 10: "40px";
|
|
58
|
+
readonly 12: "48px";
|
|
59
|
+
readonly 14: "56px";
|
|
60
|
+
readonly 16: "64px";
|
|
61
|
+
readonly 18: "72px";
|
|
62
|
+
};
|
|
63
|
+
declare const radii: {
|
|
64
|
+
readonly sm: "6px";
|
|
65
|
+
readonly md: "8px";
|
|
66
|
+
readonly lg: "12px";
|
|
67
|
+
readonly xl: "16px";
|
|
68
|
+
readonly full: "9999px";
|
|
69
|
+
};
|
|
70
|
+
type SpacingStep = keyof typeof spacing;
|
|
71
|
+
type Radius = keyof typeof radii;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Quiet Tech motion tokens.
|
|
75
|
+
* Hover transitions use the signature easing; the reading progress bar is linear.
|
|
76
|
+
*/
|
|
77
|
+
declare const easings: {
|
|
78
|
+
readonly hover: "cubic-bezier(.3,.7,.4,1)";
|
|
79
|
+
readonly linear: "linear";
|
|
80
|
+
};
|
|
81
|
+
declare const durations: {
|
|
82
|
+
readonly fast: "120ms";
|
|
83
|
+
readonly base: "200ms";
|
|
84
|
+
readonly slow: "320ms";
|
|
85
|
+
};
|
|
86
|
+
type Easing = keyof typeof easings;
|
|
87
|
+
type Duration = keyof typeof durations;
|
|
88
|
+
|
|
89
|
+
/** Minimal class-name joiner. Falsy values are dropped. */
|
|
90
|
+
declare function cx(...parts: Array<string | false | null | undefined>): string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Shell recipes: Header, Logo, Footer.
|
|
94
|
+
* Recipes are pure functions returning class strings — no DOM, no framework.
|
|
95
|
+
* Safe in Next.js Server Components; usable via [class] in Angular, :class in Vue.
|
|
96
|
+
*/
|
|
97
|
+
interface HeaderOptions {
|
|
98
|
+
/** Frosted glass background (sticky headers). */
|
|
99
|
+
glass?: boolean;
|
|
100
|
+
}
|
|
101
|
+
declare function header(options?: HeaderOptions): string;
|
|
102
|
+
declare const headerClasses: {
|
|
103
|
+
readonly nav: "qt-header__nav";
|
|
104
|
+
readonly link: "qt-header__link";
|
|
105
|
+
readonly linkActive: string;
|
|
106
|
+
readonly actions: "qt-header__actions";
|
|
107
|
+
};
|
|
108
|
+
declare function logo(): string;
|
|
109
|
+
declare const logoClasses: {
|
|
110
|
+
readonly dot: "qt-logo__dot";
|
|
111
|
+
};
|
|
112
|
+
declare function footer(): string;
|
|
113
|
+
declare const footerClasses: {
|
|
114
|
+
readonly links: "qt-footer__links";
|
|
115
|
+
readonly link: "qt-footer__link";
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Content recipes: CategoryPill, PostCard, FeaturedPostCard, PostGrid,
|
|
120
|
+
* Sidebar, Hero, Skeleton. Pure functions — Server Component safe.
|
|
121
|
+
*/
|
|
122
|
+
interface CategoryPillOptions {
|
|
123
|
+
interactive?: boolean;
|
|
124
|
+
active?: boolean;
|
|
125
|
+
}
|
|
126
|
+
declare function categoryPill(options?: CategoryPillOptions): string;
|
|
127
|
+
declare const categoryPillClasses: {
|
|
128
|
+
readonly dot: "qt-pill__dot";
|
|
129
|
+
};
|
|
130
|
+
interface PostCardOptions {
|
|
131
|
+
dense?: boolean;
|
|
132
|
+
hover?: boolean;
|
|
133
|
+
}
|
|
134
|
+
declare function postCard(options?: PostCardOptions): string;
|
|
135
|
+
declare const postCardClasses: {
|
|
136
|
+
readonly meta: "qt-post-card__meta";
|
|
137
|
+
readonly title: "qt-post-card__title";
|
|
138
|
+
readonly excerpt: "qt-post-card__excerpt";
|
|
139
|
+
};
|
|
140
|
+
declare function featuredPostCard(): string;
|
|
141
|
+
declare const featuredPostCardClasses: {
|
|
142
|
+
readonly body: "qt-featured-card__body";
|
|
143
|
+
readonly title: "qt-featured-card__title";
|
|
144
|
+
readonly visual: "qt-featured-card__visual";
|
|
145
|
+
};
|
|
146
|
+
declare function postGrid(): string;
|
|
147
|
+
interface LayoutOptions {
|
|
148
|
+
withSidebar?: boolean;
|
|
149
|
+
}
|
|
150
|
+
declare function layout(options?: LayoutOptions): string;
|
|
151
|
+
declare function sidebar(): string;
|
|
152
|
+
declare const sidebarClasses: {
|
|
153
|
+
readonly sectionTitle: "qt-sidebar__section-title";
|
|
154
|
+
};
|
|
155
|
+
declare function hero(): string;
|
|
156
|
+
declare const heroClasses: {
|
|
157
|
+
readonly eyebrow: "qt-hero__eyebrow";
|
|
158
|
+
readonly title: "qt-hero__title";
|
|
159
|
+
readonly description: "qt-hero__description";
|
|
160
|
+
};
|
|
161
|
+
interface SkeletonOptions {
|
|
162
|
+
small?: boolean;
|
|
163
|
+
}
|
|
164
|
+
declare function skeletonLine(options?: SkeletonOptions): string;
|
|
165
|
+
declare function cardSkeleton(): string;
|
|
166
|
+
|
|
167
|
+
interface ThemeState {
|
|
168
|
+
mode: ThemeMode;
|
|
169
|
+
accent: AccentName;
|
|
170
|
+
}
|
|
171
|
+
interface ThemeManagerOptions {
|
|
172
|
+
/** Element receiving data-theme / data-accent. Defaults to <html>. */
|
|
173
|
+
root?: HTMLElement;
|
|
174
|
+
defaultMode?: ThemeMode;
|
|
175
|
+
defaultAccent?: AccentName;
|
|
176
|
+
/** localStorage key. Pass null to disable persistence. */
|
|
177
|
+
storageKey?: string | null;
|
|
178
|
+
}
|
|
179
|
+
interface ThemeManager {
|
|
180
|
+
getState: () => ThemeState;
|
|
181
|
+
setMode: (mode: ThemeMode) => void;
|
|
182
|
+
setAccent: (accent: AccentName) => void;
|
|
183
|
+
toggleMode: () => void;
|
|
184
|
+
subscribe: (listener: (state: ThemeState) => void) => () => void;
|
|
185
|
+
destroy: () => void;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Framework-agnostic theme controller. Applies `data-theme` and `data-accent`
|
|
189
|
+
* attributes; theme.css does the rest via CSS vars. If the server already
|
|
190
|
+
* rendered the attributes (RSC/SSR), those win over defaults, so there is
|
|
191
|
+
* no flash of wrong theme.
|
|
192
|
+
*/
|
|
193
|
+
declare function createThemeManager(options?: ThemeManagerOptions): ThemeManager;
|
|
194
|
+
|
|
195
|
+
interface ScrollSpyOptions {
|
|
196
|
+
/** Called whenever the active heading changes. `null` when none is visible. */
|
|
197
|
+
onChange: (activeId: string | null) => void;
|
|
198
|
+
/** Forwarded to IntersectionObserver. Default biases toward the reading line. */
|
|
199
|
+
rootMargin?: string;
|
|
200
|
+
threshold?: number | number[];
|
|
201
|
+
}
|
|
202
|
+
interface ScrollSpy {
|
|
203
|
+
destroy: () => void;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Watches headings by id and reports which one is active.
|
|
207
|
+
* Framework-agnostic core used by the React TableOfContents.
|
|
208
|
+
*/
|
|
209
|
+
declare function createScrollSpy(ids: readonly string[], options: ScrollSpyOptions): ScrollSpy;
|
|
210
|
+
|
|
211
|
+
interface ReadingProgressOptions {
|
|
212
|
+
/** Element whose scroll extent defines 100%. Defaults to the document. */
|
|
213
|
+
target?: HTMLElement;
|
|
214
|
+
/** Receives progress in [0, 1]. */
|
|
215
|
+
onChange?: (percent: number) => void;
|
|
216
|
+
/** Element that receives the CSS var (default: <html>). Pass null to skip. */
|
|
217
|
+
varTarget?: HTMLElement | null;
|
|
218
|
+
}
|
|
219
|
+
interface ReadingProgress {
|
|
220
|
+
getPercent: () => number;
|
|
221
|
+
destroy: () => void;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Tracks document (or element) reading progress. Writes the
|
|
225
|
+
* `--qt-reading-progress` CSS var consumed by `.qt-reading-progress__bar`.
|
|
226
|
+
*/
|
|
227
|
+
declare function createReadingProgress(options?: ReadingProgressOptions): ReadingProgress;
|
|
228
|
+
|
|
229
|
+
/** Copy text to the clipboard. Returns false when the Clipboard API is unavailable or denied. */
|
|
230
|
+
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
231
|
+
|
|
232
|
+
export { AccentName, type CategoryPillOptions, type Duration, type Easing, type FontFamily, type FontSize, type FontWeight, type HeaderOptions, type LayoutOptions, type PostCardOptions, type Radius, type ReadingProgress, type ReadingProgressOptions, type ScrollSpy, type ScrollSpyOptions, type SkeletonOptions, type SpacingStep, type ThemeManager, type ThemeManagerOptions, ThemeMode, type ThemeState, cardSkeleton, categoryPill, categoryPillClasses, copyToClipboard, createReadingProgress, createScrollSpy, createThemeManager, cx, durations, easings, featuredPostCard, featuredPostCardClasses, fontFamilies, fontSizes, fontWeights, footer, footerClasses, header, headerClasses, hero, heroClasses, layout, letterSpacings, lineHeights, logo, logoClasses, postCard, postCardClasses, postGrid, radii, sidebar, sidebarClasses, skeletonLine, spacing };
|