@team-monolith/cds 1.99.2 → 1.99.4
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.
|
@@ -89,12 +89,6 @@ export const Book = forwardRef(function Book(props, ref) {
|
|
|
89
89
|
}, onHoverEnd: () => {
|
|
90
90
|
setOpen(false);
|
|
91
91
|
onHoverEnd === null || onHoverEnd === void 0 ? void 0 : onHoverEnd();
|
|
92
|
-
}, onFocus: () => {
|
|
93
|
-
setOpen(true);
|
|
94
|
-
onHoverStart === null || onHoverStart === void 0 ? void 0 : onHoverStart();
|
|
95
|
-
}, onBlur: () => {
|
|
96
|
-
setOpen(false);
|
|
97
|
-
onHoverEnd === null || onHoverEnd === void 0 ? void 0 : onHoverEnd();
|
|
98
92
|
} }, { children: [_jsxs(Cover, Object.assign({ className: bookClasses.cover, css: onCoverClick &&
|
|
99
93
|
css `
|
|
100
94
|
cursor: pointer;
|
|
@@ -18,6 +18,7 @@ import { DropdownMenu } from "./DropdownMenu";
|
|
|
18
18
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
|
|
19
19
|
*/
|
|
20
20
|
const Dropdown = forwardRef(function Dropdown(props, ref) {
|
|
21
|
+
var _a;
|
|
21
22
|
const { className, component: Component = "div", disabled, color = "primary", size = "medium", bold, startIcon, endIcon = _jsx(ArrowDownSFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "bold", "startIcon", "endIcon", "buttonCss", "label", "onClick", "menuProps", "children", "closeOnItemClick"]);
|
|
22
23
|
const buttonProps = Object.assign(Object.assign({}, props.buttonProps), { disabled,
|
|
23
24
|
color,
|
|
@@ -52,6 +53,6 @@ const Dropdown = forwardRef(function Dropdown(props, ref) {
|
|
|
52
53
|
});
|
|
53
54
|
(_a = menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
|
|
54
55
|
};
|
|
55
|
-
return (_jsxs(Component, Object.assign({ className: className }, other, { ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { onClick: handleClick, fullWidth: true })), _jsx(DropdownMenu, Object.assign({}, menuProps, { open: isControlled ? menuProps.open : open, onClose: handleClose, anchorEl: menuRef.current, closeOnItemClick: closeOnItemClick, itemState: itemState, setItemState: setItemState }, { children: children }))] })));
|
|
56
|
+
return (_jsxs(Component, Object.assign({ className: className }, other, { ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { onClick: handleClick, fullWidth: true, "aria-expanded": (_a = menuProps.open) !== null && _a !== void 0 ? _a : open })), _jsx(DropdownMenu, Object.assign({}, menuProps, { open: isControlled ? menuProps.open : open, onClose: handleClose, anchorEl: menuRef.current, closeOnItemClick: closeOnItemClick, itemState: itemState, setItemState: setItemState }, { children: children }))] })));
|
|
56
57
|
});
|
|
57
58
|
export { Dropdown };
|
|
@@ -49,7 +49,7 @@ const DropdownItem = React.forwardRef(function DropdownItem(props, ref) {
|
|
|
49
49
|
setSelected(setItemState, absItemIndex);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
return (_jsxs(_Fragment, { children: [_jsx(Component, Object.assign({ className: className, ref: ref, tabIndex: disabled ? -1 : 0, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: handleClick, "aria-disabled": disabled }, other, { children: _jsxs(Item, Object.assign({ ref: itemRef, disabled: disabled, selected: isSubMenuShowed || Boolean(active) }, { children: [_jsxs(LeftWrapper, { children: [checkbox && (_jsx(StyledCheckboxInput, Object.assign({}, checkboxProps, { disabled: disabled, onClick: (e) => {
|
|
52
|
+
return (_jsxs(_Fragment, { children: [_jsx(Component, Object.assign({ className: className, ref: ref, tabIndex: disabled ? -1 : 0, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: handleClick, "aria-disabled": disabled }, other, { "aria-expanded": isSubMenuExist ? isSubMenuShowed : undefined }, { children: _jsxs(Item, Object.assign({ ref: itemRef, disabled: disabled, selected: isSubMenuShowed || Boolean(active) }, { children: [_jsxs(LeftWrapper, { children: [checkbox && (_jsx(StyledCheckboxInput, Object.assign({}, checkboxProps, { disabled: disabled, onClick: (e) => {
|
|
53
53
|
e.stopPropagation();
|
|
54
54
|
} }))), startIcon && (_jsx(IconDiv, Object.assign({ type: type, preserveIconColor: preserveIconColor }, { children: startIcon }))), _jsx(LabelDiv, Object.assign({ css: labelCss, type: type }, { children: label }))] }), endIcon && (_jsx(IconDiv, Object.assign({ type: type, preserveIconColor: preserveIconColor }, { children: endIcon }))), !endIcon && isSubMenuExist && (_jsx(IconDiv, Object.assign({ type: type, preserveIconColor: preserveIconColor }, { children: _jsx(ArrowRightSLineIcon, {}) })))] })) })), isSubMenuExist && (_jsx(DropdownContext.Provider, Object.assign({ value: {
|
|
55
55
|
open,
|
|
@@ -30,7 +30,10 @@ export const SegmentedControlButton = React.forwardRef(function SegmentedControl
|
|
|
30
30
|
const isActive = context.multiSelect
|
|
31
31
|
? context.value.includes(props.value)
|
|
32
32
|
: context.value === props.value;
|
|
33
|
-
|
|
33
|
+
const { label } = other;
|
|
34
|
+
return (_jsx(StyledButton, Object.assign({}, other, { ref: ref, startIcon: typeof startIcon === "function" ? startIcon(isActive) : startIcon, endIcon: typeof endIcon === "function" ? endIcon(isActive) : endIcon, isActive: isActive, color: isActive ? "white" : "textNeutral", size: context.size, onClick: handleClick, disabled: context.disabled || props.disabled, title: isActive
|
|
35
|
+
? `${typeof label === "string" ? label : ""} 선택됨`
|
|
36
|
+
: undefined })));
|
|
34
37
|
});
|
|
35
38
|
const StyledButton = styled(Button, {
|
|
36
39
|
shouldForwardProp: (prop) => prop !== "isActive",
|