@uniai-fe/uds-primitives 0.3.39 → 0.3.40
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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { Slot } from "../../../slot";
|
|
3
|
+
|
|
4
|
+
export default function DropdownMenuItemLabel({
|
|
5
|
+
className,
|
|
6
|
+
children,
|
|
7
|
+
}: {
|
|
8
|
+
className?: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}) {
|
|
11
|
+
return (
|
|
12
|
+
<Slot.Text className={clsx("dropdown-menu-item-label", className)}>
|
|
13
|
+
{children}
|
|
14
|
+
</Slot.Text>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -6,7 +6,7 @@ import { forwardRef } from "react";
|
|
|
6
6
|
|
|
7
7
|
import type { DropdownMenuItemProps } from "../../types/props";
|
|
8
8
|
import { Checkbox } from "../../../checkbox/markup/Checkbox";
|
|
9
|
-
import
|
|
9
|
+
import DropdownMenuItemLabel from "./Label";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Dropdown Foundation; Menu Item 옵션 렌더링 컴포넌트
|
|
@@ -94,17 +94,13 @@ const DropdownMenuItem = forwardRef<HTMLDivElement, DropdownMenuItemProps>(
|
|
|
94
94
|
{/* 변경: description이 있을 때만 body wrapper를 렌더링해 불필요한 중첩 span을 줄인다. */}
|
|
95
95
|
{description ? (
|
|
96
96
|
<span className="dropdown-menu-item-body">
|
|
97
|
-
<
|
|
98
|
-
{label ?? children}
|
|
99
|
-
</Slot.Text>
|
|
97
|
+
<DropdownMenuItemLabel>{label ?? children}</DropdownMenuItemLabel>
|
|
100
98
|
<span className="dropdown-menu-item-description">
|
|
101
99
|
{description}
|
|
102
100
|
</span>
|
|
103
101
|
</span>
|
|
104
102
|
) : (
|
|
105
|
-
<
|
|
106
|
-
{label ?? children}
|
|
107
|
-
</Slot.Text>
|
|
103
|
+
<DropdownMenuItemLabel>{label ?? children}</DropdownMenuItemLabel>
|
|
108
104
|
)}
|
|
109
105
|
{right ? (
|
|
110
106
|
<span className="dropdown-menu-item-right">{right}</span>
|
|
@@ -4,6 +4,7 @@ import DropdownMenuList from "./MenuList";
|
|
|
4
4
|
import DropdownRoot from "./Root";
|
|
5
5
|
import { DropdownProvider } from "./Provider";
|
|
6
6
|
import DropdownTrigger from "./Trigger";
|
|
7
|
+
import DropdownMenuItemLabel from "./Label";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Dropdown; 기초 컴포넌트
|
|
@@ -13,6 +14,7 @@ import DropdownTrigger from "./Trigger";
|
|
|
13
14
|
* - Menu
|
|
14
15
|
* - Item
|
|
15
16
|
* - List
|
|
17
|
+
* - Label
|
|
16
18
|
* - Panel
|
|
17
19
|
* - Trigger
|
|
18
20
|
*/
|
|
@@ -20,6 +22,10 @@ export const DropdownFoundation = {
|
|
|
20
22
|
Provider: DropdownProvider,
|
|
21
23
|
Root: DropdownRoot,
|
|
22
24
|
Container: DropdownContainer,
|
|
23
|
-
Menu: {
|
|
25
|
+
Menu: {
|
|
26
|
+
Item: DropdownMenuItem,
|
|
27
|
+
List: DropdownMenuList,
|
|
28
|
+
Label: DropdownMenuItemLabel,
|
|
29
|
+
},
|
|
24
30
|
Trigger: DropdownTrigger,
|
|
25
31
|
};
|