@uniai-fe/uds-primitives 0.2.2 → 0.2.4
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/README.md +1 -1
- package/dist/styles.css +299 -81
- package/package.json +16 -9
- package/src/components/{input/img/calendar → calendar/img}/calendar.svg +5 -0
- package/src/components/calendar/index.tsx +5 -3
- package/src/components/calendar/markup/Core.tsx +67 -0
- package/src/components/calendar/markup/Icon.tsx +20 -0
- package/src/components/calendar/markup/Root.tsx +126 -0
- package/src/components/calendar/markup/index.tsx +24 -2
- package/src/components/calendar/markup/layout/Body.tsx +12 -0
- package/src/components/calendar/markup/layout/Container.tsx +43 -0
- package/src/components/calendar/markup/layout/Footer.tsx +12 -0
- package/src/components/calendar/markup/layout/Header.tsx +12 -0
- package/src/components/calendar/styles/index.scss +2 -0
- package/src/components/calendar/styles/layout.scss +21 -0
- package/src/components/calendar/styles/mantine-calendar.scss +240 -0
- package/src/components/calendar/types/calendar.ts +208 -0
- package/src/components/calendar/types/index.ts +1 -4
- package/src/components/calendar/utils/index.ts +1 -4
- package/src/components/calendar/utils/value-mapper.ts +24 -0
- package/src/components/input/index.scss +1 -1
- package/src/components/input/markup/date/Template.tsx +181 -0
- package/src/components/input/markup/date/Trigger.tsx +79 -0
- package/src/components/input/markup/date/button/ApplyButton.tsx +38 -0
- package/src/components/input/markup/date/button/ClearButton.tsx +36 -0
- package/src/components/input/markup/date/button/TodayButton.tsx +36 -0
- package/src/components/input/markup/date/footer/Container.tsx +24 -0
- package/src/components/input/markup/date/footer/Template.tsx +36 -0
- package/src/components/input/markup/date/footer/UtilContainer.tsx +23 -0
- package/src/components/input/markup/date/footer/index.ts +3 -0
- package/src/components/input/markup/date/index.tsx +27 -0
- package/src/components/input/markup/index.tsx +2 -4
- package/src/components/input/styles/date.scss +45 -0
- package/src/components/input/types/date.ts +286 -0
- package/src/components/input/types/index.ts +1 -1
- package/src/components/input/utils/address.ts +2 -2
- package/src/components/input/utils/date.ts +61 -0
- package/src/components/input/utils/index.tsx +1 -0
- package/src/components/pop-over/index.scss +1 -0
- package/src/components/pop-over/index.tsx +4 -0
- package/src/components/pop-over/markup/Content.tsx +77 -0
- package/src/components/pop-over/markup/Root.tsx +28 -0
- package/src/components/pop-over/markup/Trigger.tsx +26 -0
- package/src/components/pop-over/markup/index.tsx +17 -0
- package/src/components/pop-over/styles/base.scss +5 -0
- package/src/components/pop-over/styles/content.scss +24 -0
- package/src/components/pop-over/styles/index.scss +2 -0
- package/src/components/pop-over/types/index.ts +1 -0
- package/src/components/pop-over/types/pop-over.ts +86 -0
- package/src/index.scss +1 -0
- package/src/index.tsx +3 -1
- package/src/init/mantine.css +5 -0
- package/src/init/mantine.ts +2 -0
- package/src/components/input/markup/calendar/Base.tsx +0 -329
- package/src/components/input/markup/calendar/index.tsx +0 -8
- package/src/components/input/styles/calendar.scss +0 -110
- package/src/components/input/types/calendar.ts +0 -208
- /package/src/components/{input/img/calendar → calendar/img}/chevron-down.svg +0 -0
- /package/src/components/{input/img/calendar → calendar/img}/chevron-left.svg +0 -0
- /package/src/components/{input/img/calendar → calendar/img}/chevron-right.svg +0 -0
- /package/src/components/{input/img/calendar → calendar/img}/chevron-up.svg +0 -0
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
DatePickerProps as MantineDatePickerProps,
|
|
3
|
-
DatePickerType,
|
|
4
|
-
DatePickerValue,
|
|
5
|
-
} from "@mantine/dates";
|
|
6
|
-
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
7
|
-
import type { UseFormRegisterReturn } from "react-hook-form";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Calendar 모드; 날짜/시간 조합을 구분한다.
|
|
11
|
-
*/
|
|
12
|
-
export type InputCalendarMode = "date" | "date-time" | "time";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Calendar가 한 번에 렌더링할 열 개수.
|
|
16
|
-
* 단일/듀얼 달력을 명시적으로 구분한다.
|
|
17
|
-
*/
|
|
18
|
-
export type InputCalendarColumns = 1 | 2;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Mantine DatePicker 값 타입을 문자열 기반으로 재정의한다.
|
|
22
|
-
*/
|
|
23
|
-
export type InputCalendarValue<Type extends DatePickerType = "default"> =
|
|
24
|
-
DatePickerValue<Type, string>;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Calendar 값 변경 핸들러 시그니처.
|
|
28
|
-
* @template Type Mantine DatePickerType string literal
|
|
29
|
-
* @property {InputCalendarValue<Type>} value 현재 선택된 값
|
|
30
|
-
*/
|
|
31
|
-
export type InputCalendarOnChange<Type extends DatePickerType = "default"> = (
|
|
32
|
-
value: InputCalendarValue<Type>,
|
|
33
|
-
) => void;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* footer 버튼 기본 속성.
|
|
37
|
-
* 공통 disabled/label 정책을 공유한다.
|
|
38
|
-
* @property {ReactNode} [label] 버튼 라벨
|
|
39
|
-
* @property {boolean} [disabled] 버튼 disabled 상태
|
|
40
|
-
* @property {boolean} [visible] 버튼 노출 여부. false면 숨김
|
|
41
|
-
*/
|
|
42
|
-
export interface InputCalendarActionButtonProps {
|
|
43
|
-
/**
|
|
44
|
-
* 버튼 라벨
|
|
45
|
-
*/
|
|
46
|
-
label?: ReactNode;
|
|
47
|
-
/**
|
|
48
|
-
* 버튼 disabled 상태
|
|
49
|
-
*/
|
|
50
|
-
disabled?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* 버튼 노출 여부. false면 숨김
|
|
53
|
-
*/
|
|
54
|
-
visible?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* footer 액션 핸들러 묶음.
|
|
59
|
-
* @property {() => void} [onClear] 삭제 버튼 클릭 시 호출
|
|
60
|
-
* @property {() => void} [onToday] 오늘 버튼 클릭 시 호출
|
|
61
|
-
* @property {(value: InputCalendarValue) => void} [onApply] 적용 버튼 클릭 시 호출
|
|
62
|
-
*/
|
|
63
|
-
export interface InputCalendarActionHandlers<
|
|
64
|
-
Type extends DatePickerType = "default",
|
|
65
|
-
> {
|
|
66
|
-
/**
|
|
67
|
-
* 삭제/초기화 버튼 핸들러
|
|
68
|
-
*/
|
|
69
|
-
onClear?: () => void;
|
|
70
|
-
/**
|
|
71
|
-
* 오늘 버튼 핸들러
|
|
72
|
-
*/
|
|
73
|
-
onToday?: () => void;
|
|
74
|
-
/**
|
|
75
|
-
* 적용 버튼 핸들러 (현재 값 전달)
|
|
76
|
-
*/
|
|
77
|
-
onApply?: InputCalendarOnChange<Type>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* footer 액션 구성을 선언한다.
|
|
82
|
-
* @property {InputCalendarActionButtonProps} [clear] 삭제 버튼 옵션
|
|
83
|
-
* @property {InputCalendarActionButtonProps} [today] 오늘 버튼 옵션
|
|
84
|
-
* @property {InputCalendarActionButtonProps} [apply] 적용 버튼 옵션
|
|
85
|
-
*/
|
|
86
|
-
export interface InputCalendarActionOptions {
|
|
87
|
-
/**
|
|
88
|
-
* 삭제/초기화 버튼 옵션
|
|
89
|
-
*/
|
|
90
|
-
clear?: InputCalendarActionButtonProps;
|
|
91
|
-
/**
|
|
92
|
-
* 오늘 버튼 옵션
|
|
93
|
-
*/
|
|
94
|
-
today?: InputCalendarActionButtonProps;
|
|
95
|
-
/**
|
|
96
|
-
* 적용 버튼 옵션
|
|
97
|
-
*/
|
|
98
|
-
apply?: InputCalendarActionButtonProps;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Mantine DatePicker props 중 Input 레이어에서 그대로 노출하지 않을 항목을 제외한 타입.
|
|
103
|
-
*/
|
|
104
|
-
export type InputCalendarMantineProps<Type extends DatePickerType = "default"> =
|
|
105
|
-
Partial<
|
|
106
|
-
Omit<
|
|
107
|
-
MantineDatePickerProps<Type>,
|
|
108
|
-
"value" | "defaultValue" | "onChange" | "type" | "classNames" | "styles"
|
|
109
|
-
>
|
|
110
|
-
>;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Calendar trigger(Input) 영역에서 필요한 속성 묶음.
|
|
114
|
-
* FormField와의 조합을 고려해 label/helper 등을 상위 Template에 위임한다.
|
|
115
|
-
* @property {string} [id] trigger id (label htmlFor 연동)
|
|
116
|
-
* @property {string} [name] form name; register 미사용 시 수동 지정
|
|
117
|
-
* @property {UseFormRegisterReturn} [register] react-hook-form register 결과
|
|
118
|
-
* @property {ReactNode} [placeholder] trigger 내부 placeholder
|
|
119
|
-
* @property {string} [triggerClassName] trigger className (예: InputFoundation box)
|
|
120
|
-
*/
|
|
121
|
-
export interface InputCalendarTriggerProps extends Pick<
|
|
122
|
-
ComponentPropsWithoutRef<"button">,
|
|
123
|
-
"onClick" | "disabled"
|
|
124
|
-
> {
|
|
125
|
-
/**
|
|
126
|
-
* trigger id (label htmlFor 연동)
|
|
127
|
-
*/
|
|
128
|
-
id?: string;
|
|
129
|
-
/**
|
|
130
|
-
* form name; register 미사용 시 수동 지정
|
|
131
|
-
*/
|
|
132
|
-
name?: string;
|
|
133
|
-
/**
|
|
134
|
-
* react-hook-form register 결과
|
|
135
|
-
*/
|
|
136
|
-
register?: UseFormRegisterReturn;
|
|
137
|
-
/**
|
|
138
|
-
* trigger 내부 placeholder
|
|
139
|
-
*/
|
|
140
|
-
placeholder?: ReactNode;
|
|
141
|
-
/**
|
|
142
|
-
* trigger className (예: InputFoundation box)
|
|
143
|
-
*/
|
|
144
|
-
triggerClassName?: string;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Input Calendar core props.
|
|
149
|
-
* @property {InputCalendarMode} [mode="date"] 날짜/시간 모드
|
|
150
|
-
* @property {DatePickerType} [type="default"] Mantine range/multiple 모드
|
|
151
|
-
* @property {InputCalendarColumns} [columns=1] 동시에 노출할 달력 열 수
|
|
152
|
-
* @property {InputCalendarValue} [value] 제어형 값
|
|
153
|
-
* @property {InputCalendarValue} [defaultValue] 비제어 초기값
|
|
154
|
-
* @property {InputCalendarOnChange} [onChange] 값 변경 핸들러(직렬화 문자열 기준)
|
|
155
|
-
* @property {InputCalendarOnChange} [onValueChange] onChange 별칭(추가 파이프라인용)
|
|
156
|
-
* @property {boolean} [readOnly] 읽기 전용 여부
|
|
157
|
-
* @property {boolean} [disabled] disabled 여부
|
|
158
|
-
* @property {InputCalendarMantineProps} [datePickerProps] Mantine DatePicker 직접 옵션
|
|
159
|
-
* @property {InputCalendarActionOptions} [actions] footer 액션 옵션
|
|
160
|
-
* @property {InputCalendarActionHandlers} [actionHandlers] footer 버튼 핸들러
|
|
161
|
-
*/
|
|
162
|
-
export interface InputCalendarProps<Type extends DatePickerType = "default">
|
|
163
|
-
extends InputCalendarActionHandlers<Type>, InputCalendarTriggerProps {
|
|
164
|
-
/**
|
|
165
|
-
* 날짜/시간 모드
|
|
166
|
-
*/
|
|
167
|
-
mode?: InputCalendarMode;
|
|
168
|
-
/**
|
|
169
|
-
* Mantine DatePicker type
|
|
170
|
-
*/
|
|
171
|
-
type?: Type;
|
|
172
|
-
/**
|
|
173
|
-
* 동시에 노출할 달력 열 수
|
|
174
|
-
*/
|
|
175
|
-
columns?: InputCalendarColumns;
|
|
176
|
-
/**
|
|
177
|
-
* 제어형 값
|
|
178
|
-
*/
|
|
179
|
-
value?: InputCalendarValue<Type>;
|
|
180
|
-
/**
|
|
181
|
-
* 비제어 초기값
|
|
182
|
-
*/
|
|
183
|
-
defaultValue?: InputCalendarValue<Type>;
|
|
184
|
-
/**
|
|
185
|
-
* 값 변경 핸들러
|
|
186
|
-
*/
|
|
187
|
-
onChange?: InputCalendarOnChange<Type>;
|
|
188
|
-
/**
|
|
189
|
-
* onChange 별칭; 외부 파이프라인 시 사용
|
|
190
|
-
*/
|
|
191
|
-
onValueChange?: InputCalendarOnChange<Type>;
|
|
192
|
-
/**
|
|
193
|
-
* 읽기 전용 여부
|
|
194
|
-
*/
|
|
195
|
-
readOnly?: boolean;
|
|
196
|
-
/**
|
|
197
|
-
* disabled 여부
|
|
198
|
-
*/
|
|
199
|
-
disabled?: boolean;
|
|
200
|
-
/**
|
|
201
|
-
* Mantine DatePicker 옵션
|
|
202
|
-
*/
|
|
203
|
-
datePickerProps?: InputCalendarMantineProps<Type>;
|
|
204
|
-
/**
|
|
205
|
-
* footer 버튼 옵션
|
|
206
|
-
*/
|
|
207
|
-
actions?: InputCalendarActionOptions;
|
|
208
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|