@uniai-fe/uds-primitives 0.3.11 → 0.3.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-primitives",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "UNIAI Design System; Primitives Components Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { DatePicker } from "@mantine/dates";
4
4
  import { CalendarIcon } from "./Icon";
5
- import type { CalendarGridProps } from "../types";
5
+ import type { CalendarDatePickerProps, CalendarGridProps } from "../types";
6
6
  import { mapValueToPicker, parseValueFromPicker } from "../utils";
7
7
 
8
8
  /**
@@ -20,6 +20,14 @@ export default function CalendarCore({
20
20
  onChange,
21
21
  datePickerProps,
22
22
  }: CalendarGridProps) {
23
+ const { valueFormat: _deprecatedValueFormat, ...safeDatePickerProps } =
24
+ (datePickerProps ?? {}) as CalendarDatePickerProps & {
25
+ /**
26
+ * deprecated DatePicker 표시 포맷 옵션
27
+ */
28
+ valueFormat?: unknown;
29
+ };
30
+
23
31
  // 기본 DatePicker 옵션/스타일 책임을 Calendar.Core에 고정한다.
24
32
  const resolvedDatePickerProps = {
25
33
  size: "sm" as const,
@@ -27,7 +35,8 @@ export default function CalendarCore({
27
35
  weekendDays: [] as Array<0 | 1 | 2 | 3 | 4 | 5 | 6>,
28
36
  nextIcon: <CalendarIcon.Chevron.right />,
29
37
  previousIcon: <CalendarIcon.Chevron.left />,
30
- ...datePickerProps,
38
+ // 변경: 지원하지 않는 valueFormat은 제거한 뒤 DatePicker 옵션을 병합한다.
39
+ ...safeDatePickerProps,
31
40
  classNames: {
32
41
  levelsGroup: "calendar-month-level",
33
42
  month: "calendar-month-table",
@@ -44,7 +53,7 @@ export default function CalendarCore({
44
53
  yearsList: "calendar-years-list",
45
54
  yearsListCell: "calendar-years-list-cell",
46
55
  yearsListControl: "calendar-years-list-control",
47
- ...(datePickerProps?.classNames ?? {}),
56
+ ...(safeDatePickerProps.classNames ?? {}),
48
57
  },
49
58
  };
50
59
 
@@ -35,7 +35,6 @@ export type CalendarOnChange = (value: CalendarValue) => void;
35
35
  /**
36
36
  * Mantine DatePicker 공개 옵션.
37
37
  * @property {Partial<Record<DatePickerStylesNames, string>>} [classNames] Mantine 내부 스타일 클래스 매핑
38
- * @property {string} [valueFormat] DatePicker 표시 포맷
39
38
  */
40
39
  export type CalendarDatePickerProps = Partial<
41
40
  Omit<
@@ -49,10 +48,6 @@ export type CalendarDatePickerProps = Partial<
49
48
  | "styles"
50
49
  >
51
50
  > & {
52
- /**
53
- * DatePicker 표시 포맷
54
- */
55
- valueFormat?: string;
56
51
  /**
57
52
  * Mantine 내부 스타일 classNames override.
58
53
  */
@@ -23,9 +23,8 @@ const INPUT_DATE_TABLE_FORMAT = "YY-MM-DD";
23
23
 
24
24
  /**
25
25
  * Input Date Template; trigger + calendar 조합.
26
- * priority가 table이면 trigger 표시 포맷/DatePicker 기본 valueFormat을 `YY-MM-DD`로 맞춘다.
26
+ * priority가 table이면 trigger 표시 포맷을 `YY-MM-DD`로 맞춘다.
27
27
  * placeholder는 format과 별도 props로 처리되며, format 변경으로 placeholder가 자동 치환되지는 않는다.
28
- * 단, `datePickerProps.valueFormat`이 주어지면 해당 포맷을 우선한다.
29
28
  * @component
30
29
  * @param {InputCalendarProps} props
31
30
  * @param {CalendarMode} [props.mode="date"] 날짜/시간 모드
@@ -132,17 +131,6 @@ const InputDateTemplate = forwardRef<HTMLDivElement, InputCalendarProps>(
132
131
  [calendarValue, priority],
133
132
  );
134
133
 
135
- const resolvedDatePickerProps = useMemo(() => {
136
- if (priority !== "table" || datePickerProps?.valueFormat) {
137
- return datePickerProps;
138
- }
139
- // table priority는 yy-MM-dd 포맷을 기본값으로 둔다.
140
- return {
141
- ...datePickerProps,
142
- valueFormat: INPUT_DATE_TABLE_FORMAT,
143
- };
144
- }, [datePickerProps, priority]);
145
-
146
134
  const handleTriggerClick = (event: ReactMouseEvent<Element>) => {
147
135
  triggerOnClick?.(event);
148
136
  };
@@ -195,7 +183,8 @@ const InputDateTemplate = forwardRef<HTMLDivElement, InputCalendarProps>(
195
183
  readOnly={readOnly}
196
184
  value={calendarValue}
197
185
  onChange={handleCalendarChange}
198
- datePickerProps={resolvedDatePickerProps}
186
+ // 변경: Mantine DatePicker는 valueFormat prop을 지원하지 않으므로 옵션을 그대로 전달한다.
187
+ datePickerProps={datePickerProps}
199
188
  header={header}
200
189
  footer={footerContent}
201
190
  open={resolvedCalendarOpen}
@@ -59,8 +59,10 @@ const SelectTriggerBase = forwardRef<HTMLElement, SelectTriggerBaseProps>(
59
59
  className: clsx("select-button", className),
60
60
  "data-priority": priority,
61
61
  "data-size": size,
62
- // 변경: readOnly도 disabled와 동일한 시각 상태를 사용하고 텍스트 컬러만 별도 스타일로 분리한다.
62
+ ...restProps,
63
+ // 변경: Radix Dropdown.Trigger가 주입하는 data-state(open|closed)를 최종 단계에서 덮어써 visual state를 고정한다.
63
64
  "data-state": resolvedState,
65
+ // 변경: readOnly도 disabled와 동일한 시각 상태를 사용하고 텍스트 컬러만 별도 스타일로 분리한다.
64
66
  "data-readonly": readOnly ? "true" : undefined,
65
67
  "data-open": open || undefined,
66
68
  "data-multiple": multiple || undefined,
@@ -68,7 +70,6 @@ const SelectTriggerBase = forwardRef<HTMLElement, SelectTriggerBaseProps>(
68
70
  "aria-readonly": readOnly ? "true" : undefined,
69
71
  "aria-haspopup": ariaHasPopup ?? "listbox",
70
72
  "aria-expanded": ariaExpanded ?? open,
71
- ...restProps,
72
73
  };
73
74
 
74
75
  const elementSpecificProps =