@repraze/kernelkit 0.1.0-alpha.2 → 0.1.0-alpha.4
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/README.md +17 -0
- package/dist/components/alert.d.ts.map +1 -1
- package/dist/components/alert.js +4 -6
- package/dist/components/alert.js.map +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +1 -0
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb.js +7 -6
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/callout.d.ts +8 -4
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +22 -12
- package/dist/components/callout.js.map +1 -1
- package/dist/components/chart.js +2 -2
- package/dist/components/chart.js.map +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/code-block.js.map +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/data-table/elements/data-table-info-row.js +1 -1
- package/dist/components/data-table/elements/data-table-info-row.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +2 -4
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/message.js +2 -2
- package/dist/components/message.js.map +1 -1
- package/dist/components/meter.js +1 -1
- package/dist/components/meter.js.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/questionnaire.js +1 -1
- package/dist/components/questionnaire.js.map +1 -1
- package/dist/components/search-dialog.d.ts +6 -1
- package/dist/components/search-dialog.d.ts.map +1 -1
- package/dist/components/search-dialog.js +13 -1
- package/dist/components/search-dialog.js.map +1 -1
- package/dist/components/search-trigger.d.ts +1 -1
- package/dist/components/search-trigger.d.ts.map +1 -1
- package/dist/components/search-trigger.js +2 -2
- package/dist/components/search-trigger.js.map +1 -1
- package/dist/components/section.js +1 -1
- package/dist/components/section.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/site-footer.js +1 -1
- package/dist/components/site-footer.js.map +1 -1
- package/dist/components/site-header.js +2 -2
- package/dist/components/site-header.js.map +1 -1
- package/dist/components/stat.js +2 -2
- package/dist/components/stat.js.map +1 -1
- package/dist/components/tabs.d.ts +4 -2
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +13 -7
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/theme-menu.js +1 -1
- package/dist/components/theme-menu.js.map +1 -1
- package/dist/components/toc.js +1 -1
- package/dist/components/toc.js.map +1 -1
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +5 -2
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/components/trace.js.map +1 -1
- package/dist/docs/doc-kit.d.ts +72 -0
- package/dist/docs/doc-kit.d.ts.map +1 -0
- package/dist/docs/doc-kit.js +45 -0
- package/dist/docs/doc-kit.js.map +1 -0
- package/dist/docs/doc-page.d.ts +27 -0
- package/dist/docs/doc-page.d.ts.map +1 -0
- package/dist/docs/doc-page.js +33 -0
- package/dist/docs/doc-page.js.map +1 -0
- package/dist/docs/docs-index.d.ts +60 -0
- package/dist/docs/docs-index.d.ts.map +1 -0
- package/dist/docs/docs-index.js +45 -0
- package/dist/docs/docs-index.js.map +1 -0
- package/dist/docs/docs-nav.d.ts +13 -0
- package/dist/docs/docs-nav.d.ts.map +1 -0
- package/dist/docs/docs-nav.js +8 -0
- package/dist/docs/docs-nav.js.map +1 -0
- package/dist/docs/docs-search.d.ts +19 -0
- package/dist/docs/docs-search.d.ts.map +1 -0
- package/dist/docs/docs-search.js +33 -0
- package/dist/docs/docs-search.js.map +1 -0
- package/dist/docs/index.d.ts +7 -0
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +7 -0
- package/dist/docs/index.js.map +1 -0
- package/dist/docs/review-matrix.d.ts +25 -0
- package/dist/docs/review-matrix.d.ts.map +1 -0
- package/dist/docs/review-matrix.js +31 -0
- package/dist/docs/review-matrix.js.map +1 -0
- package/dist/hooks/use-theme-palette.d.ts +8 -0
- package/dist/hooks/use-theme-palette.d.ts.map +1 -0
- package/dist/hooks/use-theme-palette.js +24 -0
- package/dist/hooks/use-theme-palette.js.map +1 -0
- package/dist/lib/recipes.d.ts +10 -0
- package/dist/lib/recipes.d.ts.map +1 -1
- package/dist/lib/recipes.js +12 -0
- package/dist/lib/recipes.js.map +1 -1
- package/dist/provider/theme-provider.d.ts +10 -1
- package/dist/provider/theme-provider.d.ts.map +1 -1
- package/dist/provider/theme-provider.js +23 -8
- package/dist/provider/theme-provider.js.map +1 -1
- package/dist/site/brand.d.ts +20 -0
- package/dist/site/brand.d.ts.map +1 -0
- package/dist/site/brand.js +17 -0
- package/dist/site/brand.js.map +1 -0
- package/dist/site/github-icon.d.ts +4 -0
- package/dist/site/github-icon.d.ts.map +1 -0
- package/dist/site/github-icon.js +6 -0
- package/dist/site/github-icon.js.map +1 -0
- package/dist/site/index.d.ts +6 -0
- package/dist/site/index.d.ts.map +1 -0
- package/dist/site/index.js +6 -0
- package/dist/site/index.js.map +1 -0
- package/dist/site/suite-footer.d.ts +24 -0
- package/dist/site/suite-footer.d.ts.map +1 -0
- package/dist/site/suite-footer.js +19 -0
- package/dist/site/suite-footer.js.map +1 -0
- package/dist/site/suite-header.d.ts +40 -0
- package/dist/site/suite-header.d.ts.map +1 -0
- package/dist/site/suite-header.js +19 -0
- package/dist/site/suite-header.js.map +1 -0
- package/dist/site/use-page-title.d.ts +3 -0
- package/dist/site/use-page-title.d.ts.map +1 -0
- package/dist/site/use-page-title.js +8 -0
- package/dist/site/use-page-title.js.map +1 -0
- package/dist/vite/index.d.ts +65 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +242 -0
- package/dist/vite/index.js.map +1 -0
- package/package.json +39 -3
- package/src/components/alert.tsx +4 -6
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +1 -1
- package/src/components/breadcrumb.tsx +8 -7
- package/src/components/callout.tsx +27 -12
- package/src/components/chart.tsx +2 -2
- package/src/components/code-block.tsx +1 -1
- package/src/components/command.tsx +1 -1
- package/src/components/data-table/elements/data-table-info-row.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/kbd.tsx +2 -4
- package/src/components/message.tsx +2 -2
- package/src/components/meter.tsx +1 -1
- package/src/components/progress.tsx +1 -1
- package/src/components/questionnaire.tsx +1 -1
- package/src/components/search-dialog.tsx +14 -1
- package/src/components/search-trigger.tsx +2 -3
- package/src/components/section.tsx +1 -1
- package/src/components/sidebar.tsx +1 -1
- package/src/components/site-footer.tsx +1 -1
- package/src/components/site-header.tsx +2 -2
- package/src/components/stat.tsx +2 -2
- package/src/components/tabs.tsx +17 -9
- package/src/components/theme-menu.tsx +1 -1
- package/src/components/toc.tsx +1 -1
- package/src/components/tooltip.tsx +15 -3
- package/src/components/trace.tsx +1 -1
- package/src/docs/doc-kit.tsx +176 -0
- package/src/docs/doc-page.tsx +126 -0
- package/src/docs/docs-index.ts +108 -0
- package/src/docs/docs-nav.tsx +47 -0
- package/src/docs/docs-search.tsx +88 -0
- package/src/docs/index.ts +6 -0
- package/src/docs/review-matrix.tsx +67 -0
- package/src/hooks/use-theme-palette.ts +25 -0
- package/src/lib/recipes.ts +14 -0
- package/src/provider/theme-provider.tsx +34 -9
- package/src/site/brand.tsx +41 -0
- package/src/site/github-icon.tsx +10 -0
- package/src/site/index.ts +5 -0
- package/src/site/suite-footer.tsx +68 -0
- package/src/site/suite-header.tsx +114 -0
- package/src/site/use-page-title.ts +8 -0
- package/src/styles/kernelkit.css +6 -0
- package/src/styles/site.css +15 -0
- package/src/vite/client.d.ts +11 -0
- package/src/vite/index.ts +298 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Vite plugins shared by the suite's sites (Node-side: no React, nothing here reaches the browser).
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import {docsMetaPlugin, faviconPlugin, spaFallback, suiteSourceConditions, themeScriptPlugin} from "@repraze/kernelkit/vite";
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* `vite` is only imported for its types; `typescript` is loaded lazily by docsMetaPlugin / extractFunction.
|
|
10
|
+
*/
|
|
11
|
+
import { lstatSync, readdirSync, readFileSync } from "node:fs";
|
|
12
|
+
import { copyFile } from "node:fs/promises";
|
|
13
|
+
import { createRequire } from "node:module";
|
|
14
|
+
import { dirname, join, resolve } from "node:path";
|
|
15
|
+
import { themeScript } from "../provider/theme.js";
|
|
16
|
+
/**
|
|
17
|
+
* Inline the kit's pre-paint theme script into index.html, so the stored mode, contrast, accent and radius
|
|
18
|
+
* apply before first paint. Replaces the marker comment, or goes first in <head> when there is none.
|
|
19
|
+
*/
|
|
20
|
+
export function themeScriptPlugin({ storageKey, defaults, marker = "<!-- kernelkit:theme-script -->", prelude, }) {
|
|
21
|
+
const source = [prelude, themeScript({ storageKey, defaults })].filter(Boolean).join("\n");
|
|
22
|
+
return {
|
|
23
|
+
name: "kernelkit-theme-script",
|
|
24
|
+
transformIndexHtml: (html) => html.includes(marker)
|
|
25
|
+
? html.replace(marker, `<script>${source}</script>`)
|
|
26
|
+
: { html, tags: [{ tag: "script", children: source, injectTo: "head-prepend" }] },
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// ─── favicon ────────────────────────────────────────────────────────────────────────────────────
|
|
30
|
+
/**
|
|
31
|
+
* Serve (dev) and emit (build) `favicon.svg` from the brand mark's SVG, so the icon never drifts from the
|
|
32
|
+
* logo. Link it with `href="%BASE_URL%favicon.svg"` so it works under a Pages base path.
|
|
33
|
+
*/
|
|
34
|
+
export function faviconPlugin(svg, fileName = "favicon.svg") {
|
|
35
|
+
const source = typeof svg === "function" ? svg() : svg;
|
|
36
|
+
return {
|
|
37
|
+
name: "kernelkit-favicon",
|
|
38
|
+
configureServer(server) {
|
|
39
|
+
server.middlewares.use((req, res, next) => {
|
|
40
|
+
if (req.url?.split("?")[0]?.endsWith(`/${fileName}`)) {
|
|
41
|
+
res.setHeader("Content-Type", "image/svg+xml");
|
|
42
|
+
res.end(source);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
next();
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
generateBundle() {
|
|
49
|
+
this.emitFile({ type: "asset", fileName, source });
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// ─── SPA fallback ───────────────────────────────────────────────────────────────────────────────
|
|
54
|
+
/** GitHub Pages has no SPA rewrites: copy index.html to 404.html so deep links load the app. */
|
|
55
|
+
export function spaFallback() {
|
|
56
|
+
return {
|
|
57
|
+
name: "kernelkit-spa-fallback",
|
|
58
|
+
apply: "build",
|
|
59
|
+
async writeBundle({ dir }) {
|
|
60
|
+
if (dir) {
|
|
61
|
+
await copyFile(join(dir, "index.html"), join(dir, "404.html"));
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// ─── linked suite packages ──────────────────────────────────────────────────────────────────────
|
|
67
|
+
/** Is `node_modules/<name>` a symlink (npm link, a workspace), looking up from `root`? */
|
|
68
|
+
function isLinked(name, root) {
|
|
69
|
+
for (let dir = resolve(root);; dir = dirname(dir)) {
|
|
70
|
+
try {
|
|
71
|
+
return lstatSync(join(dir, "node_modules", name)).isSymbolicLink();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// not installed here: look in the parent
|
|
75
|
+
}
|
|
76
|
+
if (dirname(dir) === dir) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const DEDUPE = ["react", "react-dom", "@base-ui/react", "cmdk", "lucide-react"];
|
|
82
|
+
/**
|
|
83
|
+
* For each suite package (`@repraze/kernelkit`…) that is symlinked into node_modules (`npm link`, a
|
|
84
|
+
* workspace): serve it from its TypeScript sources (its `@repraze/source` exports condition), unbundled,
|
|
85
|
+
* so edits there hot-reload; dedupe React-context packages, since a linked package sits outside this tree.
|
|
86
|
+
* Installed from npm: nothing changes, its built dist is used and pre-bundled like any dependency.
|
|
87
|
+
*/
|
|
88
|
+
export function suiteSourceConditions(packages, options = {}) {
|
|
89
|
+
const { dedupe = DEDUPE, condition = "@repraze/source" } = options;
|
|
90
|
+
return {
|
|
91
|
+
name: "kernelkit-suite-source-conditions",
|
|
92
|
+
enforce: "pre",
|
|
93
|
+
config(config) {
|
|
94
|
+
const linked = packages.filter((name) => isLinked(name, config.root ?? process.cwd()));
|
|
95
|
+
if (!linked.length) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
resolve: { conditions: [condition, ...DEFAULT_CLIENT_CONDITIONS], dedupe },
|
|
100
|
+
optimizeDeps: { exclude: linked },
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** Vite's `defaultClientConditions`, inlined so this module needs no runtime import of vite. */
|
|
106
|
+
const DEFAULT_CLIENT_CONDITIONS = ["module", "browser", "development|production"];
|
|
107
|
+
// ─── docs manifest and demo sources ─────────────────────────────────────────────────────────────
|
|
108
|
+
const require = createRequire(import.meta.url);
|
|
109
|
+
let typescript;
|
|
110
|
+
/** TypeScript, loaded on first use (the sites already have it): only docs sites pay for it. */
|
|
111
|
+
const ts = () => (typescript ??= require("typescript"));
|
|
112
|
+
/** Static value of a string/number expression: literals, no-substitution templates, "a" + "b". */
|
|
113
|
+
function literal(node) {
|
|
114
|
+
const t = ts();
|
|
115
|
+
if (t.isStringLiteral(node) || t.isNoSubstitutionTemplateLiteral(node)) {
|
|
116
|
+
return node.text;
|
|
117
|
+
}
|
|
118
|
+
if (t.isNumericLiteral(node)) {
|
|
119
|
+
return Number(node.text);
|
|
120
|
+
}
|
|
121
|
+
if (t.isParenthesizedExpression(node)) {
|
|
122
|
+
return literal(node.expression);
|
|
123
|
+
}
|
|
124
|
+
if (t.isBinaryExpression(node) && node.operatorToken.kind === t.SyntaxKind.PlusToken) {
|
|
125
|
+
const a = literal(node.left);
|
|
126
|
+
const b = literal(node.right);
|
|
127
|
+
return a !== undefined && b !== undefined ? `${a}${b}` : undefined;
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
/** A docs page's manifest entry, read from its `defineDoc({...})` call without running it. */
|
|
132
|
+
export function readDocMeta(file, slug, source = readFileSync(file, "utf8")) {
|
|
133
|
+
const t = ts();
|
|
134
|
+
const sf = t.createSourceFile(file, source, t.ScriptTarget.Latest, true);
|
|
135
|
+
let meta;
|
|
136
|
+
const visit = (node) => {
|
|
137
|
+
if (!meta &&
|
|
138
|
+
t.isCallExpression(node) &&
|
|
139
|
+
t.isIdentifier(node.expression) &&
|
|
140
|
+
node.expression.text === "defineDoc" &&
|
|
141
|
+
node.arguments[0] &&
|
|
142
|
+
t.isObjectLiteralExpression(node.arguments[0])) {
|
|
143
|
+
const props = {};
|
|
144
|
+
for (const p of node.arguments[0].properties) {
|
|
145
|
+
if (t.isPropertyAssignment(p) && t.isIdentifier(p.name)) {
|
|
146
|
+
props[p.name.text] = literal(p.initializer);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (typeof props.title !== "string" || typeof props.category !== "string") {
|
|
150
|
+
throw new Error(`${file}: defineDoc needs literal "title" and "category" (read at build time)`);
|
|
151
|
+
}
|
|
152
|
+
meta = {
|
|
153
|
+
slug,
|
|
154
|
+
title: props.title,
|
|
155
|
+
category: props.category,
|
|
156
|
+
description: typeof props.description === "string" ? props.description : "",
|
|
157
|
+
...(typeof props.order === "number" ? { order: props.order } : {}),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
t.forEachChild(node, visit);
|
|
161
|
+
};
|
|
162
|
+
visit(sf);
|
|
163
|
+
if (!meta) {
|
|
164
|
+
throw new Error(`${file}: no defineDoc({...}) call found`);
|
|
165
|
+
}
|
|
166
|
+
return meta;
|
|
167
|
+
}
|
|
168
|
+
/** Each top-level function or const of a file, by name, as written (without `export `). */
|
|
169
|
+
export function extractFunctions(source, fileName = "doc.tsx") {
|
|
170
|
+
const t = ts();
|
|
171
|
+
const sf = t.createSourceFile(fileName, source, t.ScriptTarget.Latest, true, t.ScriptKind.TSX);
|
|
172
|
+
const out = {};
|
|
173
|
+
const text = (node) => source.slice(node.getStart(sf), node.getEnd()).replace(/^export /, "");
|
|
174
|
+
for (const statement of sf.statements) {
|
|
175
|
+
if (t.isFunctionDeclaration(statement) && statement.name) {
|
|
176
|
+
out[statement.name.text] = text(statement);
|
|
177
|
+
}
|
|
178
|
+
else if (t.isVariableStatement(statement)) {
|
|
179
|
+
for (const decl of statement.declarationList.declarations) {
|
|
180
|
+
if (t.isIdentifier(decl.name)) {
|
|
181
|
+
out[decl.name.text] = text(statement);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* A demo's own source: its declaration from `export function Name` (or `export const Name`) to its
|
|
190
|
+
* closing brace, parsed with TypeScript, so code after it (a `Notes()` helper, constants) stays out.
|
|
191
|
+
*/
|
|
192
|
+
export function extractFunction(source, name) {
|
|
193
|
+
return extractFunctions(source)[name] ?? "";
|
|
194
|
+
}
|
|
195
|
+
const META_ID = "virtual:docs-meta";
|
|
196
|
+
const META_RESOLVED = `\0${META_ID}`;
|
|
197
|
+
const SOURCES_QUERY = "demo-sources";
|
|
198
|
+
/**
|
|
199
|
+
* The docs build step, for `@repraze/kernelkit/docs`:
|
|
200
|
+
* - `virtual:docs-meta`: title, category, description and order of every page in `docsDir`, read
|
|
201
|
+
* statically from its `defineDoc({...})` call, so the nav and search don't pull every page's demos into
|
|
202
|
+
* the main bundle;
|
|
203
|
+
* - `<page>.tsx?demo-sources`: `{functions}`, each demo's own source for its Code tab (see extractFunction).
|
|
204
|
+
*
|
|
205
|
+
* Types: add `@repraze/kernelkit/vite/client` to the site's tsconfig `types`.
|
|
206
|
+
*/
|
|
207
|
+
export function docsMetaPlugin(docsDir) {
|
|
208
|
+
const dir = resolve(docsDir);
|
|
209
|
+
return {
|
|
210
|
+
name: "kernelkit-docs-meta",
|
|
211
|
+
enforce: "pre",
|
|
212
|
+
resolveId: (id) => (id === META_ID ? META_RESOLVED : undefined),
|
|
213
|
+
load(id) {
|
|
214
|
+
if (id === META_RESOLVED) {
|
|
215
|
+
const files = readdirSync(dir).filter((f) => f.endsWith(".tsx"));
|
|
216
|
+
const metas = files.map((f) => {
|
|
217
|
+
const file = join(dir, f);
|
|
218
|
+
this.addWatchFile(file);
|
|
219
|
+
return readDocMeta(file, f.replace(/\.tsx$/, ""));
|
|
220
|
+
});
|
|
221
|
+
return `export default ${JSON.stringify(metas)};`;
|
|
222
|
+
}
|
|
223
|
+
const [file = "", query = ""] = id.split("?");
|
|
224
|
+
if (query.split("&").includes(SOURCES_QUERY)) {
|
|
225
|
+
this.addWatchFile(file);
|
|
226
|
+
const functions = extractFunctions(readFileSync(file, "utf8"), file);
|
|
227
|
+
return { code: `export default ${JSON.stringify({ functions })};`, moduleType: "js" };
|
|
228
|
+
}
|
|
229
|
+
return undefined;
|
|
230
|
+
},
|
|
231
|
+
// a docs page added, removed or retitled → refresh the manifest
|
|
232
|
+
handleHotUpdate({ file, server }) {
|
|
233
|
+
if (file.startsWith(dir)) {
|
|
234
|
+
const mod = server.moduleGraph.getModuleById(META_RESOLVED);
|
|
235
|
+
if (mod) {
|
|
236
|
+
server.moduleGraph.invalidateModule(mod);
|
|
237
|
+
}
|
|
238
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BACN,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;gBAC7C,CAAC;YACL,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repraze/kernelkit",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.4",
|
|
4
4
|
"description": "Modern, techy React components: every shadcn component on Base UI, Tailwind v4 and cva, themed by TermiColor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -56,7 +56,26 @@
|
|
|
56
56
|
"types": "./dist/provider/theme.d.ts",
|
|
57
57
|
"default": "./dist/provider/theme.js"
|
|
58
58
|
},
|
|
59
|
+
"./docs": {
|
|
60
|
+
"@repraze/source": "./src/docs/index.ts",
|
|
61
|
+
"types": "./dist/docs/index.d.ts",
|
|
62
|
+
"default": "./dist/docs/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./site": {
|
|
65
|
+
"@repraze/source": "./src/site/index.ts",
|
|
66
|
+
"types": "./dist/site/index.d.ts",
|
|
67
|
+
"default": "./dist/site/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./vite": {
|
|
70
|
+
"@repraze/source": "./src/vite/index.ts",
|
|
71
|
+
"types": "./dist/vite/index.d.ts",
|
|
72
|
+
"default": "./dist/vite/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./vite/client": {
|
|
75
|
+
"types": "./src/vite/client.d.ts"
|
|
76
|
+
},
|
|
59
77
|
"./styles.css": "./src/styles/kernelkit.css",
|
|
78
|
+
"./site.css": "./src/styles/site.css",
|
|
60
79
|
"./package.json": "./package.json"
|
|
61
80
|
},
|
|
62
81
|
"files": [
|
|
@@ -83,7 +102,11 @@
|
|
|
83
102
|
"input-otp": "^1.5.0",
|
|
84
103
|
"react-resizable-panels": "^4.19.1",
|
|
85
104
|
"@tanstack/react-virtual": "^3.14.26",
|
|
86
|
-
"@shadcn/react": "^0.3.1"
|
|
105
|
+
"@shadcn/react": "^0.3.1",
|
|
106
|
+
"@fontsource-variable/geist": "^5.2.0",
|
|
107
|
+
"@fontsource-variable/jetbrains-mono": "^5.2.0",
|
|
108
|
+
"typescript": ">=5.0",
|
|
109
|
+
"vite": ">=7.0"
|
|
87
110
|
},
|
|
88
111
|
"peerDependenciesMeta": {
|
|
89
112
|
"recharts": {
|
|
@@ -115,6 +138,18 @@
|
|
|
115
138
|
},
|
|
116
139
|
"@shadcn/react": {
|
|
117
140
|
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"@fontsource-variable/geist": {
|
|
143
|
+
"optional": true
|
|
144
|
+
},
|
|
145
|
+
"@fontsource-variable/jetbrains-mono": {
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"typescript": {
|
|
149
|
+
"optional": true
|
|
150
|
+
},
|
|
151
|
+
"vite": {
|
|
152
|
+
"optional": true
|
|
118
153
|
}
|
|
119
154
|
},
|
|
120
155
|
"dependencies": {
|
|
@@ -141,6 +176,7 @@
|
|
|
141
176
|
"input-otp": "^1.5.0",
|
|
142
177
|
"react-resizable-panels": "^4.19.1",
|
|
143
178
|
"@tanstack/react-virtual": "^3.14.26",
|
|
144
|
-
"@shadcn/react": "^0.3.1"
|
|
179
|
+
"@shadcn/react": "^0.3.1",
|
|
180
|
+
"vite": "^8.3.6"
|
|
145
181
|
}
|
|
146
182
|
}
|
package/src/components/alert.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {mergeProps} from "@base-ui/react/merge-props";
|
|
4
4
|
import {useRender} from "@base-ui/react/use-render";
|
|
5
5
|
import {type Color, colorVariants} from "@repraze/kernelkit/lib/color";
|
|
6
|
-
import {heading} from "@repraze/kernelkit/lib/recipes";
|
|
6
|
+
import {heading, statusSurface, statusSurfaceNeutral} from "@repraze/kernelkit/lib/recipes";
|
|
7
7
|
import {cva} from "class-variance-authority";
|
|
8
8
|
import {cn} from "cn";
|
|
9
9
|
|
|
@@ -17,16 +17,14 @@ const alertCva = cva(
|
|
|
17
17
|
variants: {
|
|
18
18
|
color: colorVariants,
|
|
19
19
|
variant: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// no wash: card surface with a hue border, for dense layouts
|
|
23
|
-
outline: "border-(--c)/50 bg-card text-card-foreground *:[svg]:text-(--c) hc:border-(--c)",
|
|
20
|
+
soft: [statusSurface.soft, "text-foreground *:[svg]:text-(--c)"],
|
|
21
|
+
outline: [statusSurface.outline, "text-card-foreground *:[svg]:text-(--c)"],
|
|
24
22
|
},
|
|
25
23
|
},
|
|
26
24
|
compoundVariants: [
|
|
27
25
|
{
|
|
28
26
|
color: "neutral",
|
|
29
|
-
class: "
|
|
27
|
+
class: [statusSurfaceNeutral, "text-card-foreground *:[svg]:text-foreground"],
|
|
30
28
|
},
|
|
31
29
|
],
|
|
32
30
|
defaultVariants: {variant: "soft", color: "neutral"},
|
|
@@ -100,7 +100,7 @@ function AvatarGroupCount({className, ...props}: React.ComponentProps<"div">) {
|
|
|
100
100
|
<div
|
|
101
101
|
data-slot="avatar-group-count"
|
|
102
102
|
className={cn(
|
|
103
|
-
"relative flex size-8 shrink-0 items-center justify-center rounded-pill bg-muted font-
|
|
103
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-pill bg-muted font-alt text-xs font-medium text-muted-foreground ring-2 ring-background [&>svg]:size-4",
|
|
104
104
|
"group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=lg]/avatar-group:text-sm group-has-data-[size=lg]/avatar-group:[&>svg]:size-5",
|
|
105
105
|
"group-has-data-[size=sm]/avatar-group:size-6 group-has-data-[size=sm]/avatar-group:text-[0.625rem] group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
106
106
|
"group-has-data-[size=xs]/avatar-group:size-4 group-has-data-[size=xs]/avatar-group:text-[0.5rem] group-has-data-[size=xs]/avatar-group:[&>svg]:size-2",
|
package/src/components/badge.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import {cn} from "cn";
|
|
|
16
16
|
|
|
17
17
|
const badgeCva = cva(
|
|
18
18
|
[
|
|
19
|
-
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-pill border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow]",
|
|
19
|
+
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-pill border border-transparent px-2 py-0.5 font-alt text-xs font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow]",
|
|
20
20
|
"has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
21
21
|
focusRing,
|
|
22
22
|
],
|
|
@@ -4,7 +4,7 @@ import {mergeProps} from "@base-ui/react/merge-props";
|
|
|
4
4
|
import {useRender} from "@base-ui/react/use-render";
|
|
5
5
|
import {focusRing} from "@repraze/kernelkit/lib/recipes";
|
|
6
6
|
import {cn} from "cn";
|
|
7
|
-
import {
|
|
7
|
+
import {MoreHorizontalIcon} from "lucide-react";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
|
|
10
10
|
function Breadcrumb({className, ...props}: React.ComponentProps<"nav">) {
|
|
@@ -16,7 +16,7 @@ function BreadcrumbList({className, ...props}: React.ComponentProps<"ol">) {
|
|
|
16
16
|
<ol
|
|
17
17
|
data-slot="breadcrumb-list"
|
|
18
18
|
className={cn(
|
|
19
|
-
"flex flex-wrap items-center gap-1.5 text-
|
|
19
|
+
"flex flex-wrap items-center gap-1.5 font-alt text-xs wrap-break-word text-muted-foreground",
|
|
20
20
|
className,
|
|
21
21
|
)}
|
|
22
22
|
{...props}
|
|
@@ -34,7 +34,7 @@ function BreadcrumbLink({className, render, ...props}: useRender.ComponentProps<
|
|
|
34
34
|
props: mergeProps<"a">(
|
|
35
35
|
{
|
|
36
36
|
className: cn(
|
|
37
|
-
"inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground [&_svg:not([class*='size-'])]:size-3
|
|
37
|
+
"inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground [&_svg:not([class*='size-'])]:size-3",
|
|
38
38
|
focusRing,
|
|
39
39
|
className,
|
|
40
40
|
),
|
|
@@ -56,7 +56,7 @@ function BreadcrumbPage({className, ...props}: React.ComponentProps<"span">) {
|
|
|
56
56
|
aria-disabled="true"
|
|
57
57
|
aria-current="page"
|
|
58
58
|
className={cn(
|
|
59
|
-
"inline-flex items-center gap-1 font-medium text-foreground [&_svg:not([class*='size-'])]:size-3
|
|
59
|
+
"inline-flex items-center gap-1 font-medium text-foreground [&_svg:not([class*='size-'])]:size-3",
|
|
60
60
|
className,
|
|
61
61
|
)}
|
|
62
62
|
{...props}
|
|
@@ -64,16 +64,17 @@ function BreadcrumbPage({className, ...props}: React.ComponentProps<"span">) {
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** A muted `/` between levels (a path, in mono). Pass children to use another mark. */
|
|
67
68
|
function BreadcrumbSeparator({children, className, ...props}: React.ComponentProps<"li">) {
|
|
68
69
|
return (
|
|
69
70
|
<li
|
|
70
71
|
data-slot="breadcrumb-separator"
|
|
71
72
|
role="presentation"
|
|
72
73
|
aria-hidden="true"
|
|
73
|
-
className={cn("text-muted-foreground [&>svg]:size-3
|
|
74
|
+
className={cn("text-muted-foreground select-none [&>svg]:size-3", className)}
|
|
74
75
|
{...props}
|
|
75
76
|
>
|
|
76
|
-
{children ??
|
|
77
|
+
{children ?? "/"}
|
|
77
78
|
</li>
|
|
78
79
|
);
|
|
79
80
|
}
|
|
@@ -84,7 +85,7 @@ function BreadcrumbEllipsis({className, ...props}: React.ComponentProps<"span">)
|
|
|
84
85
|
data-slot="breadcrumb-ellipsis"
|
|
85
86
|
role="presentation"
|
|
86
87
|
aria-hidden="true"
|
|
87
|
-
className={cn("flex size-5 items-center justify-center rounded-sm [&>svg]:size-
|
|
88
|
+
className={cn("flex size-5 items-center justify-center rounded-sm [&>svg]:size-3.5", className)}
|
|
88
89
|
{...props}
|
|
89
90
|
>
|
|
90
91
|
<MoreHorizontalIcon />
|
|
@@ -2,44 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
import {Collapsible, CollapsibleContent, CollapsibleTrigger} from "@repraze/kernelkit/components/collapsible";
|
|
4
4
|
import {type Color, colorVariants} from "@repraze/kernelkit/lib/color";
|
|
5
|
-
import {heading} from "@repraze/kernelkit/lib/recipes";
|
|
5
|
+
import {heading, statusSurface, statusSurfaceNeutral} from "@repraze/kernelkit/lib/recipes";
|
|
6
6
|
import {cva} from "class-variance-authority";
|
|
7
7
|
import {cn} from "cn";
|
|
8
8
|
import {ChevronDownIcon} from "lucide-react";
|
|
9
9
|
import type * as React from "react";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Long-form aside for docs and articles (note, tip, warning).
|
|
13
|
-
* the
|
|
12
|
+
* Long-form aside for docs and articles (note, tip, warning). The color rides on the suite's row
|
|
13
|
+
* indicator (the sidebar and menu pill: 2px, rounded, flush left, inset from the top and bottom).
|
|
14
|
+
* Surfaces share Alert's `soft` / `outline` variants. For app status use Alert.
|
|
14
15
|
*/
|
|
15
16
|
const calloutVariants = cva(
|
|
16
17
|
[
|
|
17
|
-
"group/callout relative overflow-hidden rounded-lg border
|
|
18
|
-
|
|
18
|
+
"group/callout relative overflow-hidden rounded-lg border text-sm text-foreground",
|
|
19
|
+
// header/body divider: half-strength hue, so it reads on the soft tint too (the hue itself in hc)
|
|
20
|
+
"[--callout-line:color-mix(in_oklab,var(--c)_50%,transparent)] hc:[--callout-line:var(--c)]",
|
|
21
|
+
// the row indicator (recipes rowIndicator), always on, in the callout's color, above the header's hover.
|
|
22
|
+
// The box has no padding of its own: header and body span the full width (pl-4 clears the pill).
|
|
23
|
+
"before:pointer-events-none before:absolute before:z-10 before:top-1.5 before:bottom-1.5 before:left-0 before:w-0.5 before:rounded-pill before:bg-(--c)",
|
|
19
24
|
],
|
|
20
25
|
{
|
|
21
26
|
variants: {
|
|
22
27
|
color: colorVariants,
|
|
28
|
+
variant: statusSurface,
|
|
23
29
|
},
|
|
24
30
|
compoundVariants: [
|
|
25
31
|
{
|
|
26
32
|
color: "neutral",
|
|
27
|
-
class:
|
|
33
|
+
class: [
|
|
34
|
+
statusSurfaceNeutral,
|
|
35
|
+
"before:bg-muted-foreground [--callout-line:var(--border)] hc:[--callout-line:var(--border)]",
|
|
36
|
+
],
|
|
28
37
|
},
|
|
29
38
|
],
|
|
30
|
-
defaultVariants: {color: "neutral"},
|
|
39
|
+
defaultVariants: {color: "neutral", variant: "soft"},
|
|
31
40
|
},
|
|
32
41
|
);
|
|
33
42
|
|
|
34
43
|
const calloutHeader =
|
|
35
|
-
"flex min-h-8 w-full items-center gap-1.5
|
|
44
|
+
"flex min-h-8 w-full items-center gap-1.5 py-1.5 pr-3 pl-4 text-left text-xs text-(--c) group-data-[color=neutral]/callout:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5";
|
|
36
45
|
|
|
37
46
|
const calloutBody =
|
|
38
|
-
"
|
|
47
|
+
"py-2 pr-3 pl-4 text-sm leading-relaxed [&_a]:text-(--c) [&_a]:underline [&_a]:underline-offset-3 group-data-[color=neutral]/callout:[&_a]:text-foreground [&_p:not(:last-child)]:mb-2 border-(--callout-line)";
|
|
39
48
|
|
|
40
49
|
interface CalloutProps extends Omit<React.ComponentProps<"div">, "color" | "title"> {
|
|
41
|
-
/** Status or hue of the
|
|
50
|
+
/** Status or hue of the indicator, header and border. */
|
|
42
51
|
color?: Color | null;
|
|
52
|
+
/** `soft` (tinted, default) or `outline` (card surface, stronger border): the same axis as Alert. */
|
|
53
|
+
variant?: "soft" | "outline" | null;
|
|
43
54
|
/** Leading icon element, e.g. `<InfoIcon />`. */
|
|
44
55
|
icon?: React.ReactNode;
|
|
45
56
|
/** Header label. The header renders when `title` or `icon` is set. */
|
|
@@ -53,6 +64,7 @@ interface CalloutProps extends Omit<React.ComponentProps<"div">, "color" | "titl
|
|
|
53
64
|
function Callout({
|
|
54
65
|
className,
|
|
55
66
|
color,
|
|
67
|
+
variant,
|
|
56
68
|
icon,
|
|
57
69
|
title,
|
|
58
70
|
collapsible = false,
|
|
@@ -61,6 +73,7 @@ function Callout({
|
|
|
61
73
|
...props
|
|
62
74
|
}: CalloutProps) {
|
|
63
75
|
const resolved = color ?? "neutral";
|
|
76
|
+
const surface = variant ?? "soft";
|
|
64
77
|
const hasHeader = Boolean(title || icon);
|
|
65
78
|
const headerContent = (
|
|
66
79
|
<>
|
|
@@ -78,8 +91,9 @@ function Callout({
|
|
|
78
91
|
<Collapsible
|
|
79
92
|
data-slot="callout"
|
|
80
93
|
data-color={resolved}
|
|
94
|
+
data-variant={surface}
|
|
81
95
|
defaultOpen={!defaultCollapsed}
|
|
82
|
-
className={cn(calloutVariants({color: resolved}), className)}
|
|
96
|
+
className={cn(calloutVariants({color: resolved, variant: surface}), className)}
|
|
83
97
|
{...props}
|
|
84
98
|
>
|
|
85
99
|
<CollapsibleTrigger
|
|
@@ -110,7 +124,8 @@ function Callout({
|
|
|
110
124
|
<div
|
|
111
125
|
data-slot="callout"
|
|
112
126
|
data-color={resolved}
|
|
113
|
-
|
|
127
|
+
data-variant={surface}
|
|
128
|
+
className={cn(calloutVariants({color: resolved, variant: surface}), className)}
|
|
114
129
|
{...props}
|
|
115
130
|
>
|
|
116
131
|
{hasHeader ? (
|
package/src/components/chart.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const rechartsDefaults = [
|
|
|
21
21
|
|
|
22
22
|
const chartContainerClass = [
|
|
23
23
|
"flex aspect-video justify-center text-xs",
|
|
24
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-axis-tick_text]:font-
|
|
24
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-axis-tick_text]:font-alt",
|
|
25
25
|
"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-hover",
|
|
26
26
|
"[&_.recharts-radial-bar-background-sector]:fill-muted",
|
|
27
27
|
"[&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden",
|
|
@@ -230,7 +230,7 @@ function ChartTooltipContent({
|
|
|
230
230
|
</span>
|
|
231
231
|
</div>
|
|
232
232
|
{item.value != null && (
|
|
233
|
-
<span className="font-
|
|
233
|
+
<span className="font-alt font-medium text-foreground tabular-nums">
|
|
234
234
|
{typeof item.value === "number"
|
|
235
235
|
? item.value.toLocaleString()
|
|
236
236
|
: String(item.value)}
|
|
@@ -65,7 +65,7 @@ function CodeBlockTitle({className, ...props}: React.ComponentProps<"div">) {
|
|
|
65
65
|
<div
|
|
66
66
|
data-slot="code-block-title"
|
|
67
67
|
className={cn(
|
|
68
|
-
"min-w-0 truncate font-
|
|
68
|
+
"min-w-0 truncate font-alt text-xs font-medium text-foreground group-data-[variant=danger]/code-block:text-danger [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5",
|
|
69
69
|
className,
|
|
70
70
|
)}
|
|
71
71
|
{...props}
|
|
@@ -151,7 +151,7 @@ function CommandShortcut({className, ...props}: React.ComponentProps<"span">) {
|
|
|
151
151
|
<span
|
|
152
152
|
data-slot="command-shortcut"
|
|
153
153
|
className={cn(
|
|
154
|
-
"ml-auto pl-4 font-
|
|
154
|
+
"ml-auto pl-4 font-alt text-xs text-muted-foreground group-data-[selected=true]/command-item:text-accent-foreground",
|
|
155
155
|
className,
|
|
156
156
|
)}
|
|
157
157
|
{...props}
|
|
@@ -19,7 +19,7 @@ export function DataTableInfoRow<T>({className, view, ...props}: DataTableInfoRo
|
|
|
19
19
|
const infoColumn: DataTableViewColumn<undefined> = convertColumn({
|
|
20
20
|
id: "info",
|
|
21
21
|
cell: () => (
|
|
22
|
-
<span className="font-
|
|
22
|
+
<span className="font-alt tabular-nums">
|
|
23
23
|
{rowCount.toLocaleString()} rows · {columnCount} columns
|
|
24
24
|
</span>
|
|
25
25
|
),
|
|
@@ -35,7 +35,7 @@ function resolveItemVariant(variant: MenuItemVariant | undefined) {
|
|
|
35
35
|
|
|
36
36
|
/** Keyboard shortcut hint at the end of a menu row. */
|
|
37
37
|
const menuShortcutClass =
|
|
38
|
-
"ml-auto pl-4 font-
|
|
38
|
+
"ml-auto pl-4 font-alt text-xs text-muted-foreground group-data-highlighted/menu-item:text-accent-foreground";
|
|
39
39
|
|
|
40
40
|
/** Right-side indicator of checkbox and radio rows. */
|
|
41
41
|
const menuIndicatorClass = "pointer-events-none absolute right-2 flex size-4 items-center justify-center";
|
package/src/components/kbd.tsx
CHANGED
|
@@ -7,9 +7,7 @@ import type * as React from "react";
|
|
|
7
7
|
/** A keycap: mono, `rounded-sm`, a thicker bottom border for the key look (readable in hc). */
|
|
8
8
|
const kbdVariants = cva(
|
|
9
9
|
[
|
|
10
|
-
"pointer-events-none inline-flex w-fit items-center justify-center gap-1 rounded-sm border border-b-2 border-border bg-muted font-
|
|
11
|
-
// inside a tooltip (inverted surface) the key becomes a translucent chip
|
|
12
|
-
"in-data-[slot=tooltip-content]:border-transparent in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10",
|
|
10
|
+
"pointer-events-none inline-flex w-fit items-center justify-center gap-1 rounded-sm border border-b-2 border-border bg-muted font-alt font-medium text-muted-foreground select-none [&_svg]:shrink-0",
|
|
13
11
|
],
|
|
14
12
|
{
|
|
15
13
|
variants: {
|
|
@@ -30,7 +28,7 @@ function KbdGroup({className, ...props}: React.ComponentProps<"kbd">) {
|
|
|
30
28
|
return (
|
|
31
29
|
<kbd
|
|
32
30
|
data-slot="kbd-group"
|
|
33
|
-
className={cn("inline-flex items-center gap-1 font-
|
|
31
|
+
className={cn("inline-flex items-center gap-1 font-alt text-xs text-muted-foreground", className)}
|
|
34
32
|
{...props}
|
|
35
33
|
/>
|
|
36
34
|
);
|