@uniai-fe/uds-primitives 0.3.22 → 0.3.23
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/dist/styles.css
CHANGED
|
@@ -2309,6 +2309,9 @@ figure.chip {
|
|
|
2309
2309
|
font-weight: var(--dropdown-option-font-weight, var(--dropdown-text-weight));
|
|
2310
2310
|
line-height: var(--dropdown-option-line-height, var(--dropdown-text-medium-line-height));
|
|
2311
2311
|
}
|
|
2312
|
+
.dropdown-menu-item-trigger span {
|
|
2313
|
+
user-select: none;
|
|
2314
|
+
}
|
|
2312
2315
|
.dropdown-menu-item-trigger[data-state=selected] {
|
|
2313
2316
|
background-color: var(--dropdown-option-bg-selected);
|
|
2314
2317
|
color: var(--dropdown-option-color-selected);
|
|
@@ -2335,7 +2338,7 @@ figure.chip {
|
|
|
2335
2338
|
|
|
2336
2339
|
.dropdown-menu-item-left,
|
|
2337
2340
|
.dropdown-menu-item-right {
|
|
2338
|
-
display:
|
|
2341
|
+
display: flex;
|
|
2339
2342
|
align-items: center;
|
|
2340
2343
|
color: inherit;
|
|
2341
2344
|
}
|
|
@@ -2349,7 +2352,7 @@ figure.chip {
|
|
|
2349
2352
|
}
|
|
2350
2353
|
|
|
2351
2354
|
.dropdown-menu-item-label {
|
|
2352
|
-
display:
|
|
2355
|
+
display: flex;
|
|
2353
2356
|
align-items: center;
|
|
2354
2357
|
min-width: 0;
|
|
2355
2358
|
color: inherit;
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { forwardRef } from "react";
|
|
|
7
7
|
import type { DropdownMenuItemProps } from "../../types/props";
|
|
8
8
|
import { Checkbox } from "../../../checkbox/markup/Checkbox";
|
|
9
9
|
import type { CheckboxProps } from "../../../checkbox/types";
|
|
10
|
+
import { Slot } from "../../../slot";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Dropdown Foundation; Menu Item 옵션 렌더링 컴포넌트
|
|
@@ -42,13 +43,10 @@ const DropdownMenuItem = forwardRef<HTMLDivElement, DropdownMenuItemProps>(
|
|
|
42
43
|
ref,
|
|
43
44
|
) => {
|
|
44
45
|
const labelContent = label ?? children;
|
|
45
|
-
// 변경: label
|
|
46
|
-
const resolvedLabelContent =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
) : (
|
|
50
|
-
labelContent
|
|
51
|
-
);
|
|
46
|
+
// 변경: label 렌더링을 Slot.Text 경로로 통일해 string|number만 공통 래핑 규칙을 적용한다.
|
|
47
|
+
const resolvedLabelContent = (
|
|
48
|
+
<Slot.Text className="dropdown-menu-item-label">{labelContent}</Slot.Text>
|
|
49
|
+
);
|
|
52
50
|
const hasDescription = Boolean(description);
|
|
53
51
|
const shouldRenderCheckbox = multiple && !left;
|
|
54
52
|
|
|
@@ -98,6 +98,10 @@
|
|
|
98
98
|
var(--dropdown-text-medium-line-height)
|
|
99
99
|
);
|
|
100
100
|
|
|
101
|
+
span {
|
|
102
|
+
user-select: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
101
105
|
&[data-state="selected"] {
|
|
102
106
|
background-color: var(--dropdown-option-bg-selected);
|
|
103
107
|
color: var(--dropdown-option-color-selected);
|
|
@@ -134,7 +138,8 @@
|
|
|
134
138
|
|
|
135
139
|
.dropdown-menu-item-left,
|
|
136
140
|
.dropdown-menu-item-right {
|
|
137
|
-
|
|
141
|
+
// 변경: inline-* 금지 규칙에 맞춰 정렬 컨테이너를 flex로 통일한다.
|
|
142
|
+
display: flex;
|
|
138
143
|
align-items: center;
|
|
139
144
|
color: inherit;
|
|
140
145
|
}
|
|
@@ -148,7 +153,8 @@
|
|
|
148
153
|
}
|
|
149
154
|
|
|
150
155
|
.dropdown-menu-item-label {
|
|
151
|
-
|
|
156
|
+
// 변경: inline-* 금지 규칙에 맞춰 라벨 렌더 박스를 flex로 유지한다.
|
|
157
|
+
display: flex;
|
|
152
158
|
align-items: center;
|
|
153
159
|
min-width: 0;
|
|
154
160
|
color: inherit;
|
|
@@ -21,12 +21,30 @@ export default function SlotText<C extends ElementType = "span">({
|
|
|
21
21
|
return children;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// 변경: rest spread로 유입될 수 있는 className 충돌을 제거해 slot-text 클래스가 항상 유지되도록 한다.
|
|
25
|
+
const restPropsRecord = restProps as Record<string, unknown>;
|
|
26
|
+
const restClassName =
|
|
27
|
+
typeof restPropsRecord.className === "string"
|
|
28
|
+
? restPropsRecord.className
|
|
29
|
+
: undefined;
|
|
30
|
+
const mergedClassName = clsx("slot-text", restClassName, className);
|
|
31
|
+
const normalizedRestProps = { ...restPropsRecord };
|
|
32
|
+
delete normalizedRestProps.className;
|
|
33
|
+
|
|
34
|
+
const hasCustomTitle =
|
|
35
|
+
"title" in normalizedRestProps &&
|
|
36
|
+
typeof normalizedRestProps.title !== "undefined";
|
|
37
|
+
|
|
38
|
+
// 변경: 텍스트 children은 기본 title을 자동 주입해 native tooltip 경로를 보장한다.
|
|
39
|
+
const nativeTitleProps = hasCustomTitle ? {} : { title: String(children) };
|
|
40
|
+
|
|
24
41
|
// 문자열/숫자 children만 공통 slot text 마크업으로 감싼다.
|
|
25
42
|
return (
|
|
26
43
|
<SlotBase
|
|
27
44
|
as={as as ElementType}
|
|
28
|
-
className={
|
|
29
|
-
{...
|
|
45
|
+
className={mergedClassName}
|
|
46
|
+
{...nativeTitleProps}
|
|
47
|
+
{...normalizedRestProps}
|
|
30
48
|
>
|
|
31
49
|
{children}
|
|
32
50
|
</SlotBase>
|