File

/home/workflows/workspace/libs/design-system/indicators/software-status-indicator/src/lib/software-status-indicator.component.ts

Description

Indicator to display software status in nav header

Metadata

Index

Properties
Inputs

Inputs

size
Type : SoftwareStatusSize
Default value : 'medium'

Size of indicator

status
Type : SoftwareStatus
Required :  true

Current status of app

Properties

Readonly tooltips
Type : Record<SoftwareStatus | string>
Default value : { Preview: 'Earliest development stage: Core features are under construction and evolving.', Alpha: 'Early testing stage: Features may change. Expect bugs and incomplete functionality.', Beta: 'Near-final stage: Most features are ready, fewer bugs, and more feedback is needed.', }

Tooltips corresponding to software status

import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { PlainTooltipDirective } from '@hra-ui/design-system/tooltips/plain-tooltip';
import { SoftwareStatusSizeDirective } from './software-status-indicator-size.directive';

/** Software status options */
export type SoftwareStatus = 'Preview' | 'Alpha' | 'Beta';

/** Software status size options */
export type SoftwareStatusSize = 'small' | 'medium' | 'large';

/**
 * Indicator to display software status in nav header
 */
@Component({
  selector: 'hra-software-status-indicator',
  imports: [CommonModule, PlainTooltipDirective, SoftwareStatusSizeDirective],
  templateUrl: './software-status-indicator.component.html',
  styleUrl: './software-status-indicator.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SoftwareStatusIndicatorComponent {
  /** Current status of app */
  readonly status = input.required<SoftwareStatus>();

  /** Size of indicator */
  readonly size = input<SoftwareStatusSize>('medium');

  /** Tooltips corresponding to software status */
  readonly tooltips: Record<SoftwareStatus, string> = {
    Preview: 'Earliest development stage: Core features are under construction and evolving.',
    Alpha: 'Early testing stage: Features may change. Expect bugs and incomplete functionality.',
    Beta: 'Near-final stage: Most features are ready, fewer bugs, and more feedback is needed.',
  };
}
<div
  class="app-description"
  hraPlainTooltipSize="small"
  [hraSoftwareStatusSize]="size()"
  [hraPlainTooltip]="tooltips[status()]"
>
  {{ status() }}
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""