Skip to content

[WEB-8150] feat(banner): dedicated dismiss slot, per-placement title weight, and icon-sizing fixes#226

Open
codingwolf-at wants to merge 6 commits into
mainfrom
fix/banner-design-docs
Open

[WEB-8150] feat(banner): dedicated dismiss slot, per-placement title weight, and icon-sizing fixes#226
codingwolf-at wants to merge 6 commits into
mainfrom
fix/banner-design-docs

Conversation

@codingwolf-at

@codingwolf-at codingwolf-at commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Finalizes the Banner component for the design system. Adds a first-class dismiss
control, makes the title's weight placement-aware, corrects the leading-icon sizing to
match Figma, and simplifies/expands the Storybook coverage.

What changed

Component API (components/banner)

  • New onDismiss?: () => void prop. Renders the dedicated "Close" control Figma models
    as its own always-last anatomy node — a ghost, icon-only IconButton (magnitude="sm",
    aria-label="Dismiss") fixed at the trailing edge, after any actions. Consumers own
    visibility; the handler fires on click, the banner does not self-hide.
  • actions is now CTA-only. Docs clarify the Figma cap of three CTAs
    (primary/secondary/tertiary) and note that the non-wrapping actions group assumes a wide
    viewport (see Known limitations).
  • Simplified icon rendering. Resolve the icon once (undefined → tone default,
    null → hidden, node → custom) so a single BannerIcon wrapper renders it — no nested
    ternary/duplicated wrapper.

Elements & tokens (elements/banner)

  • BannerTitle gains a placement prop (+ BannerTitleVariantProps): title weight is
    now per-placement (page medium / inline regular) via its own composite text token instead
    of inheriting from the body column.
  • Leading-icon sizing corrected: page icon is 16×16 with 2px y-padding (hugs to 16×20
    per Figma), replacing the previous 20px node size.
  • bannerDescriptionVariants documented as an intentional empty cva (no Figma design
    uses a description yet; it inherits body styling and stays as a named part for future use).

Stories

  • Dismiss stories (Dismissible, WithActions, DismissibleInteraction) migrated to
    onDismiss; DismissibleInteraction play test asserts the handler fires.
  • Tones now shows both inline and page placements (their neutral surfaces differ).
  • Layout cleanup: shared w-180 column decorator hoisted to meta, per-story wrappers
    reduced to fragments, gap unified.
  • Elements Anatomy dismiss aligned to magnitude="sm".

Testing

  • vp check — clean (format, lint, types).
  • Banner story tests — 11/11 pass (both tiers).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Screenshot 2026-07-15 at 5 03 09 PM

Figma URL

- Modified the `BannerTitle` component to accept a `placement` prop, allowing for dynamic styling based on its position within the banner.
- Adjusted related stories to utilize the new `placement` prop, ensuring consistent rendering across different banner configurations.
- Changed the `magnitude` prop of `IconButton` in banner stories from "md" to "sm" for a more compact appearance.
- Enhanced the `bannerTitleVariants` to define styles based on the `placement`, improving visual consistency.
@github-actions

Copy link
Copy Markdown

📚 Storybook preview: https://pr-226-propel-storybook.vamsi-906.workers.dev

- Added a decorator to the Banner stories to standardize the layout with consistent spacing.
- Replaced div wrappers with fragments in multiple story render functions to simplify the structure.
- Ensured that the visual presentation of the Banner component remains consistent across different story variations.
…ability

- Introduced an `onDismiss` prop to the Banner component, allowing for a dedicated dismiss control instead of appending a dismiss button to actions.
- Updated stories to utilize the new `onDismiss` functionality, enhancing the clarity of the dismiss action.
- Adjusted documentation to reflect the changes in dismiss control structure, ensuring consistency with Figma design specifications.
…iations

- Updated the `Tones` story to display banner tones side by side for both `inline` and `page` placements, improving visual clarity.
- Enhanced documentation to clarify the layout differences between the two placements, ensuring better understanding of component behavior.
- Adjusted the `BannerProps` documentation to include layout considerations for the actions group, emphasizing the importance of viewport width in design.
…umentation

- Refactored the Banner component to streamline icon rendering logic, allowing for a single `BannerIcon` wrapper to handle default and custom icons.
- Updated the `IconButton` in stories to use a smaller magnitude for a more compact appearance.
- Enhanced comments in `variants.ts` to clarify the purpose and styling of the banner's description block, ensuring better alignment with potential design needs.
@codingwolf-at codingwolf-at changed the title refactor(banner): update BannerTitle component to accept placement prop [WIP] [WEB-8150] feat(banner): dedicated dismiss slot, per-placement title weight, and icon-sizing fixes Jul 13, 2026
@makeplane

makeplane Bot commented Jul 13, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

placement: {
page: "[--node-size:1.25rem]",
// Figma: 16×16 icon, 2px top/bottom padding on the slot (hugs to 16×20).
page: "py-0.5 [--node-size:1rem]",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Figma page banner uses a 20px leading icon (inline is 16px). This makes the page glyph 16px with vertical padding, so it will render undersized—can we retain --node-size: 1.25rem for page OR Can we add a variant if there’s a use case for a 16x16 size ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

<IconButton
prominence="ghost"
tone="neutral"
magnitude="sm"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figma uses a 24px/16px dismiss control for page and 20px/14px for inline. Hardcoding sm makes the page control undersized—could the magnitude derive from placement?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

… placement

- Added an `onDismiss` prop to the Banner component for improved dismiss control in stories.
- Adjusted the `magnitude` of the `IconButton` based on the placement prop, enhancing visual consistency.
- Updated comments in `variants.ts` to clarify icon sizing based on placement, aligning with design specifications.
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.

2 participants