@uniai-fe/uds-primitives 0.6.14 → 0.7.0

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.
@@ -0,0 +1,265 @@
1
+ import type { PopoverProps, ScrollAreaProps } from "@mantine/core";
2
+ import type {
3
+ TimePickerAmPmLabels,
4
+ TimePickerFormat,
5
+ TimePickerPasteSplit,
6
+ TimePickerPresets,
7
+ } from "@mantine/dates";
8
+ import type { ComponentPropsWithoutRef, FocusEvent, ReactNode } from "react";
9
+ import type { UseFormRegisterReturn } from "react-hook-form";
10
+ import type { FormFieldWidth } from "../../form/types/props";
11
+ import type { InputPriority, InputSize, InputState } from "./foundation";
12
+
13
+ /**
14
+ * Input Time icon position.
15
+ */
16
+ export type InputTimeIconPosition = "left" | "right";
17
+
18
+ /**
19
+ * Input TimePicker hidden input props.
20
+ */
21
+ export type InputTimeHiddenInputProps = Omit<
22
+ ComponentPropsWithoutRef<"input">,
23
+ "type" | "value" | "defaultValue" | "name"
24
+ >;
25
+
26
+ /**
27
+ * Input TimePicker props.
28
+ * @property {string} [value] 제어형 시간 값
29
+ * @property {string} [defaultValue] 비제어 초기 시간 값
30
+ * @property {(value:string)=>void} [onChange] 값 변경 핸들러
31
+ * @property {(value:string)=>void} [onValueChange] 값 변경 별칭
32
+ * @property {string} [name] form name
33
+ * @property {string} [form] form id
34
+ * @property {UseFormRegisterReturn} [register] react-hook-form register 결과
35
+ * @property {InputPriority} [priority] input priority
36
+ * @property {InputSize} [size] input size
37
+ * @property {InputState} [state] input state
38
+ * @property {boolean} [block] width 100% 여부
39
+ * @property {"full" | "fit" | "fill" | "auto" | number | string} [width] width preset 옵션
40
+ * @property {string} [className] root className
41
+ * @property {boolean} [disabled] disabled 여부
42
+ * @property {boolean} [readOnly] readOnly 여부
43
+ * @property {boolean} [required] required 여부
44
+ * @property {string} [id] root id
45
+ * @property {"12h" | "24h"} [format] 표시/입력 시간 포맷
46
+ * @property {boolean} [withSeconds] seconds 입력 노출 여부
47
+ * @property {boolean} [withDropdown] dropdown 노출 여부
48
+ * @property {boolean} [clearable] clear 버튼 노출 여부
49
+ * @property {string} [min] 최소 시간 값
50
+ * @property {string} [max] 최대 시간 값
51
+ * @property {number} [hoursStep] hour step
52
+ * @property {number} [minutesStep] minute step
53
+ * @property {number} [secondsStep] second step
54
+ * @property {ReactNode} [icon] clock icon override
55
+ * @property {"left" | "right"} [iconPosition] clock icon 위치
56
+ * @property {string} [iconLabel] clock icon 접근성 라벨
57
+ * @property {string} [clearButtonLabel] clear 버튼 접근성 라벨
58
+ * @property {PopoverProps} [popoverProps] Mantine Popover 옵션
59
+ * @property {InputTimeHiddenInputProps} [hiddenInputProps] hidden input 옵션
60
+ * @property {string} [hoursInputLabel] hour input aria-label
61
+ * @property {string} [minutesInputLabel] minute input aria-label
62
+ * @property {string} [secondsInputLabel] second input aria-label
63
+ * @property {string} [amPmInputLabel] am/pm input aria-label
64
+ * @property {TimePickerAmPmLabels} [amPmLabels] am/pm 라벨
65
+ * @property {string} [hoursPlaceholder] hour placeholder
66
+ * @property {string} [minutesPlaceholder] minute placeholder
67
+ * @property {string} [secondsPlaceholder] second placeholder
68
+ * @property {TimePickerPasteSplit} [pasteSplit] paste parser
69
+ * @property {TimePickerPresets} [presets] dropdown preset
70
+ * @property {number} [maxDropdownContentHeight] dropdown 최대 높이
71
+ * @property {ScrollAreaProps} [scrollAreaProps] dropdown scroll area 옵션
72
+ * @property {boolean} [reverseTimeControlsList] dropdown control 역순 여부
73
+ * @property {(event:FocusEvent<HTMLInputElement>)=>void} [onFocus] focus 핸들러
74
+ * @property {(event:FocusEvent<HTMLDivElement>)=>void} [onBlur] blur 핸들러
75
+ */
76
+ export interface InputTimePickerProps {
77
+ /**
78
+ * 제어형 시간 값
79
+ */
80
+ value?: string;
81
+ /**
82
+ * 비제어 초기 시간 값
83
+ */
84
+ defaultValue?: string;
85
+ /**
86
+ * 값 변경 핸들러
87
+ */
88
+ onChange?: (value: string) => void;
89
+ /**
90
+ * 값 변경 별칭
91
+ */
92
+ onValueChange?: (value: string) => void;
93
+ /**
94
+ * form name
95
+ */
96
+ name?: string;
97
+ /**
98
+ * form id
99
+ */
100
+ form?: string;
101
+ /**
102
+ * react-hook-form register 결과
103
+ */
104
+ register?: UseFormRegisterReturn;
105
+ /**
106
+ * input priority
107
+ */
108
+ priority?: InputPriority;
109
+ /**
110
+ * input size
111
+ */
112
+ size?: InputSize;
113
+ /**
114
+ * input state
115
+ */
116
+ state?: InputState;
117
+ /**
118
+ * width 100% 여부
119
+ */
120
+ block?: boolean;
121
+ /**
122
+ * width preset 옵션
123
+ */
124
+ width?: FormFieldWidth;
125
+ /**
126
+ * root className
127
+ */
128
+ className?: string;
129
+ /**
130
+ * disabled 여부
131
+ */
132
+ disabled?: boolean;
133
+ /**
134
+ * readOnly 여부
135
+ */
136
+ readOnly?: boolean;
137
+ /**
138
+ * required 여부
139
+ */
140
+ required?: boolean;
141
+ /**
142
+ * root id
143
+ */
144
+ id?: string;
145
+ /**
146
+ * 표시/입력 시간 포맷
147
+ */
148
+ format?: TimePickerFormat;
149
+ /**
150
+ * seconds 입력 노출 여부
151
+ */
152
+ withSeconds?: boolean;
153
+ /**
154
+ * dropdown 노출 여부
155
+ */
156
+ withDropdown?: boolean;
157
+ /**
158
+ * clear 버튼 노출 여부
159
+ */
160
+ clearable?: boolean;
161
+ /**
162
+ * 최소 시간 값
163
+ */
164
+ min?: string;
165
+ /**
166
+ * 최대 시간 값
167
+ */
168
+ max?: string;
169
+ /**
170
+ * hour step
171
+ */
172
+ hoursStep?: number;
173
+ /**
174
+ * minute step
175
+ */
176
+ minutesStep?: number;
177
+ /**
178
+ * second step
179
+ */
180
+ secondsStep?: number;
181
+ /**
182
+ * clock icon override
183
+ */
184
+ icon?: ReactNode;
185
+ /**
186
+ * clock icon 위치
187
+ */
188
+ iconPosition?: InputTimeIconPosition;
189
+ /**
190
+ * clock icon 접근성 라벨
191
+ */
192
+ iconLabel?: string;
193
+ /**
194
+ * clear 버튼 접근성 라벨
195
+ */
196
+ clearButtonLabel?: string;
197
+ /**
198
+ * Mantine Popover 옵션
199
+ */
200
+ popoverProps?: PopoverProps;
201
+ /**
202
+ * hidden input 옵션
203
+ */
204
+ hiddenInputProps?: InputTimeHiddenInputProps;
205
+ /**
206
+ * hour input aria-label
207
+ */
208
+ hoursInputLabel?: string;
209
+ /**
210
+ * minute input aria-label
211
+ */
212
+ minutesInputLabel?: string;
213
+ /**
214
+ * second input aria-label
215
+ */
216
+ secondsInputLabel?: string;
217
+ /**
218
+ * am/pm input aria-label
219
+ */
220
+ amPmInputLabel?: string;
221
+ /**
222
+ * am/pm 라벨
223
+ */
224
+ amPmLabels?: TimePickerAmPmLabels;
225
+ /**
226
+ * hour placeholder
227
+ */
228
+ hoursPlaceholder?: string;
229
+ /**
230
+ * minute placeholder
231
+ */
232
+ minutesPlaceholder?: string;
233
+ /**
234
+ * second placeholder
235
+ */
236
+ secondsPlaceholder?: string;
237
+ /**
238
+ * paste parser
239
+ */
240
+ pasteSplit?: TimePickerPasteSplit;
241
+ /**
242
+ * dropdown preset
243
+ */
244
+ presets?: TimePickerPresets;
245
+ /**
246
+ * dropdown 최대 높이
247
+ */
248
+ maxDropdownContentHeight?: number;
249
+ /**
250
+ * dropdown scroll area 옵션
251
+ */
252
+ scrollAreaProps?: ScrollAreaProps;
253
+ /**
254
+ * dropdown control 역순 여부
255
+ */
256
+ reverseTimeControlsList?: boolean;
257
+ /**
258
+ * focus 핸들러
259
+ */
260
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
261
+ /**
262
+ * blur 핸들러
263
+ */
264
+ onBlur?: (event: FocusEvent<HTMLDivElement>) => void;
265
+ }