import { Component, inject } from '@angular/core'; import { AfricaniesIconComponent } from '@africanies/africanies-icons'; import { AfricaniesOverlayRef, ButtonComponent, OVERLAY_DATA, } from '@africanies/africanies-ui'; /** Payload for the playground sample modal. */ export interface DemoModalData { shipmentRef: string; } /** Payload for the playground sample drawer. */ export interface DemoDrawerData { facet: string; } /** * Sample modal body — mirrors how consuming apps inject data + close with a result. */ @Component({ selector: 'app-demo-modal-panel', standalone: true, imports: [ButtonComponent, AfricaniesIconComponent], host: { class: 'flex min-h-0 w-full flex-col overflow-hidden', }, template: `

Modal

Edit {{ data.shipmentRef }}

Hosted via ModalService.open — inject OVERLAY_DATA and AfricaniesOverlayRef to close with a result.

`, }) export class DemoModalPanel { protected readonly data = inject(OVERLAY_DATA); protected readonly ref = inject( AfricaniesOverlayRef<{ saved: boolean; note: string }>, ); protected note = 'Ready for customs clearance'; } /** * Sample drawer body — right-edge panel for filters / detail chrome. */ @Component({ selector: 'app-demo-drawer-panel', standalone: true, imports: [ButtonComponent, AfricaniesIconComponent], host: { class: 'flex h-full min-h-0 flex-col overflow-hidden', }, template: `

Drawer

Filters — {{ data.facet }}

Same OverlayOpener contract as modals; panel docks to the right.

`, }) export class DemoDrawerPanel { protected readonly data = inject(OVERLAY_DATA); protected readonly ref = inject(AfricaniesOverlayRef<{ applied: boolean }>); protected readonly options = [ 'In transit', 'Delivered', 'Pending', 'Exception', ] as const; }