@ehfuse/mui-form-controls 1.3.19 → 1.3.21

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 CHANGED
@@ -42,7 +42,9 @@ MUI 기반 폼 컨트롤과 텍스트 필드 컴포넌트 모음
42
42
  | **Slider** | MUI Slider 래퍼 (폼 통합) | [API](./docs/ko/api.md#slider) |
43
43
  | **Stepper** | 스텝 진행 표시 컴포넌트 | [API](./docs/ko/api.md#stepper) |
44
44
  | **Switch** | MUI Switch 래퍼 (폼 통합) | [API](./docs/ko/api.md#switch) |
45
+ | **SwitchField** | 라벨 포함 Switch 필드 (`FormControlLabel` + `Switch`) | [API](./docs/ko/api.md#switchfield) |
45
46
  | **ToggleButton** | 토글 버튼 컴포넌트 | [API](./docs/ko/api.md#togglebutton) |
47
+ | **ToggleButtonGroupField** | 옵션 기반 토글 그룹 필드 (`ToggleButtonGroup` + form 바인딩) | [API](./docs/ko/api.md#togglebuttongroupfield) |
46
48
 
47
49
  ## 훅 (Hooks)
48
50
 
@@ -92,6 +94,7 @@ import {
92
94
  TextField,
93
95
  Rating,
94
96
  ToggleButton,
97
+ ToggleButtonGroupField,
95
98
  ButtonGroup,
96
99
  Stepper,
97
100
  NumberField,
@@ -102,6 +105,7 @@ import {
102
105
  Checkbox,
103
106
  RadioGroup,
104
107
  Switch,
108
+ SwitchField,
105
109
  Slider,
106
110
  DateRange,
107
111
  TextArea,
@@ -252,6 +256,57 @@ import {
252
256
  />
253
257
  ```
254
258
 
259
+ ## Boolean 필드 표준 패턴
260
+
261
+ `Switch`를 boolean 입력의 기본 form-binding 컴포넌트로 사용합니다.
262
+
263
+ ```tsx
264
+ import { Switch, SwitchField } from "@ehfuse/mui-form-controls";
265
+
266
+ // 1) 단일 스위치 (라벨 없음)
267
+ <Switch form={form} name="deceased_disability_certificate" />
268
+
269
+ // 2) 라벨 포함 스위치 (권장)
270
+ <SwitchField
271
+ form={form}
272
+ name="deceased_disability_certificate"
273
+ label="장애인 증명서 제출"
274
+ />
275
+
276
+ // 3) readOnly / disabled
277
+ <SwitchField
278
+ form={form}
279
+ name="deceased_disability_certificate"
280
+ label="수정 불가 항목"
281
+ readonly
282
+ />
283
+ <SwitchField
284
+ form={form}
285
+ name="deceased_disability_certificate"
286
+ label="비활성 항목"
287
+ disabled
288
+ />
289
+ ```
290
+
291
+ ## Toggle 그룹 표준 패턴
292
+
293
+ ```tsx
294
+ import { ToggleButtonGroupField } from "@ehfuse/mui-form-controls";
295
+
296
+ <ToggleButtonGroupField
297
+ form={form}
298
+ name="contractor_gender"
299
+ exclusive
300
+ options={[
301
+ { label: "남성", value: "M" },
302
+ { label: "여성", value: "F" },
303
+ ]}
304
+ onDeselect="clear"
305
+ fullWidth
306
+ size="small"
307
+ />
308
+ ```
309
+
255
310
  ## 문서 / Documentation
256
311
 
257
312
  - [한국어 문서](./docs/ko/getting-started.md)
@@ -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>>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * ToggleButtonGroupField.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 { ToggleButtonGroupFieldProps } from "./types";
10
+ export declare const ToggleButtonGroupField: React.ForwardRefExoticComponent<Omit<ToggleButtonGroupFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
package/dist/index.d.ts CHANGED
@@ -13,8 +13,10 @@ 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";
19
+ export { ToggleButtonGroupField } from "./ToggleButtonGroupField";
18
20
  export { ButtonGroup } from "./ButtonGroup";
19
21
  export { DateRange } from "./DateRange";
20
22
  export { Slider } from "./Slider";
@@ -37,4 +39,4 @@ export { BizNumTextField } from "./BizNumTextField";
37
39
  export { CardNumTextField } from "./CardNumTextField";
38
40
  export { useKoreanHolidays, useKoreanHolidaysRange } from "./hooks";
39
41
  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";
42
+ export type { SearchTextFieldProps, ClearTextFieldProps, PasswordTextFieldProps, TextFieldProps, TextAreaProps, CheckboxProps, SwitchProps, SwitchFieldProps, RadioGroupProps, RadioOption, DateRangeProps, SliderProps, RatingProps, ToggleButtonProps, ToggleButtonGroupFieldProps, ToggleButtonGroupFieldOption, 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";