@imfusion/web-ui 0.5.1-dev.6.gece7a7b5 → 0.6.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/README.md +90 -43
- package/bin/install.js +428 -0
- package/bin/install.test.ts +329 -0
- package/dist/build/vite-css-module-names/index.d.ts +20 -0
- package/dist/build/vite-css-module-names.js +17 -0
- package/dist/chunk-DmhlhrBa.js +11 -0
- package/dist/code-Blo48PGr.js +136 -0
- package/dist/codegen/gen-icons.d.ts +24 -0
- package/dist/components/callout/callout.d.ts +1 -1
- package/dist/components/chip-link/chip-link.d.ts +1 -1
- package/dist/components/code/code.d.ts +10 -18
- package/dist/components/field/field.d.ts +104 -0
- package/dist/components/field/field.meta.d.ts +2 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/fieldset/fieldset.d.ts +29 -0
- package/dist/components/fieldset/fieldset.meta.d.ts +2 -0
- package/dist/components/fieldset/index.d.ts +2 -0
- package/dist/components/icon/icon.d.ts +16 -0
- package/dist/components/icon/icon.meta.d.ts +2 -0
- package/dist/components/icon/index.d.ts +4 -0
- package/dist/components/icon/types.d.ts +2 -0
- package/dist/components/input/input.d.ts +3 -1
- package/dist/components/typo/typo.d.ts +2 -2
- package/dist/docgen/component-sources.d.ts +7 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-resize-observer.d.ts +2 -0
- package/dist/icons/catalog.gen.d.ts +8357 -0
- package/dist/icons/icon-config-provider.d.ts +8 -0
- package/dist/icons/icon-context.d.ts +4 -0
- package/dist/icons/icons.gen.d.ts +1672 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons-wBmF0U2x.js +78 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1793 -12210
- package/dist/integrations/code-highlight/code-highlight.d.ts +8 -6
- package/dist/integrations/code-highlight/highlighter.d.ts +32 -3
- package/dist/integrations/code-highlight/language-patterns.d.ts +7 -0
- package/dist/integrations/code-highlight/languages/cmake.d.ts +1 -0
- package/dist/integrations/code-highlight/languages/cpp.d.ts +1 -0
- package/dist/integrations/code-highlight/languages/python.d.ts +1 -0
- package/dist/integrations/code-highlight.js +198 -59
- package/dist/integrations/image-display-options.js +70 -69
- package/dist/llms/gen-tokens.d.ts +7 -0
- package/dist/meta-CySnRuVp.js +21 -0
- package/dist/provider/web-ui-provider.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/tabs-CMKvMF4E.js +369 -0
- package/package.json +48 -26
- package/src/docgen/doc.gen.json +381 -38
- package/src/llms/icon-catalog.gen.json +11203 -0
- package/src/llms/install-templates/AGENTS.md +34 -0
- package/src/llms/install-templates/codex-hooks.json +44 -0
- package/src/llms/install-templates/hooks/baseline-staleness.sh +17 -0
- package/src/llms/install-templates/hooks/session-start.sh +5 -0
- package/src/llms/install-templates/hooks/stop.sh +18 -0
- package/src/llms/install-templates/hooks/subagent-start.sh +5 -0
- package/src/llms/install-templates/hooks/user-prompt-submit.sh +5 -0
- package/src/llms/install-templates/settings.json +45 -0
- package/src/llms/llms.gen.txt +17 -0
- package/src/llms/skills/imf-web-ui/SKILL.md +13 -12
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +119 -0
- package/src/llms/skills/imf-web-ui-components/SKILL.md +56 -3
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +57 -0
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +141 -0
- package/src/llms/skills/imf-web-ui-conventions/templates/REPORT.md +45 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +82 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +27 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +65 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/class-names.md +50 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/components.md +101 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +221 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +40 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/git.md +34 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +35 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +26 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +53 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +44 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/react.md +109 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +88 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/testing.md +25 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +7 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +116 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +73 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +62 -0
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +67 -37
- package/src/llms/skills/imf-web-ui-update/SKILL.md +157 -0
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +4 -4
- package/src/llms/skills/imf-web-ui-ux/references/forms.md +2 -2
- package/src/llms/tokens.gen.json +887 -0
- package/bin/install-skill.js +0 -180
- package/dist/code-qBbqAHK-.js +0 -190
- package/dist/meta-B8C51eyL.js +0 -74
- package/dist/tabs-DqBFSqq6.js +0 -3789
- package/src/llms/skills/imf-web-ui-frontend-patterns/SKILL.md +0 -93
- package/src/llms/skills/imf-web-ui-frontend-patterns/references/code-conventions.md +0 -133
- package/src/llms/skills/imf-web-ui-frontend-patterns/references/react-patterns.md +0 -94
- package/src/llms/skills/imf-web-ui-imfusion-frontend-setup/SKILL.md +0 -201
package/bin/install-skill.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Installs the consumer skill family (../src/llms/skills/imf-web-ui*/)
|
|
4
|
-
// into the consumer project's agent skill directories. Runs in the
|
|
5
|
-
// CONSUMER's environment, so it may only use this package's real runtime
|
|
6
|
-
// dependencies (@clack/prompts). Never wire this into a postinstall hook:
|
|
7
|
-
// ambient script execution on `npm install` is a live supply-chain attack
|
|
8
|
-
// vector — install stays an explicit, user-run command.
|
|
9
|
-
//
|
|
10
|
-
// The skills cross-reference each other, so they install as one bundle.
|
|
11
|
-
// When both targets are selected, .agents/skills/ holds the real copy and
|
|
12
|
-
// .claude/skills/ symlinks it (this repo's own convention) so the two
|
|
13
|
-
// can't drift apart.
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
cpSync,
|
|
17
|
-
existsSync,
|
|
18
|
-
lstatSync,
|
|
19
|
-
mkdirSync,
|
|
20
|
-
readdirSync,
|
|
21
|
-
readFileSync,
|
|
22
|
-
rmSync,
|
|
23
|
-
symlinkSync,
|
|
24
|
-
writeFileSync
|
|
25
|
-
} from "node:fs";
|
|
26
|
-
import { dirname, relative, resolve } from "node:path";
|
|
27
|
-
import { fileURLToPath } from "node:url";
|
|
28
|
-
import * as p from "@clack/prompts";
|
|
29
|
-
|
|
30
|
-
const SKILL_PREFIX = "imf-web-ui";
|
|
31
|
-
const VERSION_MARKER = ".imf-web-ui-skill-version.json";
|
|
32
|
-
|
|
33
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
34
|
-
// Source is relative to THIS SCRIPT's location (inside node_modules), not
|
|
35
|
-
// the consumer's cwd — the script is invoked from the consumer's project
|
|
36
|
-
// root, but the skills it copies ship alongside this file in the package.
|
|
37
|
-
const skillsRoot = resolve(here, "..", "src", "llms", "skills");
|
|
38
|
-
const packageJson = JSON.parse(readFileSync(resolve(here, "..", "package.json"), "utf-8"));
|
|
39
|
-
const currentVersion = packageJson.version;
|
|
40
|
-
|
|
41
|
-
// Destination is relative to the consumer's project root (cwd), since
|
|
42
|
-
// that's where their `.claude/` or `.agents/` directory lives.
|
|
43
|
-
const projectRoot = process.cwd();
|
|
44
|
-
|
|
45
|
-
const TARGETS = {
|
|
46
|
-
claude: { label: "Claude Code", root: resolve(projectRoot, ".claude", "skills") },
|
|
47
|
-
agents: { label: "Vendor-neutral (.agents/)", root: resolve(projectRoot, ".agents", "skills") }
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
function discoverSkills() {
|
|
51
|
-
if (!existsSync(skillsRoot)) return [];
|
|
52
|
-
return readdirSync(skillsRoot, { withFileTypes: true })
|
|
53
|
-
.filter(entry => entry.isDirectory() && entry.name.startsWith(SKILL_PREFIX))
|
|
54
|
-
.map(entry => entry.name)
|
|
55
|
-
.sort();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function displayPath(absPath) {
|
|
59
|
-
return `./${relative(projectRoot, absPath)}`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function readInstalledVersion(dir) {
|
|
63
|
-
const markerPath = resolve(dir, VERSION_MARKER);
|
|
64
|
-
if (!existsSync(markerPath)) return null;
|
|
65
|
-
try {
|
|
66
|
-
return JSON.parse(readFileSync(markerPath, "utf-8")).version ?? null;
|
|
67
|
-
} catch {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function writeRealCopy(sourceDir, destDir) {
|
|
73
|
-
mkdirSync(dirname(destDir), { recursive: true });
|
|
74
|
-
// force: true makes re-running after a version bump overwrite cleanly.
|
|
75
|
-
cpSync(sourceDir, destDir, { recursive: true, force: true });
|
|
76
|
-
writeFileSync(resolve(destDir, VERSION_MARKER), JSON.stringify({ version: currentVersion }, null, 2) + "\n");
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function writeSymlink(linkPath, targetPath) {
|
|
80
|
-
mkdirSync(dirname(linkPath), { recursive: true });
|
|
81
|
-
// lstat (not existsSync, which follows symlinks) catches a broken/stale
|
|
82
|
-
// symlink left over from a prior run, not just a real file or directory.
|
|
83
|
-
if (lstatSync(linkPath, { throwIfNoEntry: false })) {
|
|
84
|
-
rmSync(linkPath, { recursive: true, force: true });
|
|
85
|
-
}
|
|
86
|
-
symlinkSync(relative(dirname(linkPath), targetPath), linkPath);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// --target claude|agents (repeatable) selects targets without the
|
|
90
|
-
// interactive prompt — for CI and scripted installs.
|
|
91
|
-
function parseTargetFlags(argv) {
|
|
92
|
-
const targets = [];
|
|
93
|
-
for (let i = 0; i < argv.length; i++) {
|
|
94
|
-
if (argv[i] !== "--target") continue;
|
|
95
|
-
const value = argv[i + 1];
|
|
96
|
-
if (!value || !(value in TARGETS)) {
|
|
97
|
-
console.error(`--target expects one of: ${Object.keys(TARGETS).join(", ")}`);
|
|
98
|
-
process.exit(1);
|
|
99
|
-
}
|
|
100
|
-
targets.push(value);
|
|
101
|
-
i++;
|
|
102
|
-
}
|
|
103
|
-
return targets;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
async function main() {
|
|
107
|
-
const skills = discoverSkills();
|
|
108
|
-
const flagTargets = parseTargetFlags(process.argv.slice(2));
|
|
109
|
-
|
|
110
|
-
p.intro(`@imfusion/web-ui — install the ${SKILL_PREFIX} skills (${skills.length})`);
|
|
111
|
-
|
|
112
|
-
if (skills.length === 0) {
|
|
113
|
-
p.log.error(`No skills found at ${skillsRoot}. Reinstall @imfusion/web-ui and try again.`);
|
|
114
|
-
p.outro("Nothing installed.");
|
|
115
|
-
process.exitCode = 1;
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const existingVersions = Object.values(TARGETS)
|
|
120
|
-
.flatMap(({ root }) => skills.map(name => readInstalledVersion(resolve(root, name))))
|
|
121
|
-
.filter(Boolean);
|
|
122
|
-
if (existingVersions.length > 0 && existingVersions.every(v => v === currentVersion)) {
|
|
123
|
-
p.log.info(`Already up to date (v${currentVersion}). Re-running will overwrite with the same content.`);
|
|
124
|
-
} else if (existingVersions.some(v => v !== currentVersion)) {
|
|
125
|
-
const from = existingVersions.find(v => v !== currentVersion);
|
|
126
|
-
p.log.info(`Updating installed skills from v${from} to v${currentVersion}.`);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
p.log.message(`Skills in this bundle:\n${skills.map(name => ` - ${name}`).join("\n")}`);
|
|
130
|
-
|
|
131
|
-
let selected;
|
|
132
|
-
if (flagTargets.length > 0) {
|
|
133
|
-
selected = flagTargets;
|
|
134
|
-
p.log.info(`Targets from --target flags: ${selected.join(", ")}`);
|
|
135
|
-
} else {
|
|
136
|
-
selected = await p.multiselect({
|
|
137
|
-
message: "Install into which skill directory (or directories)?",
|
|
138
|
-
options: Object.entries(TARGETS).map(([key, { label, root }]) => ({
|
|
139
|
-
value: key,
|
|
140
|
-
label,
|
|
141
|
-
hint: displayPath(root)
|
|
142
|
-
})),
|
|
143
|
-
required: true
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
if (p.isCancel(selected)) {
|
|
147
|
-
p.cancel("Cancelled — nothing installed.");
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const both = selected.includes("claude") && selected.includes("agents");
|
|
153
|
-
|
|
154
|
-
for (const name of skills) {
|
|
155
|
-
const sourceDir = resolve(skillsRoot, name);
|
|
156
|
-
if (both) {
|
|
157
|
-
// .agents/ is the canonical real copy; .claude/ aliases it via symlink.
|
|
158
|
-
const realDir = resolve(TARGETS.agents.root, name);
|
|
159
|
-
writeRealCopy(sourceDir, realDir);
|
|
160
|
-
writeSymlink(resolve(TARGETS.claude.root, name), realDir);
|
|
161
|
-
} else {
|
|
162
|
-
for (const key of selected) {
|
|
163
|
-
writeRealCopy(sourceDir, resolve(TARGETS[key].root, name));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (both) {
|
|
169
|
-
p.log.success(`Vendor-neutral (.agents/) -> ${displayPath(TARGETS.agents.root)}/${SKILL_PREFIX}*`);
|
|
170
|
-
p.log.success(`Claude Code -> ${displayPath(TARGETS.claude.root)}/${SKILL_PREFIX}* (symlinks -> .agents/)`);
|
|
171
|
-
} else {
|
|
172
|
-
for (const key of selected) {
|
|
173
|
-
p.log.success(`${TARGETS[key].label} -> ${displayPath(TARGETS[key].root)}/${SKILL_PREFIX}*`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
p.outro(`Done — ${skills.length} skills installed.`);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
await main();
|
package/dist/code-qBbqAHK-.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { a as e, r as t, t as n } from "./meta-B8C51eyL.js";
|
|
2
|
-
import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useRef as l, useState as u } from "react";
|
|
3
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
|
-
//#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
5
|
-
var p = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), m = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), g = (e) => {
|
|
6
|
-
let t = h(e);
|
|
7
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
8
|
-
}, _ = {
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width: 24,
|
|
11
|
-
height: 24,
|
|
12
|
-
viewBox: "0 0 24 24",
|
|
13
|
-
fill: "none",
|
|
14
|
-
stroke: "currentColor",
|
|
15
|
-
strokeWidth: 2,
|
|
16
|
-
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round"
|
|
18
|
-
}, v = (e) => {
|
|
19
|
-
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
20
|
-
return !1;
|
|
21
|
-
}, y = r({}), b = () => s(y), x = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
|
|
22
|
-
let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: m = "currentColor", className: h = "" } = b() ?? {}, g = r ?? f ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
|
|
23
|
-
return i("svg", {
|
|
24
|
-
ref: l,
|
|
25
|
-
..._,
|
|
26
|
-
width: t ?? u ?? _.width,
|
|
27
|
-
height: t ?? u ?? _.height,
|
|
28
|
-
stroke: e ?? m,
|
|
29
|
-
strokeWidth: g,
|
|
30
|
-
className: p("lucide", h, a),
|
|
31
|
-
...!o && !v(c) && { "aria-hidden": "true" },
|
|
32
|
-
...c
|
|
33
|
-
}, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]]);
|
|
34
|
-
}), S = (e, t) => {
|
|
35
|
-
let n = a(({ className: n, ...r }, a) => i(x, {
|
|
36
|
-
ref: a,
|
|
37
|
-
iconNode: t,
|
|
38
|
-
className: p(`lucide-${m(g(e))}`, `lucide-${e}`, n),
|
|
39
|
-
...r
|
|
40
|
-
}));
|
|
41
|
-
return n.displayName = g(e), n;
|
|
42
|
-
}, C = S("arrow-right", [["path", {
|
|
43
|
-
d: "M5 12h14",
|
|
44
|
-
key: "1ays0h"
|
|
45
|
-
}], ["path", {
|
|
46
|
-
d: "m12 5 7 7-7 7",
|
|
47
|
-
key: "xquz4c"
|
|
48
|
-
}]]), w = S("arrow-up-right", [["path", {
|
|
49
|
-
d: "M7 7h10v10",
|
|
50
|
-
key: "1tivn9"
|
|
51
|
-
}], ["path", {
|
|
52
|
-
d: "M7 17 17 7",
|
|
53
|
-
key: "1vkiza"
|
|
54
|
-
}]]), T = S("check", [["path", {
|
|
55
|
-
d: "M20 6 9 17l-5-5",
|
|
56
|
-
key: "1gmf2c"
|
|
57
|
-
}]]), E = S("copy", [["rect", {
|
|
58
|
-
width: "14",
|
|
59
|
-
height: "14",
|
|
60
|
-
x: "8",
|
|
61
|
-
y: "8",
|
|
62
|
-
rx: "2",
|
|
63
|
-
ry: "2",
|
|
64
|
-
key: "17jyea"
|
|
65
|
-
}], ["path", {
|
|
66
|
-
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
67
|
-
key: "zix9uf"
|
|
68
|
-
}]]);
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/hooks/use-clipboard.ts
|
|
71
|
-
function D({ timeout: e = 1500 } = {}) {
|
|
72
|
-
let [t, n] = u(!1), r = l(void 0);
|
|
73
|
-
return c(() => () => clearTimeout(r.current), []), {
|
|
74
|
-
copied: t,
|
|
75
|
-
copy: o((t) => {
|
|
76
|
-
navigator.clipboard.writeText(t).then(() => {
|
|
77
|
-
n(!0), clearTimeout(r.current), r.current = setTimeout(() => n(!1), e);
|
|
78
|
-
});
|
|
79
|
-
}, [e])
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
var O = {
|
|
83
|
-
block: "imf-ui-code-module-block",
|
|
84
|
-
copy: "imf-ui-code-module-copy",
|
|
85
|
-
icon: "imf-ui-code-module-icon",
|
|
86
|
-
inline: "imf-ui-code-module-inline",
|
|
87
|
-
inlineCopy: "imf-ui-code-module-inlineCopy",
|
|
88
|
-
inlineLink: "imf-ui-code-module-inlineLink",
|
|
89
|
-
language: "imf-ui-code-module-language",
|
|
90
|
-
pre: "imf-ui-code-module-pre",
|
|
91
|
-
separator: "imf-ui-code-module-separator"
|
|
92
|
-
}, k = /* @__PURE__ */ e({
|
|
93
|
-
Block: () => M,
|
|
94
|
-
Inline: () => A,
|
|
95
|
-
InlineLink: () => j
|
|
96
|
-
});
|
|
97
|
-
function A({ className: e, copyable: n = !1, highlighted: r, children: i, ...a }) {
|
|
98
|
-
let { copied: o, copy: s } = D(), c = o ? T : E;
|
|
99
|
-
return /* @__PURE__ */ f("code", {
|
|
100
|
-
...a,
|
|
101
|
-
"data-imf-ui-component": "Code.Inline",
|
|
102
|
-
className: t(O.inline, e),
|
|
103
|
-
children: [
|
|
104
|
-
r ?? i,
|
|
105
|
-
n && /* @__PURE__ */ d("span", { className: O.separator }),
|
|
106
|
-
n && /* @__PURE__ */ d("button", {
|
|
107
|
-
type: "button",
|
|
108
|
-
className: O.inlineCopy,
|
|
109
|
-
"data-copied": o || void 0,
|
|
110
|
-
"aria-label": o ? "Copied" : "Copy",
|
|
111
|
-
onClick: () => s(i),
|
|
112
|
-
children: /* @__PURE__ */ d(c, {
|
|
113
|
-
size: 12,
|
|
114
|
-
strokeWidth: 2,
|
|
115
|
-
"aria-hidden": !0
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
]
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
A.displayName = "Code.Inline";
|
|
122
|
-
function j({ className: e, kind: n = "external", children: r, ...i }) {
|
|
123
|
-
let a = n === "external" ? w : C;
|
|
124
|
-
return /* @__PURE__ */ f("a", {
|
|
125
|
-
...n === "external" ? {
|
|
126
|
-
target: "_blank",
|
|
127
|
-
rel: "noreferrer"
|
|
128
|
-
} : {},
|
|
129
|
-
...i,
|
|
130
|
-
"data-imf-ui-component": "Code.InlineLink",
|
|
131
|
-
"data-kind": n,
|
|
132
|
-
className: t(O.inline, O.inlineLink, e),
|
|
133
|
-
children: [
|
|
134
|
-
r,
|
|
135
|
-
/* @__PURE__ */ d("span", { className: O.separator }),
|
|
136
|
-
/* @__PURE__ */ d("span", {
|
|
137
|
-
className: O.icon,
|
|
138
|
-
"aria-hidden": !0,
|
|
139
|
-
children: /* @__PURE__ */ d(a, {
|
|
140
|
-
size: 12,
|
|
141
|
-
strokeWidth: 2
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
]
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
j.displayName = "Code.InlineLink";
|
|
148
|
-
function M({ className: e, language: n, hideCopy: r = !1, highlighted: i, children: a, ...o }) {
|
|
149
|
-
let { copied: s, copy: c } = D(), l = s ? T : E;
|
|
150
|
-
return /* @__PURE__ */ f("div", {
|
|
151
|
-
"data-imf-ui-component": "Code.Block",
|
|
152
|
-
className: t(O.block, e),
|
|
153
|
-
children: [
|
|
154
|
-
n != null && /* @__PURE__ */ d("span", {
|
|
155
|
-
className: O.language,
|
|
156
|
-
children: n
|
|
157
|
-
}),
|
|
158
|
-
!r && /* @__PURE__ */ d("button", {
|
|
159
|
-
type: "button",
|
|
160
|
-
className: O.copy,
|
|
161
|
-
"data-copied": s || void 0,
|
|
162
|
-
"aria-label": s ? "Copied" : "Copy",
|
|
163
|
-
onClick: () => c(a),
|
|
164
|
-
children: /* @__PURE__ */ d(l, {
|
|
165
|
-
size: 12,
|
|
166
|
-
strokeWidth: 2,
|
|
167
|
-
"aria-hidden": !0
|
|
168
|
-
})
|
|
169
|
-
}),
|
|
170
|
-
/* @__PURE__ */ d("pre", {
|
|
171
|
-
...o,
|
|
172
|
-
className: O.pre,
|
|
173
|
-
children: /* @__PURE__ */ d("code", { children: i ?? a })
|
|
174
|
-
})
|
|
175
|
-
]
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
M.displayName = "Code.Block";
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/components/code/code.meta.ts
|
|
181
|
-
var N = {
|
|
182
|
-
name: "Code",
|
|
183
|
-
category: n.display,
|
|
184
|
-
status: "stable",
|
|
185
|
-
namespace: !0,
|
|
186
|
-
description: "Displays source code — Code.Inline for a fragment in running text, Code.Block for a fenced block with an optional language label and copy button. Also called a code snippet or code block.",
|
|
187
|
-
origin: "native"
|
|
188
|
-
};
|
|
189
|
-
//#endregion
|
|
190
|
-
export { k as a, T as c, S as d, j as i, w as l, M as n, D as o, A as r, E as s, N as t, C as u };
|
package/dist/meta-B8C51eyL.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.defineProperty, t = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), n = (t, n) => {
|
|
3
|
-
let r = {};
|
|
4
|
-
for (var i in t) e(r, i, {
|
|
5
|
-
get: t[i],
|
|
6
|
-
enumerable: !0
|
|
7
|
-
});
|
|
8
|
-
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region node_modules/clsx/dist/clsx.mjs
|
|
12
|
-
function r(e) {
|
|
13
|
-
var t, n, i = "";
|
|
14
|
-
if (typeof e == "string" || typeof e == "number") i += e;
|
|
15
|
-
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
16
|
-
var a = e.length;
|
|
17
|
-
for (t = 0; t < a; t++) e[t] && (n = r(e[t])) && (i && (i += " "), i += n);
|
|
18
|
-
} else for (n in e) e[n] && (i && (i += " "), i += n);
|
|
19
|
-
return i;
|
|
20
|
-
}
|
|
21
|
-
function i() {
|
|
22
|
-
for (var e, t, n = 0, i = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = r(e)) && (i && (i += " "), i += t);
|
|
23
|
-
return i;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region node_modules/class-variance-authority/dist/index.mjs
|
|
27
|
-
var a = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, o = i, s = (e, t) => (n) => {
|
|
28
|
-
if (t?.variants == null) return o(e, n?.class, n?.className);
|
|
29
|
-
let { variants: r, defaultVariants: i } = t, s = Object.keys(r).map((e) => {
|
|
30
|
-
let t = n?.[e], o = i?.[e];
|
|
31
|
-
if (t === null) return null;
|
|
32
|
-
let s = a(t) || a(o);
|
|
33
|
-
return r[e][s];
|
|
34
|
-
}), c = n && Object.entries(n).reduce((e, t) => {
|
|
35
|
-
let [n, r] = t;
|
|
36
|
-
return r === void 0 || (e[n] = r), e;
|
|
37
|
-
}, {});
|
|
38
|
-
return o(e, s, t?.compoundVariants?.reduce((e, t) => {
|
|
39
|
-
let { class: n, className: r, ...a } = t;
|
|
40
|
-
return Object.entries(a).every((e) => {
|
|
41
|
-
let [t, n] = e;
|
|
42
|
-
return Array.isArray(n) ? n.includes({
|
|
43
|
-
...i,
|
|
44
|
-
...c
|
|
45
|
-
}[t]) : {
|
|
46
|
-
...i,
|
|
47
|
-
...c
|
|
48
|
-
}[t] === n;
|
|
49
|
-
}) ? [
|
|
50
|
-
...e,
|
|
51
|
-
n,
|
|
52
|
-
r
|
|
53
|
-
] : e;
|
|
54
|
-
}, []), n?.class, n?.className);
|
|
55
|
-
}, c = {
|
|
56
|
-
buttons: {
|
|
57
|
-
id: "buttons",
|
|
58
|
-
label: "Buttons"
|
|
59
|
-
},
|
|
60
|
-
inputs: {
|
|
61
|
-
id: "inputs",
|
|
62
|
-
label: "Inputs"
|
|
63
|
-
},
|
|
64
|
-
layout: {
|
|
65
|
-
id: "layout",
|
|
66
|
-
label: "Layout"
|
|
67
|
-
},
|
|
68
|
-
display: {
|
|
69
|
-
id: "display",
|
|
70
|
-
label: "Display"
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
//#endregion
|
|
74
|
-
export { n as a, t as i, s as n, o as r, c as t };
|