GitHub

Statusable

Statusable enforces consistent use of status across components.

Directives

DaffStatusableDirective

import { DaffStatusableDirective } from '@daffodil/design'

Enforces consistent use of DaffStatus on a component by applying status-specific CSS classes and validating the status in dev mode.

@Directive()
class DaffStatusableDirective implements DaffStatusable, OnChanges, OnInit {
  defaultStatus: DaffStatus

  @Input() status: DaffStatus
}

Inputs

status
DaffStatus
Default –
Description

The status of the component.

Properties

defaultStatus
DaffStatus
Default –
Description

The default status used when no status is set.


Types

DaffStatusable

import { DaffStatusable } from '@daffodil/design'

The DaffStatusable interface defines a component that can have a status. This status determines the styling or behavior of the component.

interface DaffStatusable {
  status: DaffStatus
}

Properties

status
DaffStatus

The status of the component.


DaffStatus

import { DaffStatus } from '@daffodil/design'

The DaffStatus type defines the possible status values that a component can have.

  • 'info': Indicates an informational status.
  • 'warn': Indicates a warning status.
  • 'critical': Indicates a critical or error status.
  • 'success': Indicates a success status.
type DaffStatus = 'info' | 'warn' | 'critical' | 'success'

DaffStatusEnum

import { DaffStatusEnum } from '@daffodil/design'

The DaffStatusEnum enumerates the possible status values for a component.

enum DaffStatusEnum {
  Info = DaffStatusEnum.Info,
  Warn = DaffStatusEnum.Warn,
  Critical = DaffStatusEnum.Critical,
  Success = DaffStatusEnum.Success,
}