import { Component, input } from '@angular/core'; import { HeadingComponent } from '@shared/ui/heading/heading.component'; /** Molecule: a content card. Standardises the repeated card surface (white, subtle border, rounded, padded) so pages compose cards instead of hand-rolling a hand-rolled card surface. Optional heading; the rest is projected. Local class is .app-card (NOT Bootstrap's .card, whose padding-on-body layout differs). */ @Component({ selector: 'app-card', imports: [HeadingComponent], styles: [ ` :host { display: block; block-size: 100%; } .app-card { background: var(--rhc-color-wit); border: var(--rhc-border-width-sm) solid var(--rhc-color-border-subtle); border-radius: var(--rhc-border-radius-md); padding: var(--rhc-space-max-xl); block-size: 100%; box-sizing: border-box; } .app-card > * + * { margin-block-start: var(--rhc-space-max-md); } `, ], template: `
@if (heading()) { {{ heading() }} }
`, }) export class CardComponent { heading = input(); level = input<1 | 2 | 3 | 4 | 5>(3); }