@berdsk/ui 0.2.7 → 0.2.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.
Files changed (56) hide show
  1. package/README.md +0 -0
  2. package/dist/Button.cjs +1 -1
  3. package/dist/Button.d.cts +5 -5
  4. package/dist/Button.d.ts +5 -5
  5. package/dist/Button.js +1 -1
  6. package/dist/Icon.cjs +1 -1
  7. package/dist/Icon.js +1 -1
  8. package/dist/Section.cjs +1 -1
  9. package/dist/Section.d.cts +2 -2
  10. package/dist/Section.d.ts +2 -2
  11. package/dist/Section.js +1 -1
  12. package/dist/ThemeProvider.cjs +1 -1
  13. package/dist/ThemeProvider.d.cts +4 -0
  14. package/dist/ThemeProvider.d.ts +4 -0
  15. package/dist/ThemeProvider.js +1 -1
  16. package/dist/chunk-3SA2QKC6.js +2 -0
  17. package/dist/chunk-3SA2QKC6.js.map +1 -0
  18. package/dist/{chunk-CTLSX32U.js → chunk-CK44QQW5.js} +8 -8
  19. package/dist/chunk-CK44QQW5.js.map +1 -0
  20. package/dist/{chunk-YY4J5WFK.cjs → chunk-ENMFI5RT.cjs} +8 -8
  21. package/dist/chunk-ENMFI5RT.cjs.map +1 -0
  22. package/dist/{chunk-JD5SEMO3.js → chunk-GUQJ6RZT.js} +2 -2
  23. package/dist/chunk-GUQJ6RZT.js.map +1 -0
  24. package/dist/{chunk-ASY4HDST.cjs → chunk-KXPGO6PS.cjs} +3 -3
  25. package/dist/chunk-KXPGO6PS.cjs.map +1 -0
  26. package/dist/chunk-MVVNEKMH.js +2 -0
  27. package/dist/chunk-MVVNEKMH.js.map +1 -0
  28. package/dist/chunk-OI62N27S.cjs +2 -0
  29. package/dist/chunk-OI62N27S.cjs.map +1 -0
  30. package/dist/{chunk-CL3NQPYL.cjs → chunk-U7VSEXSW.cjs} +2 -2
  31. package/dist/chunk-U7VSEXSW.cjs.map +1 -0
  32. package/dist/chunk-Z5XWNRFP.cjs +2 -0
  33. package/dist/chunk-Z5XWNRFP.cjs.map +1 -0
  34. package/dist/{chunk-UYXCJGNM.js → chunk-ZOVZGLB5.js} +3 -3
  35. package/dist/chunk-ZOVZGLB5.js.map +1 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.js +1 -1
  38. package/docs/Button.md +76 -0
  39. package/docs/Icon.md +44 -0
  40. package/docs/Section.md +92 -0
  41. package/docs/Theme.md +158 -0
  42. package/package.json +57 -53
  43. package/dist/chunk-ACL5MABU.js +0 -2
  44. package/dist/chunk-ACL5MABU.js.map +0 -1
  45. package/dist/chunk-ASY4HDST.cjs.map +0 -1
  46. package/dist/chunk-BQKAOXAV.js +0 -2
  47. package/dist/chunk-BQKAOXAV.js.map +0 -1
  48. package/dist/chunk-CL3NQPYL.cjs.map +0 -1
  49. package/dist/chunk-CTLSX32U.js.map +0 -1
  50. package/dist/chunk-JD5SEMO3.js.map +0 -1
  51. package/dist/chunk-KRYE247M.cjs +0 -2
  52. package/dist/chunk-KRYE247M.cjs.map +0 -1
  53. package/dist/chunk-RNA5V64T.cjs +0 -2
  54. package/dist/chunk-RNA5V64T.cjs.map +0 -1
  55. package/dist/chunk-UYXCJGNM.js.map +0 -1
  56. package/dist/chunk-YY4J5WFK.cjs.map +0 -1
package/docs/Button.md ADDED
@@ -0,0 +1,76 @@
1
+ # Button
2
+
3
+ O componente `Button` é um elemento versátil para ações do usuário, suportando diversas variantes, tamanhos e estados.
4
+
5
+ ## Importação
6
+
7
+ ```tsx
8
+ import { Button } from '@berdsk/ui';
9
+ ```
10
+
11
+ ## Propriedades
12
+
13
+ O componente aceita todas as propriedades padrão de um elemento `<button>` ou `<a>` (dependendo do uso de `href`), além das seguintes:
14
+
15
+ | Propriedade | Tipo | Padrão | Descrição |
16
+ | :---------- | :-------------------------------------------------- | :---------- | :--------------------------------------------------------- |
17
+ | `variant` | `'solid' \| 'outlined' \| 'ghost' \| 'link'` | `'solid'` | Estilo visual do botão. |
18
+ | `color` | `'primary' \| 'secondary' \| 'danger' \| 'success'` | `'primary'` | Cor temática do botão. |
19
+ | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | `'md'` | Tamanho do botão. |
20
+ | `rounded` | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'full'` | `'md'` | Arredondamento das bordas. |
21
+ | `leftIcon` | `React.ReactNode` | - | Ícone exibido à esquerda do texto. |
22
+ | `rightIcon` | `React.ReactNode` | - | Ícone exibido à direita do texto. |
23
+ | `fullWidth` | `boolean` | `false` | Se verdadeiro, o botão ocupa toda a largura do container. |
24
+ | `href` | `string` | - | Se fornecido, o botão será renderizado como uma tag `<a>`. |
25
+
26
+ ## Exemplo de Uso
27
+
28
+ ### Variantes e Cores
29
+
30
+ ```tsx
31
+ <Button variant="solid" color="primary">Primário Sólido</Button>
32
+ <Button variant="outlined" color="danger">Perigo Outlined</Button>
33
+ <Button variant="ghost" color="success">Sucesso Ghost</Button>
34
+ <Button variant="link">Link</Button>
35
+ ```
36
+
37
+ ### Com Ícones
38
+
39
+ ```tsx
40
+ import { Button, Icon } from '@berdsk/ui';
41
+
42
+ <Button leftIcon={<Icon className="fas fa-plus" />}>
43
+ Adicionar
44
+ </Button>
45
+
46
+ <Button
47
+ variant="outlined"
48
+ rightIcon={<Icon className="fas fa-arrow-right" />}
49
+ >
50
+ Continuar
51
+ </Button>
52
+
53
+ {/* Botão apenas com ícone */}
54
+ <Button rounded="full" leftIcon={<Icon className="fas fa-search" />} />
55
+ ```
56
+
57
+ ### Como Link
58
+
59
+ ```tsx
60
+ <Button href="https://berdsk.com.br" variant="link">
61
+ Visitar Site
62
+ </Button>
63
+ ```
64
+
65
+ ## Estilização e Tailwind
66
+
67
+ O `Button` utiliza utilitários do Tailwind internamente (via injeção de estilos do `ThemeProvider`) e tokens temáticos mapeados para variáveis CSS. Em projetos que usam Tailwind, você pode sobrescrever/estender estilos com `className`:
68
+
69
+ ```tsx
70
+ <Button className="shadow-md hover:scale-105 transition-transform">Ação</Button>
71
+ <Button variant="outlined" color="secondary" className="rounded-full" />
72
+ ```
73
+
74
+ - As cores respeitam o tema: `bg-primary`, `text-secondary`, `border-danger`, etc.
75
+ - Os tamanhos afetam altura e paddings (`h-10 px-4`, etc.). Para botão apenas com ícone, a largura é ajustada automaticamente e `aspect-square` é aplicado.
76
+ - `rounded` mapeia para `rounded-none|xs|sm|md|lg|full` com valores vindos do tema.
package/docs/Icon.md ADDED
@@ -0,0 +1,44 @@
1
+ # Icon
2
+
3
+ O componente `Icon` é utilizado para renderizar ícones na interface, carregando automaticamente o CDN de ícones da Berdsk.
4
+
5
+ ## Importação
6
+
7
+ ```tsx
8
+ import { Icon } from '@berdsk/ui';
9
+ ```
10
+
11
+ ## Propriedades
12
+
13
+ O componente aceita todas as propriedades padrão de um elemento `<i>` do HTML (através de `React.HTMLAttributes<HTMLElement>`), além das seguintes:
14
+
15
+ | Propriedade | Tipo | Obrigatório | Descrição |
16
+ | :---------- | :------- | :---------- | :----------------------------------------------------------------------------------------------------------------------------- |
17
+ | `className` | `string` | Sim | Classes CSS para o ícone (ex: `fas fa-user`). Você pode combinar com utilitários Tailwind como `text-primary`, `text-xl`, etc. |
18
+
19
+ ## Funcionamento
20
+
21
+ Ao ser utilizado pela primeira vez, o componente injeta automaticamente no `<head>` do documento:
22
+
23
+ 1. Um link de `preconnect` para `https://cdn.berdsk.com.br`.
24
+ 2. O link para o CSS global de ícones: `https://cdn.berdsk.com.br/berdsk-ui/icons/all.css`.
25
+
26
+ ## Exemplo de Uso
27
+
28
+ ```tsx
29
+ import { Icon } from '@berdsk/ui';
30
+
31
+ function MyComponent() {
32
+ return (
33
+ <div className="flex gap-gap">
34
+ <Icon className="fas fa-user text-primary" />
35
+ <Icon className="fas fa-home text-xl" />
36
+ </div>
37
+ );
38
+ }
39
+ ```
40
+
41
+ ### Dica
42
+
43
+ - Quando usado com Tailwind, utilize `text-*` para cor/tamanho (ex.: `text-primary`, `text-2xl`).
44
+ - Em projetos sem Tailwind, você ainda pode customizar via `style` inline (ex.: `style={{ color: '#444', fontSize: 20 }}`).
@@ -0,0 +1,92 @@
1
+ # Section
2
+
3
+ O componente `Section` ajuda a estruturar áreas da página com largura total ou centralização automática, além de oferecer divisores decorativos no topo e/ou base.
4
+
5
+ ## Importação
6
+
7
+ ```tsx
8
+ import { Section } from '@berdsk/ui';
9
+ ```
10
+
11
+ ## Propriedades
12
+
13
+ | Propriedade | Tipo | Padrão | Descrição |
14
+ | :------------------- | :----------------- | :------------ | :------------------------------------------------------------------------------- | ----- | ----------------------------- | ------- | ----------- | -------------------------------- |
15
+ | `as` | `'section' | 'header' | 'footer' | 'nav' | 'article' | 'main'` | `'section'` | Elemento HTML a ser renderizado. |
16
+ | `fullWidth` | `boolean` | `false` | Se `true`, renderiza os filhos ocupando 100% da largura (sem container central). |
17
+ | `screenHeight` | `boolean` | `false` | Se `true`, a altura mínima será a altura total da tela (`min-h-screen`). |
18
+ | `flex` | `boolean` | `false` | Habilita comportamento flex para a `Section` (`flex-1` quando aplicável). |
19
+ | `centerX` | `boolean` | `false` | Centraliza conteúdo no eixo X (horizontal). |
20
+ | `centerY` | `boolean` | `false` | Centraliza conteúdo no eixo Y (vertical). |
21
+ | `containerClassName` | `string` | `''` | Classes extras aplicadas ao container interno quando `fullWidth` é `false`. |
22
+ | `divisorTop` | `{ variant: 'wavy' | 'wavy-simple' | 'arched'; color?: string; className?: string; height?: number; }` | `-` | Exibe um divisor SVG no topo. |
23
+ | `divisorBottom` | `{ variant: 'wavy' | 'wavy-simple' | 'arched'; color?: string; className?: string; height?: number; }` | `-` | Exibe um divisor SVG na base. |
24
+ | `className` | `string` | `''` | Classes adicionais para a `Section` (útil para Tailwind). |
25
+
26
+ ## Comportamento do Container
27
+
28
+ - Quando `fullWidth = false` (padrão): o conteúdo é envolvido por um container central (`max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8`).
29
+ - Quando `fullWidth = true`: os filhos são renderizados diretamente, ocupando toda a largura disponível.
30
+
31
+ ## Divisores (Dividers)
32
+
33
+ - `variant`: Escolha entre `wavy`, `wavy-simple` e `arched`.
34
+ - `color`: Cor do divisor. Aceita cores CSS (ex: `#fff`, `rgb(255,0,0)`) ou qualquer classe do Tailwind (ex: `text-primary-200`, `bg-sky-500`, `fill-red-500`). O componente tenta detectar automaticamente se o valor é uma cor CSS ou uma classe Tailwind. Por padrão usa `currentColor`.
35
+ - `height`: Altura em pixels (padrão `100`).
36
+ - `className`: Classes extras; ex.: `text-primary/60` para aplicar opacidade com Tailwind.
37
+
38
+ ### Comportamento dos Divisores
39
+
40
+ Os divisores são posicionados de forma absoluta no topo ou base **do lado de fora** da seção (`z-50`). Eles utilizam tradução negativa (`translate-y`) para garantir que a transição entre seções seja suave e decorativa, sem ocupar espaço no fluxo do documento.
41
+
42
+ **Dica de Design:** Como os divisores ficam fora da seção, eles geralmente sobrepõem a seção vizinha. Certifique-se de que as cores dos divisores combinem com as seções adjacentes para um efeito visual harmonioso. Se você tiver problemas de visibilidade (ex: divisor sumindo sob outra seção), pode ser necessário ajustar o `z-index` das seções em seu projeto.
43
+
44
+ ## Exemplos
45
+
46
+ ### Seção padrão centralizada
47
+
48
+ ```tsx
49
+ <Section>
50
+ <h1 className="text-2xl">Título</h1>
51
+ <p>Conteúdo</p>
52
+ </Section>
53
+ ```
54
+
55
+ ### Full width com centralização e altura da tela
56
+
57
+ ```tsx
58
+ <Section fullWidth screenHeight centerX centerY className="bg-primary/5">
59
+ <div className="text-center">
60
+ <h2 className="text-xl text-primary">Bem-vindo</h2>
61
+ <p>Seção com 100% da largura e altura da tela.</p>
62
+ </div>
63
+ </Section>
64
+ ```
65
+
66
+ ### Com divisores decorativos
67
+
68
+ ```tsx
69
+ <Section
70
+ screenHeight
71
+ centerX
72
+ centerY
73
+ className="bg-secondary/10"
74
+ divisorTop={{ variant: 'wavy', className: 'text-secondary', height: 80 }}
75
+ divisorBottom={{
76
+ variant: 'arched',
77
+ className: 'text-secondary',
78
+ height: 120,
79
+ }}
80
+ >
81
+ <div className="text-center">
82
+ <h2 className="text-xl">Seção com Divisores</h2>
83
+ <p>Topo ondulado e base arqueada.</p>
84
+ </div>
85
+ </Section>
86
+ ```
87
+
88
+ ## Tailwind e Tema
89
+
90
+ - A `Section` utiliza utilitários como `relative`, `w-full`, `min-h-screen`, `flex`, `items-center`, `justify-center`, etc.
91
+ - Em projetos sem Tailwind, o `ThemeProvider` injeta os utilitários essenciais para funcionamento out-of-the-box.
92
+ - Em projetos com Tailwind, use `className` para estender o visual. As cores `primary|secondary|danger|success` vêm do tema via variáveis CSS e mapeamentos no Tailwind.
package/docs/Theme.md ADDED
@@ -0,0 +1,158 @@
1
+ # Tematização (ThemeProvider)
2
+
3
+ A biblioteca `@berdsk/ui` utiliza um sistema de tematização baseado em CSS Variables para garantir que os componentes sejam consistentes e facilmente customizáveis.
4
+
5
+ ## Uso Básico
6
+
7
+ Para que os estilos dos componentes funcionem corretamente e para ter acesso ao esquema de cores padrão, envolva sua aplicação com o `ThemeProvider`.
8
+
9
+ ```tsx
10
+ import { ThemeProvider } from '@berdsk/ui';
11
+
12
+ function App() {
13
+ return (
14
+ <ThemeProvider>
15
+ <YourAppContent />
16
+ </ThemeProvider>
17
+ );
18
+ }
19
+ ```
20
+
21
+ ## Customização
22
+
23
+ Você pode passar um objeto `theme` para o `ThemeProvider` para sobrescrever as cores, espaçamentos e arredondamentos padrão.
24
+
25
+ ```tsx
26
+ import { ThemeProvider, Button } from '@berdsk/ui';
27
+
28
+ const myTheme = {
29
+ colors: {
30
+ primary: '#6200ee',
31
+ secondary: '#03dac6',
32
+ danger: '#b00020',
33
+ success: '#4caf50',
34
+ },
35
+ spacing: {
36
+ gap: '1rem',
37
+ },
38
+ border: {
39
+ color: '#e0e0e0',
40
+ size: '2px',
41
+ radius: {
42
+ md: '8px',
43
+ full: '50px',
44
+ },
45
+ },
46
+ };
47
+
48
+ function App() {
49
+ return (
50
+ <ThemeProvider theme={myTheme}>
51
+ <Button color="primary">Meu Botão Customizado</Button>
52
+ </ThemeProvider>
53
+ );
54
+ }
55
+ ```
56
+
57
+ ## Integração com Tailwind (opcional)
58
+
59
+ A biblioteca já funciona "zero-config". Caso seu projeto utilize Tailwind, você pode aproveitar os tokens do tema mapeados para utilitários Tailwind:
60
+
61
+ - Cores: `bg-primary`, `text-secondary`, `border-danger`, `bg-success`, etc.
62
+ - Bordas: `rounded-none|xs|sm|md|lg|full` (valores vindos do tema).
63
+ - Espaçamento customizado: `gap-gap`.
64
+
65
+ Exemplo de `tailwind.config.js` (já incluso na biblioteca como referência):
66
+
67
+ ```js
68
+ /** @type {import('tailwindcss').Config} */
69
+ export default {
70
+ content: ['./src/**/*.{js,ts,jsx,tsx}'],
71
+ theme: {
72
+ extend: {
73
+ colors: {
74
+ primary: 'var(--berdsk-color-primary)',
75
+ secondary: 'var(--berdsk-color-secondary)',
76
+ danger: 'var(--berdsk-color-danger)',
77
+ success: 'var(--berdsk-color-success)',
78
+ },
79
+ borderRadius: {
80
+ none: 'var(--berdsk-rounded-none)',
81
+ xs: 'var(--berdsk-rounded-xs)',
82
+ sm: 'var(--berdsk-rounded-sm)',
83
+ md: 'var(--berdsk-rounded-md)',
84
+ lg: 'var(--berdsk-rounded-lg)',
85
+ full: 'var(--berdsk-rounded-full)',
86
+ },
87
+ spacing: {
88
+ gap: 'var(--berdsk-spacing-gap)',
89
+ },
90
+ },
91
+ },
92
+ plugins: [],
93
+ };
94
+ ```
95
+
96
+ Observações:
97
+
98
+ - Em projetos sem Tailwind, o `ThemeProvider` injeta utilitários essenciais (usados por `Button`, `Icon`, `Section`) para funcionamento imediato.
99
+ - Em projetos com Tailwind, utilize `className` para estender/ajustar o visual facilmente.
100
+
101
+ ## Tipografia e Fontes do Next.js
102
+
103
+ Para utilizar fontes do Next.js (`next/font/google`) no `ThemeProvider`, você pode passar o `fontFamily` diretamente do objeto de estilo da fonte.
104
+
105
+ ```tsx
106
+ 'use client';
107
+
108
+ import { ThemeProvider } from '@berdsk/ui';
109
+ import { Zain } from 'next/font/google';
110
+ import { PropsWithChildren } from 'react';
111
+
112
+ const zain = Zain({
113
+ subsets: ['latin'],
114
+ weight: ['400', '700'],
115
+ });
116
+
117
+ const Theme = ({ children }: PropsWithChildren) => {
118
+ return (
119
+ <ThemeProvider
120
+ theme={{
121
+ typography: {
122
+ fontFamily: zain.style.fontFamily,
123
+ fontWeight: '700',
124
+ },
125
+ }}
126
+ >
127
+ {children}
128
+ </ThemeProvider>
129
+ );
130
+ };
131
+
132
+ export default Theme;
133
+ ```
134
+
135
+ ## Esquema de Cores Padrão
136
+
137
+ Por padrão, a biblioteca utiliza as seguintes cores:
138
+
139
+ | Nome | Valor Hex | Variável CSS |
140
+ | :------------- | :-------- | :------------------------- |
141
+ | `primary` | `#007bff` | `--berdsk-color-primary` |
142
+ | `secondary` | `#6c757d` | `--berdsk-color-secondary` |
143
+ | `danger` | `#dc3545` | `--berdsk-color-danger` |
144
+ | `success` | `#28a745` | `--berdsk-color-success` |
145
+ | `border.color` | `#dee2e6` | `--berdsk-border-color` |
146
+ | `border.size` | `1px` | `--berdsk-border-size` |
147
+ | `spacing.gap` | `0.5rem` | `--berdsk-spacing-gap` |
148
+
149
+ ## Arredondamentos Padrão (border.radius)
150
+
151
+ | Nome | Valor | Variável CSS |
152
+ | :----- | :--------- | :---------------------- |
153
+ | `none` | `0` | `--berdsk-rounded-none` |
154
+ | `xs` | `0.125rem` | `--berdsk-rounded-xs` |
155
+ | `sm` | `0.25rem` | `--berdsk-rounded-sm` |
156
+ | `md` | `0.375rem` | `--berdsk-rounded-md` |
157
+ | `lg` | `0.5rem` | `--berdsk-rounded-lg` |
158
+ | `full` | `9999px` | `--berdsk-rounded-full` |
package/package.json CHANGED
@@ -1,53 +1,57 @@
1
- {
2
- "name": "@berdsk/ui",
3
- "version": "0.2.7",
4
- "description": "Biblioteca de componentes UI profissional da Berdsk",
5
- "author": "Berdsk",
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
- "license": "MIT",
10
- "keywords": [],
11
- "sideEffects": false,
12
- "type": "module",
13
- "main": "./dist/index.cjs",
14
- "module": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "import": "./dist/index.js",
20
- "require": "./dist/index.cjs"
21
- }
22
- },
23
- "files": [
24
- "dist"
25
- ],
26
- "engines": {
27
- "node": ">=18"
28
- },
29
- "scripts": {
30
- "build": "tsup",
31
- "clean": "rimraf dist",
32
- "prepublishOnly": "npm run build",
33
- "dev": "tsup --watch"
34
- },
35
- "peerDependencies": {
36
- "react": ">=18",
37
- "react-dom": ">=18"
38
- },
39
- "devDependencies": {
40
- "@types/react": "^19.2.14",
41
- "@types/react-dom": "^19.2.0",
42
- "autoprefixer": "^10.4.24",
43
- "classnames": "^2.5.1",
44
- "postcss": "^8.5.6",
45
- "react": "^19.2.4",
46
- "react-dom": "^19.2.4",
47
- "rimraf": "^5.0.0",
48
- "tailwind-merge": "^3.4.0",
49
- "tailwindcss": "^4.1.18",
50
- "tsup": "^8.5.1",
51
- "typescript": "^5.9.3"
52
- }
53
- }
1
+ {
2
+ "name": "@berdsk/ui",
3
+ "version": "0.2.9",
4
+ "description": "Biblioteca de componentes UI profissional da Berdsk",
5
+ "author": "Berdsk",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "license": "MIT",
10
+ "keywords": [],
11
+ "sideEffects": false,
12
+ "type": "module",
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "docs"
26
+ ],
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup",
32
+ "clean": "rimraf dist",
33
+ "prepublishOnly": "npm run build",
34
+ "dev": "tsup --watch",
35
+ "format": "prettier --write ."
36
+ },
37
+ "peerDependencies": {
38
+ "react": ">=18",
39
+ "react-dom": ">=18"
40
+ },
41
+ "devDependencies": {
42
+ "@types/react": "^19.2.14",
43
+ "@types/react-dom": "^19.2.0",
44
+ "autoprefixer": "^10.4.24",
45
+ "classnames": "^2.5.1",
46
+ "postcss": "^8.5.6",
47
+ "prettier": "^3.8.1",
48
+ "prettier-plugin-tailwindcss": "^0.7.2",
49
+ "react": "^19.2.4",
50
+ "react-dom": "^19.2.4",
51
+ "rimraf": "^5.0.0",
52
+ "tailwind-merge": "^3.4.0",
53
+ "tailwindcss": "^4.1.18",
54
+ "tsup": "^8.5.1",
55
+ "typescript": "^5.9.3"
56
+ }
57
+ }
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-JD5SEMO3.js';import {jsx}from'react/jsx-runtime';var s=({className:e,...o})=>jsx("i",{className:a(e),...o});export{s as a};//# sourceMappingURL=chunk-ACL5MABU.js.map
2
- //# sourceMappingURL=chunk-ACL5MABU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Icon.tsx"],"names":["Icon","className","props","jsx","cn"],"mappings":"wEAOO,IAAMA,EAA4B,CAAC,CAAE,UAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,GACvDC,IAAC,GAAA,CAAA,CAAE,SAAA,CAAWC,EAAGH,CAAS,CAAA,CAAI,GAAGC,CAAAA,CAAO","file":"chunk-ACL5MABU.js","sourcesContent":["import * as React from \"react\";\r\nimport cn from \"../utils/cn\";\r\n\r\nexport interface IconProps extends React.HTMLAttributes<HTMLElement> {\r\n className: string;\r\n}\r\n\r\nexport const Icon: React.FC<IconProps> = ({ className, ...props }) => {\r\n return <i className={cn(className)} {...props} />;\r\n};\r\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Section.tsx"],"names":["DivisorSVG","variant","color","className","height","position","hasColor","isCssColor","style","wrapperClasses","cn","naturalFlatSide","desiredTouchSide","svgCommonStyle","jsxs","jsx","Section","children","Component","fullWidth","screenHeight","flex","centerX","centerY","containerClassName","divisorTop","divisorBottom","props","isSectionColumn","sectionClasses","containerClasses","Section_default"],"mappings":"2GAyBA,IAAMA,EAAa,CAAC,CAClB,QAAAC,CAAAA,CACA,KAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,OAAAC,CAAAA,CAAS,GAAA,CACT,SAAAC,CACF,CAAA,GAAuD,CAErD,IAAMC,CAAAA,CAAW,CAAC,CAACJ,CAAAA,CAKbK,EAAaD,CAAAA,GAAaJ,CAAAA,CAAM,SAAS,GAAG,CAAA,EAAKA,EAAM,QAAA,CAAS,KAAK,GAAKA,CAAAA,CAAM,QAAA,CAAS,KAAK,CAAA,EAAKA,CAAAA,CAAM,SAAS,GAAG,CAAA,CAAA,CAErHM,CAAAA,CAAuB,CAC3B,OAAAJ,CAAAA,CACA,GAAIG,EAAa,CAAE,KAAA,CAAAL,CAAM,CAAA,CAAI,EAC/B,CAAA,CAEMO,CAAAA,CAAiBC,oBACrB,iDAAA,CACAL,CAAAA,GAAa,MAAQ,aAAA,CAAgB,UAAA,CACrCC,GAAY,CAACC,CAAAA,CAAaL,EAAQ,EAAA,CAClCC,CACF,EAGMQ,CAAAA,CAA4D,CAChE,KAAM,QAAA,CACN,aAAA,CAAe,MACf,MAAA,CAAQ,QACV,EAMMC,CAAAA,CAAmBP,CAAAA,GAAa,MAAQ,QAAA,CAAW,KAAA,CAEnDQ,EADYF,CAAAA,CAAgBV,CAAO,IAAMW,CAAAA,CAE3C,CAAE,SAAA,CAAW,YAAA,CAAc,gBAAiB,QAAS,CAAA,CACrD,EAAC,CAEL,OACEE,gBAAC,KAAA,CAAA,CAAI,SAAA,CAAWL,EAAgB,KAAA,CAAOD,CAAAA,CAAO,cAAW,IAAA,CACtD,QAAA,CAAA,CAAAP,IAAY,MAAA,EACXc,cAAAA,CAAC,OACC,KAAA,CAAM,MAAA,CACN,OAAO,MAAA,CACP,OAAA,CAAQ,eACR,mBAAA,CAAoB,MAAA,CACp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AA,CAAI,SAAA,CAAWe,EAAmB,QAAA,CAAAb,CAAAA,CAAS,EAE7CS,CAAAA,EACCX,cAAAA,CAACf,EAAA,CACC,QAAA,CAAS,SACT,OAAA,CAAS0B,CAAAA,CAAc,QACvB,KAAA,CAAOA,CAAAA,CAAc,MACrB,SAAA,CAAWA,CAAAA,CAAc,UACzB,MAAA,CAAQA,CAAAA,CAAc,OACxB,CAAA,CAAA,CAEJ,CAEJ,EAEOK,CAAAA,CAAQf","file":"chunk-ASY4HDST.cjs","sourcesContent":["import { CSSProperties, HTMLAttributes, ReactNode } from \"react\";\r\nimport cn from \"../utils/cn\";\r\n\r\ntype DivisorVariant = \"wavy\" | \"wavy-simple\" | \"arched\";\r\n\r\ninterface DivisorOptions {\r\n variant: DivisorVariant;\r\n color?: string; // CSS color (hex, rgb, hsl ou token tailwind via className externa)\r\n className?: string; // Classes adicionais (ex: text-primary-500)\r\n height?: number; // altura em px (default 100)\r\n}\r\n\r\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\r\n children: ReactNode;\r\n as?: \"section\" | \"header\" | \"footer\" | \"nav\" | \"article\" | \"main\";\r\n fullWidth?: boolean;\r\n screenHeight?: boolean;\r\n flex?: boolean;\r\n centerX?: boolean;\r\n centerY?: boolean;\r\n containerClassName?: string;\r\n divisorTop?: DivisorOptions;\r\n divisorBottom?: DivisorOptions;\r\n}\r\n\r\nconst DivisorSVG = ({\r\n variant,\r\n color,\r\n className,\r\n height = 100,\r\n position,\r\n}: DivisorOptions & { position: \"top\" | \"bottom\" }) => {\r\n // Se não houver color nem className, usamos currentColor\r\n const hasColor = !!color;\r\n \r\n // Verifica se o color passado parece uma classe Tailwind (não contém #, rgb, hsl e não é uma cor nomeada simples se quisermos ser rigorosos, \r\n // mas geralmente se tem espaços ou começa com text-/bg-/fill- é tailwind)\r\n // Uma abordagem melhor: se não contém caracteres especiais de cores CSS, tratamos como classe.\r\n const isCssColor = hasColor && (color.includes(\"#\") || color.includes(\"rgb\") || color.includes(\"hsl\") || color.includes(\"(\"));\r\n\r\n const style: CSSProperties = { \r\n height,\r\n ...(isCssColor ? { color } : {})\r\n };\r\n\r\n const wrapperClasses = cn(\r\n \"absolute left-0 w-full z-50 pointer-events-none\",\r\n position === \"top\" ? \"bottom-full\" : \"top-full\",\r\n hasColor && !isCssColor ? color : \"\", // Se for classe Tailwind, joga no cn\r\n className,\r\n );\r\n\r\n // Lado \"reto\" natural de cada SVG\r\n const naturalFlatSide: Record<DivisorVariant, \"top\" | \"bottom\"> = {\r\n wavy: \"bottom\",\r\n \"wavy-simple\": \"top\",\r\n arched: \"bottom\",\r\n };\r\n\r\n // Se o divisor está no TOPO da section (lado de fora), a base reta do SVG deve estar no BOTTOM\r\n // (para encostar na borda superior da section).\r\n // Se o divisor está na BASE da section (lado de fora), a base reta do SVG deve estar no TOP\r\n // (para encostar na borda inferior da section).\r\n const desiredTouchSide = position === \"top\" ? \"bottom\" : \"top\";\r\n const needsFlip = naturalFlatSide[variant] !== desiredTouchSide;\r\n const svgCommonStyle: CSSProperties = needsFlip\r\n ? { transform: \"scaleY(-1)\", transformOrigin: \"center\" }\r\n : {};\r\n\r\n return (\r\n <div className={wrapperClasses} style={style} aria-hidden>\r\n {variant === \"wavy\" && (\r\n <svg\r\n width=\"100%\"\r\n height=\"100%\"\r\n viewBox=\"0 0 1280 140\"\r\n preserveAspectRatio=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n style={svgCommonStyle}\r\n >\r\n <g fill=\"currentColor\">\r\n <path\r\n d=\"M1280 3.4C1050.59 18 1019.4 84.89 734.42 84.89c-320 0-320-84.3-640-84.3C59.4.59 28.2 1.6 0 3.4V140h1280z\"\r\n fillOpacity=\".3\"\r\n />\r\n <path\r\n d=\"M0 24.31c43.46-5.69 94.56-9.25 158.42-9.25 320 0 320 89.24 640 89.24 256.13 0 307.28-57.16 481.58-80V140H0z\"\r\n fillOpacity=\".5\"\r\n />\r\n <path d=\"M1280 51.76c-201 12.49-242.43 53.4-513.58 53.4-320 0-320-57-640-57-48.85.01-90.21 1.35-126.42 3.6V140h1280z\" />\r\n </g>\r\n </svg>\r\n )}\r\n {variant === \"wavy-simple\" && (\r\n <svg\r\n width=\"100%\"\r\n height=\"100%\"\r\n viewBox=\"0 0 1280 140\"\r\n preserveAspectRatio=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n style={svgCommonStyle}\r\n >\r\n <g fill=\"currentColor\">\r\n <path d=\"M320 28C160 28 80 49 0 70V0h1280v70c-80 21-160 42-320 42-320 0-320-84-640-84z\" />\r\n </g>\r\n </svg>\r\n )}\r\n {variant === \"arched\" && (\r\n <svg\r\n width=\"100%\"\r\n height=\"100%\"\r\n viewBox=\"0 0 1280 140\"\r\n preserveAspectRatio=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n style={svgCommonStyle}\r\n >\r\n <g fill=\"currentColor\">\r\n <path\r\n d=\"M725.29 101.2C325.22 122.48 0 0 0 0v140h1280V0s-154.64 79.92-554.71 101.2z\"\r\n fillOpacity=\".3\"\r\n />\r\n <path\r\n d=\"M556.45 119.74C953.41 140 1280 14 1280 14v126H0V0s159.5 99.48 556.45 119.74z\"\r\n fillOpacity=\".5\"\r\n />\r\n <path d=\"M640 140c353.46 0 640-140 640-139v140H0V0s286.54 140 640 140z\" />\r\n </g>\r\n </svg>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport const Section = ({\r\n children,\r\n as: Component = \"section\",\r\n fullWidth = false,\r\n screenHeight = false,\r\n flex = false,\r\n centerX = false,\r\n centerY = false,\r\n className = \"\",\r\n containerClassName = \"\",\r\n divisorTop,\r\n divisorBottom,\r\n ...props\r\n}: SectionProps) => {\r\n const isSectionColumn = !!screenHeight;\r\n\r\n const sectionClasses = cn(\r\n \"relative w-full\",\r\n screenHeight && \"min-h-screen\",\r\n flex && \"flex-1\",\r\n screenHeight && \"flex flex-col\",\r\n (centerX || centerY) && \"flex\",\r\n // Centralização quando é fullWidth ou screenHeight (flex-col)\r\n centerX && (fullWidth || isSectionColumn) && \"items-center\",\r\n centerY && (fullWidth || isSectionColumn) && \"justify-center\",\r\n // Centralização quando é fullWidth e NÃO é coluna (flex-row padrão)\r\n centerX && fullWidth && !isSectionColumn && \"justify-center\",\r\n centerY && fullWidth && !isSectionColumn && \"items-center\",\r\n className,\r\n );\r\n\r\n const containerClasses = cn(\r\n \"mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl w-full\",\r\n {\r\n \"flex-1\": screenHeight,\r\n flex: centerX || centerY,\r\n \"justify-center\": centerX,\r\n \"items-center\": centerY,\r\n },\r\n containerClassName,\r\n );\r\n\r\n return (\r\n <Component className={sectionClasses} {...props}>\r\n {divisorTop && (\r\n <DivisorSVG\r\n position=\"top\"\r\n variant={divisorTop.variant}\r\n color={divisorTop.color}\r\n className={divisorTop.className}\r\n height={divisorTop.height}\r\n />\r\n )}\r\n {fullWidth ? (\r\n children\r\n ) : (\r\n <div className={containerClasses}>{children}</div>\r\n )}\r\n {divisorBottom && (\r\n <DivisorSVG\r\n position=\"bottom\"\r\n variant={divisorBottom.variant}\r\n color={divisorBottom.color}\r\n className={divisorBottom.className}\r\n height={divisorBottom.height}\r\n />\r\n )}\r\n </Component>\r\n );\r\n};\r\n\r\nexport default Section;\r\n"]}
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-JD5SEMO3.js';import*as p from'react';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var R=p.forwardRef(({children:s,variant:t="solid",color:u="primary",size:o="md",rounded:x="md",leftIcon:r,rightIcon:n,fullWidth:m=false,className:g="",href:c,...d},l)=>{let h={solid:{primary:"bg-primary text-white hover:brightness-90",secondary:"bg-secondary text-white hover:brightness-90",danger:"bg-danger text-white hover:brightness-90",success:"bg-success text-white hover:brightness-90"},outlined:{primary:"border-primary text-primary hover:bg-black/5 bg-transparent",secondary:"border-secondary text-secondary hover:bg-black/5 bg-transparent",danger:"border-danger text-danger hover:bg-black/5 bg-transparent",success:"border-success text-success hover:bg-black/5 bg-transparent"},ghost:{primary:"text-primary hover:bg-black/5 bg-transparent border-transparent",secondary:"text-secondary hover:bg-black/5 bg-transparent border-transparent",danger:"text-danger hover:bg-black/5 bg-transparent border-transparent",success:"text-success hover:bg-black/5 bg-transparent border-transparent"},link:{primary:"text-primary hover:opacity-80 underline bg-transparent border-none p-0 h-auto",secondary:"text-secondary hover:opacity-80 underline bg-transparent border-none p-0 h-auto",danger:"text-danger hover:opacity-80 underline bg-transparent border-none p-0 h-auto",success:"text-success hover:opacity-80 underline bg-transparent border-none p-0 h-auto"}},y={xs:"h-6 px-2 text-xs",sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-base",lg:"h-12 px-6 text-lg",xl:"h-14 px-8 text-xl","2xl":"h-16 px-10 text-2xl"},f={xs:"w-6",sm:"w-8",md:"w-10",lg:"w-12",xl:"w-14","2xl":"w-16"},v={none:"rounded-none",xs:"rounded-xs",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},w=!s&&(r||n),i=a("inline-flex items-center justify-center font-medium cursor-pointer transition-all border disabled:opacity-60 disabled:cursor-not-allowed gap-gap",t!=="link"?y[o]:"",t!=="link"&&w?`${f[o]} aspect-square px-0`:"",t!=="link"?v[x]:"",h[t][u],m?"w-full flex":"",g),b=jsxs(Fragment,{children:[r&&jsx("span",{className:"flex items-center justify-center",children:r}),s&&jsx("span",{className:a("text-center",{"flex-1":!!(r||n)}),children:s}),n&&jsx("span",{className:"flex items-center justify-center",children:n})]});return c?jsx("a",{href:c,className:i,ref:l,...d,children:b}):jsx("button",{className:i,ref:l,...d,children:b})});R.displayName="Button";export{R as a};//# sourceMappingURL=chunk-BQKAOXAV.js.map
2
- //# sourceMappingURL=chunk-BQKAOXAV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Button.tsx"],"names":["Button","children","variant","color","size","rounded","leftIcon","rightIcon","fullWidth","className","href","props","ref","variants","sizes","iconOnlySizes","roundness","isIconOnly","combined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,CAAAA,CAEAa,GAAAA,CAAC,GAAA,CAAA,CACC,IAAA,CAAMb,CAAAA,CACN,SAAA,CAAWQ,CAAAA,CACX,GAAA,CAAKN,CAAAA,CACJ,GAAID,CAAAA,CAEJ,QAAA,CAAAS,CAAAA,CACH,CAAA,CAKFG,GAAAA,CAAC,QAAA,CAAA,CACC,SAAA,CAAWL,CAAAA,CACX,GAAA,CAAKN,CAAAA,CACJ,GAAID,CAAAA,CAEJ,QAAA,CAAAS,CAAAA,CACH,CAEJ,CACF,EAEApB,CAAAA,CAAO,WAAA,CAAc,QAAA","file":"chunk-BQKAOXAV.js","sourcesContent":["import * as React from \"react\";\r\nimport { Icon } from \"./Icon\";\r\nimport cn from \"../utils/cn\";\r\n\r\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> {\r\n variant?: \"solid\" | \"outlined\" | \"ghost\" | \"link\";\r\n color?: \"primary\" | \"secondary\" | \"danger\" | \"success\";\r\n size?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\r\n rounded?: \"none\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"full\";\r\n leftIcon?: React.ReactNode;\r\n rightIcon?: React.ReactNode;\r\n fullWidth?: boolean;\r\n href?: string;\r\n}\r\n\r\nexport const Button = React.forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\r\n (\r\n {\r\n children,\r\n variant = \"solid\",\r\n color = \"primary\",\r\n size = \"md\",\r\n rounded = \"md\",\r\n leftIcon,\r\n rightIcon,\r\n fullWidth = false,\r\n className = \"\",\r\n href,\r\n ...props\r\n },\r\n ref\r\n ) => {\r\n const variants = {\r\n solid: {\r\n primary: \"bg-primary text-white hover:brightness-90\",\r\n secondary: \"bg-secondary text-white hover:brightness-90\",\r\n danger: \"bg-danger text-white hover:brightness-90\",\r\n success: \"bg-success text-white hover:brightness-90\",\r\n },\r\n outlined: {\r\n primary: \"border-primary text-primary hover:bg-black/5 bg-transparent\",\r\n secondary: \"border-secondary text-secondary hover:bg-black/5 bg-transparent\",\r\n danger: \"border-danger text-danger hover:bg-black/5 bg-transparent\",\r\n success: \"border-success text-success hover:bg-black/5 bg-transparent\",\r\n },\r\n ghost: {\r\n primary: \"text-primary hover:bg-black/5 bg-transparent border-transparent\",\r\n secondary: \"text-secondary hover:bg-black/5 bg-transparent border-transparent\",\r\n danger: \"text-danger hover:bg-black/5 bg-transparent border-transparent\",\r\n success: \"text-success hover:bg-black/5 bg-transparent border-transparent\",\r\n },\r\n link: {\r\n primary: \"text-primary hover:opacity-80 underline bg-transparent border-none p-0 h-auto\",\r\n secondary: \"text-secondary hover:opacity-80 underline bg-transparent border-none p-0 h-auto\",\r\n danger: \"text-danger hover:opacity-80 underline bg-transparent border-none p-0 h-auto\",\r\n success: \"text-success hover:opacity-80 underline bg-transparent border-none p-0 h-auto\",\r\n },\r\n };\r\n\r\n const sizes = {\r\n xs: \"h-6 px-2 text-xs\",\r\n sm: \"h-8 px-3 text-sm\",\r\n md: \"h-10 px-4 text-base\",\r\n lg: \"h-12 px-6 text-lg\",\r\n xl: \"h-14 px-8 text-xl\",\r\n \"2xl\": \"h-16 px-10 text-2xl\",\r\n };\r\n\r\n const iconOnlySizes = {\r\n xs: \"w-6\",\r\n sm: \"w-8\",\r\n md: \"w-10\",\r\n lg: \"w-12\",\r\n xl: \"w-14\",\r\n \"2xl\": \"w-16\",\r\n };\r\n\r\n const roundness = {\r\n none: \"rounded-none\",\r\n xs: \"rounded-xs\",\r\n sm: \"rounded-sm\",\r\n md: \"rounded-md\",\r\n lg: \"rounded-lg\",\r\n full: \"rounded-full\",\r\n };\r\n\r\n const isIconOnly = !children && (leftIcon || rightIcon);\r\n\r\n const combinedClasses = cn(\r\n \"inline-flex items-center justify-center font-medium cursor-pointer transition-all border disabled:opacity-60 disabled:cursor-not-allowed gap-gap\",\r\n variant !== \"link\" ? sizes[size] : \"\",\r\n variant !== \"link\" && isIconOnly ? `${iconOnlySizes[size]} aspect-square px-0` : \"\",\r\n variant !== \"link\" ? roundness[rounded] : \"\",\r\n variants[variant][color],\r\n fullWidth ? \"w-full flex\" : \"\",\r\n className\r\n );\r\n\r\n const content = (\r\n <>\r\n {leftIcon && (\r\n <span className=\"flex items-center justify-center\">\r\n {leftIcon}\r\n </span>\r\n )}\r\n {children && (\r\n <span className={cn(\"text-center\", { \"flex-1\": !!(leftIcon || rightIcon) })}>\r\n {children}\r\n </span>\r\n )}\r\n {rightIcon && (\r\n <span className=\"flex items-center justify-center\">\r\n {rightIcon}\r\n </span>\r\n )}\r\n </>\r\n );\r\n\r\n if (href) {\r\n return (\r\n <a\r\n href={href}\r\n className={combinedClasses}\r\n ref={ref as React.ForwardedRef<HTMLAnchorElement>}\r\n {...(props as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\r\n >\r\n {content}\r\n </a>\r\n );\r\n }\r\n\r\n return (\r\n <button\r\n className={combinedClasses}\r\n ref={ref as React.ForwardedRef<HTMLButtonElement>}\r\n {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\r\n >\r\n {content}\r\n </button>\r\n );\r\n }\r\n);\r\n\r\nButton.displayName = \"Button\";\r\n"]}