@team-monolith/cds 1.99.2 → 1.99.3
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) ? "true" : "false" })), _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,
|