import { Component, signal } from '@angular/core'; import { AfricaniesIconComponent } from '@africanies/africanies-icons'; import { ButtonComponent, type ButtonSize, type ButtonVariant, CopyButtonComponent, } from '@africanies/africanies-ui'; import { DemoSectionComponent } from '../shared/demo-section.component'; import { PageHeaderComponent } from '../shared/page-header.component'; import { VariantLabelComponent } from '../shared/variant-label.component'; import { BUTTON_CONTEXT, BUTTON_COPY, BUTTON_DISABLED, BUTTON_ICONS, BUTTON_LINKS, BUTTON_LOADING, BUTTON_MATRIX, BUTTON_SIZES, BUTTON_VARIANTS, } from '../snippets'; /** * */ @Component({ selector: 'app-button-page', standalone: true, imports: [ ButtonComponent, CopyButtonComponent, AfricaniesIconComponent, PageHeaderComponent, DemoSectionComponent, VariantLabelComponent, ], template: `
@for (v of variants; track v) { }
@for (s of sizes; track s) { }
@for (s of sizes; track s) { } @for (v of variants; track v) { @for (s of sizes; track s) { } }
Variant{{ s }}
{{ v }}
{{ copyReference }}

Shipment SFN-1042

Draft · Lagos → London

`, }) export class ButtonPage { protected readonly variants: ButtonVariant[] = [ 'primary', 'secondary', 'flat', 'ghost', 'ghost-primary', 'ghost-danger', 'underline', 'danger', ]; protected readonly sizes: ButtonSize[] = ['sm', 'md', 'lg']; protected readonly labels: Record = { primary: 'Save shipment', secondary: 'Save draft', flat: 'Filters', ghost: 'Cancel', 'ghost-primary': 'Add row', 'ghost-danger': 'Remove', underline: 'Learn more', danger: 'Delete', }; protected readonly variantsCode = BUTTON_VARIANTS; protected readonly sizesCode = BUTTON_SIZES; protected readonly matrixCode = BUTTON_MATRIX; protected readonly iconsCode = BUTTON_ICONS; protected readonly linksCode = BUTTON_LINKS; protected readonly disabledCode = BUTTON_DISABLED; protected readonly loadingCode = BUTTON_LOADING; protected readonly contextCode = BUTTON_CONTEXT; protected readonly copyCode = BUTTON_COPY; protected readonly copyReference = 'SFN-1042'; protected readonly copySnippet = ''; protected readonly saving = signal(false); protected save(): void { this.saving.set(true); window.setTimeout(() => this.saving.set(false), 1600); } }