@agilys-system/design-system 1.0.4 → 1.0.5

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 (2) hide show
  1. package/README.md +28 -41
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,22 +1,24 @@
1
1
  # @agilys/design-system
2
2
 
3
- Design system em React para os projetos web da Agilys. Componentes construídos com [Vite](https://vitejs.dev), [Tailwind CSS](https://tailwindcss.com) e [class-variance-authority](https://cva.style), com playground em [Storybook](https://storybook.js.org).
3
+ Design system para os projetos web da Agilys. Componentes construídos com [Vite](https://vitejs.dev), [Tailwind CSS](https://tailwindcss.com) e [class-variance-authority](https://cva.style), com playground em [Chromatic](https://www.chromatic.com/library?appId=6a70e8317b8a3509112750bf).
4
4
 
5
5
  ## Instalação
6
6
 
7
7
  ```bash
8
8
  npm install @agilys/design-system
9
- ```
10
9
 
11
- Este pacote tem `react` e `react-dom` (>=18) como `peerDependencies` — instale-os no projeto consumidor caso ainda não existam.
10
+ ou
11
+
12
+ yarn add @agilys/design-system
13
+ ```
12
14
 
13
15
  ## Uso
14
16
 
15
17
  Importe os componentes e o CSS do pacote no ponto de entrada da sua aplicação:
16
18
 
17
19
  ```tsx
18
- import { Button } from '@agilys/design-system';
19
- import '@agilys/design-system/styles.css';
20
+ import { Button } from "@agilys/design-system";
21
+ import "@agilys/design-system/styles.css";
20
22
 
21
23
  function App() {
22
24
  return <Button variant="primary">Clique aqui</Button>;
@@ -32,46 +34,43 @@ Se o projeto consumidor também usa Tailwind, adicione o pacote ao `content` do
32
34
  ```js
33
35
  export default {
34
36
  content: [
35
- './src/**/*.{ts,tsx}',
36
- './node_modules/@agilys/design-system/dist/**/*.js',
37
+ "./src/**/*.{ts,tsx}",
38
+ "./node_modules/@agilys/design-system/dist/**/*.js",
37
39
  ],
38
40
  };
39
41
  ```
40
42
 
41
43
  ## Componentes disponíveis
42
44
 
43
- | Componente | Documentação |
44
- | --- | --- |
45
- | `Button` | [docs/button.md](./docs/button.md) |
45
+ | Componente | Documentação |
46
+ | ------------ | ------------------------------------------- |
47
+ | `Avatar` | [docs/avatar.md](./docs/avatar.md) |
48
+ | `Badge` | [docs/badge.md](./docs/badge.md) |
49
+ | `Button` | [docs/button.md](./docs/button.md) |
50
+ | `Input` | [docs/input.md](./docs/input.md) |
51
+ | `Modal` | [docs/modal.md](./docs/modal.md) |
52
+ | `Pagination` | [docs/pagination.md](./docs/pagination.md) |
53
+ | `Table` | [docs/table.md](./docs/table.md) |
54
+ | `Typography` | [docs/typography.md](./docs/typography.md) |
46
55
 
47
56
  Consulte a pasta [`docs/`](./docs) para o manual de integração de cada componente.
48
57
 
49
- ## Desenvolvimento
50
-
51
- ```bash
52
- npm install # instala dependências
53
- npm run dev # sobe o Storybook em http://localhost:6006 (playground dos componentes)
54
- npm run build # gera o build da lib em dist/ (JS + tipos + CSS)
55
- npm run build:storybook # gera o build estático do Storybook
56
- npm run lint # roda o ESLint
57
- ```
58
-
59
58
  ### Estrutura do projeto
60
59
 
61
60
  ```
62
61
  src/
63
62
  components/
64
- Button/
65
- Button.tsx
66
- Button.stories.tsx
67
- index.ts
63
+ Component/
64
+ Component.tsx # component
65
+ Component.stories.tsx # samples do storybook
66
+ index.ts # entry-point
68
67
  lib/
69
68
  cn.ts # helper (clsx + tailwind-merge)
70
69
  styles/
71
70
  tailwind.css
72
71
  index.ts # entry point público do pacote
73
72
  docs/
74
- button.md # manual de integração do Button
73
+ component.md # manual de integração de cada componente
75
74
  .storybook/ # configuração do Storybook (playground)
76
75
  .github/workflows/
77
76
  publish.yml # publica no npm a cada push na branch main
@@ -79,23 +78,11 @@ docs/
79
78
 
80
79
  ### Adicionando um novo componente
81
80
 
82
- 1. Crie `src/components/MeuComponente/MeuComponente.tsx`.
83
- 2. Exporte o componente em `src/components/MeuComponente/index.ts`.
81
+ 1. Crie `src/components/Component/Component.tsx`.
82
+ 2. Exporte o componente em `src/components/Component/index.ts`.
84
83
  3. Reexporte em `src/index.ts`.
85
- 4. Crie a story em `src/components/MeuComponente/MeuComponente.stories.tsx`.
86
- 5. Documente o uso em `docs/meu-componente.md` e adicione uma linha na tabela acima.
87
-
88
- ## Publicação (CI/CD)
89
-
90
- O workflow [`.github/workflows/publish.yml`](./.github/workflows/publish.yml) roda a cada push na branch `main`:
91
-
92
- 1. Instala dependências, faz lint e build do pacote.
93
- 2. Compara a versão em `package.json` com a versão publicada no npm.
94
- 3. Se a versão mudou, publica automaticamente em `https://registry.npmjs.org` (`npm publish`).
95
-
96
- Para publicar uma nova versão, faça `npm version <patch|minor|major>` (ou edite `version` no `package.json`) e faça merge/push na `main`.
97
-
98
- > **Secret necessário:** configure `NPM_TOKEN` (token de automação do npm com permissão de publish) em *Settings → Secrets and variables → Actions* no repositório GitHub.
84
+ 4. Crie a story em `src/components/Component/Component.stories.tsx`.
85
+ 5. Documente o uso em `docs/component.md` e adicione uma linha na tabela acima.
99
86
 
100
87
  ## Licença
101
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilys-system/design-system",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Design system (React) for Agilys web projects — components built with Vite, Tailwind CSS and Storybook.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "lint": "eslint . --ext .ts,.tsx",
38
38
  "preview": "vite preview",
39
39
  "prepublishOnly": "npm run build",
40
- "chromatic": "npx chromatic --project-token=chpt_f4efa71abe7a530"
40
+ "chromatic": "npx chromatic"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "react": ">=18.0.0",