@situaction/traq-ui-ste 1.2.26 → 1.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,13 @@
1
1
  import { FC, InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { Size } from '../interface';
3
3
 
4
+ type InputMode = "default" | "time";
5
+ type TimeFormat = "HH:mm" | "HH:mm:ss";
4
6
  export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
5
7
  /** How large should the input be? **/
6
8
  sizeStyle?: Size;
7
9
  /** input status style **/
8
- status?: 'default' | 'error' | 'secondary' | 'ghost';
10
+ status?: "default" | "error" | "secondary" | "ghost";
9
11
  /** Optional unit or additional label to display next to the input **/
10
12
  labelUnit?: string;
11
13
  /** If true, the input will have rounded corners **/
@@ -19,10 +21,25 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
19
21
  /** Disable the input field **/
20
22
  disabled?: boolean;
21
23
  fullWidth?: boolean;
24
+ /** Input rendering mode **/
25
+ mode?: InputMode;
26
+ /** Time format used when mode="time" **/
27
+ timeFormat?: TimeFormat;
28
+ /** Emits time as milliseconds since midnight (0..86_399_999). null if empty/invalid. */
29
+ onTimeChange?: (timeMs: number | null) => void;
22
30
  }
23
31
  /**
24
32
  * The Input component renders an input field with optional icons or labels on the left and right.
25
33
  * It supports different input sizes, status styles, and focus handling.
26
34
  * The input can also be disabled and have rounded corners.
35
+ *
36
+ * When mode="time", it behaves like a segmented time editor:
37
+ * - Empty shows "--:--" / "--:--:--" and DOES NOT auto-fill "00:00" on focus/hover/click
38
+ * - Click selects HH / mm / ss
39
+ * - ArrowLeft/Right switches segment
40
+ * - ArrowUp/Down increments/decrements current segment
41
+ * - Digits edit current segment (2-digit buffer) then move next
42
+ * - onTimeChange emits ms since midnight, or null if empty/invalid
27
43
  */
28
44
  export declare const Input: FC<InputProps>;
45
+ export {};