/**
 * `<number-format-ui>` — Display a numeric value with locale-aware formatting — currency,
percentage, compact (1.2K / 3.4M), unit, or plain decimal. Wraps
`Intl.NumberFormat`. Distinct from `<input-ui type="number">`
(an INPUT primitive); this is a DISPLAY primitive — read-only, no
form participation, no keyboard handling. Pair with `<stat-ui>` for
KPI surfaces or use standalone inline within prose.

 *
 * @see https://ui-kit.exe.xyz/site/components/number-format
 *
 * Type declarations generated by scripts/build/dts-codegen.mjs from
 * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
 * run `npm run build:components`, then `npm run codegen:dts` to
 * regenerate; or hand-author this file fully if rich event types are
 * needed beyond what the yaml `events:` block can express.
 */

import { UIElement } from '../../core/element.js';

export class UINumberFormat extends UIElement {
  /** When [notation="compact"], controls the compact-form length.
`short` = "1.2M" (default); `long` = "1.2 million".
 */
  compactDisplay: 'short' | 'long';
  /** ISO 4217 currency code (e.g. "USD", "EUR", "JPY"). Required when
[number-style="currency"]; ignored otherwise.
 */
  currency: string;
  /** BCP-47 locale tag for the formatter. Empty defaults to the
document locale (`<html lang>`) then to browser default.
 */
  locale: string;
  /** Maximum fractional digits (0–20). Default `2` for decimal/
currency/percent, `1` for compact notation.
 */
  maximumFractionDigits: number;
  /** Minimum fractional digits (0–20). Padded with trailing zeros.
Useful for currency display to force ".00" suffix.
 */
  minimumFractionDigits: number;
  /** `Intl.NumberFormat` `notation` option. `standard` is the
thousands-grouped form (1,234,567); `compact` is the abbreviated
form (1.2M); `scientific` and `engineering` are the exponent
forms. Defaults to `standard`.
 */
  notation: 'standard' | 'compact' | 'scientific' | 'engineering';
  /** `Intl.NumberFormat` `style` option. `decimal` (default) renders a
plain number with locale-aware grouping. `currency` requires
[currency] to be set. `percent` formats 0–1 as 0%–100%. `unit`
requires [unit] to be set (e.g. "kilobyte", "celsius").
 */
  numberStyle: 'decimal' | 'currency' | 'percent' | 'unit';
  /** `Intl.NumberFormat` `signDisplay` option. `auto` (default) shows
"−" for negatives only; `always` shows "+" / "−"; `exceptZero`
shows sign for non-zero only; `never` hides signs.
 */
  signDisplay: 'auto' | 'always' | 'exceptZero' | 'never';
  /** `Intl.NumberFormat` unit identifier (e.g. "kilometer-per-hour",
"celsius", "byte"). Required when [number-style="unit"]; ignored
otherwise. See MDN's NumberFormat docs for the valid set.
 */
  unit: string;
  /** The numeric value to format. Empty string or non-numeric value
renders nothing.
 */
  value: number;
}
