@ehfuse/mui-form-controls 1.3.18 → 1.3.20

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 KIM YOUNG JIN (ehfuse@gmail.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,262 +1,296 @@
1
- # @ehfuse/mui-form-controls
2
-
3
- MUI 기반 폼 컨트롤과 텍스트 필드 컴포넌트 모음
4
-
5
- ## 컴포넌트
6
-
7
- | 컴포넌트 | 설명 | 문서 |
8
- | ----------------------------- | ---------------------------------------------------------------- | ------------------------------------------------- |
9
- | **AddressTextField** | 다음 우편번호 API 연동 주소 검색 필드 | [API](./docs/ko/api.md#addresstextfield) |
10
- | **Autocomplete** | 자동완성 기능이 있는 입력 필드 | [API](./docs/ko/api.md#autocomplete) |
11
- | **BizNumTextField** | 사업자등록번호 입력 필드 (검증, 복사 기능) | [API](./docs/ko/api.md#biznumtextfield) |
12
- | **CardNumTextField** | 카드번호 입력 필드 (마스킹, 브랜드 감지, 로고 아이콘) | [API](./docs/ko/api.md#cardnumtextfield) |
13
- | **ClearTextField** | 클리어 버튼이 있는 기본 텍스트 필드 | [API](./docs/ko/api.md#cleartextfield) |
14
- | **DateRange** | 날짜 범위 입력 필드 (시작일, 종료일) | [API](./docs/ko/api.md#daterange) |
15
- | **DateTextField** | 달력 팝업, 다양한 날짜 포맷, 공휴일 표시 지원 날짜 필드 | [API](./docs/ko/api.md#datetextfield) |
16
- | **DateTimeTextField** | 날짜 + 시간 입력 필드 | [API](./docs/ko/api.md#datetimetextfield) |
17
- | **EmailTextField** | 도메인 자동완성, 유효성 검사 기능이 있는 이메일 필드 | [API](./docs/ko/api.md#emailtextfield) |
18
- | **JuminTextField** | 주민등록번호 입력 필드 (마스킹, 정보 추출) | [API](./docs/ko/api.md#jumintextfield) |
19
- | **NumberField** | 숫자 입력 (증감 버튼 포함) | [API](./docs/ko/api.md#numberfield) |
20
- | **NumberSpinner** | 숫자 스피너 | [API](./docs/ko/api.md#numberspinner) |
21
- | **NumberTextField** | 천 단위 구분자, 소수점, 음수 지원하는 숫자 필드 | [API](./docs/ko/api.md#numbertextfield) |
22
- | **PasswordTextField** | 비밀번호 보기/숨기기 토글, 유효성 검사 기능이 있는 비밀번호 필드 | [API](./docs/ko/api.md#passwordtextfield) |
23
- | **PhoneTextField** | 자동 포맷팅, prefix 고정 기능이 있는 전화번호 필드 | [API](./docs/ko/api.md#phonetextfield) |
24
- | **SearchTextField** | 클리어 버튼, 로딩 상태, 디바운스 기능이 있는 검색 필드 | [API](./docs/ko/api.md#searchtextfield) |
25
- | **TextArea** | 여러 줄 텍스트 입력 필드 | [API](./docs/ko/api.md#textarea) |
26
- | **TextField** | MUI TextField 래퍼 (폼 통합) | [API](./docs/ko/api.md#textfield) |
27
- | **TimeTextField** | 시간 입력 필드 (자동 포맷팅, 시간 범위 제한) | [API](./docs/ko/api.md#timetextfield) |
28
- | **VerificationCodeTextField** | 인증번호 입력 필드 (숫자/영문/혼합) | [API](./docs/ko/api.md#verificationcodetextfield) |
29
-
30
- ## 폼 컨트롤 (Form Controls)
31
-
32
- 키보드 입력이 필요한 컴포넌트는 위 "컴포넌트"에, 마우스 조작만으로 선택/토글하는 컴포넌트는 여기서 분리해 정리했습니다.
33
-
34
- | 컴포넌트 | 설명 | 문서 |
35
- | ---------------- | --------------------------------------------------------- | ------------------------------------ |
36
- | **ButtonGroup** | 버튼 그룹 컴포넌트 | [API](./docs/ko/api.md#buttongroup) |
37
- | **Checkbox** | MUI Checkbox 래퍼 (폼 통합) | [API](./docs/ko/api.md#checkbox) |
38
- | **LabelSelect** | MUI Select 기반 선택 필드 (InputLabel, 포커스 기반 notch) | [API](./docs/ko/api.md#labelselect) |
39
- | **RadioGroup** | MUI RadioGroup 래퍼 (폼 통합) | [API](./docs/ko/api.md#radiogroup) |
40
- | **Rating** | 평점 입력 컴포넌트 | [API](./docs/ko/api.md#rating) |
41
- | **Select** | MUI Select 기반 선택 필드 (라벨 미포함) | [API](./docs/ko/api.md#select) |
42
- | **Slider** | MUI Slider 래퍼 (폼 통합) | [API](./docs/ko/api.md#slider) |
43
- | **Stepper** | 스텝 진행 표시 컴포넌트 | [API](./docs/ko/api.md#stepper) |
44
- | **Switch** | MUI Switch 래퍼 (폼 통합) | [API](./docs/ko/api.md#switch) |
45
- | **ToggleButton** | 토글 버튼 컴포넌트 | [API](./docs/ko/api.md#togglebutton) |
46
-
47
- ## 훅 (Hooks)
48
-
49
- | 훅 | 설명 | 문서 |
50
- | -------------------------- | --------------------------------------------------- | ---------------------------------------------- |
51
- | **useKoreanHolidays** | 단일 연도의 한국 공휴일을 조회하는 커스텀 훅 | [API](./docs/ko/api.md#usekoreanholidays) |
52
- | **useKoreanHolidaysRange** | 여러 연도의 한국 공휴일을 한번에 조회하는 커스텀 훅 | [API](./docs/ko/api.md#usekoreanholidaysrange) |
53
-
54
- ## 설치
55
-
56
- ```bash
57
- npm install @ehfuse/mui-form-controls
58
- ```
59
-
60
- ## 필수 의존성
61
-
62
- ```json
63
- {
64
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
65
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
66
- "@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
67
- "@mui/icons-material": "^5.0.0 || ^6.0.0 || ^7.0.0",
68
- "@emotion/react": "^11.0.0",
69
- "@emotion/styled": "^11.0.0",
70
- "@ehfuse/overlay-scrollbar": "^1.0.0"
71
- }
72
- ```
73
-
74
- ## 빠른 시작
75
-
76
- ```tsx
77
- import {
78
- SearchTextField,
79
- ClearTextField,
80
- PasswordTextField,
81
- PhoneTextField,
82
- EmailTextField,
83
- NumberTextField,
84
- AddressTextField,
85
- JuminTextField,
86
- BizNumTextField,
87
- CardNumTextField,
88
- VerificationCodeTextField,
89
- DateTextField,
90
- TimeTextField,
91
- DateTimeTextField,
92
- TextField,
93
- Rating,
94
- ToggleButton,
95
- ButtonGroup,
96
- Stepper,
97
- NumberField,
98
- NumberSpinner,
99
- Select,
100
- LabelSelect,
101
- Autocomplete,
102
- Checkbox,
103
- RadioGroup,
104
- Switch,
105
- Slider,
106
- DateRange,
107
- TextArea,
108
- useKoreanHolidays,
109
- useKoreanHolidaysRange,
110
- } from '@ehfuse/mui-form-controls';
111
-
112
- // 검색 필드
113
- <SearchTextField
114
- value={search}
115
- onChange={(e) => setSearch(e.target.value)}
116
- searchIcon
117
- loading={isSearching}
118
- />
119
-
120
- // 비밀번호 필드
121
- <PasswordTextField
122
- value={password}
123
- onChange={(e) => setPassword(e.target.value)}
124
- showToggle
125
- />
126
-
127
- // 전화번호 필드
128
- <PhoneTextField
129
- value={phone}
130
- onChange={(e) => setPhone(e.target.value)}
131
- prefix="010"
132
- />
133
-
134
- // 이메일 필드 (forma 호환)
135
- <EmailTextField
136
- name="email"
137
- value={email}
138
- onChange={handleFormChange}
139
- extraDomains={["mycompany.com"]}
140
- />
141
-
142
- // 숫자 필드
143
- <NumberTextField
144
- value={amount}
145
- onChange={(e) => setAmount(e.target.value)}
146
- prefix="₩"
147
- suffix="원"
148
- />
149
-
150
- // 날짜 필드
151
- <DateTextField
152
- value={date}
153
- onChange={(e) => setDate(e.target.value)}
154
- format="YYYY.MM.DD"
155
- selectedColor="secondary.main"
156
- />
157
-
158
- // 주소 필드
159
- <AddressTextField
160
- value={address}
161
- onChange={setAddress}
162
- />
163
-
164
- // 주민등록번호 필드
165
- <JuminTextField
166
- value={jumin}
167
- onChange={setJumin}
168
- mask
169
- />
170
-
171
- // 사업자등록번호 필드
172
- <BizNumTextField
173
- value={bizNum}
174
- onChange={setBizNum}
175
- validate
176
- copyIcon
177
- />
178
-
179
- // 카드번호 필드
180
- <CardNumTextField
181
- value={cardNum}
182
- onChange={(e) => setCardNum(e.target.value)}
183
- onCardBrandChange={(brand) => console.log('카드 브랜드:', brand)}
184
- />
185
-
186
- // 인증번호 필드
187
- <VerificationCodeTextField
188
- value={code}
189
- onChange={setCode}
190
- length={6}
191
- type="numeric"
192
- onComplete={(code) => console.log('완료:', code)}
193
- />
194
-
195
- // 시간 필드
196
- <TimeTextField
197
- value={time}
198
- onChange={(e) => setTime(e.target.value)}
199
- format="HH:mm"
200
- minTime="09:00"
201
- maxTime="18:00"
202
- />
203
-
204
- // 선택 필드 (라벨 없음)
205
- <Select
206
- name="status"
207
- form={form}
208
- options={[
209
- { value: 'active', label: '활성' },
210
- { value: 'inactive', label: '비활성' },
211
- ]}
212
- emptyLabel="상태 선택"
213
- />
214
-
215
- // 선택 필드 (라벨 포함)
216
- <LabelSelect
217
- name="category"
218
- label="카테고리"
219
- form={form}
220
- options={[
221
- { value: 'a', label: 'A' },
222
- { value: 'b', label: 'B' },
223
- ]}
224
- />
225
-
226
- // 자동완성 필드
227
- <Autocomplete
228
- name="department"
229
- label="부서"
230
- form={form}
231
- options={[
232
- { value: 'dev', label: '개발' },
233
- { value: 'design', label: '디자인' },
234
- ]}
235
- />
236
-
237
- // 날짜 범위
238
- <DateRange
239
- form={form}
240
- startName="startDate"
241
- endName="endDate"
242
- startLabel="시작일"
243
- endLabel="종료일"
244
- />
245
-
246
- // 텍스트 에어리어
247
- <TextArea
248
- name="memo"
249
- label="메모"
250
- form={form}
251
- minRows={4}
252
- />
253
- ```
254
-
255
- ## 문서 / Documentation
256
-
257
- - [한국어 문서](./docs/ko/getting-started.md)
258
- - [English Documentation](./docs/en/getting-started.md)
259
-
260
- ## 라이선스 / License
261
-
262
- MIT © 김영진 (Kim Young Jin)
1
+ # @ehfuse/mui-form-controls
2
+
3
+ MUI 기반 폼 컨트롤과 텍스트 필드 컴포넌트 모음
4
+
5
+ ## 컴포넌트
6
+
7
+ | 컴포넌트 | 설명 | 문서 |
8
+ | ----------------------------- | ---------------------------------------------------------------- | ------------------------------------------------- |
9
+ | **AddressTextField** | 다음 우편번호 API 연동 주소 검색 필드 | [API](./docs/ko/api.md#addresstextfield) |
10
+ | **Autocomplete** | 자동완성 기능이 있는 입력 필드 | [API](./docs/ko/api.md#autocomplete) |
11
+ | **BizNumTextField** | 사업자등록번호 입력 필드 (검증, 복사 기능) | [API](./docs/ko/api.md#biznumtextfield) |
12
+ | **CardNumTextField** | 카드번호 입력 필드 (마스킹, 브랜드 감지, 로고 아이콘) | [API](./docs/ko/api.md#cardnumtextfield) |
13
+ | **ClearTextField** | 클리어 버튼이 있는 기본 텍스트 필드 | [API](./docs/ko/api.md#cleartextfield) |
14
+ | **DateRange** | 날짜 범위 입력 필드 (시작일, 종료일) | [API](./docs/ko/api.md#daterange) |
15
+ | **DateTextField** | 달력 팝업, 다양한 날짜 포맷, 공휴일 표시 지원 날짜 필드 | [API](./docs/ko/api.md#datetextfield) |
16
+ | **DateTimeTextField** | 날짜 + 시간 입력 필드 | [API](./docs/ko/api.md#datetimetextfield) |
17
+ | **EmailTextField** | 도메인 자동완성, 유효성 검사 기능이 있는 이메일 필드 | [API](./docs/ko/api.md#emailtextfield) |
18
+ | **JuminTextField** | 주민등록번호 입력 필드 (마스킹, 정보 추출) | [API](./docs/ko/api.md#jumintextfield) |
19
+ | **NumberField** | 숫자 입력 (증감 버튼 포함) | [API](./docs/ko/api.md#numberfield) |
20
+ | **NumberSpinner** | 숫자 스피너 | [API](./docs/ko/api.md#numberspinner) |
21
+ | **NumberTextField** | 천 단위 구분자, 소수점, 음수 지원하는 숫자 필드 | [API](./docs/ko/api.md#numbertextfield) |
22
+ | **PasswordTextField** | 비밀번호 보기/숨기기 토글, 유효성 검사 기능이 있는 비밀번호 필드 | [API](./docs/ko/api.md#passwordtextfield) |
23
+ | **PhoneTextField** | 자동 포맷팅, prefix 고정 기능이 있는 전화번호 필드 | [API](./docs/ko/api.md#phonetextfield) |
24
+ | **SearchTextField** | 클리어 버튼, 로딩 상태, 디바운스 기능이 있는 검색 필드 | [API](./docs/ko/api.md#searchtextfield) |
25
+ | **TextArea** | 여러 줄 텍스트 입력 필드 | [API](./docs/ko/api.md#textarea) |
26
+ | **TextField** | MUI TextField 래퍼 (폼 통합) | [API](./docs/ko/api.md#textfield) |
27
+ | **TimeTextField** | 시간 입력 필드 (자동 포맷팅, 시간 범위 제한) | [API](./docs/ko/api.md#timetextfield) |
28
+ | **VerificationCodeTextField** | 인증번호 입력 필드 (숫자/영문/혼합) | [API](./docs/ko/api.md#verificationcodetextfield) |
29
+
30
+ ## 폼 컨트롤 (Form Controls)
31
+
32
+ 키보드 입력이 필요한 컴포넌트는 위 "컴포넌트"에, 마우스 조작만으로 선택/토글하는 컴포넌트는 여기서 분리해 정리했습니다.
33
+
34
+ | 컴포넌트 | 설명 | 문서 |
35
+ | ---------------- | --------------------------------------------------------- | ------------------------------------ |
36
+ | **ButtonGroup** | 버튼 그룹 컴포넌트 | [API](./docs/ko/api.md#buttongroup) |
37
+ | **Checkbox** | MUI Checkbox 래퍼 (폼 통합) | [API](./docs/ko/api.md#checkbox) |
38
+ | **LabelSelect** | MUI Select 기반 선택 필드 (InputLabel, 포커스 기반 notch) | [API](./docs/ko/api.md#labelselect) |
39
+ | **RadioGroup** | MUI RadioGroup 래퍼 (폼 통합) | [API](./docs/ko/api.md#radiogroup) |
40
+ | **Rating** | 평점 입력 컴포넌트 | [API](./docs/ko/api.md#rating) |
41
+ | **Select** | MUI Select 기반 선택 필드 (라벨 미포함) | [API](./docs/ko/api.md#select) |
42
+ | **Slider** | MUI Slider 래퍼 (폼 통합) | [API](./docs/ko/api.md#slider) |
43
+ | **Stepper** | 스텝 진행 표시 컴포넌트 | [API](./docs/ko/api.md#stepper) |
44
+ | **Switch** | MUI Switch 래퍼 (폼 통합) | [API](./docs/ko/api.md#switch) |
45
+ | **SwitchField** | 라벨 포함 Switch 필드 (`FormControlLabel` + `Switch`) | [API](./docs/ko/api.md#switchfield) |
46
+ | **ToggleButton** | 토글 버튼 컴포넌트 | [API](./docs/ko/api.md#togglebutton) |
47
+
48
+ ## 훅 (Hooks)
49
+
50
+ | | 설명 | 문서 |
51
+ | -------------------------- | --------------------------------------------------- | ---------------------------------------------- |
52
+ | **useKoreanHolidays** | 단일 연도의 한국 공휴일을 조회하는 커스텀 훅 | [API](./docs/ko/api.md#usekoreanholidays) |
53
+ | **useKoreanHolidaysRange** | 여러 연도의 한국 공휴일을 한번에 조회하는 커스텀 훅 | [API](./docs/ko/api.md#usekoreanholidaysrange) |
54
+
55
+ ## 설치
56
+
57
+ ```bash
58
+ npm install @ehfuse/mui-form-controls
59
+ ```
60
+
61
+ ## 필수 의존성
62
+
63
+ ```json
64
+ {
65
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
66
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
67
+ "@mui/material": "^5.0.0 || ^6.0.0 || ^7.0.0",
68
+ "@mui/icons-material": "^5.0.0 || ^6.0.0 || ^7.0.0",
69
+ "@emotion/react": "^11.0.0",
70
+ "@emotion/styled": "^11.0.0",
71
+ "@ehfuse/overlay-scrollbar": "^1.0.0"
72
+ }
73
+ ```
74
+
75
+ ## 빠른 시작
76
+
77
+ ```tsx
78
+ import {
79
+ SearchTextField,
80
+ ClearTextField,
81
+ PasswordTextField,
82
+ PhoneTextField,
83
+ EmailTextField,
84
+ NumberTextField,
85
+ AddressTextField,
86
+ JuminTextField,
87
+ BizNumTextField,
88
+ CardNumTextField,
89
+ VerificationCodeTextField,
90
+ DateTextField,
91
+ TimeTextField,
92
+ DateTimeTextField,
93
+ TextField,
94
+ Rating,
95
+ ToggleButton,
96
+ ButtonGroup,
97
+ Stepper,
98
+ NumberField,
99
+ NumberSpinner,
100
+ Select,
101
+ LabelSelect,
102
+ Autocomplete,
103
+ Checkbox,
104
+ RadioGroup,
105
+ Switch,
106
+ SwitchField,
107
+ Slider,
108
+ DateRange,
109
+ TextArea,
110
+ useKoreanHolidays,
111
+ useKoreanHolidaysRange,
112
+ } from '@ehfuse/mui-form-controls';
113
+
114
+ // 검색 필드
115
+ <SearchTextField
116
+ value={search}
117
+ onChange={(e) => setSearch(e.target.value)}
118
+ searchIcon
119
+ loading={isSearching}
120
+ />
121
+
122
+ // 비밀번호 필드
123
+ <PasswordTextField
124
+ value={password}
125
+ onChange={(e) => setPassword(e.target.value)}
126
+ showToggle
127
+ />
128
+
129
+ // 전화번호 필드
130
+ <PhoneTextField
131
+ value={phone}
132
+ onChange={(e) => setPhone(e.target.value)}
133
+ prefix="010"
134
+ />
135
+
136
+ // 이메일 필드 (forma 호환)
137
+ <EmailTextField
138
+ name="email"
139
+ value={email}
140
+ onChange={handleFormChange}
141
+ extraDomains={["mycompany.com"]}
142
+ />
143
+
144
+ // 숫자 필드
145
+ <NumberTextField
146
+ value={amount}
147
+ onChange={(e) => setAmount(e.target.value)}
148
+ prefix="₩"
149
+ suffix="원"
150
+ />
151
+
152
+ // 날짜 필드
153
+ <DateTextField
154
+ value={date}
155
+ onChange={(e) => setDate(e.target.value)}
156
+ format="YYYY.MM.DD"
157
+ selectedColor="secondary.main"
158
+ />
159
+
160
+ // 주소 필드
161
+ <AddressTextField
162
+ value={address}
163
+ onChange={setAddress}
164
+ />
165
+
166
+ // 주민등록번호 필드
167
+ <JuminTextField
168
+ value={jumin}
169
+ onChange={setJumin}
170
+ mask
171
+ />
172
+
173
+ // 사업자등록번호 필드
174
+ <BizNumTextField
175
+ value={bizNum}
176
+ onChange={setBizNum}
177
+ validate
178
+ copyIcon
179
+ />
180
+
181
+ // 카드번호 필드
182
+ <CardNumTextField
183
+ value={cardNum}
184
+ onChange={(e) => setCardNum(e.target.value)}
185
+ onCardBrandChange={(brand) => console.log('카드 브랜드:', brand)}
186
+ />
187
+
188
+ // 인증번호 필드
189
+ <VerificationCodeTextField
190
+ value={code}
191
+ onChange={setCode}
192
+ length={6}
193
+ type="numeric"
194
+ onComplete={(code) => console.log('완료:', code)}
195
+ />
196
+
197
+ // 시간 필드
198
+ <TimeTextField
199
+ value={time}
200
+ onChange={(e) => setTime(e.target.value)}
201
+ format="HH:mm"
202
+ minTime="09:00"
203
+ maxTime="18:00"
204
+ />
205
+
206
+ // 선택 필드 (라벨 없음)
207
+ <Select
208
+ name="status"
209
+ form={form}
210
+ options={[
211
+ { value: 'active', label: '활성' },
212
+ { value: 'inactive', label: '비활성' },
213
+ ]}
214
+ emptyLabel="상태 선택"
215
+ />
216
+
217
+ // 선택 필드 (라벨 포함)
218
+ <LabelSelect
219
+ name="category"
220
+ label="카테고리"
221
+ form={form}
222
+ options={[
223
+ { value: 'a', label: 'A' },
224
+ { value: 'b', label: 'B' },
225
+ ]}
226
+ />
227
+
228
+ // 자동완성 필드
229
+ <Autocomplete
230
+ name="department"
231
+ label="부서"
232
+ form={form}
233
+ options={[
234
+ { value: 'dev', label: '개발' },
235
+ { value: 'design', label: '디자인' },
236
+ ]}
237
+ />
238
+
239
+ // 날짜 범위
240
+ <DateRange
241
+ form={form}
242
+ startName="startDate"
243
+ endName="endDate"
244
+ startLabel="시작일"
245
+ endLabel="종료일"
246
+ />
247
+
248
+ // 텍스트 에어리어
249
+ <TextArea
250
+ name="memo"
251
+ label="메모"
252
+ form={form}
253
+ minRows={4}
254
+ />
255
+ ```
256
+
257
+ ## Boolean 필드 표준 패턴
258
+
259
+ `Switch`를 boolean 입력의 기본 form-binding 컴포넌트로 사용합니다.
260
+
261
+ ```tsx
262
+ import { Switch, SwitchField } from "@ehfuse/mui-form-controls";
263
+
264
+ // 1) 단일 스위치 (라벨 없음)
265
+ <Switch form={form} name="deceased_disability_certificate" />
266
+
267
+ // 2) 라벨 포함 스위치 (권장)
268
+ <SwitchField
269
+ form={form}
270
+ name="deceased_disability_certificate"
271
+ label="장애인 증명서 제출"
272
+ />
273
+
274
+ // 3) readOnly / disabled
275
+ <SwitchField
276
+ form={form}
277
+ name="deceased_disability_certificate"
278
+ label="수정 불가 항목"
279
+ readonly
280
+ />
281
+ <SwitchField
282
+ form={form}
283
+ name="deceased_disability_certificate"
284
+ label="비활성 항목"
285
+ disabled
286
+ />
287
+ ```
288
+
289
+ ## 문서 / Documentation
290
+
291
+ - [한국어 문서](./docs/ko/getting-started.md)
292
+ - [English Documentation](./docs/en/getting-started.md)
293
+
294
+ ## 라이선스 / License
295
+
296
+ MIT © 김영진 (Kim Young Jin)
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SwitchField.tsx
3
+ *
4
+ * @license MIT
5
+ * @copyright 2025 김영진 (Kim Young Jin)
6
+ * @author 김영진 (ehfuse@gmail.com)
7
+ */
8
+ import React from "react";
9
+ import type { SwitchFieldProps } from "./types";
10
+ export declare const SwitchField: React.ForwardRefExoticComponent<Omit<SwitchFieldProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export { TextArea } from "./TextArea";
13
13
  export { Checkbox } from "./Checkbox";
14
14
  export { RadioGroup } from "./RadioGroup";
15
15
  export { Switch } from "./Switch";
16
+ export { SwitchField } from "./SwitchField";
16
17
  export { Rating } from "./Rating";
17
18
  export { ToggleButton } from "./ToggleButton";
18
19
  export { ButtonGroup } from "./ButtonGroup";
@@ -37,4 +38,4 @@ export { BizNumTextField } from "./BizNumTextField";
37
38
  export { CardNumTextField } from "./CardNumTextField";
38
39
  export { useKoreanHolidays, useKoreanHolidaysRange } from "./hooks";
39
40
  export { CardIcon, VisaIcon, MastercardIcon, AmexIcon, JcbIcon, DinersIcon, DiscoverIcon, UnionPayIcon, BcIcon, } from "./icons";
40
- export type { SearchTextFieldProps, ClearTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ButtonGroupProps, StepperProps, AutocompleteProps, AutocompleteOption, SelectProps, SelectOption, LabelSelectProps, LabelSelectOption, PasswordValidationRules, PasswordValidationResult, PhoneTextFieldProps, PhoneFormat, AddressTextFieldProps, DaumPostcodeData, NumberTextFieldProps, JuminTextFieldProps, JuminInfo, VerificationCodeTextFieldProps, VerificationCodeType, EmailTextFieldProps, CustomDomain, DateTextFieldProps, DateFormat, TimeTextFieldProps, TimeFormat, DateTimeTextFieldProps, DateTimeFormat, BizNumTextFieldProps, CardNumTextFieldProps, SelectChangeEvent, } from "./types";
41
+ export type { SearchTextFieldProps, ClearTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, SwitchFieldProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ButtonGroupProps, StepperProps, AutocompleteProps, AutocompleteOption, SelectProps, SelectOption, LabelSelectProps, LabelSelectOption, PasswordValidationRules, PasswordValidationResult, PhoneTextFieldProps, PhoneFormat, AddressTextFieldProps, DaumPostcodeData, NumberTextFieldProps, JuminTextFieldProps, JuminInfo, VerificationCodeTextFieldProps, VerificationCodeType, EmailTextFieldProps, CustomDomain, DateTextFieldProps, DateFormat, TimeTextFieldProps, TimeFormat, DateTimeTextFieldProps, DateTimeFormat, BizNumTextFieldProps, CardNumTextFieldProps, SelectChangeEvent, } from "./types";