import { type CSSProperties } from 'react'; import type { MaskingProps } from '@dynatrace/strato-components/core'; import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units'; import type { Threshold } from '../../../core/types/threshold-types.js'; import type { SingleValueAlignment, SingleValueBaseProps, SingleValueUnit } from '../../core/components/single-value-renderer/types/single-value-base-props.js'; import type { SparklineVariant } from '../../core/components/sparkline-display/types/sparkline-props.js'; import type { SparklineThresholdProps } from '../../core/components/sparkline-display/types/sparkline-thresholds-props.js'; import { SparklineXAxisProps } from '../../core/components/sparkline-display/types/sparkline-x-axis-props.js'; import type { SparklineYAxisProps } from '../../core/components/sparkline-display/types/sparkline-y-axis-props.js'; import type { Formatter } from '../../core/types/formatter.js'; import { SeriesCurve } from '../../core/types/timeseries.js'; /** * Props for SingleValue * @public */ export interface SingleValueProps extends SingleValueBaseProps, MaskingProps { /** Show the loading indicator when truly. * @defaultValue false */ loading?: boolean; /** Class names to be attached to the outer container. */ className?: string; /** Inline styles that will override the outer container. */ style?: CSSProperties; } /** * Configuration for SingleValue * @public */ export interface SingleValueSparklineConfig { /** Sparkline color **/ color?: string; /** Sparkline variant (line, area) **/ variant?: SparklineVariant; /** Thresholds props for the sparkline */ thresholds?: SparklineThresholdProps[]; /** X-axis props for the sparkline */ xAxis?: SparklineXAxisProps; /** Y-axis props for the sparkline */ yAxis?: SparklineYAxisProps; /** Whether Sparkline shows X Axis ticks or not **/ showTicks?: boolean; /** Whether Sparkline shows min/max values or not */ showContextValues?: boolean; /** Gap policy */ gapPolicy?: 'connect' | 'gap'; /** Sparkline curve type */ curve?: SeriesCurve; } /** * @public */ export interface SingleValueConfigProperties { /** Optional label text to show beneath the value. */ label?: string; /** State of the value. This affects text and prefix icon color. * @defaultValue 'default' */ color?: string; /** Optional unit to show in the right of the value */ unit?: SingleValueUnit; /** If specified, value will be formatted with given formatter options. */ formatter?: Formatter | FormatOptions; /** Threshold configurations defining conditions to match a given value. */ thresholds?: Threshold[]; /** Sparkline config properties */ sparkline?: SingleValueSparklineConfig; /** Horizontal alignment of icon, value and unit. * @defaultValue 'start' */ alignment?: SingleValueAlignment; }