@uniai-fe/uds-primitives 0.12.0 → 0.12.2
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.
- package/dist/styles.css +100 -96
- package/package.json +3 -3
- package/src/components/input/index.tsx +1 -1
- package/src/components/input/markup/time/Template.tsx +28 -22
- package/src/components/input/markup/time/Trigger.tsx +14 -59
- package/src/components/input/markup/time/index.tsx +7 -0
- package/src/components/input/styles/foundation.scss +7 -13
- package/src/components/input/styles/time.scss +61 -34
- package/src/components/input/styles/variables.scss +19 -30
- package/src/components/input/types/time.ts +204 -2
- package/src/components/select/styles/select.scss +12 -12
- package/src/components/select/styles/variables.scss +1 -12
- package/src/components/time-picker/markup/Footer.tsx +1 -19
- package/src/components/time-picker/markup/HourSection.tsx +1 -28
- package/src/components/time-picker/markup/MinuteSection.tsx +1 -19
- package/src/components/time-picker/markup/Summary.tsx +1 -6
- package/src/components/time-picker/types/time-picker.ts +99 -0
- package/src/components/input/img/clock.svg +0 -4
|
@@ -31,11 +31,14 @@
|
|
|
31
31
|
align-items: center;
|
|
32
32
|
flex: 1 1 auto;
|
|
33
33
|
min-width: 0;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
height: var(--input-default-height-medium);
|
|
35
|
+
min-height: var(--input-default-height-medium);
|
|
36
|
+
padding: var(--input-default-padding-block)
|
|
37
|
+
var(--input-default-padding-inline);
|
|
36
38
|
border: var(--input-time-border-width) solid var(--input-time-border-color);
|
|
37
39
|
border-radius: var(--input-time-radius);
|
|
38
40
|
background-color: var(--input-time-surface-color);
|
|
41
|
+
box-sizing: border-box;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
.input-time-fields-group {
|
|
@@ -69,19 +72,6 @@
|
|
|
69
72
|
letter-spacing: var(--input-time-letter-spacing);
|
|
70
73
|
text-align: center;
|
|
71
74
|
|
|
72
|
-
&:first-child {
|
|
73
|
-
text-align: right;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&:last-of-type {
|
|
77
|
-
text-align: left;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&:not(:first-child):not(:last-of-type) {
|
|
81
|
-
width: var(--input-time-field-middle-width);
|
|
82
|
-
min-width: var(--input-time-field-middle-width);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
75
|
&::placeholder {
|
|
86
76
|
color: var(--input-time-placeholder-color);
|
|
87
77
|
}
|
|
@@ -116,8 +106,8 @@
|
|
|
116
106
|
|
|
117
107
|
svg {
|
|
118
108
|
display: block;
|
|
119
|
-
width:
|
|
120
|
-
height:
|
|
109
|
+
width: var(--input-time-icon-size);
|
|
110
|
+
height: var(--input-time-icon-size);
|
|
121
111
|
}
|
|
122
112
|
}
|
|
123
113
|
|
|
@@ -141,6 +131,7 @@
|
|
|
141
131
|
background-color: var(--input-time-surface-color);
|
|
142
132
|
color: var(--input-time-text-color);
|
|
143
133
|
cursor: pointer;
|
|
134
|
+
box-sizing: border-box;
|
|
144
135
|
|
|
145
136
|
&:first-child {
|
|
146
137
|
border-radius: 0 var(--input-time-stepper-radius) 0 0;
|
|
@@ -163,26 +154,57 @@
|
|
|
163
154
|
}
|
|
164
155
|
|
|
165
156
|
.input-time:where([data-size="small"]) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
157
|
+
--input-time-radius: var(--input-default-radius-small);
|
|
158
|
+
--input-time-stepper-button-height: calc(
|
|
159
|
+
var(--input-default-height-small) / 2
|
|
160
|
+
);
|
|
161
|
+
--input-time-font-size: var(--input-time-text-small-size);
|
|
162
|
+
--input-time-line-height: var(--input-time-text-small-line-height);
|
|
163
|
+
--input-time-font-weight: var(--input-time-text-small-weight);
|
|
164
|
+
--input-time-letter-spacing: var(--input-time-text-small-letter-spacing);
|
|
169
165
|
|
|
170
|
-
.input-time-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
font-weight: var(--input-time-text-small-weight);
|
|
166
|
+
.input-time-trigger-input {
|
|
167
|
+
height: var(--input-default-height-small);
|
|
168
|
+
min-height: var(--input-default-height-small);
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
|
|
177
172
|
.input-time:where([data-size="large"]) {
|
|
173
|
+
--input-time-radius: var(--input-default-radius-large);
|
|
174
|
+
--input-time-stepper-button-height: calc(
|
|
175
|
+
var(--input-default-height-large) / 2
|
|
176
|
+
);
|
|
177
|
+
--input-time-font-size: var(--input-time-text-large-size);
|
|
178
|
+
--input-time-line-height: var(--input-time-text-large-line-height);
|
|
179
|
+
--input-time-font-weight: var(--input-time-text-large-weight);
|
|
180
|
+
--input-time-letter-spacing: var(--input-time-text-large-letter-spacing);
|
|
181
|
+
|
|
178
182
|
.input-time-trigger-input {
|
|
179
|
-
|
|
183
|
+
height: var(--input-default-height-large);
|
|
184
|
+
min-height: var(--input-default-height-large);
|
|
180
185
|
}
|
|
186
|
+
}
|
|
181
187
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
188
|
+
.input-time:where([data-state="active"]),
|
|
189
|
+
.input-time:where([data-state="focused"]) {
|
|
190
|
+
.input-time-field::placeholder {
|
|
191
|
+
color: var(--input-time-text-color);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.input-time:where([data-priority="primary"][data-state="focused"]) {
|
|
196
|
+
.input-time-trigger-input,
|
|
197
|
+
.input-time-stepper-button {
|
|
198
|
+
border-color: var(--input-time-border-active-color);
|
|
199
|
+
border-width: var(--input-time-border-width-focus);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.input-time-stepper-button {
|
|
203
|
+
border-left: 0;
|
|
204
|
+
|
|
205
|
+
&:last-child {
|
|
206
|
+
border-top: 0;
|
|
207
|
+
}
|
|
186
208
|
}
|
|
187
209
|
}
|
|
188
210
|
|
|
@@ -199,8 +221,8 @@
|
|
|
199
221
|
|
|
200
222
|
.input-time:where([data-priority="tertiary"]) {
|
|
201
223
|
.input-time-trigger-input {
|
|
202
|
-
min-height: var(--input-
|
|
203
|
-
border-radius: var(--input-
|
|
224
|
+
min-height: var(--input-tertiary-height-base);
|
|
225
|
+
border-radius: var(--input-tertiary-radius-base);
|
|
204
226
|
}
|
|
205
227
|
}
|
|
206
228
|
|
|
@@ -209,11 +231,11 @@
|
|
|
209
231
|
height: 100%;
|
|
210
232
|
|
|
211
233
|
.input-time-trigger-input {
|
|
212
|
-
min-height: var(--input-
|
|
234
|
+
min-height: var(--input-default-height-small);
|
|
213
235
|
height: 100%;
|
|
214
236
|
padding-inline: var(--input-time-table-padding-inline);
|
|
215
237
|
border-color: var(--input-time-table-border-color);
|
|
216
|
-
border-radius: var(--input-
|
|
238
|
+
border-radius: var(--input-table-radius-base);
|
|
217
239
|
background-color: var(--input-time-table-surface-color);
|
|
218
240
|
}
|
|
219
241
|
|
|
@@ -244,11 +266,16 @@
|
|
|
244
266
|
background-color: var(--input-time-surface-disabled-color);
|
|
245
267
|
}
|
|
246
268
|
|
|
247
|
-
.input-time-field
|
|
269
|
+
.input-time-field,
|
|
270
|
+
.input-time-period-field {
|
|
248
271
|
color: var(--input-time-text-disabled-color);
|
|
249
272
|
cursor: default;
|
|
250
273
|
}
|
|
251
274
|
|
|
275
|
+
.input-time-field::placeholder {
|
|
276
|
+
color: var(--input-time-text-disabled-color);
|
|
277
|
+
}
|
|
278
|
+
|
|
252
279
|
.input-time-icon-button {
|
|
253
280
|
color: var(--input-time-icon-disabled-color);
|
|
254
281
|
cursor: default;
|
|
@@ -17,25 +17,18 @@
|
|
|
17
17
|
--input-utility-gap: var(--spacing-gap-2);
|
|
18
18
|
--input-tertiary-row-gap: var(--spacing-gap-1);
|
|
19
19
|
--input-tertiary-control-row-gap: var(--spacing-gap-1);
|
|
20
|
-
--input-default-radius-
|
|
20
|
+
--input-default-radius-small: var(--theme-radius-medium-4);
|
|
21
|
+
--input-default-radius-medium: var(--theme-radius-large-1);
|
|
22
|
+
--input-default-radius-large: var(--theme-radius-large-2);
|
|
23
|
+
--input-default-radius-base: var(--input-default-radius-medium);
|
|
21
24
|
--input-tertiary-radius-base: var(--theme-radius-large-2);
|
|
22
25
|
--input-table-radius-base: 0;
|
|
23
26
|
--input-tertiary-element-min-height: 1.5em;
|
|
24
27
|
--input-textarea-min-height: calc(var(--input-default-height-medium) * 2);
|
|
25
28
|
--input-textarea-height: 128px;
|
|
26
|
-
/* TextArea size token은 Input 기본 size token을 재할당해 축을 일치시킨다. */
|
|
27
|
-
--input-textarea-radius-small: var(--input-default-radius-base);
|
|
28
|
-
--input-textarea-radius-medium: var(--input-default-radius-base);
|
|
29
|
-
--input-textarea-radius-large: var(--input-default-radius-base);
|
|
30
|
-
--input-textarea-padding-inline-small: var(--spacing-padding-6);
|
|
31
|
-
--input-textarea-padding-inline-medium: var(--spacing-padding-6);
|
|
32
|
-
--input-textarea-padding-inline-large: var(--spacing-padding-6);
|
|
33
29
|
--input-textarea-padding-block-small: var(--spacing-padding-5);
|
|
34
30
|
--input-textarea-padding-block-medium: var(--spacing-padding-5);
|
|
35
31
|
--input-textarea-padding-block-large: var(--spacing-padding-6);
|
|
36
|
-
--input-textarea-gap-small: var(--input-default-gap);
|
|
37
|
-
--input-textarea-gap-medium: var(--input-default-gap);
|
|
38
|
-
--input-textarea-gap-large: var(--input-default-gap);
|
|
39
32
|
--input-textarea-counter-font-size: var(--font-label-medium-size);
|
|
40
33
|
--input-textarea-counter-line-height: var(--font-label-medium-line-height);
|
|
41
34
|
--input-textarea-counter-font-weight: var(--font-label-medium-weight);
|
|
@@ -122,33 +115,24 @@
|
|
|
122
115
|
|
|
123
116
|
/* TimePicker tokens */
|
|
124
117
|
--input-time-width: 100%;
|
|
125
|
-
--input-time-height-small: var(--input-default-height-small);
|
|
126
|
-
--input-time-height-medium: var(--input-default-height-medium);
|
|
127
|
-
--input-time-height-large: var(--input-default-height-large);
|
|
128
|
-
--input-time-tertiary-height: var(--input-tertiary-height-base);
|
|
129
|
-
--input-time-padding-inline: var(--input-default-padding-inline);
|
|
130
|
-
--input-time-padding-block: var(--input-default-padding-block);
|
|
131
|
-
--input-time-secondary-padding-block: var(--input-secondary-padding-block);
|
|
132
118
|
--input-time-table-padding-inline: var(--spacing-padding-4);
|
|
133
|
-
--input-time-radius: var(--
|
|
134
|
-
--input-time-tertiary-radius: var(--input-tertiary-radius-base);
|
|
135
|
-
--input-time-table-radius: var(--input-table-radius-base);
|
|
119
|
+
--input-time-radius: var(--input-default-radius-medium);
|
|
136
120
|
--input-time-field-gap: 0;
|
|
137
|
-
--input-time-field-width: 2.7ch;
|
|
138
|
-
--input-time-field-middle-width: 2.2ch;
|
|
139
121
|
--input-time-period-field-width: 4.2ch;
|
|
140
122
|
--input-time-field-height: 100%;
|
|
141
123
|
--input-time-icon-size: 24px;
|
|
142
124
|
--input-time-stepper-width: 28px;
|
|
143
|
-
--input-time-stepper-button-height:
|
|
125
|
+
--input-time-stepper-button-height: calc(
|
|
126
|
+
var(--input-default-height-medium) / 2
|
|
127
|
+
);
|
|
144
128
|
--input-time-stepper-radius: var(--theme-radius-medium-3);
|
|
145
129
|
--input-time-stepper-icon-size: 16px;
|
|
146
|
-
--input-time-text-color: var(--
|
|
147
|
-
--input-time-text-disabled-color: var(--
|
|
148
|
-
--input-time-placeholder-color: var(--
|
|
130
|
+
--input-time-text-color: var(--color-cool-gray-30);
|
|
131
|
+
--input-time-text-disabled-color: var(--color-cool-gray-60);
|
|
132
|
+
--input-time-placeholder-color: var(--color-cool-gray-40);
|
|
149
133
|
--input-time-separator-color: var(--color-label-alternative);
|
|
150
|
-
--input-time-icon-color: var(--color-
|
|
151
|
-
--input-time-icon-disabled-color: var(--color-
|
|
134
|
+
--input-time-icon-color: var(--color-cool-gray-25);
|
|
135
|
+
--input-time-icon-disabled-color: var(--color-cool-gray-45);
|
|
152
136
|
--input-time-font-size: var(--input-text-medium-size);
|
|
153
137
|
--input-time-line-height: var(--input-text-medium-line-height);
|
|
154
138
|
--input-time-font-weight: var(--input-text-medium-weight);
|
|
@@ -173,6 +157,7 @@
|
|
|
173
157
|
--input-time-border-color: var(--input-border-color);
|
|
174
158
|
--input-time-border-width: var(--input-border-width-default);
|
|
175
159
|
--input-time-border-width-emphasis: var(--input-border-width-emphasis);
|
|
160
|
+
--input-time-border-width-focus: 2px;
|
|
176
161
|
--input-time-border-active-color: var(--input-border-active-color);
|
|
177
162
|
--input-time-border-success-color: var(--input-border-success-color);
|
|
178
163
|
--input-time-border-error-color: var(--input-border-error-color);
|
|
@@ -180,6 +165,10 @@
|
|
|
180
165
|
--input-time-table-border-color: var(--input-border-table-default-color);
|
|
181
166
|
--input-time-surface-color: var(--input-surface-color);
|
|
182
167
|
--input-time-secondary-surface-color: var(--input-secondary-surface-color);
|
|
183
|
-
--input-time-surface-disabled-color: var(--
|
|
168
|
+
--input-time-surface-disabled-color: var(--color-cool-gray-85);
|
|
184
169
|
--input-time-table-surface-color: var(--input-table-surface-color);
|
|
185
170
|
}
|
|
171
|
+
|
|
172
|
+
.input-time {
|
|
173
|
+
--input-time-field-width: 1.9em;
|
|
174
|
+
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ComponentPropsWithoutRef,
|
|
3
|
+
FocusEvent,
|
|
4
|
+
KeyboardEvent,
|
|
5
|
+
ReactNode,
|
|
6
|
+
} from "react";
|
|
2
7
|
import type { UseFormRegisterReturn } from "react-hook-form";
|
|
3
8
|
import type { FormFieldWidth } from "../../form/types/props";
|
|
4
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
TimePickerFormat,
|
|
11
|
+
TimePickerPeriod,
|
|
12
|
+
TimePickerUnit,
|
|
13
|
+
} from "../../time-picker/types";
|
|
5
14
|
import type { InputPriority, InputSize, InputState } from "./foundation";
|
|
6
15
|
|
|
7
16
|
/**
|
|
@@ -18,6 +27,199 @@ export type InputTimeHiddenInputProps = Omit<
|
|
|
18
27
|
"type" | "value" | "defaultValue" | "name"
|
|
19
28
|
>;
|
|
20
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Input Time draft field 값.
|
|
32
|
+
* @property {string} hours 시 입력값
|
|
33
|
+
* @property {string} minutes 분 입력값
|
|
34
|
+
* @property {string} seconds 초 입력값
|
|
35
|
+
*/
|
|
36
|
+
export interface InputTimeDraftFields {
|
|
37
|
+
/**
|
|
38
|
+
* 시 입력값.
|
|
39
|
+
*/
|
|
40
|
+
hours: string;
|
|
41
|
+
/**
|
|
42
|
+
* 분 입력값.
|
|
43
|
+
*/
|
|
44
|
+
minutes: string;
|
|
45
|
+
/**
|
|
46
|
+
* 초 입력값.
|
|
47
|
+
*/
|
|
48
|
+
seconds: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Input Time 편집 중인 시간 값.
|
|
53
|
+
* @property {InputTimeDraftFields} fields 시·분·초 입력값
|
|
54
|
+
* @property {"am" | "pm"} period 오전·오후 구분
|
|
55
|
+
*/
|
|
56
|
+
export interface InputTimeDraft {
|
|
57
|
+
/**
|
|
58
|
+
* 시·분·초 입력값.
|
|
59
|
+
*/
|
|
60
|
+
fields: InputTimeDraftFields;
|
|
61
|
+
/**
|
|
62
|
+
* "am" | "pm".
|
|
63
|
+
*/
|
|
64
|
+
period: TimePickerPeriod;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Input Time trigger field 값.
|
|
69
|
+
* @see InputTimeDraftFields
|
|
70
|
+
*/
|
|
71
|
+
export type InputTimeTriggerFields = InputTimeDraftFields;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Input Time Trigger props.
|
|
75
|
+
* @property {InputTimeTriggerFields} fields 시·분·초 입력값
|
|
76
|
+
* @property {"am" | "pm"} period 오전·오후 구분
|
|
77
|
+
* @property {"hours" | "minutes" | "seconds" | null} activeUnit 현재 활성 단위
|
|
78
|
+
* @property {"primary" | "secondary" | "tertiary" | "table"} priority input priority
|
|
79
|
+
* @property {"small" | "medium" | "large"} size input size
|
|
80
|
+
* @property {"default" | "active" | "focused" | "success" | "error" | "disabled" | "loading"} state input state
|
|
81
|
+
* @property {"12h" | "24h"} format 표시 형식
|
|
82
|
+
* @property {boolean} withSeconds 초 field 노출 여부
|
|
83
|
+
* @property {boolean} disabled 비활성화 여부
|
|
84
|
+
* @property {boolean} readOnly 읽기 전용 여부
|
|
85
|
+
* @property {ReactNode} icon clock icon
|
|
86
|
+
* @property {"left" | "right"} iconPosition clock icon 위치
|
|
87
|
+
* @property {string} iconLabel clock icon 접근성 라벨
|
|
88
|
+
* @property {string} hoursInputLabel 시 input 접근성 라벨
|
|
89
|
+
* @property {string} minutesInputLabel 분 input 접근성 라벨
|
|
90
|
+
* @property {string} secondsInputLabel 초 input 접근성 라벨
|
|
91
|
+
* @property {string} amPmInputLabel 오전·오후 input 접근성 라벨
|
|
92
|
+
* @property {string} hoursPlaceholder 시 placeholder
|
|
93
|
+
* @property {string} minutesPlaceholder 분 placeholder
|
|
94
|
+
* @property {string} secondsPlaceholder 초 placeholder
|
|
95
|
+
* @property {(unit: "hours" | "minutes" | "seconds", value: string) => void} onFieldChange field 변경 핸들러
|
|
96
|
+
* @property {(unit: "hours" | "minutes" | "seconds", event: FocusEvent<HTMLInputElement>) => void} onFieldFocus field focus 핸들러
|
|
97
|
+
* @property {(unit: "hours" | "minutes" | "seconds") => void} onFieldBlur field blur 핸들러
|
|
98
|
+
* @property {(unit: "hours" | "minutes" | "seconds", event: KeyboardEvent<HTMLInputElement>) => void} onFieldKeyDown field keyboard 핸들러
|
|
99
|
+
* @property {(period: "am" | "pm") => void} onPeriodChange 오전·오후 변경 핸들러
|
|
100
|
+
* @property {(amount: 1 | -1) => void} onStep 활성 단위 증감 핸들러
|
|
101
|
+
* @property {(event: FocusEvent<HTMLDivElement>) => void} onRootBlur root blur 핸들러
|
|
102
|
+
*/
|
|
103
|
+
export interface InputTimeTriggerProps extends Omit<
|
|
104
|
+
ComponentPropsWithoutRef<"div">,
|
|
105
|
+
"onBlur" | "onFocus"
|
|
106
|
+
> {
|
|
107
|
+
/**
|
|
108
|
+
* 시·분·초 입력값.
|
|
109
|
+
*/
|
|
110
|
+
fields: InputTimeTriggerFields;
|
|
111
|
+
/**
|
|
112
|
+
* "am" | "pm".
|
|
113
|
+
*/
|
|
114
|
+
period: TimePickerPeriod;
|
|
115
|
+
/**
|
|
116
|
+
* "hours" | "minutes" | "seconds" | null.
|
|
117
|
+
*/
|
|
118
|
+
activeUnit: TimePickerUnit | null;
|
|
119
|
+
/**
|
|
120
|
+
* "primary" | "secondary" | "tertiary" | "table".
|
|
121
|
+
*/
|
|
122
|
+
priority: InputPriority;
|
|
123
|
+
/**
|
|
124
|
+
* "small" | "medium" | "large".
|
|
125
|
+
*/
|
|
126
|
+
size: InputSize;
|
|
127
|
+
/**
|
|
128
|
+
* "default" | "active" | "focused" | "success" | "error" | "disabled" | "loading".
|
|
129
|
+
*/
|
|
130
|
+
state: InputState;
|
|
131
|
+
/**
|
|
132
|
+
* "12h" | "24h".
|
|
133
|
+
*/
|
|
134
|
+
format: TimePickerFormat;
|
|
135
|
+
/**
|
|
136
|
+
* 초 field 노출 여부.
|
|
137
|
+
*/
|
|
138
|
+
withSeconds: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* 비활성화 여부.
|
|
141
|
+
*/
|
|
142
|
+
disabled: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* 읽기 전용 여부.
|
|
145
|
+
*/
|
|
146
|
+
readOnly: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* clock icon.
|
|
149
|
+
*/
|
|
150
|
+
icon: ReactNode;
|
|
151
|
+
/**
|
|
152
|
+
* "left" | "right".
|
|
153
|
+
*/
|
|
154
|
+
iconPosition: InputTimeIconPosition;
|
|
155
|
+
/**
|
|
156
|
+
* clock icon 접근성 라벨.
|
|
157
|
+
*/
|
|
158
|
+
iconLabel: string;
|
|
159
|
+
/**
|
|
160
|
+
* 시 input 접근성 라벨.
|
|
161
|
+
*/
|
|
162
|
+
hoursInputLabel: string;
|
|
163
|
+
/**
|
|
164
|
+
* 분 input 접근성 라벨.
|
|
165
|
+
*/
|
|
166
|
+
minutesInputLabel: string;
|
|
167
|
+
/**
|
|
168
|
+
* 초 input 접근성 라벨.
|
|
169
|
+
*/
|
|
170
|
+
secondsInputLabel: string;
|
|
171
|
+
/**
|
|
172
|
+
* 오전·오후 input 접근성 라벨.
|
|
173
|
+
*/
|
|
174
|
+
amPmInputLabel: string;
|
|
175
|
+
/**
|
|
176
|
+
* 시 placeholder.
|
|
177
|
+
*/
|
|
178
|
+
hoursPlaceholder: string;
|
|
179
|
+
/**
|
|
180
|
+
* 분 placeholder.
|
|
181
|
+
*/
|
|
182
|
+
minutesPlaceholder: string;
|
|
183
|
+
/**
|
|
184
|
+
* 초 placeholder.
|
|
185
|
+
*/
|
|
186
|
+
secondsPlaceholder: string;
|
|
187
|
+
/**
|
|
188
|
+
* field 변경 핸들러.
|
|
189
|
+
*/
|
|
190
|
+
onFieldChange: (unit: TimePickerUnit, value: string) => void;
|
|
191
|
+
/**
|
|
192
|
+
* field focus 핸들러.
|
|
193
|
+
*/
|
|
194
|
+
onFieldFocus: (
|
|
195
|
+
unit: TimePickerUnit,
|
|
196
|
+
event: FocusEvent<HTMLInputElement>,
|
|
197
|
+
) => void;
|
|
198
|
+
/**
|
|
199
|
+
* field blur 핸들러.
|
|
200
|
+
*/
|
|
201
|
+
onFieldBlur: (unit: TimePickerUnit) => void;
|
|
202
|
+
/**
|
|
203
|
+
* field keyboard 핸들러.
|
|
204
|
+
*/
|
|
205
|
+
onFieldKeyDown: (
|
|
206
|
+
unit: TimePickerUnit,
|
|
207
|
+
event: KeyboardEvent<HTMLInputElement>,
|
|
208
|
+
) => void;
|
|
209
|
+
/**
|
|
210
|
+
* 오전·오후 변경 핸들러.
|
|
211
|
+
*/
|
|
212
|
+
onPeriodChange: (period: TimePickerPeriod) => void;
|
|
213
|
+
/**
|
|
214
|
+
* 활성 단위 증감 핸들러.
|
|
215
|
+
*/
|
|
216
|
+
onStep: (amount: 1 | -1) => void;
|
|
217
|
+
/**
|
|
218
|
+
* root blur 핸들러.
|
|
219
|
+
*/
|
|
220
|
+
onRootBlur: (event: FocusEvent<HTMLDivElement>) => void;
|
|
221
|
+
}
|
|
222
|
+
|
|
21
223
|
/**
|
|
22
224
|
* Input Time Template props.
|
|
23
225
|
* 저장값은 24시간 `HH:mm` 또는 `HH:mm:ss` 문자열을 사용한다.
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
display: flex;
|
|
50
50
|
width: 100%;
|
|
51
51
|
align-items: center;
|
|
52
|
-
gap: var(--
|
|
53
|
-
min-height: var(--
|
|
54
|
-
padding: var(--
|
|
55
|
-
var(--
|
|
56
|
-
border: var(--
|
|
52
|
+
gap: var(--input-default-gap);
|
|
53
|
+
min-height: var(--input-default-height-medium);
|
|
54
|
+
padding: var(--input-default-padding-block)
|
|
55
|
+
var(--input-default-padding-inline);
|
|
56
|
+
border: var(--input-border-width-default) solid
|
|
57
57
|
var(--select-primary-color-border);
|
|
58
|
-
border-radius: var(--
|
|
58
|
+
border-radius: var(--input-default-radius-medium);
|
|
59
59
|
background-color: var(--select-primary-color-surface);
|
|
60
60
|
cursor: pointer;
|
|
61
61
|
transition:
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
text-align: left;
|
|
66
66
|
|
|
67
67
|
&:where([data-size="small"]) {
|
|
68
|
-
min-height: var(--
|
|
69
|
-
border-radius: var(--
|
|
68
|
+
min-height: var(--input-default-height-small);
|
|
69
|
+
border-radius: var(--input-default-radius-small);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
&:where([data-size="xsmall"]) {
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
&:where([data-size="large"]) {
|
|
84
|
-
min-height: var(--
|
|
85
|
-
border-radius: var(--
|
|
84
|
+
min-height: var(--input-default-height-large);
|
|
85
|
+
border-radius: var(--input-default-radius-large);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
&:where([data-multiple="true"]) {
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
&:where(:not([data-priority="secondary"])):focus-visible,
|
|
147
147
|
&:where(:not([data-priority="secondary"])):focus-within {
|
|
148
148
|
border-color: var(--select-primary-color-border-focused);
|
|
149
|
-
border-width: var(--
|
|
149
|
+
border-width: var(--input-border-width-emphasis);
|
|
150
150
|
--select-icon-fill: var(--select-icon-color-focused);
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
&:where([data-priority="table"]):focus-visible,
|
|
156
156
|
&:where([data-priority="table"]):focus-within {
|
|
157
157
|
border-color: var(--select-table-border-focus-color);
|
|
158
|
-
border-width: var(--
|
|
158
|
+
border-width: var(--input-border-width-emphasis);
|
|
159
159
|
--select-icon-fill: var(--select-table-icon-color-focused);
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Select tokens
|
|
1
|
+
/* Select-specific tokens. Primary small/medium/large geometry consumes Input.Base directly. */
|
|
2
2
|
:root {
|
|
3
3
|
/* layout presets */
|
|
4
4
|
--select-width: 100%;
|
|
@@ -6,25 +6,14 @@
|
|
|
6
6
|
--select-layout-gap: var(--spacing-gap-2);
|
|
7
7
|
--select-value-gap: var(--spacing-gap-2);
|
|
8
8
|
|
|
9
|
-
--select-primary-height-small: var(--input-default-height-small);
|
|
10
|
-
--select-primary-height-medium: var(--input-default-height-medium);
|
|
11
|
-
--select-primary-height-large: var(--input-default-height-large);
|
|
12
9
|
--select-primary-height-xsmall: 24px;
|
|
13
10
|
|
|
14
|
-
--select-primary-radius-small: var(--input-default-radius-base);
|
|
15
|
-
--select-primary-radius-medium: var(--input-default-radius-base);
|
|
16
|
-
--select-primary-radius-large: var(--input-default-radius-base);
|
|
17
11
|
--select-primary-radius-xsmall: var(--theme-radius-medium-2);
|
|
18
12
|
|
|
19
|
-
--select-primary-padding-inline: var(--input-default-padding-inline);
|
|
20
|
-
--select-primary-padding-block: var(--input-default-padding-block);
|
|
21
|
-
--select-primary-gap-inline: var(--input-default-gap);
|
|
22
13
|
--select-primary-padding-inline-start-xsmall: var(--spacing-padding-4);
|
|
23
14
|
--select-primary-padding-inline-end-xsmall: var(--spacing-padding-3);
|
|
24
15
|
--select-primary-padding-block-xsmall: var(--spacing-padding-2);
|
|
25
16
|
--select-primary-gap-inline-xsmall: var(--spacing-gap-1);
|
|
26
|
-
--select-primary-border-width-default: var(--input-border-width-default);
|
|
27
|
-
--select-primary-border-width-focus: var(--input-border-width-emphasis);
|
|
28
17
|
|
|
29
18
|
--select-secondary-radius: var(--theme-radius-medium-1);
|
|
30
19
|
--select-secondary-padding-inline: var(--spacing-padding-4);
|
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
import { Button } from "../../button";
|
|
2
|
-
|
|
3
|
-
interface TimePickerFooterProps {
|
|
4
|
-
/**
|
|
5
|
-
* 삭제 action 노출 여부.
|
|
6
|
-
*/
|
|
7
|
-
clearable: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* 비활성화 여부.
|
|
10
|
-
*/
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 삭제 핸들러.
|
|
14
|
-
*/
|
|
15
|
-
onClear: () => void;
|
|
16
|
-
/**
|
|
17
|
-
* 적용 핸들러.
|
|
18
|
-
*/
|
|
19
|
-
onApply: () => void;
|
|
20
|
-
}
|
|
2
|
+
import type { TimePickerFooterProps } from "../types";
|
|
21
3
|
|
|
22
4
|
/**
|
|
23
5
|
* TimePicker Footer; 삭제와 적용 action을 렌더한다.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SegmentedControl } from "../../segmented-control";
|
|
2
|
-
import type {
|
|
2
|
+
import type { TimePickerHourSectionProps } from "../types";
|
|
3
3
|
|
|
4
4
|
const HOURS_12 = Array.from({ length: 12 }, (_, index) => index + 1);
|
|
5
5
|
const HOURS_24 = Array.from({ length: 24 }, (_, index) => index);
|
|
@@ -8,33 +8,6 @@ const PERIOD_OPTIONS = [
|
|
|
8
8
|
{ value: "pm", label: "오후" },
|
|
9
9
|
];
|
|
10
10
|
|
|
11
|
-
interface TimePickerHourSectionProps {
|
|
12
|
-
/**
|
|
13
|
-
* "12h" | "24h".
|
|
14
|
-
*/
|
|
15
|
-
format: TimePickerFormat;
|
|
16
|
-
/**
|
|
17
|
-
* 선택한 표시 시.
|
|
18
|
-
*/
|
|
19
|
-
selectedHour: number | null;
|
|
20
|
-
/**
|
|
21
|
-
* "am" | "pm".
|
|
22
|
-
*/
|
|
23
|
-
period: TimePickerPeriod;
|
|
24
|
-
/**
|
|
25
|
-
* 비활성화 여부.
|
|
26
|
-
*/
|
|
27
|
-
disabled: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* 시 선택 핸들러.
|
|
30
|
-
*/
|
|
31
|
-
onHourSelect: (hours: number) => void;
|
|
32
|
-
/**
|
|
33
|
-
* 오전·오후 변경 핸들러.
|
|
34
|
-
*/
|
|
35
|
-
onPeriodChange: (period: TimePickerPeriod) => void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
11
|
/**
|
|
39
12
|
* TimePicker Hour Section; 오전·오후와 시 선택 grid를 렌더한다.
|
|
40
13
|
* @component
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import MinusIcon from "../img/minus.svg";
|
|
2
2
|
import PlusIcon from "../img/plus.svg";
|
|
3
|
+
import type { TimePickerMinuteSectionProps } from "../types";
|
|
3
4
|
|
|
4
5
|
const MINUTES = Array.from({ length: 12 }, (_, index) => index * 5);
|
|
5
6
|
|
|
6
|
-
interface TimePickerMinuteSectionProps {
|
|
7
|
-
/**
|
|
8
|
-
* 선택한 분.
|
|
9
|
-
*/
|
|
10
|
-
selectedMinute: number | null;
|
|
11
|
-
/**
|
|
12
|
-
* 비활성화 여부.
|
|
13
|
-
*/
|
|
14
|
-
disabled: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* 1분 증감 핸들러.
|
|
17
|
-
*/
|
|
18
|
-
onMinuteStep: (amount: 1 | -1) => void;
|
|
19
|
-
/**
|
|
20
|
-
* 분 선택 핸들러.
|
|
21
|
-
*/
|
|
22
|
-
onMinuteSelect: (minutes: number) => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
7
|
/**
|
|
26
8
|
* TimePicker Minute Section; 1분 stepper와 5분 선택 grid를 렌더한다.
|
|
27
9
|
* @component
|