readme-aura 0.1.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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +192 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/components/MockupPhone.d.ts +11 -0
  7. package/dist/components/MockupPhone.js +155 -0
  8. package/dist/components/MockupPhone.js.map +1 -0
  9. package/dist/components/StatsCard.d.ts +11 -0
  10. package/dist/components/StatsCard.js +91 -0
  11. package/dist/components/StatsCard.js.map +1 -0
  12. package/dist/components/index.d.ts +2 -0
  13. package/dist/components/index.js +3 -0
  14. package/dist/components/index.js.map +1 -0
  15. package/dist/fonts.d.ts +3 -0
  16. package/dist/fonts.js +58 -0
  17. package/dist/fonts.js.map +1 -0
  18. package/dist/github.d.ts +12 -0
  19. package/dist/github.js +271 -0
  20. package/dist/github.js.map +1 -0
  21. package/dist/init.d.ts +14 -0
  22. package/dist/init.js +105 -0
  23. package/dist/init.js.map +1 -0
  24. package/dist/parser.d.ts +2 -0
  25. package/dist/parser.js +49 -0
  26. package/dist/parser.js.map +1 -0
  27. package/dist/renderer.d.ts +5 -0
  28. package/dist/renderer.js +124 -0
  29. package/dist/renderer.js.map +1 -0
  30. package/dist/templates/source-profile.d.ts +5 -0
  31. package/dist/templates/source-profile.js +30 -0
  32. package/dist/templates/source-profile.js.map +1 -0
  33. package/dist/templates/source-project.d.ts +5 -0
  34. package/dist/templates/source-project.js +27 -0
  35. package/dist/templates/source-project.js.map +1 -0
  36. package/dist/templates/workflow.d.ts +1 -0
  37. package/dist/templates/workflow.js +27 -0
  38. package/dist/templates/workflow.js.map +1 -0
  39. package/dist/types.d.ts +71 -0
  40. package/dist/types.js +2 -0
  41. package/dist/types.js.map +1 -0
  42. package/package.json +57 -0
  43. package/readme.source.md +498 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yehor Kharchenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ ![readme-aura-component-0](./.github/assets/readme-aura-component-0-39fe8b1c.svg "Generated by readme-aura")
2
+
3
+ Write custom **React/JSX components** directly inside your Markdown, and readme-aura will render them into beautiful SVGs that work on GitHub.
4
+
5
+ GitHub strips all JS and CSS from README files. This tool lets you bypass that limitation by compiling your designs into static SVG images at build time.
6
+
7
+ ## How It Works
8
+
9
+ 1. Run `npx readme-aura init` in your repo — creates workflow, source template, and audits `.gitignore`
10
+ 2. Edit `readme.source.md` — add JSX components inside ` ```aura ` code blocks
11
+ 3. Preview locally with `npx readme-aura build` — JSX gets rendered to SVG via [Vercel Satori](https://github.com/vercel/satori)
12
+ 4. Push to `main` — the GitHub Action auto-generates your `README.md`
13
+
14
+ ![readme-aura-component-1](./.github/assets/readme-aura-component-1-2cc164cb.svg "Generated by readme-aura")
15
+
16
+ ## Quick Start
17
+
18
+ Run one command in your repo — it creates the GitHub Actions workflow, a starter `readme.source.md`, and ensures `.gitignore` won't block generated files:
19
+
20
+ ```bash
21
+ npx readme-aura init
22
+ ```
23
+
24
+ Then preview locally:
25
+
26
+ ```bash
27
+ npx readme-aura build
28
+ ```
29
+
30
+ That's it. Push to `main` and the workflow will auto-generate your `README.md` on every push.
31
+
32
+ > `init` auto-detects profile repos (`username/username`) and picks the right template.
33
+
34
+ ### Commands
35
+
36
+ | Command | Description |
37
+ |---------|-------------|
38
+ | `npx readme-aura init` | Scaffold workflow, source template, audit `.gitignore` |
39
+ | `npx readme-aura build` | Render ` ```aura ` blocks to SVG and generate `README.md` |
40
+
41
+ ### Build Options
42
+
43
+ | Option | Default | Description |
44
+ |--------|---------|-------------|
45
+ | `-s, --source` | `readme.source.md` | Source markdown file |
46
+ | `-o, --output` | `README.md` | Output markdown file |
47
+ | `-a, --assets` | `.github/assets` | Directory for generated SVGs |
48
+ | `-f, --fonts-dir` | — | Custom fonts directory |
49
+ | `-g, --github-user` | auto-detect | GitHub username for stats |
50
+ | `-t, --github-token` | `$GITHUB_TOKEN` | Token for GitHub API |
51
+
52
+ ### Init Options
53
+
54
+ | Option | Default | Description |
55
+ |--------|---------|-------------|
56
+ | `--template` | auto-detect | Template: `profile` or `project` |
57
+ | `--force` | `false` | Overwrite existing files |
58
+
59
+ ## What `init` Creates
60
+
61
+ The `init` command sets up everything you need:
62
+
63
+ **`.github/workflows/readme-aura.yml`** — GitHub Action that rebuilds your README on every push to `main` and on a daily schedule (to keep GitHub stats fresh):
64
+
65
+ ```yaml
66
+ name: Generate README
67
+ on:
68
+ push:
69
+ branches: [main]
70
+ paths: ['readme.source.md']
71
+ schedule:
72
+ - cron: '0 6 * * *'
73
+ workflow_dispatch:
74
+
75
+ permissions:
76
+ contents: write
77
+
78
+ jobs:
79
+ generate:
80
+ runs-on: ubuntu-latest
81
+ steps:
82
+ - uses: actions/checkout@v4
83
+
84
+ - name: Generate README
85
+ uses: collectioneur/readme-aura@main
86
+ with:
87
+ github_token: ${{ secrets.GITHUB_TOKEN }}
88
+ ```
89
+
90
+ **`readme.source.md`** — Starter template with example ` ```aura ` blocks, customized for your repo type.
91
+
92
+ **`.gitignore` audit** — Ensures `.github/assets/`, `.github/workflows/`, `README.md`, and `readme.source.md` are not ignored.
93
+
94
+ ## Features
95
+
96
+ ![readme-aura-component-2](./.github/assets/readme-aura-component-2-1b11d685.svg "Generated by readme-aura")
97
+
98
+ * **Write React/JSX** — Use familiar `style={{ }}` syntax with flexbox, gradients, shadows
99
+ * **Powered by Satori** — Vercel's engine converts JSX to SVG without a browser
100
+ * **Custom Fonts** — Inter bundled by default, bring your own via `--fonts-dir`
101
+ * **Meta Syntax** — Control dimensions: ` ```aura width=800 height=400 `
102
+ * **GitHub-Compatible** — Output is pure Markdown + SVG, works everywhere
103
+
104
+ ## Animations
105
+
106
+ You can add **CSS-based SVG animations** using the `<style>` injection mechanism. Satori renders a static frame at build time; the browser animates the SVG when it is displayed (e.g. on GitHub).
107
+
108
+ **How it works:** Add a `<style>` block in your JSX. Define `@keyframes` and apply them to elements by `#id` or `.class`. The renderer extracts and injects the CSS into the final SVG.
109
+
110
+ **Animatable properties:** `transform` (translate, scale, rotate), `opacity`, `fill`, and `stroke-dasharray`/`stroke-dashoffset`. Layout properties (`width`, `height`, `margin`) are unreliable.
111
+
112
+ **Targeting:** Use `id` on SVG elements (`<ellipse id="glow">`, `<g id="group">`) and reference them in CSS: `#glow { animation: pulse 2s infinite; }`. Raw SVG elements preserve `id`; Satori-rendered HTML may not always preserve `className`.
113
+
114
+ ![readme-aura-component-3](./.github/assets/readme-aura-component-3-65da8580.svg "Generated by readme-aura")
115
+
116
+ **Limitations:** No JavaScript, no SMIL. GitHub strips scripts but supports CSS animations. Prefer `transform` and `opacity` for best compatibility.
117
+
118
+ ## Tech Stack
119
+
120
+ ![readme-aura-component-4](./.github/assets/readme-aura-component-4-bba5e99b.svg "Generated by readme-aura")
121
+
122
+ ## If You Use readme-aura
123
+
124
+ * **Add the topic:** Consider adding the [readme-aura](https://github.com/topics/readme-aura) topic to your repository so others can discover it.
125
+ * **Keep the footer:** I would appreciate it if you keep the "powered by readme-aura" footer in your README. It helps others find and try the tool.
126
+
127
+ ## License
128
+
129
+ MIT
130
+
131
+
132
+ <br>
133
+
134
+ <p align="center"><sub>𝗉𝗈𝗐𝖾𝗋𝖾𝖽 𝖻𝗒 <a href="https://github.com/collectioneur/readme-aura">𝗋𝖾𝖺𝖽𝗆𝖾-𝖺𝗎𝗋𝖺</a></sub></p>
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,192 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { writeFile, mkdir, readdir, unlink } from 'node:fs/promises';
4
+ import { createHash } from 'node:crypto';
5
+ import { resolve } from 'node:path';
6
+ import { parseSource } from './parser.js';
7
+ import { renderBlock, createElement } from './renderer.js';
8
+ import { loadDefaultFonts, loadFontsFromDir } from './fonts.js';
9
+ import { fetchGitHubData, fetchRepositoryData, detectGitHubUser, detectGitHubRemote, createMockGitHubData, createMockRepoData, } from './github.js';
10
+ import { makeStatsCard, makeMockupPhone } from './components/index.js';
11
+ import { initProject } from './init.js';
12
+ const program = new Command();
13
+ program
14
+ .name('readme-aura')
15
+ .description('Next-Gen README generator - render React/JSX components to SVG inside Markdown')
16
+ .version('0.1.0');
17
+ program
18
+ .command('init')
19
+ .description('Scaffold readme-aura in your project (workflow, source template, gitignore audit)')
20
+ .option('--template <type>', 'Template: profile or project (auto-detected from git remote)')
21
+ .option('--force', 'Overwrite existing files', false)
22
+ .action(async (opts) => {
23
+ console.log('\n readme-aura init\n');
24
+ const result = await initProject({
25
+ template: opts.template,
26
+ force: opts.force,
27
+ });
28
+ if (result.remote) {
29
+ console.log(` Detected: ${result.remote.owner}/${result.remote.repo}`);
30
+ }
31
+ console.log(` Template: ${result.template}\n`);
32
+ for (const file of result.created) {
33
+ console.log(` + Created ${file}`);
34
+ }
35
+ for (const file of result.skipped) {
36
+ console.log(` - Skipped ${file} (already exists, use --force to overwrite)`);
37
+ }
38
+ for (const rule of result.gitignoreFixed) {
39
+ console.log(` ~ Added to .gitignore: ${rule}`);
40
+ }
41
+ console.log('\n Next steps:');
42
+ console.log(' 1. Edit readme.source.md to customize your README');
43
+ console.log(' 2. Test locally: npx readme-aura build');
44
+ console.log(' 3. Push to main — the workflow will auto-generate your README\n');
45
+ });
46
+ program
47
+ .command('build')
48
+ .description('Parse source markdown, render JSX to SVG, and generate README')
49
+ .option('-s, --source <path>', 'Source markdown file', 'readme.source.md')
50
+ .option('-o, --output <path>', 'Output markdown file', 'README.md')
51
+ .option('-a, --assets <path>', 'Assets directory for generated images', '.github/assets')
52
+ .option('-f, --fonts-dir <path>', 'Directory with custom font files (.ttf/.otf/.woff)')
53
+ .option('-g, --github-user <username>', 'GitHub username (auto-detected from git remote if omitted)')
54
+ .option('-t, --github-token <token>', 'GitHub token (defaults to GITHUB_TOKEN env variable)')
55
+ .option('--owner <owner>', 'Repository owner (auto-detected from git remote if omitted)')
56
+ .option('--repo <repo>', 'Repository name (auto-detected from git remote if omitted)')
57
+ .action(async (opts) => {
58
+ const sourcePath = resolve(opts.source);
59
+ const outputPath = resolve(opts.output);
60
+ const assetsDir = opts.assets;
61
+ console.log(`\n readme-aura v0.1.0\n`);
62
+ console.log(` Source: ${sourcePath}`);
63
+ console.log(` Output: ${outputPath}`);
64
+ console.log(` Assets: ${resolve(assetsDir)}`);
65
+ try {
66
+ const parseResult = await parseSource(sourcePath, assetsDir, outputPath);
67
+ const { blocks } = parseResult;
68
+ let { markdown } = parseResult;
69
+ await mkdir(resolve(assetsDir), { recursive: true });
70
+ // ── Resolve GitHub data ──────────────────────────────────
71
+ let github = null;
72
+ const githubUser = opts.githubUser ?? detectGitHubUser();
73
+ const githubToken = opts.githubToken ?? process.env.GITHUB_TOKEN;
74
+ if (githubUser) {
75
+ console.log(`\n GitHub: @${githubUser}`);
76
+ if (githubToken) {
77
+ try {
78
+ console.log(' Fetching GitHub data...');
79
+ github = await fetchGitHubData(githubUser, githubToken);
80
+ console.log(` Fetched: ${github.stats.totalRepos} repos, ${github.stats.totalStars} stars, ${github.languages.length} languages`);
81
+ }
82
+ catch (err) {
83
+ console.warn(` Warning: GitHub API failed: ${err.message}`);
84
+ console.warn(' Falling back to mock data.\n');
85
+ github = createMockGitHubData(githubUser);
86
+ }
87
+ }
88
+ else {
89
+ console.log(' No GITHUB_TOKEN found — using mock data for preview.');
90
+ github = createMockGitHubData(githubUser);
91
+ }
92
+ }
93
+ else {
94
+ console.log('\n GitHub: not configured (use --github-user or set git remote)');
95
+ }
96
+ // ── Resolve repository data ────────────────────────────────
97
+ let repoData = null;
98
+ const remote = detectGitHubRemote();
99
+ const owner = opts.owner ?? remote?.owner ?? null;
100
+ const repo = opts.repo ?? remote?.repo ?? null;
101
+ if (owner && repo) {
102
+ if (githubToken) {
103
+ try {
104
+ console.log(` Fetching repo: ${owner}/${repo}...`);
105
+ repoData = await fetchRepositoryData(owner, repo, githubToken);
106
+ console.log(` Fetched repo: ${owner}/${repo} — ${repoData.stars} stars, ${repoData.forks} forks`);
107
+ }
108
+ catch (err) {
109
+ console.warn(` Warning: Repo API failed: ${err.message}`);
110
+ console.warn(' Falling back to mock repo data.\n');
111
+ repoData = createMockRepoData(owner, repo);
112
+ }
113
+ }
114
+ else {
115
+ console.log(' No GITHUB_TOKEN — using mock repo data for preview.');
116
+ repoData = createMockRepoData(owner, repo);
117
+ }
118
+ }
119
+ else {
120
+ console.log(' Repo: not configured (use --owner/--repo or set git remote)');
121
+ }
122
+ if (blocks.length === 0) {
123
+ console.log('\n No aura blocks found in source file.');
124
+ }
125
+ else {
126
+ // Load fonts
127
+ console.log('\n Loading fonts...');
128
+ let fonts;
129
+ if (opts.fontsDir) {
130
+ fonts = await loadFontsFromDir(opts.fontsDir);
131
+ console.log(` Loaded ${fonts.length} font(s) from ${resolve(opts.fontsDir)}`);
132
+ }
133
+ else {
134
+ fonts = await loadDefaultFonts();
135
+ console.log(` Loaded ${fonts.length} default font(s)`);
136
+ }
137
+ // Build context that will be injected into JSX
138
+ const context = {};
139
+ if (github) {
140
+ context.github = github;
141
+ }
142
+ if (repoData) {
143
+ context.repo = repoData;
144
+ }
145
+ // Inject built-in components (available in every aura block)
146
+ context.StatsCard = makeStatsCard(createElement);
147
+ context.MockupPhone = makeMockupPhone(createElement);
148
+ // Render blocks to SVG (filename includes content hash for GitHub cache busting)
149
+ console.log(`\n Rendering ${blocks.length} block(s)...\n`);
150
+ const svgMap = new Map();
151
+ const writtenFiles = [];
152
+ for (const block of blocks) {
153
+ try {
154
+ const svg = await renderBlock(block, fonts, context);
155
+ svgMap.set(block.index, svg);
156
+ const hash = createHash('sha256').update(svg).digest('hex').slice(0, 8);
157
+ const filename = `readme-aura-component-${block.index}-${hash}.svg`;
158
+ const svgPath = resolve(assetsDir, filename);
159
+ await writeFile(svgPath, svg, 'utf-8');
160
+ writtenFiles.push(filename);
161
+ markdown = markdown.replaceAll(`readme-aura-component-${block.index}.svg`, filename);
162
+ console.log(` [${block.index}] Rendered -> ${filename}`);
163
+ }
164
+ catch (err) {
165
+ console.error(`\n Error in block ${block.index}: ${err.message}\n`);
166
+ process.exit(1);
167
+ }
168
+ }
169
+ // Remove old generated SVGs (not in this build)
170
+ const generatedPattern = /^(?:readme-aura-component-\d+(-[\w]+)?\.svg|component-\d+(-[\w]+)?\.svg)$/;
171
+ const existing = await readdir(resolve(assetsDir));
172
+ for (const name of existing) {
173
+ if (generatedPattern.test(name) && !writtenFiles.includes(name)) {
174
+ await unlink(resolve(assetsDir, name));
175
+ }
176
+ }
177
+ }
178
+ const footer = '\n\n<br>\n\n<p align="center"><sub>𝗉𝗈𝗐𝖾𝗋𝖾𝖽 𝖻𝗒 <a href="https://github.com/collectioneur/readme-aura">𝗋𝖾𝖺𝖽𝗆𝖾-𝖺𝗎𝗋𝖺</a></sub></p>\n';
179
+ await writeFile(outputPath, markdown + footer, 'utf-8');
180
+ console.log(`\n Generated: ${outputPath}`);
181
+ console.log(` SVGs saved to: ${resolve(assetsDir)}\n`);
182
+ }
183
+ catch (err) {
184
+ if (err.code === 'ENOENT') {
185
+ console.error(`\n Error: Source file not found: ${sourcePath}\n`);
186
+ process.exit(1);
187
+ }
188
+ throw err;
189
+ }
190
+ });
191
+ program.parse();
192
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC,gFAAgF,CAAC;KAC7F,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,O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MAAM,GACV,qJAAqJ,CAAC;QACxJ,MAAM,SAAS,CAAC,UAAU,EAAE,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,kBAAkB,UAAU,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,oBAAoB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrD,OAAO,CAAC,KAAK,CAAC,qCAAqC,UAAU,IAAI,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { GitHubData } from '../types.js';
2
+ type H = (type: unknown, props: Record<string, unknown> | null, ...children: unknown[]) => unknown;
3
+ /**
4
+ * Phone-frame mockup card — displays profile info, mini stats, and top repos.
5
+ * Usage in aura blocks: <MockupPhone github={github} />
6
+ * Recommended dimensions: width=380 height=680
7
+ */
8
+ export declare function makeMockupPhone(h: H): ({ github }: {
9
+ github: GitHubData;
10
+ }) => unknown;
11
+ export {};
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Phone-frame mockup card — displays profile info, mini stats, and top repos.
3
+ * Usage in aura blocks: <MockupPhone github={github} />
4
+ * Recommended dimensions: width=380 height=680
5
+ */
6
+ export function makeMockupPhone(h) {
7
+ return function MockupPhone({ github }) {
8
+ const topRepos = github.repos.slice(0, 4);
9
+ const initial = (github.user.name || github.user.login).charAt(0).toUpperCase();
10
+ return h('div', {
11
+ style: {
12
+ display: 'flex',
13
+ flexDirection: 'column',
14
+ width: '100%',
15
+ height: '100%',
16
+ background: '#111111',
17
+ borderRadius: 44,
18
+ border: '4px solid #252525',
19
+ boxShadow: '0 30px 80px rgba(0,0,0,0.8), 0 0 0 1px #1a1a1a',
20
+ fontFamily: 'Inter, sans-serif',
21
+ overflow: 'hidden',
22
+ },
23
+ },
24
+ // ── Camera island ───────────────────────────────────────────
25
+ h('div', {
26
+ style: {
27
+ display: 'flex',
28
+ justifyContent: 'center',
29
+ alignItems: 'center',
30
+ paddingTop: 14,
31
+ paddingBottom: 12,
32
+ background: '#111111',
33
+ },
34
+ }, h('div', {
35
+ style: {
36
+ width: 80,
37
+ height: 22,
38
+ background: '#0a0a0a',
39
+ borderRadius: 11,
40
+ border: '1px solid #1e1e1e',
41
+ },
42
+ })),
43
+ // ── Screen ─────────────────────────────────────────────────
44
+ h('div', {
45
+ style: {
46
+ display: 'flex',
47
+ flexDirection: 'column',
48
+ flex: 1,
49
+ background: '#0a0f1a',
50
+ padding: '14px 16px',
51
+ },
52
+ },
53
+ // Profile row
54
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 12, marginBottom: 14 } },
55
+ // Avatar circle with initial
56
+ h('div', {
57
+ style: {
58
+ width: 44,
59
+ height: 44,
60
+ borderRadius: 22,
61
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
62
+ border: '2px solid #667eea',
63
+ display: 'flex',
64
+ alignItems: 'center',
65
+ justifyContent: 'center',
66
+ boxShadow: '0 0 12px rgba(102,126,234,0.4)',
67
+ },
68
+ }, h('span', { style: { fontSize: 18, color: 'white', fontWeight: 700 } }, initial)),
69
+ // Name + handle
70
+ h('div', { style: { display: 'flex', flexDirection: 'column' } }, h('span', { style: { fontSize: 14, fontWeight: 700, color: '#e2e8f0' } }, github.user.name || github.user.login), h('span', { style: { fontSize: 11, color: '#4a5568' } }, '@' + github.user.login))),
71
+ // Mini stats row
72
+ h('div', {
73
+ style: {
74
+ display: 'flex',
75
+ gap: 0,
76
+ marginBottom: 14,
77
+ background: '#0d1117',
78
+ borderRadius: 10,
79
+ border: '1px solid #1a2332',
80
+ overflow: 'hidden',
81
+ },
82
+ }, ...[
83
+ { label: 'STARS', value: github.stats.totalStars, color: '#ffd700' },
84
+ { label: 'COMMITS', value: github.stats.totalCommits, color: '#00e5ff' },
85
+ { label: 'REPOS', value: github.stats.totalRepos, color: '#a78bfa' },
86
+ ].flatMap((stat, i, arr) => {
87
+ const tile = h('div', {
88
+ style: {
89
+ display: 'flex',
90
+ flexDirection: 'column',
91
+ alignItems: 'center',
92
+ flex: 1,
93
+ padding: '10px 4px',
94
+ },
95
+ }, h('span', { style: { fontSize: 16, fontWeight: 700, color: stat.color } }, String(stat.value)), h('span', { style: { fontSize: 8, color: '#4a5568', marginTop: 3, letterSpacing: 1 } }, stat.label));
96
+ // Divider between tiles
97
+ const divider = i < arr.length - 1 ? h('div', { style: { width: 1, background: '#1a2332' } }) : null;
98
+ return divider ? [tile, divider] : [tile];
99
+ })),
100
+ // "TOP REPOS" label
101
+ h('span', {
102
+ style: {
103
+ fontSize: 9,
104
+ color: '#2d3748',
105
+ fontWeight: 700,
106
+ letterSpacing: 1.5,
107
+ marginBottom: 8,
108
+ },
109
+ }, 'TOP REPOS'),
110
+ // Repo list
111
+ h('div', { style: { display: 'flex', flexDirection: 'column', gap: 6, flex: 1 } }, ...topRepos.map((repo) => h('div', {
112
+ style: {
113
+ display: 'flex',
114
+ flexDirection: 'column',
115
+ padding: '9px 11px',
116
+ background: '#0d1117',
117
+ borderRadius: 8,
118
+ border: '1px solid #1a2332',
119
+ },
120
+ },
121
+ // Repo name + stars
122
+ h('div', {
123
+ style: {
124
+ display: 'flex',
125
+ alignItems: 'center',
126
+ justifyContent: 'space-between',
127
+ },
128
+ }, h('span', { style: { fontSize: 12, fontWeight: 600, color: '#58a6ff' } }, repo.name), h('div', { style: { display: 'flex', alignItems: 'center', gap: 3 } }, h('span', { style: { fontSize: 10, color: '#ffd700' } }, '★'), h('span', { style: { fontSize: 10, color: '#6e7681' } }, String(repo.stars)))),
129
+ // Language pill
130
+ repo.language
131
+ ? h('div', { style: { display: 'flex', marginTop: 5 } }, h('span', {
132
+ style: {
133
+ fontSize: 9,
134
+ color: '#4a5568',
135
+ background: '#161b22',
136
+ padding: '2px 7px',
137
+ borderRadius: 4,
138
+ },
139
+ }, repo.language))
140
+ : null)))),
141
+ // ── Home indicator bar ──────────────────────────────────────
142
+ h('div', {
143
+ style: {
144
+ display: 'flex',
145
+ justifyContent: 'center',
146
+ alignItems: 'center',
147
+ padding: '12px 0',
148
+ background: '#111111',
149
+ },
150
+ }, h('div', {
151
+ style: { width: 100, height: 4, background: '#2a2a2a', borderRadius: 2 },
152
+ })));
153
+ };
154
+ }
155
+ //# sourceMappingURL=MockupPhone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MockupPhone.js","sourceRoot":"","sources":["../../src/components/MockupPhone.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,CAAI;IAClC,OAAO,SAAS,WAAW,CAAC,EAAE,MAAM,EAA0B;QAC5D,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAEhF,OAAO,CAAC,CACN,KAAK,EACL;YACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;gBACvB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;gBACd,UAAU,EAAE,SAAS;gBACrB,YAAY,EAAE,EAAE;gBAChB,MAAM,EAAE,mBAAmB;gBAC3B,SAAS,EAAE,gDAAgD;gBAC3D,UAAU,EAAE,mBAAmB;gBAC/B,QAAQ,EAAE,QAAQ;aACnB;SACF;QAED,+DAA+D;QAC/D,CAAC,CACC,KAAK,EACL;YACE,KAAK,EA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ChB,UAAU,EAAE,SAAS;oBACrB,OAAO,EAAE,SAAS;oBAClB,YAAY,EAAE,CAAC;iBAChB;aACF,EACD,IAAI,CAAC,QAAQ,CACd,CACF;YACH,CAAC,CAAC,IAAI,CACT,CACF,CACF,CACF;QAED,+DAA+D;QAC/D,CAAC,CACC,KAAK,EACL;YACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,cAAc,EAAE,QAAQ;gBACxB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,QAAQ;gBACjB,UAAU,EAAE,SAAS;aACtB;SACF,EACD,CAAC,CAAC,KAAK,EAAE;YACP,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE;SACzE,CAAC,CACH,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { GitHubData } from '../types.js';
2
+ type H = (type: unknown, props: Record<string, unknown> | null, ...children: unknown[]) => unknown;
3
+ /**
4
+ * Neon/cyberpunk stats card — shows stars, commits, repos, forks + top languages.
5
+ * Usage in aura blocks: <StatsCard github={github} />
6
+ * Recommended dimensions: width=800 height=190
7
+ */
8
+ export declare function makeStatsCard(h: H): ({ github }: {
9
+ github: GitHubData;
10
+ }) => unknown;
11
+ export {};
@@ -0,0 +1,91 @@
1
+ const STATS = [
2
+ {
3
+ label: 'STARS',
4
+ key: 'totalStars',
5
+ color: '#ffd700',
6
+ shadow: '0 0 22px rgba(255,215,0,0.35)',
7
+ },
8
+ {
9
+ label: 'COMMITS',
10
+ key: 'totalCommits',
11
+ color: '#00e5ff',
12
+ shadow: '0 0 22px rgba(0,229,255,0.35)',
13
+ },
14
+ {
15
+ label: 'REPOS',
16
+ key: 'totalRepos',
17
+ color: '#a78bfa',
18
+ shadow: '0 0 22px rgba(167,139,250,0.35)',
19
+ },
20
+ {
21
+ label: 'FORKS',
22
+ key: 'totalForks',
23
+ color: '#f472b6',
24
+ shadow: '0 0 22px rgba(244,114,182,0.35)',
25
+ },
26
+ ];
27
+ /**
28
+ * Neon/cyberpunk stats card — shows stars, commits, repos, forks + top languages.
29
+ * Usage in aura blocks: <StatsCard github={github} />
30
+ * Recommended dimensions: width=800 height=190
31
+ */
32
+ export function makeStatsCard(h) {
33
+ return function StatsCard({ github }) {
34
+ return h('div', {
35
+ style: {
36
+ display: 'flex',
37
+ flexDirection: 'column',
38
+ width: '100%',
39
+ height: '100%',
40
+ background: 'linear-gradient(135deg, #090917 0%, #0d0d2e 100%)',
41
+ borderRadius: 20,
42
+ padding: '22px 26px',
43
+ fontFamily: 'Inter, sans-serif',
44
+ border: '1px solid #1c1c4e',
45
+ },
46
+ },
47
+ // ── Header ─────────────────────────────────────────────────
48
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 10, marginBottom: 16 } },
49
+ // Neon pulse dot
50
+ h('div', {
51
+ style: {
52
+ width: 8,
53
+ height: 8,
54
+ borderRadius: 4,
55
+ background: '#00ff9f',
56
+ boxShadow: '0 0 8px #00ff9f, 0 0 16px rgba(0,255,159,0.5)',
57
+ },
58
+ }),
59
+ // Username label
60
+ h('span', { style: { fontSize: 12, color: '#667eea', fontWeight: 700, letterSpacing: 2 } }, '@' + github.user.login + ' // stats'),
61
+ // Full name (right-aligned)
62
+ h('div', { style: { display: 'flex', flex: 1, justifyContent: 'flex-end' } }, h('span', { style: { fontSize: 11, color: '#33336e' } }, github.user.name || ''))),
63
+ // ── Stat tiles ─────────────────────────────────────────────
64
+ h('div', { style: { display: 'flex', gap: 10, flex: 1 } }, ...STATS.map(({ label, key, color, shadow }) => h('div', {
65
+ style: {
66
+ display: 'flex',
67
+ flexDirection: 'column',
68
+ flex: 1,
69
+ background: '#0a0a22',
70
+ borderRadius: 14,
71
+ padding: '14px 18px',
72
+ alignItems: 'center',
73
+ justifyContent: 'center',
74
+ border: '1px solid #1e1e4e',
75
+ boxShadow: shadow,
76
+ },
77
+ }, h('span', { style: { fontSize: 28, fontWeight: 700, color, lineHeight: '1' } }, String(github.stats[key])), h('span', { style: { fontSize: 9, color: '#44448a', marginTop: 8, letterSpacing: 1.5 } }, label)))),
78
+ // ── Language strip ─────────────────────────────────────────
79
+ github.languages.length > 0
80
+ ? h('div', { style: { display: 'flex', gap: 12, marginTop: 14, alignItems: 'center' } }, ...github.languages.slice(0, 6).map((lang) => h('div', { style: { display: 'flex', alignItems: 'center', gap: 4 } }, h('div', {
81
+ style: {
82
+ width: 6,
83
+ height: 6,
84
+ borderRadius: 3,
85
+ background: lang.color,
86
+ },
87
+ }), h('span', { style: { fontSize: 9, color: '#44448a' } }, lang.name))))
88
+ : null);
89
+ };
90
+ }
91
+ //# sourceMappingURL=StatsCard.js.map