@seedgrid/ai-toolkit 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +151 -2
- package/dist/adapters/claude.js +114 -0
- package/dist/adapters/codex.js +108 -0
- package/dist/adapters/index.js +17 -0
- package/dist/adapters/shared.js +142 -0
- package/dist/adapters/types.js +1 -0
- package/dist/cli.js +203 -0
- package/dist/commands/common.js +98 -0
- package/dist/commands/doctor.js +290 -0
- package/dist/commands/init.js +9 -0
- package/dist/commands/install.js +107 -0
- package/dist/commands/remove.js +54 -0
- package/dist/commands/review.js +127 -0
- package/dist/commands/status.js +73 -0
- package/dist/commands/update.js +8 -0
- package/dist/commands/validate.js +27 -0
- package/dist/core/apply.js +181 -0
- package/dist/core/blocks.js +64 -0
- package/dist/core/content.js +528 -0
- package/dist/core/env.js +40 -0
- package/dist/core/frontmatter.js +29 -0
- package/dist/core/hash.js +14 -0
- package/dist/core/inspect.js +51 -0
- package/dist/core/lock.js +124 -0
- package/dist/core/paths.js +65 -0
- package/dist/core/plan.js +242 -0
- package/dist/core/tools.js +62 -0
- package/dist/core/types.js +11 -0
- package/dist/core/updates.js +121 -0
- package/docs/arquitetura.md +80 -0
- package/docs/compatibilidade.md +50 -0
- package/docs/formato.md +155 -0
- package/docs/instalacao.md +105 -0
- package/docs/manutencao.md +115 -0
- package/package.json +43 -4
- package/seedgridKB/SeedGrid/Extensions/Catalogo-de-enums.md +161 -0
- package/seedgridKB/SeedGrid/Extensions/Catalogo-de-propriedades.md +971 -0
- package/seedgridKB/SeedGrid/Extensions/Indice.md +63 -0
- package/seedgridKB/SeedGrid/Extensions/ai-pricing/Configuracao.md +124 -0
- package/seedgridKB/SeedGrid/Extensions/ai-pricing/Enums.md +40 -0
- package/seedgridKB/SeedGrid/Extensions/ai-pricing/Exemplos.md +97 -0
- package/seedgridKB/SeedGrid/Extensions/ai-pricing/Visao-geral.md +114 -0
- package/seedgridKB/SeedGrid/Extensions/apikeys/Configuracao-Rust.md +69 -0
- package/seedgridKB/SeedGrid/Extensions/apikeys/Configuracao.md +88 -0
- package/seedgridKB/SeedGrid/Extensions/apikeys/Enums.md +33 -0
- package/seedgridKB/SeedGrid/Extensions/apikeys/Exemplos.md +121 -0
- package/seedgridKB/SeedGrid/Extensions/apikeys/Rust.md +126 -0
- package/seedgridKB/SeedGrid/Extensions/apikeys/Visao-geral.md +111 -0
- package/seedgridKB/SeedGrid/Extensions/audit/Configuracao-Rust.md +93 -0
- package/seedgridKB/SeedGrid/Extensions/audit/Configuracao.md +127 -0
- package/seedgridKB/SeedGrid/Extensions/audit/Enums.md +66 -0
- package/seedgridKB/SeedGrid/Extensions/audit/Exemplos.md +151 -0
- package/seedgridKB/SeedGrid/Extensions/audit/Rust.md +120 -0
- package/seedgridKB/SeedGrid/Extensions/audit/Visao-geral.md +114 -0
- package/seedgridKB/SeedGrid/Extensions/backup/Configuracao-Rust.md +136 -0
- package/seedgridKB/SeedGrid/Extensions/backup/Configuracao.md +319 -0
- package/seedgridKB/SeedGrid/Extensions/backup/Enums.md +131 -0
- package/seedgridKB/SeedGrid/Extensions/backup/Exemplos.md +210 -0
- package/seedgridKB/SeedGrid/Extensions/backup/Rust.md +135 -0
- package/seedgridKB/SeedGrid/Extensions/backup/Visao-geral.md +150 -0
- package/seedgridKB/SeedGrid/Extensions/billing/Configuracao-Rust.md +86 -0
- package/seedgridKB/SeedGrid/Extensions/billing/Configuracao.md +243 -0
- package/seedgridKB/SeedGrid/Extensions/billing/Enums.md +165 -0
- package/seedgridKB/SeedGrid/Extensions/billing/Exemplos.md +205 -0
- package/seedgridKB/SeedGrid/Extensions/billing/Rust.md +109 -0
- package/seedgridKB/SeedGrid/Extensions/billing/Visao-geral.md +181 -0
- package/seedgridKB/SeedGrid/Extensions/broker/Configuracao-Rust.md +40 -0
- package/seedgridKB/SeedGrid/Extensions/broker/Visao-geral.md +114 -0
- package/seedgridKB/SeedGrid/Extensions/cache/Configuracao-Rust.md +73 -0
- package/seedgridKB/SeedGrid/Extensions/cache/Configuracao.md +112 -0
- package/seedgridKB/SeedGrid/Extensions/cache/Enums.md +36 -0
- package/seedgridKB/SeedGrid/Extensions/cache/Exemplos.md +149 -0
- package/seedgridKB/SeedGrid/Extensions/cache/Rust.md +81 -0
- package/seedgridKB/SeedGrid/Extensions/cache/Visao-geral.md +90 -0
- package/seedgridKB/SeedGrid/Extensions/commons/Configuracao.md +107 -0
- package/seedgridKB/SeedGrid/Extensions/commons/Enums.md +105 -0
- package/seedgridKB/SeedGrid/Extensions/commons/Exemplos.md +141 -0
- package/seedgridKB/SeedGrid/Extensions/commons/Visao-geral.md +99 -0
- package/seedgridKB/SeedGrid/Extensions/exchange/Configuracao.md +122 -0
- package/seedgridKB/SeedGrid/Extensions/exchange/Enums.md +29 -0
- package/seedgridKB/SeedGrid/Extensions/exchange/Exemplos.md +82 -0
- package/seedgridKB/SeedGrid/Extensions/exchange/Visao-geral.md +118 -0
- package/seedgridKB/SeedGrid/Extensions/filemanagement/Configuracao-Rust.md +110 -0
- package/seedgridKB/SeedGrid/Extensions/filemanagement/Configuracao.md +157 -0
- package/seedgridKB/SeedGrid/Extensions/filemanagement/Exemplos.md +157 -0
- package/seedgridKB/SeedGrid/Extensions/filemanagement/Rust.md +70 -0
- package/seedgridKB/SeedGrid/Extensions/filemanagement/Visao-geral.md +88 -0
- package/seedgridKB/SeedGrid/Extensions/login-tenancy/Configuracao-Rust.md +124 -0
- package/seedgridKB/SeedGrid/Extensions/login-tenancy/Configuracao.md +195 -0
- package/seedgridKB/SeedGrid/Extensions/login-tenancy/Enums.md +71 -0
- package/seedgridKB/SeedGrid/Extensions/login-tenancy/Exemplos.md +149 -0
- package/seedgridKB/SeedGrid/Extensions/login-tenancy/Rust.md +139 -0
- package/seedgridKB/SeedGrid/Extensions/login-tenancy/Visao-geral.md +130 -0
- package/seedgridKB/SeedGrid/Extensions/notification/Configuracao.md +141 -0
- package/seedgridKB/SeedGrid/Extensions/notification/Enums.md +52 -0
- package/seedgridKB/SeedGrid/Extensions/notification/Exemplos.md +141 -0
- package/seedgridKB/SeedGrid/Extensions/notification/Visao-geral.md +113 -0
- package/seedgridKB/SeedGrid/Extensions/privacy/Configuracao-Rust.md +67 -0
- package/seedgridKB/SeedGrid/Extensions/privacy/Configuracao.md +94 -0
- package/seedgridKB/SeedGrid/Extensions/privacy/Enums.md +79 -0
- package/seedgridKB/SeedGrid/Extensions/privacy/Exemplos.md +172 -0
- package/seedgridKB/SeedGrid/Extensions/privacy/Rust.md +107 -0
- package/seedgridKB/SeedGrid/Extensions/privacy/Visao-geral.md +90 -0
- package/seedgridKB/SeedGrid/Extensions/realtime/Configuracao-Rust.md +72 -0
- package/seedgridKB/SeedGrid/Extensions/realtime/Configuracao.md +104 -0
- package/seedgridKB/SeedGrid/Extensions/realtime/Exemplos.md +104 -0
- package/seedgridKB/SeedGrid/Extensions/realtime/Rust.md +69 -0
- package/seedgridKB/SeedGrid/Extensions/realtime/Visao-geral.md +105 -0
- package/seedgridKB/SeedGrid/Extensions/resilience/Configuracao-Rust.md +68 -0
- package/seedgridKB/SeedGrid/Extensions/resilience/Configuracao.md +186 -0
- package/seedgridKB/SeedGrid/Extensions/resilience/Enums.md +96 -0
- package/seedgridKB/SeedGrid/Extensions/resilience/Exemplos.md +229 -0
- package/seedgridKB/SeedGrid/Extensions/resilience/Rust.md +80 -0
- package/seedgridKB/SeedGrid/Extensions/resilience/Visao-geral.md +112 -0
- package/seedgridKB/SeedGrid/Extensions/runtime/Configuracao-Rust.md +90 -0
- package/seedgridKB/SeedGrid/Extensions/runtime/Visao-geral.md +114 -0
- package/seedgridKB/SeedGrid/Extensions/security/Configuracao-Rust.md +327 -0
- package/seedgridKB/SeedGrid/Extensions/security/Configuracao.md +510 -0
- package/seedgridKB/SeedGrid/Extensions/security/Enums.md +95 -0
- package/seedgridKB/SeedGrid/Extensions/security/Exemplos.md +218 -0
- package/seedgridKB/SeedGrid/Extensions/security/Rust.md +203 -0
- package/seedgridKB/SeedGrid/Extensions/security/Visao-geral.md +131 -0
- package/seedgridKB/SeedGrid/Extensions/subdomain-tenancy/Configuracao-Rust.md +188 -0
- package/seedgridKB/SeedGrid/Extensions/subdomain-tenancy/Configuracao.md +345 -0
- package/seedgridKB/SeedGrid/Extensions/subdomain-tenancy/Enums.md +117 -0
- package/seedgridKB/SeedGrid/Extensions/subdomain-tenancy/Exemplos.md +205 -0
- package/seedgridKB/SeedGrid/Extensions/subdomain-tenancy/Rust.md +161 -0
- package/seedgridKB/SeedGrid/Extensions/subdomain-tenancy/Visao-geral.md +142 -0
- package/seedgridKB/SeedGrid/Extensions/whatsapp/Configuracao-Rust.md +75 -0
- package/seedgridKB/SeedGrid/Extensions/whatsapp/Configuracao.md +152 -0
- package/seedgridKB/SeedGrid/Extensions/whatsapp/Enums.md +198 -0
- package/seedgridKB/SeedGrid/Extensions/whatsapp/Exemplos.md +173 -0
- package/seedgridKB/SeedGrid/Extensions/whatsapp/Rust.md +83 -0
- package/seedgridKB/SeedGrid/Extensions/whatsapp/Visao-geral.md +99 -0
- package/seedgridKB/SeedGrid/Mapa-dos-repositorios.md +112 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/Indice.md +323 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/buttons/API.md +257 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/buttons/Exemplos.md +307 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/buttons/Visao-geral.md +51 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/datatable/API.md +174 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/datatable/Exemplos.md +236 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/datatable/Visao-geral.md +76 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/digits/API.md +339 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/digits/Exemplos.md +311 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/digits/Visao-geral.md +57 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/editor/API.md +125 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/editor/Exemplos.md +116 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/editor/Visao-geral.md +86 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/feedback-e-exibicao/API.md +490 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/feedback-e-exibicao/Exemplos.md +544 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/feedback-e-exibicao/Visao-geral.md +69 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/fundamentos/API.md +113 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/fundamentos/Exemplos.md +159 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/fundamentos/Visao-geral.md +92 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/gadgets/API.md +516 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/gadgets/Exemplos.md +629 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/gadgets/Visao-geral.md +80 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/inputs-selecao/API.md +615 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/inputs-selecao/Exemplos.md +384 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/inputs-selecao/Visao-geral.md +111 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/inputs-texto/API.md +661 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/inputs-texto/Exemplos.md +312 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/inputs-texto/Visao-geral.md +123 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/layout/API.md +1090 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/layout/Exemplos.md +1172 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/layout/Visao-geral.md +98 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/Visao-geral.md +98 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-apikeys.md +118 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-audit.md +88 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-backup.md +131 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-billing-platform.md +132 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-billing-user.md +120 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-login-tenancy.md +119 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-security.md +427 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-self-enter.md +104 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/modulos/fe-subdomain-tenancy.md +110 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/navegacao-e-overlay/API.md +490 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/navegacao-e-overlay/Exemplos.md +561 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/navegacao-e-overlay/Visao-geral.md +82 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/pacotes/Visao-geral.md +68 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/pacotes/fe-commons.md +61 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/pacotes/fe-core.md +140 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/pacotes/fe-playground.md +112 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/pacotes/fe-theme.md +97 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/providers/API.md +177 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/providers/Exemplos.md +332 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/providers/Visao-geral.md +106 -0
- package/seedgridKB/SeedGrid/SeedGrid-components/showcase.md +70 -0
- package/seedgridKB/SeedGrid/Toolkit/agents/arquiteto.md +53 -0
- package/seedgridKB/SeedGrid/Toolkit/agents/backend-java.md +45 -0
- package/seedgridKB/SeedGrid/Toolkit/agents/backend-rust.md +43 -0
- package/seedgridKB/SeedGrid/Toolkit/agents/frontend-react.md +41 -0
- package/seedgridKB/SeedGrid/Toolkit/agents/qa.md +44 -0
- package/seedgridKB/SeedGrid/Toolkit/agents/revisor.md +40 -0
- package/seedgridKB/SeedGrid/Toolkit/references/fluxo-de-trabalho.md +78 -0
- package/seedgridKB/SeedGrid/Toolkit/references/glossario.md +15 -0
- package/seedgridKB/SeedGrid/Toolkit/references/modos-shared-native.md +27 -0
- package/seedgridKB/SeedGrid/Toolkit/rules/backend-java-seedgrid.md +54 -0
- package/seedgridKB/SeedGrid/Toolkit/rules/coordenacao.md +39 -0
- package/seedgridKB/SeedGrid/Toolkit/rules/formato-entrega.md +29 -0
- package/seedgridKB/SeedGrid/Toolkit/rules/frontend-seedgrid.md +47 -0
- package/seedgridKB/SeedGrid/Toolkit/rules/personalizacao-local.md +22 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/planejar-mudanca/SKILL.md +38 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/revisar-codigo/SKILL.md +33 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/revisar-codigo/references/checklist.md +25 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-backend-crud/SKILL.md +29 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-bump/SKILL.md +26 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-crud/SKILL.md +221 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-crud/agents/openai.yaml +4 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-crud/references/checklist.md +31 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-crud/references/patterns.md +185 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-crud/references/routing.md +66 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-new-screen/SKILL.md +56 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-new-screen/agents/openai.yaml +4 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-new-screen/references/checklist.md +32 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-new-screen/references/steps.md +114 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/seedgrid-review/SKILL.md +61 -0
- package/seedgridKB/SeedGrid/Toolkit/skills/validar-mudanca/SKILL.md +29 -0
- package/seedgridKB/SeedGrid/Toolkit/templates/decisao-arquitetura.md +29 -0
- package/seedgridKB/SeedGrid/Toolkit/templates/especificacao-tarefa.md +32 -0
- package/seedgridKB/SeedGrid/Toolkit/templates/relatorio-validacao.md +30 -0
- package/seedgridKB/SeedGrid/Versoes.md +64 -0
- package/seedgridKB/SeedGrid/Visao-geral.md +35 -0
- package/seedgridKB/manifest.json +142 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [seedgrid, front, component, digits]
|
|
3
|
+
fonte: front/seedgrid-fe-components/packages/seedgrid-fe-components/src/digits
|
|
4
|
+
branch: main
|
|
5
|
+
commit: ad30fc11de
|
|
6
|
+
analisado-em: 2026-10-14
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# API — dígitos animados (`digits`)
|
|
10
|
+
|
|
11
|
+
Visão geral: [[SeedGrid/SeedGrid-components/digits/Visao-geral|Dígitos — visão geral]] · Exemplos: [[SeedGrid/SeedGrid-components/digits/Exemplos|Dígitos — exemplos]]
|
|
12
|
+
|
|
13
|
+
> **Como ler as tabelas.** Geradas a partir do tipo TypeScript real do 1º parâmetro de cada componente (TS checker, commit `ad30fc11de`) — lista completa das props próprias. **Padrão**: valor sem marca = inicializador na desestruturação do componente (Confirmado); `ᶠ` = fallback interno `??` no corpo do componente (Confirmado, expressão pode estar abreviada); `ᵇ` = padrão aplicado pelo componente base para o qual a prop é repassada; `ᵐ` = declarado só no `*.meta.ts`; `ˢ` = declarado só na tabela de props do showcase (`ᵐ`/`ˢ` = Não confirmado no código); `—` = sem padrão. **Descrição**: JSDoc > `*.meta.ts` > tabela do showcase (textos originais, sem acento quando assim na fonte); *(Inferência)* = escrita a partir da leitura do código. **Obrigatória** = prop não opcional no tipo.
|
|
14
|
+
|
|
15
|
+
Características comuns (Confirmado, leitura dos 8 arquivos):
|
|
16
|
+
- Todos recebem `value: string` obrigatório e animam/redesenham quando ele muda. Nenhum dispara eventos (não há props de callback).
|
|
17
|
+
- Nenhum repassa atributos DOM arbitrários (sem `...rest`); só `className` e, em alguns, `style`.
|
|
18
|
+
- Somente `SgDiscardDigit` aceita `ref` (handle imperativo). Os demais são componentes de função sem `forwardRef`.
|
|
19
|
+
- Nenhum consome contexto/provider; não usam i18n.
|
|
20
|
+
- Import: todos pelo barrel `@seedgrid/fe-components` (também reexportados pelos `index.ts` de cada subpasta, que não são entradas públicas do `package.json`).
|
|
21
|
+
|
|
22
|
+
## SgDiscardDigit
|
|
23
|
+
|
|
24
|
+
Pilha de folhas de papel: a folha do topo é "descartada" (voa para fora) ou "chega" (`incoming`) quando `value` muda; suporta paginação imperativa. Fonte: `src/digits/discard-digit/SgDiscardDigit.tsx` → `SgDiscardDigit`.
|
|
25
|
+
|
|
26
|
+
### Import
|
|
27
|
+
```tsx
|
|
28
|
+
import { SgDiscardDigit, type SgDiscardDigitProps, type SgDiscardDigitHandle } from "@seedgrid/fe-components";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Props
|
|
32
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
33
|
+
|---|---|---|---|---|
|
|
34
|
+
| `value` | `string` | — | Sim | Texto/valor exibido na folha do topo. |
|
|
35
|
+
| `color` | `string` | `"#0f172a"` | Não | Cor do texto principal. |
|
|
36
|
+
| `font` | `string` | — | Não | Fonte (font-family) usada no texto. |
|
|
37
|
+
| `backgroundColor` | `string` | `"#f8fafc"` | Não | Cor de fundo das folhas. |
|
|
38
|
+
| `fontSize` | `number` | `64` | Não | Tamanho da fonte em px (escala geral do bloco). |
|
|
39
|
+
| `fontWeight` | `number \| string` | `700` | Não | Peso da fonte. |
|
|
40
|
+
| `animateOnChange` | `boolean` | `true` | Não | Ativa animacao de descarte quando o valor muda. |
|
|
41
|
+
| `transitionMs` | `number` | `640` | Não | Duracao total da animacao em ms. |
|
|
42
|
+
| `stackDepth` | `number` | `20` | Não | Quantidade de folhas visiveis na pilha (min 2, max 30). Ignorado se totalNumberPages for definido. |
|
|
43
|
+
| `totalNumberPages` | `number` | — | Não | Total de paginas do monte. Quando definido, a pilha visual encolhe a cada increasePage(). |
|
|
44
|
+
| `changeAnimationMode` | `"discard" \| "incoming"` | `"discard"` | Não | Estrategia de animacao para mudancas por prop `value`. |
|
|
45
|
+
| `className` | `string` | — | Não | Classes CSS adicionais. |
|
|
46
|
+
| `style` | `React.CSSProperties` | — | Não | Estilo inline adicional. |
|
|
47
|
+
|
|
48
|
+
- Aceita `ref` (via `React.forwardRef`) e `key`.
|
|
49
|
+
|
|
50
|
+
### Eventos e callbacks
|
|
51
|
+
Nenhum. A mudança de `value` dispara a animação (se `animateOnChange`); com `changeAnimationMode="discard"` a folha atual voa com movimento aleatório (`createRandomMotion`), com `"incoming"` a nova folha entra sobre a pilha. Confirmado.
|
|
52
|
+
|
|
53
|
+
### Ref
|
|
54
|
+
`React.forwardRef<SgDiscardDigitHandle, SgDiscardDigitProps>` com `useImperativeHandle` (Confirmado):
|
|
55
|
+
|
|
56
|
+
| Método | Retorno | Comportamento |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `decreasePage()` | `void` | Página atual − 1 (mínimo 1). |
|
|
59
|
+
| `increasePage()` | `void` | Página atual + 1 (máximo `totalNumberPages`, se definido; sem limite caso contrário). |
|
|
60
|
+
| `page()` | `number` | Página atual (1-indexed). |
|
|
61
|
+
|
|
62
|
+
Profundidade visual da pilha: com `totalNumberPages` = `clamp(totalNumberPages − páginaAtual + 1, 1, 30)`; sem ele = `clamp(stackDepth, 2, 30)`. O handle **não** altera `value` — o exemplo do showcase atualiza `value` e chama o método em paralelo.
|
|
63
|
+
|
|
64
|
+
### Children, slots e composição
|
|
65
|
+
Não aceita `children`. Usado internamente por `SgClock` (`digitalStyle="discard"`) e `SgStringAnimator` (`stringAnimatorStyle="discard"`).
|
|
66
|
+
|
|
67
|
+
### Contexto, providers e hooks
|
|
68
|
+
Nenhum.
|
|
69
|
+
|
|
70
|
+
### Acessibilidade
|
|
71
|
+
Raiz com `role="img"` e `aria-label={value}`; camadas decorativas com `aria-hidden="true"`. Sem tratamento de `prefers-reduced-motion` encontrado. Confirmado.
|
|
72
|
+
|
|
73
|
+
### Tipos auxiliares exportados
|
|
74
|
+
`SgDiscardDigitHandle` (acima).
|
|
75
|
+
|
|
76
|
+
## SgFadeDigit
|
|
77
|
+
|
|
78
|
+
Card em que o caractere atual some (fade-out) e o novo aparece (fade-in). Fonte: `src/digits/fade-digit/SgFadeDigit.tsx` → `SgFadeDigit`.
|
|
79
|
+
|
|
80
|
+
### Import
|
|
81
|
+
```tsx
|
|
82
|
+
import { SgFadeDigit, type SgFadeDigitProps } from "@seedgrid/fe-components";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Props
|
|
86
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
87
|
+
|---|---|---|---|---|
|
|
88
|
+
| `value` | `string` | — | Sim | Character to display. When changed, the current digit fades out and the new one fades in. |
|
|
89
|
+
| `color` | `string` | `"#edebeb"` | Não | Text color of the digit. |
|
|
90
|
+
| `backgroundColor` | `string` | `"#333232"` | Não | Card background color. |
|
|
91
|
+
| `font` | `string` | — | Não | CSS font-family for the digit. |
|
|
92
|
+
| `fontSize` | `number` | `70` | Não | Font size in pixels — controls overall card scale. |
|
|
93
|
+
| `className` | `string` | — | Não | Additional CSS classes on the outer card wrapper. |
|
|
94
|
+
|
|
95
|
+
### Eventos e callbacks
|
|
96
|
+
Nenhum. Duração fixa do fade: constante interna `FADE_MS = 200` ms (não configurável). Confirmado.
|
|
97
|
+
|
|
98
|
+
### Ref
|
|
99
|
+
Não aceita ref.
|
|
100
|
+
|
|
101
|
+
### Children, slots e composição
|
|
102
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="fade"`) e `SgStringAnimator`.
|
|
103
|
+
|
|
104
|
+
### Contexto, providers e hooks
|
|
105
|
+
Nenhum.
|
|
106
|
+
|
|
107
|
+
### Acessibilidade
|
|
108
|
+
Raiz com `aria-label={displayValue}` (valor exibido no momento), sem `role`. Confirmado.
|
|
109
|
+
|
|
110
|
+
## SgFlipDigit
|
|
111
|
+
|
|
112
|
+
Card "flip" (estilo placar de aeroporto) implementado com a biblioteca `@pqina/flip` (MIT), carregada por `import()` dinâmico dentro de `useEffect` (seguro para SSR). O CSS da biblioteca é embutido e injetado uma vez em `<style id="pqina-flip-css">`. Fonte: `src/digits/flip-digit/SgFlipDigit.tsx` → `SgFlipDigit`.
|
|
113
|
+
|
|
114
|
+
### Import
|
|
115
|
+
```tsx
|
|
116
|
+
import { SgFlipDigit, type SgFlipDigitProps } from "@seedgrid/fe-components";
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Props
|
|
120
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
121
|
+
|---|---|---|---|---|
|
|
122
|
+
| `value` | `string` | — | Sim | The character to display (single char) |
|
|
123
|
+
| `fontSize` | `number` | `70` | Não | Font size in pixels — controls overall scale |
|
|
124
|
+
| `className` | `string` | — | Não | Additional CSS classes applied to the outer wrapper |
|
|
125
|
+
|
|
126
|
+
### Eventos e callbacks
|
|
127
|
+
Nenhum. Mudanças de `value` são aplicadas à instância `Tick` (`tickRef.current.value = value`).
|
|
128
|
+
|
|
129
|
+
### Ref
|
|
130
|
+
Não aceita ref.
|
|
131
|
+
|
|
132
|
+
### Children, slots e composição
|
|
133
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="flip"`) e `SgStringAnimator`.
|
|
134
|
+
|
|
135
|
+
### Contexto, providers e hooks
|
|
136
|
+
Nenhum.
|
|
137
|
+
|
|
138
|
+
### Acessibilidade
|
|
139
|
+
O wrapper interno criado para a biblioteca recebe `aria-hidden="true"`; o componente **não** expõe `aria-label` nem `role` com o valor — o dígito não é anunciado por leitores de tela. Confirmado (lacuna de acessibilidade).
|
|
140
|
+
|
|
141
|
+
## SgMatrixDigit
|
|
142
|
+
|
|
143
|
+
Texto desenhado em matriz de pontos 5×7 (estilo painel LED). Aceita string com vários caracteres. Fonte: `src/digits/matrix-digit/SgMatrixDigit.tsx` → `SgMatrixDigit`.
|
|
144
|
+
|
|
145
|
+
### Import
|
|
146
|
+
```tsx
|
|
147
|
+
import { SgMatrixDigit, type SgMatrixDigitProps } from "@seedgrid/fe-components";
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Props
|
|
151
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
152
|
+
|---|---|---|---|---|
|
|
153
|
+
| `value` | `string` | — (`?? ""` interno) | Sim | Text to render using matrix dots. Supports letters, numbers and common symbols. Convertido para maiúsculas; glifos: espaço, 0-9, A-Z, `- _ . : / ? !`; demais caracteres usam um glifo de fallback. |
|
|
154
|
+
| `color` | `string` | `"#22d3ee"` | Não | Color of active dots. |
|
|
155
|
+
| `backgroundColor` | `string` | `"#0b1220"` | Não | Background color of the matrix container. |
|
|
156
|
+
| `offColor` | `string` | `"rgba(148, 163, 184, 0.22)"` | Não | Color of inactive dots. |
|
|
157
|
+
| `dotSize` | `number` | `9` | Não | Dot size in pixels. |
|
|
158
|
+
| `gap` | `number` | `3` | Não | Gap between dots in pixels. |
|
|
159
|
+
| `charGap` | `number` | `7` | Não | Gap between characters in pixels. |
|
|
160
|
+
| `padding` | `number` | `8` | Não | Internal padding in pixels. |
|
|
161
|
+
| `rounded` | `number` | `10` | Não | Border radius of the matrix container in pixels. |
|
|
162
|
+
| `glow` | `boolean` | `true` | Não | Add a subtle glow around active dots. |
|
|
163
|
+
| `className` | `string` | — | Não | Additional CSS classes for the outer wrapper. |
|
|
164
|
+
| `style` | `React.CSSProperties` | — | Não | Additional CSS style for the outer wrapper. |
|
|
165
|
+
|
|
166
|
+
### Eventos e callbacks
|
|
167
|
+
Nenhum.
|
|
168
|
+
|
|
169
|
+
### Ref
|
|
170
|
+
Não aceita ref.
|
|
171
|
+
|
|
172
|
+
### Children, slots e composição
|
|
173
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="matrix"`) e `SgStringAnimator`.
|
|
174
|
+
|
|
175
|
+
### Contexto, providers e hooks
|
|
176
|
+
Nenhum.
|
|
177
|
+
|
|
178
|
+
### Acessibilidade
|
|
179
|
+
`role="img"` + `aria-label={value}`; pontos com `aria-hidden`. Confirmado.
|
|
180
|
+
|
|
181
|
+
## SgNeonDigit
|
|
182
|
+
|
|
183
|
+
Texto com brilho neon (`text-shadow`) e troca com fade-out/fade-in. Fonte: `src/digits/neon-digit/SgNeonDigit.tsx` → `SgNeonDigit`.
|
|
184
|
+
|
|
185
|
+
### Import
|
|
186
|
+
```tsx
|
|
187
|
+
import { SgNeonDigit, type SgNeonDigitProps } from "@seedgrid/fe-components";
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Props
|
|
191
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
192
|
+
|---|---|---|---|---|
|
|
193
|
+
| `value` | `string` | — | Sim | Text/character rendered with neon style. |
|
|
194
|
+
| `animateOnChange` | `boolean` | `true` | Não | Enables fade-out/fade-in animation when value changes. |
|
|
195
|
+
| `transitionMs` | `number` | `320` | Não | Total animation time in milliseconds when value changes. |
|
|
196
|
+
| `color` | `string` | `"#e2e8f0"` | Não | Main text color. |
|
|
197
|
+
| `backgroundColor` | `string` | `"#120f2b"` | Não | Background color of the component surface. |
|
|
198
|
+
| `shadowColor` | `string` | `?? color` ᶠ | Não | Glow/shadow color around the text. |
|
|
199
|
+
| `shadowStrength` | `number` | `1` | Não | Extra intensity factor for the glow effect. |
|
|
200
|
+
| `fontSize` | `number` | `46` | Não | Font size in pixels. |
|
|
201
|
+
| `fontWeight` | `number \| string` | `600` | Não | Font weight of the text. |
|
|
202
|
+
| `font` | `string` | `?? fontFamily` ᶠ | Não | Font family alias (same effect as fontFamily). |
|
|
203
|
+
| `letterSpacing` | `number` | `0` | Não | Letter spacing in pixels. |
|
|
204
|
+
| `padding` | `number` | `14` | Não | Internal padding in pixels. |
|
|
205
|
+
| `rounded` | `number` | `12` | Não | Border radius in pixels. |
|
|
206
|
+
| `fontFamily` | `string` | — | Não | Custom font family. |
|
|
207
|
+
| `className` | `string` | — | Não | Additional classes on container. |
|
|
208
|
+
| `style` | `React.CSSProperties` | — | Não | Additional style on container. |
|
|
209
|
+
|
|
210
|
+
`font` e `fontFamily` são aliases; `font` tem precedência (`font ?? fontFamily`). Na troca de valor, o texto é substituído na metade da duração (`max(40, round(transitionMs/2))` ms). Confirmado.
|
|
211
|
+
|
|
212
|
+
### Eventos e callbacks
|
|
213
|
+
Nenhum.
|
|
214
|
+
|
|
215
|
+
### Ref
|
|
216
|
+
Não aceita ref.
|
|
217
|
+
|
|
218
|
+
### Children, slots e composição
|
|
219
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="neon"`) e `SgStringAnimator`.
|
|
220
|
+
|
|
221
|
+
### Contexto, providers e hooks
|
|
222
|
+
Nenhum.
|
|
223
|
+
|
|
224
|
+
### Acessibilidade
|
|
225
|
+
`role="img"` + `aria-label={value}`. Confirmado.
|
|
226
|
+
|
|
227
|
+
## SgRoller3DDigit
|
|
228
|
+
|
|
229
|
+
Tambor vertical que rola até a posição de `value` dentro de `items` via `transform` CSS. Fonte: `src/digits/roller3d-digit/SgRoller3DDigit.tsx` → `SgRoller3DDigit`.
|
|
230
|
+
|
|
231
|
+
### Import
|
|
232
|
+
```tsx
|
|
233
|
+
import { SgRoller3DDigit, type SgRoller3DDigitProps } from "@seedgrid/fe-components";
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Props
|
|
237
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
238
|
+
|---|---|---|---|---|
|
|
239
|
+
| `value` | `string` | — | Sim | Current value to display — must be present in `items` (se ausente, o tambor fica na posição 0: `Math.max(0, items.indexOf(value))`). |
|
|
240
|
+
| `items` | `string[]` | `DEFAULT_ITEMS` = `["0",…,"9"]` | Não | Ordered list of all possible values this roller can show. The drum scrolls to the position of `value` in this list. |
|
|
241
|
+
| `fontSize` | `number` | `32` | Não | Font size in pixels — controls overall scale |
|
|
242
|
+
| `transitionMs` | `number` | `500` | Não | Transition duration in milliseconds |
|
|
243
|
+
| `className` | `string` | — | Não | Additional CSS classes on the outer wrapper |
|
|
244
|
+
|
|
245
|
+
### Eventos e callbacks
|
|
246
|
+
Nenhum.
|
|
247
|
+
|
|
248
|
+
### Ref
|
|
249
|
+
Não aceita ref.
|
|
250
|
+
|
|
251
|
+
### Children, slots e composição
|
|
252
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="roller3d"`) e `SgStringAnimator` (que passa `items = charset`).
|
|
253
|
+
|
|
254
|
+
### Contexto, providers e hooks
|
|
255
|
+
Nenhum.
|
|
256
|
+
|
|
257
|
+
### Acessibilidade
|
|
258
|
+
Nenhum `role`/`aria-*` encontrado no arquivo; todos os itens de `items` ficam no DOM. Confirmado (lacuna).
|
|
259
|
+
|
|
260
|
+
## SgSegmentDigit
|
|
261
|
+
|
|
262
|
+
Dígito em segmentos SVG compacto (grade 6×10), herdando a cor do texto (`currentColor`). Suporta `:` para relógios. Fonte: `src/digits/segment-digit/SgSegmentDigit.tsx` → `SgSegmentDigit`.
|
|
263
|
+
|
|
264
|
+
### Import
|
|
265
|
+
```tsx
|
|
266
|
+
import { SgSegmentDigit, type SgSegmentDigitProps } from "@seedgrid/fe-components";
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Props
|
|
270
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
271
|
+
|---|---|---|---|---|
|
|
272
|
+
| `value` | `string` | — (`?? " "` interno) | Sim | Character rendered by the component (first character is used). Glifos: 0-9, `-`, espaço e `:`; outros viram espaço. |
|
|
273
|
+
| `size` | `number` | `16` | Não | Display height in pixels. |
|
|
274
|
+
| `color` | `string` | — (`currentColor`, herda a cor de texto do tema) | Não | Color of active segments. |
|
|
275
|
+
| `className` | `string` | — | Não | Additional classes on outer wrapper. |
|
|
276
|
+
| `style` | `React.CSSProperties` | — | Não | Additional inline styles on outer wrapper. |
|
|
277
|
+
|
|
278
|
+
### Eventos e callbacks
|
|
279
|
+
Nenhum.
|
|
280
|
+
|
|
281
|
+
### Ref
|
|
282
|
+
Não aceita ref.
|
|
283
|
+
|
|
284
|
+
### Children, slots e composição
|
|
285
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="segment"`).
|
|
286
|
+
|
|
287
|
+
### Contexto, providers e hooks
|
|
288
|
+
Nenhum.
|
|
289
|
+
|
|
290
|
+
### Acessibilidade
|
|
291
|
+
`<svg role="img" aria-label={value}>`. Confirmado.
|
|
292
|
+
|
|
293
|
+
## SgSevenSegmentDigit
|
|
294
|
+
|
|
295
|
+
Display de 7 segmentos estilo LED, com paletas predefinidas, brilho e inclinação. Fonte: `src/digits/seven-segment-digit/SgSevenSegmentDigit.tsx` → `SgSevenSegmentDigit`.
|
|
296
|
+
|
|
297
|
+
### Import
|
|
298
|
+
```tsx
|
|
299
|
+
import { SgSevenSegmentDigit, type SgSevenSegmentDigitProps, type SgSevenSegmentDigitPalette } from "@seedgrid/fe-components";
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Props
|
|
303
|
+
| Prop | Tipo | Padrão | Obrigatória | Descrição |
|
|
304
|
+
|---|---|---|---|---|
|
|
305
|
+
| `value` | `string` | — | Sim | Character rendered by the component (first character is used). Convertido para maiúscula; glifos: espaço, `-`, `_`, 0-9, A-F, H, J, L, P, U, Y; outros viram espaço. |
|
|
306
|
+
| `palette` | `SgSevenSegmentDigitPalette` = `"red" \| "blue" \| "yellow" \| "green" \| "white"` | `"red"` | Não | Preset visual palette for active, inactive and background colors. |
|
|
307
|
+
| `color` | `string` | `?? paletteTokens.color` ᶠ | Não | Color of active segments. |
|
|
308
|
+
| `backgroundColor` | `string` | `?? paletteTokens.backgroundColor` ᶠ | Não | Background color of the component panel. |
|
|
309
|
+
| `offColor` | `string` | `?? paletteTokens.offColor` ᶠ | Não | Color of inactive segments. |
|
|
310
|
+
| `size` | `number` | `108` | Não | Component height in pixels. |
|
|
311
|
+
| `width` | `number` | `?? h * 0.62` ᶠ | Não | Component width in pixels. By default, derived from `size`. |
|
|
312
|
+
| `thickness` | `number` | `14` | Não | Segment thickness in pixels. |
|
|
313
|
+
| `padding` | `number` | `10` | Não | Internal panel padding in pixels. |
|
|
314
|
+
| `rounded` | `number` | `12` | Não | Border radius of the panel in pixels. |
|
|
315
|
+
| `skew` | `number` | `-8` | Não | Applies a subtle skew to mimic classic LED displays. |
|
|
316
|
+
| `glow` | `boolean` | `true` | Não | Enables glow effect on active segments. |
|
|
317
|
+
| `transitionMs` | `number` | `180` | Não | Segment transition duration in milliseconds. |
|
|
318
|
+
| `className` | `string` | — | Não | Additional classes on outer wrapper. |
|
|
319
|
+
| `style` | `React.CSSProperties` | — | Não | Additional inline styles on outer wrapper. |
|
|
320
|
+
|
|
321
|
+
`color`, `backgroundColor` e `offColor` sobrescrevem individualmente os tokens da `palette` (`color ?? paletteTokens.color` etc.). Confirmado.
|
|
322
|
+
|
|
323
|
+
### Eventos e callbacks
|
|
324
|
+
Nenhum.
|
|
325
|
+
|
|
326
|
+
### Ref
|
|
327
|
+
Não aceita ref.
|
|
328
|
+
|
|
329
|
+
### Children, slots e composição
|
|
330
|
+
Não aceita `children`. Usado por `SgClock` (`digitalStyle="sevenSegment"`).
|
|
331
|
+
|
|
332
|
+
### Contexto, providers e hooks
|
|
333
|
+
Nenhum.
|
|
334
|
+
|
|
335
|
+
### Acessibilidade
|
|
336
|
+
`role="img"` + `aria-label={value}`; segmentos com `aria-hidden`. Confirmado.
|
|
337
|
+
|
|
338
|
+
### Tipos auxiliares exportados
|
|
339
|
+
`SgSevenSegmentDigitPalette = "red" | "blue" | "yellow" | "green" | "white"`.
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
---
|
|
2
|
+
tags: [seedgrid, front, component, digits]
|
|
3
|
+
fonte: front/seedgrid-fe-components/apps/showcase/src/app/components/digits
|
|
4
|
+
branch: main
|
|
5
|
+
commit: ad30fc11de
|
|
6
|
+
analisado-em: 2026-10-14
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Exemplos — dígitos animados
|
|
10
|
+
|
|
11
|
+
Exemplos copiados 1:1 dos arquivos `samples/*.tsx.sample` do showcase (rotas `/components/digits/<slug>`). Todos foram verificados com type-check TypeScript (`strict`) contra `packages/seedgrid-fe-components/src/index.ts` no commit `ad30fc11de` — sem erros. As classes utilitárias (`flex`, `gap-4`…) são Tailwind do app de exemplo.
|
|
12
|
+
|
|
13
|
+
API: [[SeedGrid/SeedGrid-components/digits/API|API dos dígitos]] · Visão geral: [[SeedGrid/SeedGrid-components/digits/Visao-geral|Dígitos — visão geral]]
|
|
14
|
+
|
|
15
|
+
## SgDiscardDigit
|
|
16
|
+
|
|
17
|
+
### Pilha com profundidade variável
|
|
18
|
+
`stackDepth` controla quantas folhas aparecem (2–30).
|
|
19
|
+
|
|
20
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-discard-digit/samples/basico.tsx.sample`
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
"use client";
|
|
24
|
+
|
|
25
|
+
import React from "react";
|
|
26
|
+
import { SgButton, SgDiscardDigit } from "@seedgrid/fe-components";
|
|
27
|
+
|
|
28
|
+
export default function Example() {
|
|
29
|
+
const [stackDepth, setStackDepth] = React.useState(8);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex items-center gap-4">
|
|
33
|
+
<SgDiscardDigit value="7" color="#0f172a" font={'"Inter", "Segoe UI", sans-serif'} backgroundColor="#f8fafc" stackDepth={stackDepth} />
|
|
34
|
+
<div className="flex flex-col gap-2">
|
|
35
|
+
<SgButton size="sm" onClick={() => setStackDepth((prev) => Math.min(30, prev + 1))}>Next (+1 folha)</SgButton>
|
|
36
|
+
<SgButton size="sm" severity="secondary" onClick={() => setStackDepth((prev) => Math.max(2, prev - 1))}>Previous (-1 folha)</SgButton>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Paginação imperativa via `ref`
|
|
44
|
+
`totalNumberPages` + `SgDiscardDigitHandle.increasePage()/decreasePage()`; a pilha encolhe a cada página. Note que `value` é atualizado separadamente pelo estado do exemplo.
|
|
45
|
+
|
|
46
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-discard-digit/samples/paginacao-imperativa-ref.tsx.sample`
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
"use client";
|
|
50
|
+
|
|
51
|
+
import React from "react";
|
|
52
|
+
import { SgButton, SgDiscardDigit, type SgDiscardDigitHandle } from "@seedgrid/fe-components";
|
|
53
|
+
|
|
54
|
+
const TOTAL_PAGES = 10;
|
|
55
|
+
|
|
56
|
+
export default function Example() {
|
|
57
|
+
const ref = React.useRef<SgDiscardDigitHandle>(null);
|
|
58
|
+
const [page, setPage] = React.useState(1);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex flex-wrap items-end gap-8">
|
|
62
|
+
<SgDiscardDigit ref={ref} value={String(page)} totalNumberPages={TOTAL_PAGES} fontSize={64} />
|
|
63
|
+
<div className="space-y-3">
|
|
64
|
+
<p className="text-sm text-muted-foreground">Pagina <strong>{page}</strong> de {TOTAL_PAGES}</p>
|
|
65
|
+
<div className="flex gap-2">
|
|
66
|
+
<SgButton size="sm" disabled={page <= 1} onClick={() => { ref.current?.decreasePage(); setPage((prev) => Math.max(1, prev - 1)); }}>Previous</SgButton>
|
|
67
|
+
<SgButton size="sm" disabled={page >= TOTAL_PAGES} onClick={() => { ref.current?.increasePage(); setPage((prev) => Math.min(TOTAL_PAGES, prev + 1)); }}>Proxima</SgButton>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## SgFadeDigit
|
|
76
|
+
|
|
77
|
+
### Básico 0–9
|
|
78
|
+
|
|
79
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-fade-digit/samples/basico-0-9.tsx.sample`
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
"use client";
|
|
83
|
+
|
|
84
|
+
import React from "react";
|
|
85
|
+
import { SgButton, SgFadeDigit } from "@seedgrid/fe-components";
|
|
86
|
+
|
|
87
|
+
export default function Example() {
|
|
88
|
+
const [digit, setDigit] = React.useState("0");
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div className="flex items-center gap-4">
|
|
92
|
+
<SgFadeDigit value={digit} />
|
|
93
|
+
<div className="flex flex-col gap-2">
|
|
94
|
+
<SgButton size="sm" onClick={() => setDigit((prev) => String((Number(prev) + 1) % 10))}>
|
|
95
|
+
Next (+1)
|
|
96
|
+
</SgButton>
|
|
97
|
+
<SgButton size="sm" severity="secondary" onClick={() => setDigit((prev) => String((Number(prev) - 1 + 10) % 10))}>
|
|
98
|
+
Previous (-1)
|
|
99
|
+
</SgButton>
|
|
100
|
+
<SgButton size="sm" severity="info" onClick={() => setDigit(String(Math.floor(Math.random() * 10)))}>
|
|
101
|
+
Random
|
|
102
|
+
</SgButton>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## SgFlipDigit
|
|
110
|
+
|
|
111
|
+
### Básico
|
|
112
|
+
|
|
113
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-flip-digit/samples/basico.tsx.sample`
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import * as React from "react";
|
|
117
|
+
import { SgButton, SgFlipDigit } from "@seedgrid/fe-components";
|
|
118
|
+
|
|
119
|
+
export default function Example() {
|
|
120
|
+
const [digit, setDigit] = React.useState("0");
|
|
121
|
+
const nextDigit = () => setDigit((prev) => String((Number(prev) + 1) % 10));
|
|
122
|
+
const prevDigit = () => setDigit((prev) => String((Number(prev) - 1 + 10) % 10));
|
|
123
|
+
const randomDigit = () => setDigit(String(Math.floor(Math.random() * 10)));
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<div className="flex items-center gap-4">
|
|
127
|
+
<SgFlipDigit value={digit} />
|
|
128
|
+
<div className="flex flex-col gap-2">
|
|
129
|
+
<SgButton onClick={nextDigit} size="sm">Next (+1)</SgButton>
|
|
130
|
+
<SgButton onClick={prevDigit} size="sm" severity="secondary">Previous (-1)</SgButton>
|
|
131
|
+
<SgButton onClick={randomDigit} size="sm" severity="info">Random</SgButton>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## SgMatrixDigit
|
|
139
|
+
|
|
140
|
+
### Texto matricial
|
|
141
|
+
Vários caracteres por instância, com ajuste de `dotSize`, `gap` e `charGap`.
|
|
142
|
+
|
|
143
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-matrix-digit/samples/texto-matricial.tsx.sample`
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
"use client";
|
|
147
|
+
|
|
148
|
+
import React from "react";
|
|
149
|
+
import { SgButton, SgMatrixDigit } from "@seedgrid/fe-components";
|
|
150
|
+
|
|
151
|
+
const MESSAGES = ["SEEDGRID", "MATRIX 2026", "ABC-123"] as const;
|
|
152
|
+
|
|
153
|
+
export default function Example() {
|
|
154
|
+
const [index, setIndex] = React.useState(0);
|
|
155
|
+
const value = MESSAGES[index] ?? MESSAGES[0];
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<div className="space-y-3">
|
|
159
|
+
<SgMatrixDigit value={value} color="#a3e635" backgroundColor="#06090f" dotSize={8} gap={2} charGap={6} />
|
|
160
|
+
<SgButton size="sm" onClick={() => setIndex((prev) => (prev + 1) % MESSAGES.length)}>Change text</SgButton>
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## SgNeonDigit
|
|
167
|
+
|
|
168
|
+
### Básico com cor de brilho
|
|
169
|
+
|
|
170
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-neon-digit/samples/basico.tsx.sample`
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
"use client";
|
|
174
|
+
|
|
175
|
+
import React from "react";
|
|
176
|
+
import { SgButton, SgNeonDigit } from "@seedgrid/fe-components";
|
|
177
|
+
|
|
178
|
+
export default function Example() {
|
|
179
|
+
const [digit, setDigit] = React.useState("0");
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<div className="flex items-center gap-4">
|
|
183
|
+
<SgNeonDigit value={digit} color="#f8fafc" backgroundColor="#120f2b" shadowColor="#8b5cf6" />
|
|
184
|
+
<div className="flex flex-col gap-2">
|
|
185
|
+
<SgButton size="sm" onClick={() => setDigit((prev) => String((Number(prev) + 1) % 10))}>Next (+1)</SgButton>
|
|
186
|
+
<SgButton size="sm" severity="secondary" onClick={() => setDigit((prev) => String((Number(prev) - 1 + 10) % 10))}>Previous (-1)</SgButton>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## SgRoller3DDigit
|
|
194
|
+
|
|
195
|
+
### Básico 0–9 (usa `items` padrão)
|
|
196
|
+
|
|
197
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-roller3d-digit/samples/basico-0-9.tsx.sample`
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
"use client";
|
|
201
|
+
|
|
202
|
+
import React from "react";
|
|
203
|
+
import { SgButton, SgRoller3DDigit } from "@seedgrid/fe-components";
|
|
204
|
+
|
|
205
|
+
export default function Example() {
|
|
206
|
+
const [digit, setDigit] = React.useState("0");
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<div className="flex items-center gap-4">
|
|
210
|
+
<SgRoller3DDigit value={digit} fontSize={32} />
|
|
211
|
+
<div className="flex flex-col gap-2">
|
|
212
|
+
<SgButton size="sm" onClick={() => setDigit((prev) => String((Number(prev) + 1) % 10))}>Next (+1)</SgButton>
|
|
213
|
+
<SgButton size="sm" severity="secondary" onClick={() => setDigit((prev) => String((Number(prev) - 1 + 10) % 10))}>Previous (-1)</SgButton>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## SgSegmentDigit
|
|
221
|
+
|
|
222
|
+
### Composição estilo relógio (`HH:MM:SS`)
|
|
223
|
+
Um componente por caractere, incluindo `:`.
|
|
224
|
+
|
|
225
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-segment-digit/samples/composicao-estilo-relogio.tsx.sample`
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
"use client";
|
|
229
|
+
|
|
230
|
+
import React from "react";
|
|
231
|
+
import { SgButton, SgSegmentDigit } from "@seedgrid/fe-components";
|
|
232
|
+
|
|
233
|
+
function pad(value: number) {
|
|
234
|
+
return String(value).padStart(2, "0");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export default function Example() {
|
|
238
|
+
const [seconds, setSeconds] = React.useState(0);
|
|
239
|
+
const total = seconds % 86400;
|
|
240
|
+
const hh = pad(Math.floor(total / 3600));
|
|
241
|
+
const mm = pad(Math.floor((total % 3600) / 60));
|
|
242
|
+
const ss = pad(total % 60);
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<div className="space-y-4">
|
|
246
|
+
<div className="flex items-end gap-1">
|
|
247
|
+
{[...hh, ":", ...mm, ":", ...ss].map((value, index) => (
|
|
248
|
+
<SgSegmentDigit key={index} value={value} size={36} />
|
|
249
|
+
))}
|
|
250
|
+
</div>
|
|
251
|
+
<SgButton size="sm" onClick={() => setSeconds((prev) => prev + 1)}>+1 second</SgButton>
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## SgSevenSegmentDigit
|
|
258
|
+
|
|
259
|
+
### Básico com troca de paleta
|
|
260
|
+
|
|
261
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-seven-segment-digit/samples/basico-0-9.tsx.sample`
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
"use client";
|
|
265
|
+
|
|
266
|
+
import React from "react";
|
|
267
|
+
import { SgButton, SgSevenSegmentDigit } from "@seedgrid/fe-components";
|
|
268
|
+
|
|
269
|
+
export default function Example() {
|
|
270
|
+
const [digit, setDigit] = React.useState("0");
|
|
271
|
+
const [palette, setPalette] = React.useState<"red" | "blue" | "yellow" | "green" | "white">("red");
|
|
272
|
+
const palettes: typeof palette[] = ["red", "blue", "yellow", "green", "white"];
|
|
273
|
+
|
|
274
|
+
return (
|
|
275
|
+
<div className="flex items-center gap-4">
|
|
276
|
+
<SgSevenSegmentDigit value={digit} palette={palette} />
|
|
277
|
+
<div className="flex flex-col gap-2">
|
|
278
|
+
<SgButton size="sm" onClick={() => setDigit((prev) => String((Number(prev) + 1) % 10))}>Next (+1)</SgButton>
|
|
279
|
+
<SgButton size="sm" severity="secondary" onClick={() => setDigit((prev) => String((Number(prev) - 1 + 10) % 10))}>Previous (-1)</SgButton>
|
|
280
|
+
<div className="flex flex-wrap gap-2">
|
|
281
|
+
{palettes.map((item) => (
|
|
282
|
+
<SgButton key={item} size="sm" appearance={palette === item ? "solid" : "outline"} onClick={() => setPalette(item)}>{item}</SgButton>
|
|
283
|
+
))}
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Paletas lado a lado
|
|
292
|
+
|
|
293
|
+
Fonte: `front/seedgrid-fe-components/apps/showcase/src/app/components/digits/sg-seven-segment-digit/samples/temas-de-cor.tsx.sample`
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
"use client";
|
|
297
|
+
|
|
298
|
+
import { SgGrid, SgSevenSegmentDigit } from "@seedgrid/fe-components";
|
|
299
|
+
|
|
300
|
+
export default function Example() {
|
|
301
|
+
return (
|
|
302
|
+
<SgGrid columns={{ base: 1, md: 5 }} gap={12}>
|
|
303
|
+
<SgSevenSegmentDigit value="8" palette="red" />
|
|
304
|
+
<SgSevenSegmentDigit value="8" palette="blue" />
|
|
305
|
+
<SgSevenSegmentDigit value="8" palette="yellow" />
|
|
306
|
+
<SgSevenSegmentDigit value="8" palette="green" />
|
|
307
|
+
<SgSevenSegmentDigit value="8" palette="white" />
|
|
308
|
+
</SgGrid>
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
```
|