Skip to content

feat: add Banner component - #1251

Merged
maarante-ux merged 17 commits into
masterfrom
feat/ocean-banner-component
Jun 29, 2026
Merged

feat: add Banner component#1251
maarante-ux merged 17 commits into
masterfrom
feat/ocean-banner-component

Conversation

@maarante-ux

Copy link
Copy Markdown
Collaborator

Descrição

Implementa o componente Banner no Ocean Design System Web, conforme especificação do PRD #1247 e Jira MR-494.

Mudanças

  • Novo componente Banner em packages/ocean-react
  • Estilos BEM em packages/ocean-core
  • Stories no Storybook com todas as variantes
  • Testes unitários com cobertura de todos os comportamentos
  • Documentação em packages/ocean-docs

Variantes implementadas

  • Size: large (imagem no topo), small (imagem à direita)
  • Type: default, warning, negative, emphasys
  • Props opcionais: description, image, buttons (array, máx 2), backgroundColor

Jira

MR-494

maarante-ux and others added 17 commits June 9, 2026 17:21
Implements the Banner component in Ocean Design System Web, with size (large/small) and type (default/warning/negative/emphasys) variants, optional image, description, and buttons (max 2).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace buttons[] with primaryAction/secondaryAction explicit props (D1/D2)
- Derive button variant from type (default→primary/tertiary, warning→primaryWarning/tertiaryWarning, negative→primaryCritical/tertiaryCritical, emphasys→secondary/inverse)
- Remove backgroundColor prop (D3)
- Default size to 'large' (D6)
- Use Typography heading4/description instead of raw divs (D12)
- Fix border-radius token: $border-radius-md → $border-radius-sm (D12)
- Fix image width in small layout: 25% → 82px fixed (D11)
- Fix spacing tokens: gap content→actions uses $spacing-stack-sm (large) / $spacing-stack-xxs-extra (small); title↔description margin uses $spacing-stack-xxxs (D12)
- Fix emphasys description color: $color-interface-light-pure → $color-interface-light-up (D12)
- Update tests and stories to match new API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…update stories

- Emphasys secondary action: use tertiary variant with $color-interface-light-pure override instead of nonexistent inverse style
- Unify text-to-button spacing to 12px ($spacing-stack-xxs-extra) for both sizes
- Add WithPrimaryAndSecondaryActions and WithPrimaryActionOnly story sections covering all 4 types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace buttons[]/ButtonProps with primaryAction/secondaryAction/ActionProps
- Remove backgroundColor prop reference
- Mark size as optional with default 'large'
- Fix description color tokens in types table (dark-down, not dark-deep)
- Update button variant table: emphasys uses secondary/tertiary (not inverse)
- Add button-variants-by-type table
- Update story embed IDs to new story names
- Update live code examples to use new props

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
heading4 herdava extrabold (800) e line-height loose (132%) via mixin global.
Sobrescreve no escopo do banner para bold (700) e medium (124%) conforme Figma.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
description herdava regular (400) via mixin texts. Sobrescreve no escopo
do banner com fontWeightMedium (600/SemiBold) conforme Figma.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… small

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…manho de tela

Remove flex-wrap e o override de largura responsivo que faziam a imagem
quebrar para baixo em telas menores.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…o componente

Substitui seletores de classe customizada (ods-banner__title/description)
pelas classes originais do Typography (ods-typography__heading4/description)
para que os estilos sejam efetivamente aplicados, mantendo o escopo no .ods-banner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Usa discriminated union: BannerLargeProps (image: string) | BannerSmallProps (image?: string).
TypeScript impede o uso de large sem imagem em tempo de compilação.
Atualiza testes, stories e documentação.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Corrige também o seletor que estava incorreto (buscava filho em vez de
mesmo elemento). Usa .ods-typography__description dentro de &--emphasys.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@maarante-ux
maarante-ux marked this pull request as ready for review June 22, 2026 15:30
@maarante-ux
maarante-ux merged commit a4dfe36 into master Jun 29, 2026
10 of 12 checks passed
@maarante-ux
maarante-ux deleted the feat/ocean-banner-component branch June 29, 2026 12:47
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants