@uniai-fe/uds-primitives 0.3.18 → 0.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.
Files changed (81) hide show
  1. package/dist/styles.css +228 -114
  2. package/package.json +1 -1
  3. package/src/components/badge/markup/Badge.tsx +3 -5
  4. package/src/components/badge/styles/index.scss +2 -1
  5. package/src/components/button/index.tsx +7 -1
  6. package/src/components/button/markup/Base.tsx +5 -10
  7. package/src/components/button/markup/Label.tsx +23 -0
  8. package/src/components/button/markup/index.ts +1 -0
  9. package/src/components/button/types/index.ts +1 -0
  10. package/src/components/button/types/label.ts +9 -0
  11. package/src/components/checkbox/markup/Checkbox.tsx +9 -4
  12. package/src/components/checkbox/styles/index.scss +6 -4
  13. package/src/components/chip/index.tsx +1 -2
  14. package/src/components/chip/markup/Chip.tsx +36 -24
  15. package/src/components/chip/markup/DefaultStyle.tsx +34 -19
  16. package/src/components/chip/markup/InputStyle.tsx +17 -7
  17. package/src/components/chip/markup/Label.tsx +15 -0
  18. package/src/components/chip/markup/ListRoot.tsx +88 -0
  19. package/src/components/chip/markup/RemoveButton.tsx +4 -1
  20. package/src/components/chip/markup/index.tsx +13 -1
  21. package/src/components/chip/styles/chip.scss +43 -15
  22. package/src/components/chip/types/options.ts +22 -14
  23. package/src/components/chip/types/props-internal.ts +9 -5
  24. package/src/components/chip/types/props.ts +127 -46
  25. package/src/components/chip/utils/index.ts +1 -1
  26. package/src/components/dropdown/styles/dropdown.scss +44 -23
  27. package/src/components/dropdown/styles/variables.scss +25 -0
  28. package/src/components/dropdown/types/base.ts +2 -2
  29. package/src/components/form/markup/form-field/Header.tsx +3 -1
  30. package/src/components/input/markup/file/UploadedChip.tsx +5 -5
  31. package/src/components/input/types/file.ts +1 -1
  32. package/src/components/radio/markup/Radio.tsx +9 -4
  33. package/src/components/radio/styles/index.scss +6 -4
  34. package/src/components/segmented-control/markup/Label.tsx +22 -0
  35. package/src/components/segmented-control/markup/List.tsx +2 -3
  36. package/src/components/segmented-control/markup/index.ts +1 -0
  37. package/src/components/segmented-control/styles/index.scss +4 -4
  38. package/src/components/segmented-control/types/index.ts +9 -0
  39. package/src/components/select/hooks/interaction.ts +5 -5
  40. package/src/components/select/img/chevron/primary/xsmall.svg +3 -0
  41. package/src/components/select/markup/Default.tsx +183 -212
  42. package/src/components/select/markup/foundation/Base.tsx +19 -12
  43. package/src/components/select/markup/foundation/Icon.tsx +9 -3
  44. package/src/components/select/markup/foundation/Selected.tsx +115 -10
  45. package/src/components/select/markup/multiple/Multiple.tsx +63 -135
  46. package/src/components/select/styles/select.scss +128 -72
  47. package/src/components/select/styles/variables.scss +11 -0
  48. package/src/components/select/types/base.ts +3 -2
  49. package/src/components/select/types/icon.ts +34 -3
  50. package/src/components/select/types/interaction.ts +1 -1
  51. package/src/components/select/types/option.ts +0 -80
  52. package/src/components/select/types/props.ts +167 -92
  53. package/src/components/select/types/trigger.ts +52 -1
  54. package/src/components/slot/index.tsx +2 -6
  55. package/src/components/slot/markup/Text.tsx +34 -0
  56. package/src/components/slot/markup/index.tsx +7 -0
  57. package/src/components/slot/types/index.ts +2 -0
  58. package/src/components/slot/types/text.ts +24 -0
  59. package/src/components/table/markup/foundation/Cell.tsx +4 -12
  60. package/src/components/table/markup/foundation/Td.tsx +4 -7
  61. package/src/components/table/markup/foundation/Text.tsx +16 -0
  62. package/src/components/table/markup/foundation/Th.tsx +4 -7
  63. package/src/components/table/markup/foundation/index.tsx +2 -0
  64. package/src/components/table/types/foundation.ts +9 -0
  65. package/src/components/tooltip/markup/Message.tsx +3 -1
  66. package/src/components/tooltip/markup/Text.tsx +21 -0
  67. package/src/components/tooltip/markup/index.tsx +3 -0
  68. package/src/components/tooltip/types/index.ts +1 -0
  69. package/src/components/tooltip/types/text.ts +9 -0
  70. package/src/index.scss +0 -1
  71. package/src/index.tsx +0 -1
  72. package/src/components/chip/utils/class-name.ts +0 -36
  73. package/src/components/label/hooks/index.ts +0 -4
  74. package/src/components/label/img/.gitkeep +0 -0
  75. package/src/components/label/index.scss +0 -1
  76. package/src/components/label/index.tsx +0 -4
  77. package/src/components/label/markup/index.tsx +0 -4
  78. package/src/components/label/styles/index.scss +0 -0
  79. package/src/components/label/types/index.ts +0 -4
  80. package/src/components/label/utils/index.ts +0 -4
  81. /package/src/components/slot/markup/{Component.tsx → Base.tsx} +0 -0
@@ -1,5 +1,10 @@
1
- import type { HTMLAttributes, ReactNode } from "react";
1
+ import type {
2
+ ComponentPropsWithoutRef,
3
+ HTMLAttributes,
4
+ ReactNode,
5
+ } from "react";
2
6
  import type { DropdownMenuProps } from "@radix-ui/react-dropdown-menu";
7
+ import type { UseFormRegisterReturn } from "react-hook-form";
3
8
 
4
9
  import type {
5
10
  DropdownContainerProps,
@@ -8,7 +13,7 @@ import type {
8
13
  } from "../../dropdown/types";
9
14
  import type { FormFieldWidth } from "../../form/types";
10
15
  import type { SelectPriority, SelectSize, SelectState } from "./base";
11
- import type { SelectDropdownOption, SelectOptionChangePayload } from "./option";
16
+ import type { SelectDropdownOption } from "./option";
12
17
  import type {
13
18
  SelectTriggerDefaultProps,
14
19
  SelectTriggerMultipleProps,
@@ -24,7 +29,6 @@ import type {
24
29
  export interface SelectStyleOptions {
25
30
  /**
26
31
  * priority scale
27
- * - table 우선순위는 width 미지정 시 기본 block(full)로 동작한다.
28
32
  */
29
33
  priority?: SelectPriority;
30
34
  /**
@@ -83,6 +87,7 @@ export interface SelectComponentState {
83
87
  * @property {string} [className] 사용자 정의 className
84
88
  * @property {ReactNode} children trigger/Dropdown 등 내부 콘텐츠
85
89
  * @property {boolean} [block] block 여부
90
+ * @property {FormFieldWidth} [width] width preset
86
91
  */
87
92
  export interface SelectContainerProps extends HTMLAttributes<HTMLDivElement> {
88
93
  /**
@@ -115,118 +120,191 @@ export interface SelectWidthOption {
115
120
  }
116
121
 
117
122
  /**
118
- * Select root props
119
- * @typedef {SelectStyleOptions & SelectValueOptions & SelectComponentState} SelectProps
120
- * @property {SelectPriority} [priority] priority scale
121
- * @property {SelectSize} [size] size scale
122
- * @property {SelectState} [state] visual state
123
- * @property {boolean} [block] block 여부
124
- * @property {ReactNode} [displayLabel] 선택된 라벨
125
- * @property {ReactNode} [placeholder] placeholder 텍스트
126
- * @property {ReactNode[]} [tags] multi select 태그 리스트
127
- * @property {boolean} [multiple] multi select 여부
128
- * @property {boolean} [isOpen] dropdown open 여부
129
- * @property {FormFieldWidth} [width] width preset 옵션
130
- */
131
- export type SelectProps = SelectStyleOptions &
132
- SelectValueOptions &
133
- SelectComponentState &
134
- SelectWidthOption;
135
-
136
- /**
137
- * Select dropdown 옵션 구성 props; 옵션 모델/이벤트/하위호환 제어 축을 정의한다.
138
- * @property {SelectDropdownOption[]} [options] dropdown option 리스트(권장: options[].selected로 초기값 선언)
139
- * @property {string[]} [selectedOptionIds] 선택된 option id 리스트(legacy controlled)
140
- * @property {(payload: SelectOptionChangePayload) => void} [onChange] 선택 결과 변경 콜백(권장)
141
- * @property {(option: SelectDropdownOption) => void} [onOptionSelect] option 선택 콜백(legacy)
142
- * @property {SelectSize} [dropdownSize] dropdown surface size 스케일
143
- * @property {DropdownPanelWidth} [dropdownWidth="match"] dropdown panel width 옵션
144
- * @property {DropdownMenuProps} [dropdownRootProps] Dropdown.Root 전달 props(제어 props 제외)
145
- * @property {DropdownContainerProps} [dropdownContainerProps] Dropdown.Container 전달 props(children/size 제외)
146
- * @property {DropdownMenuListProps} [dropdownMenuListProps] Dropdown.Menu.List 전달 props
147
- * @property {ReactNode} [alt] option이 비어 있을 때 렌더링할 alternate 콘텐츠
123
+ * Select custom option props
124
+ * @property {string} [placeholder] 직접입력 모드 전용 placeholder
125
+ * @property {ReactNode} [optionName] dropdown의 "직접 입력" 옵션 문구
148
126
  */
149
- export interface SelectDropdownConfigProps {
127
+ export interface SelectCustomOptions {
150
128
  /**
151
- * dropdown option 리스트
152
- * - 권장: uncontrolled 초기 선택은 options[].selected사용한다.
129
+ * 직접입력 모드 전용 placeholder
130
+ * - 미지정 Select root placeholder재사용한다.
153
131
  */
154
- options?: SelectDropdownOption[];
132
+ placeholder?: string;
155
133
  /**
156
- * 선택된 option id 리스트
157
- * @deprecated onChange + options[].selected 기반 계약을 우선 사용한다.
134
+ * dropdown의 "직접 입력" 옵션 문구
135
+ * - 미지정 "직접 입력"을 기본값으로 사용한다.
158
136
  */
159
- selectedOptionIds?: string[];
137
+ optionName?: ReactNode;
138
+ }
139
+
140
+ /**
141
+ * Select custom input props
142
+ * @property {ComponentPropsWithoutRef<"input">} [native] label input native 속성
143
+ */
144
+ export interface SelectCustomInputProps extends ComponentPropsWithoutRef<"input"> {
145
+ placeholder?: never;
146
+ }
147
+
148
+ /**
149
+ * Select form register extension
150
+ * @property {UseFormRegisterReturn} [register] source field register(기본: hidden value input)
151
+ * @property {UseFormRegisterReturn} [customRegister] custom field register(직접입력 label input)
152
+ */
153
+ export interface SelectFormRegisterExtension {
160
154
  /**
161
- * 선택 결과 변경 콜백
162
- * - 권장: payload.selectedOptions / payload.selectedValues를 직접 소비한다.
155
+ * source field register
156
+ * - Select value 제출 필드(`select-input-value`)에 연결한다.
163
157
  */
164
- onChange?: (payload: SelectOptionChangePayload) => void;
158
+ register?: UseFormRegisterReturn;
165
159
  /**
166
- * option 선택 콜백
167
- * @deprecated onChange로 대체되며 하위호환을 위해 유지된다.
160
+ * custom field register
161
+ * - 직접입력 label 필드(`select-input-label`)에 연결한다.
168
162
  */
169
- onOptionSelect?: (option: SelectDropdownOption) => void;
163
+ customRegister?: UseFormRegisterReturn;
164
+ }
165
+
166
+ /**
167
+ * Select callback params
168
+ * @property {SelectDropdownOption} [nextOption] 현재 상호작용한 option
169
+ * @property {SelectDropdownOption} [prevOption] 이전 기준 option
170
+ * @property {Event} [event] 원본 메뉴 선택 이벤트
171
+ */
172
+ export type SelectCallbackParams = (
173
+ nextOption?: SelectDropdownOption,
174
+ prevOption?: SelectDropdownOption,
175
+ event?: Event,
176
+ ) => void;
177
+
178
+ /**
179
+ * Select dropdown 확장 props
180
+ * @property {SelectSize} [size] dropdown surface size 스케일
181
+ * @property {DropdownPanelWidth} [width] dropdown panel width 옵션
182
+ * @property {Omit<DropdownMenuProps, "open" | "defaultOpen" | "onOpenChange">} [rootProps] Dropdown.Root 전달 props
183
+ * @property {Omit<DropdownContainerProps, "children" | "size" | "width">} [containerProps] Dropdown.Container 전달 props
184
+ * @property {DropdownMenuListProps} [menuListProps] Dropdown.Menu.List 전달 props
185
+ * @property {ReactNode} [alt] option이 비어 있을 때 렌더링할 alternate 콘텐츠
186
+ */
187
+ export interface SelectDropdownExtension {
170
188
  /**
171
189
  * dropdown surface size 스케일
172
190
  */
173
- dropdownSize?: SelectSize;
191
+ size?: SelectSize;
174
192
  /**
175
193
  * dropdown panel width 옵션
176
194
  */
177
- dropdownWidth?: DropdownPanelWidth;
195
+ width?: DropdownPanelWidth;
178
196
  /**
179
197
  * Dropdown.Root 전달 props(제어 props 제외)
180
- * - 타입 출처를 명확히 하기 위해 Radix 원본 타입을 직접 사용한다.
181
198
  */
182
- dropdownRootProps?: Omit<
183
- DropdownMenuProps,
184
- "open" | "defaultOpen" | "onOpenChange"
185
- >;
199
+ rootProps?: Omit<DropdownMenuProps, "open" | "defaultOpen" | "onOpenChange">;
186
200
  /**
187
- * Dropdown.Container 전달 props(children/size 제외)
201
+ * Dropdown.Container 전달 props(children/size/width 제외)
188
202
  */
189
- dropdownContainerProps?: Omit<
190
- DropdownContainerProps,
191
- "children" | "size" | "width"
192
- >;
203
+ containerProps?: Omit<DropdownContainerProps, "children" | "size" | "width">;
193
204
  /**
194
205
  * Dropdown.Menu.List 전달 props
195
206
  */
196
- dropdownMenuListProps?: DropdownMenuListProps;
207
+ menuListProps?: DropdownMenuListProps;
197
208
  /**
198
- * option이 비어 있을 때 렌더링할 alternate 콘텐츠
209
+ * item이 비어 있을 때 렌더링할 alternate 콘텐츠
199
210
  */
200
211
  alt?: ReactNode;
201
212
  }
202
213
 
203
214
  /**
204
- * Select dropdown 개방 제어 props; open controlled/uncontrolled 축을 정의한다.
215
+ * Select dropdown 옵션 구성 props
216
+ * @property {SelectDropdownOption[]} [items] dropdown item 리스트(권장: items[].selected 초기값)
217
+ * @property {SelectCallbackParams} [onSelectOption] option 선택 액션 콜백
218
+ * @property {SelectCallbackParams} [onSelectChange] 선택값 변경 콜백
219
+ * @property {SelectDropdownExtension} [dropdown] dropdown 확장 옵션
220
+ */
221
+ export interface SelectDropdownConfigProps {
222
+ /**
223
+ * dropdown item 리스트
224
+ */
225
+ items: SelectDropdownOption[];
226
+ /**
227
+ * option 선택 액션 콜백
228
+ */
229
+ onSelectOption?: SelectCallbackParams;
230
+ /**
231
+ * 선택값 변경 콜백
232
+ */
233
+ onSelectChange?: SelectCallbackParams;
234
+ /**
235
+ * dropdown 확장 옵션
236
+ */
237
+ dropdownOptions?: SelectDropdownExtension;
238
+ }
239
+
240
+ /**
241
+ * Select dropdown 개방 제어 props
205
242
  * @property {boolean} [open] dropdown open 상태
206
243
  * @property {boolean} [defaultOpen] uncontrolled 초기 open 상태
207
- * @property {(open: boolean) => void} [onOpenChange] open state change 콜백
244
+ * @property {(open: boolean) => void} [onOpen] open state change 콜백
208
245
  */
209
246
  export interface SelectDropdownBehaviorProps {
210
247
  /**
211
248
  * dropdown open 상태
212
- * - 값이 있으면 controlled open 모드로 동작한다.
213
249
  */
214
250
  open?: boolean;
215
251
  /**
216
252
  * uncontrolled 초기 open 상태
217
- * - open prop이 없을 때만 초기값으로 사용된다.
218
253
  */
219
254
  defaultOpen?: boolean;
220
255
  /**
221
256
  * open state change 콜백
222
- * - controlled/uncontrolled 모두에서 호출된다.
223
257
  */
224
- onOpenChange?: (open: boolean) => void;
258
+ onOpen?: (open: boolean) => void;
259
+ }
260
+
261
+ /**
262
+ * Select trigger native event props
263
+ * @property {HTMLAttributes<HTMLElement>} [triggerProps] trigger native 속성/이벤트
264
+ */
265
+ export interface SelectTriggerEventProps {
266
+ /**
267
+ * trigger native 속성/이벤트
268
+ */
269
+ triggerProps?: HTMLAttributes<HTMLElement>;
225
270
  }
226
271
 
272
+ /**
273
+ * Select custom option extension
274
+ * @property {SelectCustomOptions} [customOptions] 직접 입력 옵션 구성
275
+ * @property {SelectCustomInputProps} [inputProps] 직접 입력 input 구성
276
+ */
277
+ export interface SelectCustomOptionExtension {
278
+ /**
279
+ * 직접 입력 옵션 구성
280
+ */
281
+ customOptions?: SelectCustomOptions;
282
+ /**
283
+ * 직접 입력 input 구성
284
+ */
285
+ inputProps?: SelectCustomInputProps;
286
+ }
287
+
288
+ /**
289
+ * Select root props
290
+ * @property {SelectPriority} [priority] priority scale
291
+ * @property {SelectSize} [size] size scale
292
+ * @property {SelectState} [state] visual state
293
+ * @property {boolean} [block] block 여부
294
+ * @property {ReactNode} [displayLabel] 선택된 라벨
295
+ * @property {ReactNode} [placeholder] placeholder 텍스트
296
+ * @property {ReactNode[]} [tags] multi select 태그 리스트
297
+ * @property {boolean} [multiple] multi select 여부
298
+ * @property {boolean} [isOpen] dropdown open 여부
299
+ * @property {FormFieldWidth} [width] width preset 옵션
300
+ */
301
+ export type SelectProps = SelectStyleOptions &
302
+ SelectValueOptions &
303
+ SelectComponentState &
304
+ SelectWidthOption;
305
+
227
306
  /**
228
307
  * Select.Default 컴포넌트 props
229
- * @typedef {SelectTriggerDefaultProps & SelectDropdownConfigProps & SelectDropdownBehaviorProps & SelectWidthOption} SelectDefaultComponentProps
230
308
  * @property {ReactNode} [displayLabel] 선택된 라벨
231
309
  * @property {ReactNode} [placeholder] placeholder 텍스트
232
310
  * @property {SelectPriority} [priority] priority scale
@@ -238,24 +316,26 @@ export interface SelectDropdownBehaviorProps {
238
316
  * @property {boolean} [readOnly] readOnly 여부
239
317
  * @property {SelectTriggerButtonType} [buttonType] button type
240
318
  * @property {FormFieldWidth} [width] width preset 옵션
241
- * @property {SelectDropdownOption[]} [options] dropdown option 리스트
242
- * @property {string[]} [selectedOptionIds] 선택된 option id 리스트
243
- * @property {(payload: SelectOptionChangePayload) => void} [onChange] 선택 결과 변경 콜백
244
- * @property {(option: SelectDropdownOption) => void} [onOptionSelect] option 선택 콜백
245
- * @property {SelectSize} [dropdownSize] dropdown surface size 스케일
246
- * @property {DropdownPanelWidth} [dropdownWidth="match"] dropdown panel width 옵션
247
- * @property {Omit<DropdownMenuProps, "open" | "defaultOpen" | "onOpenChange">} [dropdownRootProps] Dropdown.Root 전달 props
248
- * @property {Omit<DropdownContainerProps, "children" | "size" | "width">} [dropdownContainerProps] Dropdown.Container 전달 props
249
- * @property {DropdownMenuListProps} [dropdownMenuListProps] Dropdown.Menu.List 전달 props
250
- * @property {ReactNode} [alt] option이 비어 있을 때 렌더링할 alternate 콘텐츠
319
+ * @property {SelectDropdownOption[]} [items] dropdown item 리스트
320
+ * @property {SelectCallbackParams} [onSelectOption] option 선택 액션 콜백
321
+ * @property {SelectCallbackParams} [onSelectChange] 선택값 변경 콜백
322
+ * @property {SelectDropdownExtension} [dropdown] dropdown 확장 옵션
251
323
  * @property {boolean} [open] dropdown open 상태
252
324
  * @property {boolean} [defaultOpen] uncontrolled 초기 open 상태
253
- * @property {(open: boolean) => void} [onOpenChange] open state change 콜백
325
+ * @property {(open: boolean) => void} [onOpen] open state change 콜백
326
+ * @property {HTMLAttributes<HTMLElement>} [triggerProps] trigger native 속성/이벤트
327
+ * @property {SelectCustomOptions} [customOptions] 직접 입력 옵션 구성
328
+ * @property {SelectCustomInputProps} [inputProps] 직접 입력 input 구성
329
+ * @property {UseFormRegisterReturn} [register] source field register
330
+ * @property {UseFormRegisterReturn} [customRegister] custom field register
254
331
  */
255
332
  export type SelectDefaultComponentProps = SelectTriggerDefaultProps &
256
333
  SelectDropdownConfigProps &
257
334
  SelectDropdownBehaviorProps &
258
- SelectWidthOption;
335
+ SelectWidthOption &
336
+ SelectTriggerEventProps &
337
+ SelectCustomOptionExtension &
338
+ SelectFormRegisterExtension;
259
339
 
260
340
  /**
261
341
  * Select.Multiple 전체 선택 옵션 props
@@ -275,7 +355,6 @@ export interface SelectMultipleAllOptionProps {
275
355
 
276
356
  /**
277
357
  * Select.Multiple 컴포넌트 props
278
- * @typedef {SelectTriggerMultipleProps & SelectDropdownConfigProps & SelectDropdownBehaviorProps & SelectWidthOption & SelectMultipleAllOptionProps} SelectMultipleComponentProps
279
358
  * @property {ReactNode} [displayLabel] 선택된 라벨
280
359
  * @property {ReactNode} [placeholder] placeholder 텍스트
281
360
  * @property {SelectMultipleTag[]} [tags] multi select tag 리스트
@@ -287,19 +366,14 @@ export interface SelectMultipleAllOptionProps {
287
366
  * @property {boolean} [disabled] disabled 여부
288
367
  * @property {boolean} [readOnly] readOnly 여부
289
368
  * @property {FormFieldWidth} [width] width preset 옵션
290
- * @property {SelectDropdownOption[]} [options] dropdown option 리스트
291
- * @property {string[]} [selectedOptionIds] 선택된 option id 리스트
292
- * @property {(payload: SelectOptionChangePayload) => void} [onChange] 선택 결과 변경 콜백
293
- * @property {(option: SelectDropdownOption) => void} [onOptionSelect] option 선택 콜백
294
- * @property {SelectSize} [dropdownSize] dropdown surface size 스케일
295
- * @property {DropdownPanelWidth} [dropdownWidth="match"] dropdown panel width 옵션
296
- * @property {Omit<DropdownMenuProps, "open" | "defaultOpen" | "onOpenChange">} [dropdownRootProps] Dropdown.Root 전달 props
297
- * @property {Omit<DropdownContainerProps, "children" | "size" | "width">} [dropdownContainerProps] Dropdown.Container 전달 props
298
- * @property {DropdownMenuListProps} [dropdownMenuListProps] Dropdown.Menu.List 전달 props
299
- * @property {ReactNode} [alt] option이 비어 있을 때 렌더링할 alternate 콘텐츠
369
+ * @property {SelectDropdownOption[]} [items] dropdown item 리스트
370
+ * @property {SelectCallbackParams} [onSelectOption] option 선택 액션 콜백
371
+ * @property {SelectCallbackParams} [onSelectChange] 선택값 변경 콜백
372
+ * @property {SelectDropdownExtension} [dropdown] dropdown 확장 옵션
300
373
  * @property {boolean} [open] dropdown open 상태
301
374
  * @property {boolean} [defaultOpen] uncontrolled 초기 open 상태
302
- * @property {(open: boolean) => void} [onOpenChange] open state change 콜백
375
+ * @property {(open: boolean) => void} [onOpen] open state change 콜백
376
+ * @property {HTMLAttributes<HTMLElement>} [triggerProps] trigger native 속성/이벤트
303
377
  * @property {boolean} [showSelectAllOption] dropdown 첫 행에 "전체" 옵션 노출 여부
304
378
  * @property {ReactNode} [selectAllLabel] "전체" 옵션 라벨 커스터마이징
305
379
  */
@@ -307,4 +381,5 @@ export type SelectMultipleComponentProps = SelectTriggerMultipleProps &
307
381
  SelectDropdownConfigProps &
308
382
  SelectDropdownBehaviorProps &
309
383
  SelectWidthOption &
310
- SelectMultipleAllOptionProps;
384
+ SelectMultipleAllOptionProps &
385
+ SelectTriggerEventProps;
@@ -1,4 +1,11 @@
1
- import type { ElementType, HTMLAttributes, ReactNode } from "react";
1
+ import type {
2
+ ComponentPropsWithoutRef,
3
+ ElementType,
4
+ HTMLAttributes,
5
+ ReactNode,
6
+ } from "react";
7
+ import type { UseFormRegisterReturn } from "react-hook-form";
8
+ import type { SelectOptionValue } from "./option";
2
9
 
3
10
  import type {
4
11
  SelectPriority,
@@ -32,6 +39,7 @@ export interface SelectTriggerBaseProps extends HTMLAttributes<HTMLElement> {
32
39
  priority?: SelectPriority;
33
40
  /**
34
41
  * size scale
42
+ * - xsmall (primary 전용)
35
43
  * - small
36
44
  * - medium
37
45
  * - large
@@ -101,6 +109,7 @@ export interface SelectTriggerDefaultProps extends HTMLAttributes<HTMLElement> {
101
109
  priority?: SelectPriority;
102
110
  /**
103
111
  * size scale
112
+ * - xsmall (primary 전용)
104
113
  * - small
105
114
  * - medium
106
115
  * - large
@@ -161,6 +170,7 @@ export interface SelectTriggerMultipleProps extends HTMLAttributes<HTMLElement>
161
170
  priority?: SelectPriority;
162
171
  /**
163
172
  * size scale
173
+ * - xsmall (primary 전용)
164
174
  * - small
165
175
  * - medium
166
176
  * - large
@@ -196,6 +206,14 @@ export interface SelectTriggerMultipleProps extends HTMLAttributes<HTMLElement>
196
206
  * @property {ReactNode} [label] 표시할 라벨
197
207
  * @property {ReactNode} [placeholder] placeholder 텍스트
198
208
  * @property {boolean} [isPlaceholder] placeholder 상태 여부
209
+ * @property {boolean} [readOnly] readOnly 여부
210
+ * @property {UseFormRegisterReturn} [register] source field register
211
+ * @property {UseFormRegisterReturn} [customRegister] custom field register
212
+ * @property {ComponentPropsWithoutRef<"input">} [inputProps] label input native 속성
213
+ * @property {string} [valueText] label input 표시 문자열
214
+ * @property {SelectOptionValue | ""} [valueFieldValue] hidden value input 값
215
+ * @property {boolean} [shouldFocusInput] custom mode 진입 시 label input focus 여부
216
+ * @property {(value: string) => void} [onLabelChange] label 입력 변경 콜백
199
217
  */
200
218
  export interface SelectSelectedProps {
201
219
  /**
@@ -210,4 +228,37 @@ export interface SelectSelectedProps {
210
228
  * placeholder 상태 여부
211
229
  */
212
230
  isPlaceholder?: boolean;
231
+ /**
232
+ * readOnly 여부
233
+ */
234
+ readOnly?: boolean;
235
+ /**
236
+ * source field register
237
+ */
238
+ register?: UseFormRegisterReturn;
239
+ /**
240
+ * custom field register
241
+ */
242
+ customRegister?: UseFormRegisterReturn;
243
+ /**
244
+ * label input native 속성
245
+ * - placeholder는 root/customOptions 경로가 우선하므로 제외한다.
246
+ */
247
+ inputProps?: Omit<ComponentPropsWithoutRef<"input">, "placeholder">;
248
+ /**
249
+ * label input 표시 문자열
250
+ */
251
+ valueText?: string;
252
+ /**
253
+ * hidden value input 값
254
+ */
255
+ valueFieldValue?: SelectOptionValue | "";
256
+ /**
257
+ * custom mode 진입 시 label input focus 여부
258
+ */
259
+ shouldFocusInput?: boolean;
260
+ /**
261
+ * label 입력 변경 콜백
262
+ */
263
+ onLabelChange?: (value: string) => void;
213
264
  }
@@ -1,6 +1,2 @@
1
- export { default as SlotComponent } from "./markup/Component";
2
- export type {
3
- SlotComponentProps,
4
- SlotComponentType,
5
- PolymorphicRef,
6
- } from "./types/props";
1
+ export * from "./markup";
2
+ export type * from "./types";
@@ -0,0 +1,34 @@
1
+ import type { ElementType } from "react";
2
+ import clsx from "clsx";
3
+ import SlotBase from "./Base";
4
+ import type { SlotTextProps } from "../types/text";
5
+
6
+ /**
7
+ * SlotText; 텍스트 역할 children만 래핑하는 공용 슬롯.
8
+ * @component
9
+ * @param {SlotTextProps} props
10
+ * @param {React.ElementType} [props.as="span"] 렌더링할 요소.
11
+ * @param {React.ReactNode} [props.children] 문자열/숫자는 래핑하고, 그 외 ReactNode는 그대로 반환한다.
12
+ * @param {string} [props.className] 래핑 시 적용할 className.
13
+ */
14
+ export default function SlotText<C extends ElementType = "span">({
15
+ as = "span" as C,
16
+ children,
17
+ className,
18
+ ...restProps
19
+ }: SlotTextProps<C>) {
20
+ if (!["string", "number"].includes(typeof children)) {
21
+ return children;
22
+ }
23
+
24
+ // 문자열/숫자 children만 공통 slot text 마크업으로 감싼다.
25
+ return (
26
+ <SlotBase
27
+ as={as as ElementType}
28
+ className={clsx("slot-text", className)}
29
+ {...restProps}
30
+ >
31
+ {children}
32
+ </SlotBase>
33
+ );
34
+ }
@@ -0,0 +1,7 @@
1
+ import SlotBase from "./Base";
2
+ import SlotText from "./Text";
3
+
4
+ export const Slot = {
5
+ Base: SlotBase,
6
+ Text: SlotText,
7
+ };
@@ -0,0 +1,2 @@
1
+ export type * from "./props";
2
+ export type * from "./text";
@@ -0,0 +1,24 @@
1
+ import type { ElementType, ReactNode } from "react";
2
+ import type { SlotComponentRestProps } from "./props";
3
+
4
+ /**
5
+ * SlotTextProps; 텍스트 역할 children 래핑용 공통 props.
6
+ * @property {React.ElementType} [as] 렌더링할 요소. 기본값은 span.
7
+ * @property {React.ReactNode} [children] 문자열/숫자는 래핑하고 그 외 ReactNode는 그대로 반환한다.
8
+ * @property {string} [className] 텍스트 래퍼 className.
9
+ */
10
+ export type SlotTextProps<C extends ElementType = "span"> =
11
+ SlotComponentRestProps<C> & {
12
+ /**
13
+ * 렌더링할 요소.
14
+ */
15
+ as?: C;
16
+ /**
17
+ * 텍스트/노드 children.
18
+ */
19
+ children?: ReactNode;
20
+ /**
21
+ * 텍스트 래퍼 className.
22
+ */
23
+ className?: string;
24
+ };
@@ -1,6 +1,7 @@
1
1
  import clsx from "clsx";
2
2
  import { forwardRef } from "react";
3
3
  import type { TableCellContentProps } from "../../types";
4
+ import TableText from "./Text";
4
5
 
5
6
  /**
6
7
  * Table Foundation; Cell 콘텐츠 래퍼 컴포넌트
@@ -48,18 +49,9 @@ const TableCell = forwardRef<HTMLDivElement, TableCellContentProps>(
48
49
  )}
49
50
  >
50
51
  {/* 변경: 텍스트 콘텐츠는 slot 전용 className으로 감싸 스타일 적용 범위를 고정한다. */}
51
- {typeof children === "string" || typeof children === "number" ? (
52
- <span
53
- className={clsx(
54
- "table-cell-text",
55
- section && `table-${section}-cell-text`,
56
- )}
57
- >
58
- {children}
59
- </span>
60
- ) : (
61
- children
62
- )}
52
+ <TableText className={clsx(section && `table-${section}-cell-text`)}>
53
+ {children}
54
+ </TableText>
63
55
  </div>
64
56
  );
65
57
  },
@@ -1,6 +1,7 @@
1
1
  import clsx from "clsx";
2
2
  import { forwardRef } from "react";
3
3
  import type { TableTdProps } from "../../types";
4
+ import TableText from "./Text";
4
5
 
5
6
  /**
6
7
  * Table Foundation; Td 마크업 컴포넌트
@@ -20,13 +21,9 @@ const TableTd = forwardRef<HTMLTableCellElement, TableTdProps>(
20
21
  style={{ ...style, textAlign: "left" }}
21
22
  >
22
23
  {/* 변경: 태그 셀렉터 의존을 피하기 위해 className 기반 텍스트 노드를 사용한다. */}
23
- {typeof children === "string" || typeof children === "number" ? (
24
- <span className={clsx("table-native-cell-text", "table-td-text")}>
25
- {children}
26
- </span>
27
- ) : (
28
- children
29
- )}
24
+ <TableText className={clsx("table-native-cell-text", "table-td-text")}>
25
+ {children}
26
+ </TableText>
30
27
  </td>
31
28
  );
32
29
  },
@@ -0,0 +1,16 @@
1
+ import clsx from "clsx";
2
+ import { Slot } from "../../../slot";
3
+ import type { TableTextProps } from "../../types";
4
+
5
+ /**
6
+ * Table Text; th/td/cell 텍스트 공통 렌더 컴포넌트.
7
+ * @component
8
+ * @param {TableTextProps} props
9
+ * @param {React.ReactNode} [props.children] 텍스트 콘텐츠
10
+ * @param {string} [props.className] table text className
11
+ */
12
+ export default function TableText({ className, ...restProps }: TableTextProps) {
13
+ return (
14
+ <Slot.Text className={clsx("table-cell-text", className)} {...restProps} />
15
+ );
16
+ }
@@ -1,6 +1,7 @@
1
1
  import clsx from "clsx";
2
2
  import { forwardRef } from "react";
3
3
  import type { TableThProps } from "../../types";
4
+ import TableText from "./Text";
4
5
 
5
6
  /**
6
7
  * Table Foundation; Th 마크업 컴포넌트
@@ -29,13 +30,9 @@ const TableTh = forwardRef<HTMLTableCellElement, TableThProps>(
29
30
  style={style}
30
31
  >
31
32
  {/* 변경: 태그 셀렉터 의존을 피하기 위해 className 기반 텍스트 노드를 사용한다. */}
32
- {typeof children === "string" || typeof children === "number" ? (
33
- <span className={clsx("table-native-cell-text", "table-th-text")}>
34
- {children}
35
- </span>
36
- ) : (
37
- children
38
- )}
33
+ <TableText className={clsx("table-native-cell-text", "table-th-text")}>
34
+ {children}
35
+ </TableText>
39
36
  </th>
40
37
  );
41
38
  },
@@ -8,6 +8,7 @@ import TableTh from "./Th";
8
8
  import TableRoot from "./Root";
9
9
  import TableRow from "./Row";
10
10
  import TableTd from "./Td";
11
+ import TableText from "./Text";
11
12
 
12
13
  /**
13
14
  * Table Foundation; 기초 마크업 컴포넌트 세트
@@ -27,4 +28,5 @@ export const TableFoundation = {
27
28
  Tr: TableRow,
28
29
  Th: TableTh,
29
30
  Td: TableTd,
31
+ Text: TableText,
30
32
  };
@@ -1,4 +1,5 @@
1
1
  import type { ComponentPropsWithoutRef } from "react";
2
+ import type { SlotTextProps } from "../../slot";
2
3
 
3
4
  export const TABLE_CELL_ALIGN_OPTIONS = ["left", "center", "right"] as const;
4
5
  export const TABLE_CELL_ALIGN_Y_OPTIONS = ["top", "center", "bottom"] as const;
@@ -273,3 +274,11 @@ export interface TableHeadCellProps extends TableThProps {}
273
274
  * @deprecated `TableTdProps` 사용을 권장한다.
274
275
  */
275
276
  export interface TableCellProps extends TableTdProps {}
277
+
278
+ /**
279
+ * Table Types; Text 렌더 props
280
+ * @property {React.ElementType} [as] 렌더링할 요소. 기본값은 span.
281
+ * @property {React.ReactNode} [children] 텍스트 콘텐츠
282
+ * @property {string} [className] table text className
283
+ */
284
+ export type TableTextProps = SlotTextProps;