import { useUniqueId } from "@charcuterie/logic" import type { ControlSize } from "@charcuterie/tokens" import type { KeyboardEvent as ReactKeyboardEvent, ReactNode, } from "react" import { useState } from "react" import { CONTROL_SIZE_CLASS } from "../controlStyles.ts" import { DISABLED_CLASS, FOCUS_RING_CLASS, } from "../intentStyles.ts" import type { SlotProps } from "../slotProps.ts" import { mergeSlotProps } from "../slotProps.ts" import { toClassName } from "../toClassName.ts" import type { TimecodeRange } from "./timecode.ts" import { clampTimecode, formatTimecode, parseTimecodeInput, } from "./timecode.ts" export type TimecodeInputProps = SlotProps & { className?: string /** * How long the media is. It is the default `maxValueMs`, so a * consumer that knows the file's length gets the clamp without * stating a bound twice. */ durationMs?: number isDisabled?: boolean /** * Section mode — a start and an end. A **mode, not a sibling * component**, following `DatePicker`'s `isRange` and `Combobox`'s * `isMultiple`. */ isRange?: boolean /** * Required. In section mode it names **both** inputs, as * "