acioleui 0.1.7 → 0.1.9
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.
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: acioleui-design
|
|
3
|
+
description: Use when building, refactoring, reviewing, or debugging React interfaces that use the AcioleUI component library, the acioleui npm package, AcioleUI design tokens, themes, icons, overlays, forms, navigation, data display, or layout primitives.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# acioleui design
|
|
7
|
+
|
|
8
|
+
Use AcioleUI as the application's UI system. Reuse its components, semantic tokens, providers, hooks, and icons before creating local equivalents.
|
|
9
|
+
|
|
10
|
+
## Required setup
|
|
11
|
+
|
|
12
|
+
Load `acioleui/styles` once at the application entry point and use the existing `ThemeProvider` at the application root:
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import "acioleui/styles";
|
|
16
|
+
import { ThemeProvider } from "acioleui";
|
|
17
|
+
|
|
18
|
+
<ThemeProvider defaultTheme="light">{children}</ThemeProvider>;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`ThemeProvider` already includes toast infrastructure. Do not add a second ToastProvider.
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
1. Translate the request into component roles: layout, typography, forms, feedback, overlays, navigation, or data display.
|
|
26
|
+
2. Reuse AcioleUI primitives and semantic tokens before writing local CSS or components.
|
|
27
|
+
3. Verify exact props from the installed package types before implementing non-trivial UI.
|
|
28
|
+
4. Keep components in their own folders and separate UI, business rules, and data access.
|
|
29
|
+
5. Preserve controlled React behavior, keyboard semantics, labels, ARIA, loading, empty, and error states.
|
|
30
|
+
6. Run TypeScript and build validation before finishing.
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "acioleui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "AcioleUI React component library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/ThiagoAciole/acioleui.git"
|
|
7
|
+
"url": "git+https://github.com/ThiagoAciole/acioleui.git"
|
|
8
8
|
},
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/ThiagoAciole/acioleui/issues"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/ThiagoAciole/acioleui#readme",
|
|
13
|
+
"bin": {
|
|
14
|
+
"create-acioleui": "./scripts/create.mjs"
|
|
15
|
+
},
|
|
13
16
|
"keywords": [
|
|
14
17
|
"react",
|
|
15
18
|
"components",
|
|
@@ -40,7 +43,9 @@
|
|
|
40
43
|
"./package.json": "./package.json"
|
|
41
44
|
},
|
|
42
45
|
"files": [
|
|
43
|
-
"dist"
|
|
46
|
+
"dist",
|
|
47
|
+
"scripts/create.mjs",
|
|
48
|
+
".agents"
|
|
44
49
|
],
|
|
45
50
|
"sideEffects": [
|
|
46
51
|
"**/*.css"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const name = args.find((arg) => !arg.startsWith('-'));
|
|
8
|
+
const install = args.includes('--install');
|
|
9
|
+
if (!name) {
|
|
10
|
+
console.error('Uso: npm create acioleui@latest <nome> [--install]');
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const target = resolve(process.cwd(), name);
|
|
14
|
+
if (existsSync(target)) {
|
|
15
|
+
console.error('A pasta já existe: ' + target);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const files = {
|
|
19
|
+
'package.json': JSON.stringify({ name: name.toLowerCase().replace(/[^a-z0-9-_]/g, '-'), private: true, type: 'module', scripts: { dev: 'vite', build: 'tsc && vite build', preview: 'vite preview' }, dependencies: { acioleui: '^0.1.7', react: '^18.3.1', 'react-dom': '^18.3.1' }, devDependencies: { '@vitejs/plugin-react': '^4.4.1', typescript: '^5.4.0', vite: '^7.3.1' } }, null, 2) + '\n',
|
|
20
|
+
'index.html': '<div id="root"></div><script type="module" src="/src/main.tsx"></script>\n',
|
|
21
|
+
'tsconfig.json': JSON.stringify({ compilerOptions: { target: 'ES2020', lib: ['ES2020', 'DOM'], module: 'ESNext', moduleResolution: 'Bundler', strict: true, jsx: 'react-jsx', noEmit: true, skipLibCheck: true }, include: ['src'] }, null, 2) + '\n',
|
|
22
|
+
'vite.config.ts': "import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nexport default defineConfig({ plugins: [react()] });\n",
|
|
23
|
+
'src/main.tsx': "import { createRoot } from 'react-dom/client';\nimport { ThemeProvider } from 'acioleui';\nimport 'acioleui/styles';\nimport './styles.css';\n\nfunction App() { return <main><h1>Seu projeto AcioleUI</h1><p>Comece a construir.</p></main>; }\ncreateRoot(document.getElementById('root')!).render(<ThemeProvider defaultTheme=\"light\"><App /></ThemeProvider>);\n",
|
|
24
|
+
'src/styles.css': ':root { font-family: Inter, system-ui, sans-serif; color: #1f2937; background: #f8fafc; } body { margin: 0; } main { padding: 48px; }\n',
|
|
25
|
+
'AGENTS.md': '# Estrutura do projeto\n\nReact + Vite + TypeScript com AcioleUI.\n\n- `src/components`: um componente reutilizável por pasta, com `index.tsx` e `styles.ts` quando necessário.\n- `src/pages`: telas, uma por pasta.\n- `src/layouts`: shells compartilhados.\n- `src/contexts`: providers e estado global.\n- `src/hooks`: hooks reutilizáveis.\n- `src/services`: API e integrações externas.\n- `src/store`: estado de domínio.\n- `src/styles`: tokens, temas e estilos globais.\n- `src/assets`: imagens importadas pelo código.\n- `src/utils`: helpers puros.\n\nUse AcioleUI e seu `ThemeProvider` antes de criar alternativas. Separe UI, negócio e dados. Preserve acessibilidade. Valide com `npm run build`.\n',
|
|
26
|
+
'.agents/skills/acioleui-design/SKILL.md': readFileSync(new URL('../.agents/skills/acioleui-design/SKILL.md', import.meta.url), 'utf8')
|
|
27
|
+
};
|
|
28
|
+
for (const directory of ['src/components', 'src/contexts', 'src/hooks', 'src/layouts', 'src/pages/Home', 'src/services', 'src/store', 'src/styles', 'src/assets', 'src/utils']) {
|
|
29
|
+
files[`${directory}/.gitkeep`] = '';
|
|
30
|
+
}
|
|
31
|
+
for (const [file, content] of Object.entries(files)) { const path = resolve(target, file); mkdirSync(resolve(path, '..'), { recursive: true }); writeFileSync(path, content); }
|
|
32
|
+
console.log('Projeto AcioleUI criado em ' + target);
|
|
33
|
+
if (install) { const result = spawnSync(process.platform === 'win32' ? 'npm.cmd' : 'npm', ['install'], { cwd: target, stdio: 'inherit' }); if (result.status !== 0) process.exit(result.status ?? 1); }
|