Skip to content

feat(CnCard): add footer support, grid header layout, icon slot, and smart tooltip#18

Merged
SudoThijn merged 6 commits intodevelopmentfrom
feature/REGISTERS-482/changes-for-configuration-page
Mar 30, 2026
Merged

feat(CnCard): add footer support, grid header layout, icon slot, and smart tooltip#18
SudoThijn merged 6 commits intodevelopmentfrom
feature/REGISTERS-482/changes-for-configuration-page

Conversation

@SudoThijn
Copy link
Copy Markdown
Contributor

@SudoThijn SudoThijn commented Mar 18, 2026

Summary

Enhances CnCard and CnStatusBadge with features needed for the configuration page.

CnCard

  • Footer section — new footerLinks (array of { url, label }) and tags (strings or { text, variant } objects) props render a bordered footer area with links and CnStatusBadge tags; fully overridable via #footer slot
  • Grid header layout — replaced flexbox with a 2-column/2-row CSS grid so labels span the full header width beneath the title/actions row, preventing stacking issues with icons
  • Smart title tooltip — tooltip only activates when the title text is actually ellipsized (uses ResizeObserver); titleTooltip prop still overrides this behaviour
  • Header separator — restored border-bottom on the card header
  • Active state — removed background colour from active cards (border highlight only)
  • Description style — removed italic styling from card description text

CnStatusBadge

  • Added named #icon slot inside the default slot for rendering an icon alongside badge text
  • Added gap spacing in CSS between icon and label
  • Fixed solid default variant — changed background from --color-text-maxcontrast (too dark) to --color-background-dark with --color-main-text for correct contrast

Based off of: #17

…le tooltip

Refactors CnCard header from flexbox to CSS grid (1fr auto, 2 rows) so labels
always span full width beneath the title/actions row, preventing stacking issues.

Adds footer section to CnCard with footerLinks and tags props, rendered as
clickable anchor links and small CnStatusBadge tags separated by a border.

Implements a smart tooltip on the title: uses a ResizeObserver to detect when
text is ellipsized and only shows the tooltip in that case, avoiding redundant
tooltips on untruncated titles.

Moves labels slot outside the <h2> element to the header container level so
they participate correctly in the grid layout.

Removes the active background color from CnCard — the active border alone now
indicates the active state, avoiding incorrect CSS variable usage.

Adds icon slot support to CnStatusBadge and gap spacing between icon and label
text.

Fixes solid default badge to use --color-background-dark with main text color
instead of maxcontrast white, for better theme compatibility.
…eature/REGISTERS-482/changes-for-configuration-page
Base automatically changed from feature/REGISTERS-481/changes-for-entities-page to development March 30, 2026 09:52
@SudoThijn SudoThijn merged commit a638d95 into development Mar 30, 2026
1 check passed
@SudoThijn SudoThijn deleted the feature/REGISTERS-482/changes-for-configuration-page branch March 30, 2026 11:50
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