@team-monolith/cds 1.26.2 → 1.27.0
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/patterns/Dropdown/Dropdown.d.ts +2 -4
- package/dist/patterns/Dropdown/Dropdown.js +6 -6
- package/dist/patterns/Dropdown/DropdownItem/DropdownItem.d.ts +2 -2
- package/dist/patterns/Dropdown/DropdownItem/DropdownItem.js +5 -3
- package/dist/patterns/Dropdown/DropdownItem/index.d.ts +1 -0
- package/dist/patterns/Dropdown/DropdownItem/index.js +1 -0
- package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.js +2 -2
- package/dist/patterns/Dropdown/DropdownMenu/index.d.ts +1 -0
- package/dist/patterns/Dropdown/DropdownMenu/index.js +1 -0
- package/dist/patterns/Dropdown/index.d.ts +1 -2
- package/dist/patterns/Dropdown/index.js +1 -2
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +2 -1
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +1 -1
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.d.ts +2 -0
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { ButtonColor, ButtonSize } from "../..";
|
|
4
3
|
import { DropdownMenuProps } from "./DropdownMenu";
|
|
5
4
|
import { SerializedStyles } from "@emotion/react";
|
|
5
|
+
import { ButtonColor, ButtonSize } from "../../components/Button";
|
|
6
6
|
export interface DropdownProps {
|
|
7
7
|
className?: string;
|
|
8
8
|
component?: React.ElementType;
|
|
@@ -12,8 +12,6 @@ export interface DropdownProps {
|
|
|
12
12
|
color?: ButtonColor;
|
|
13
13
|
/** 버튼 컴포넌트 크기 */
|
|
14
14
|
size?: ButtonSize;
|
|
15
|
-
/** 버튼 컴포넌트 텍스트 굵음 여부 */
|
|
16
|
-
bold?: boolean;
|
|
17
15
|
/** 버튼 컴포넌트 내 좌측에 표기될 아이콘 */
|
|
18
16
|
startIcon?: React.ReactNode;
|
|
19
17
|
/** 버튼 컴포넌트 내 우측에 표기될 아이콘 */
|
|
@@ -35,4 +33,4 @@ export interface DropdownProps {
|
|
|
35
33
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
|
|
36
34
|
*/
|
|
37
35
|
declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<any>>;
|
|
38
|
-
export
|
|
36
|
+
export default Dropdown;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @emotion/react */
|
|
3
3
|
import { forwardRef, useRef, useState } from "react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import DropdownMenu from "./DropdownMenu";
|
|
5
|
+
import Button from "../../components/Button";
|
|
6
|
+
import { ArrowDropDownFillIcon } from "../../icons";
|
|
6
7
|
/**
|
|
7
8
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
|
|
8
9
|
*/
|
|
9
10
|
const Dropdown = forwardRef((props, ref) => {
|
|
10
|
-
const { className, component: Component = "div", disabled, color = "primary", size = "medium",
|
|
11
|
+
const { className, component: Component = "div", disabled, color = "primary", size = "medium", startIcon, endIcon = _jsx(ArrowDropDownFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick, } = props;
|
|
11
12
|
const buttonProps = {
|
|
12
13
|
disabled,
|
|
13
14
|
color,
|
|
@@ -24,7 +25,6 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
24
25
|
};
|
|
25
26
|
const handleClose = (e) => {
|
|
26
27
|
var _a;
|
|
27
|
-
e.stopPropagation();
|
|
28
28
|
setOpen(false);
|
|
29
29
|
setItemState((prevState) => {
|
|
30
30
|
const newState = new Map(prevState);
|
|
@@ -38,6 +38,6 @@ const Dropdown = forwardRef((props, ref) => {
|
|
|
38
38
|
});
|
|
39
39
|
(_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
|
|
40
40
|
};
|
|
41
|
-
return (_jsxs(Component, Object.assign({ className: className, ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { label: label,
|
|
41
|
+
return (_jsxs(Component, Object.assign({ className: className, ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { label: label, onClick: handleClick, fullWidth: true })), _jsx(DropdownMenu, Object.assign({}, menuProps, { open: open, onClose: handleClose, anchorEl: menuRef.current, closeOnItemClick: closeOnItemClick, itemState: itemState, setItemState: setItemState }, { children: children }))] })));
|
|
42
42
|
});
|
|
43
|
-
export
|
|
43
|
+
export default Dropdown;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import { SerializedStyles } from "@emotion/react";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { CheckboxInputProps } from "../../..";
|
|
5
4
|
import { DropdownMenuProps } from "../DropdownMenu";
|
|
5
|
+
import { CheckboxInputProps } from "../../../components/CheckboxInput";
|
|
6
6
|
export type DropdownItemType = "default" | "danger";
|
|
7
7
|
export type ItemState = Map<string, {
|
|
8
8
|
open: boolean;
|
|
@@ -47,4 +47,4 @@ export interface DropdownItemProps {
|
|
|
47
47
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1900&t=FwczLZ1IVvskUVbT-0)
|
|
48
48
|
*/
|
|
49
49
|
declare const DropdownItem: React.ForwardRefExoticComponent<DropdownItemProps & React.RefAttributes<any>>;
|
|
50
|
-
export
|
|
50
|
+
export default DropdownItem;
|
|
@@ -14,11 +14,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/reac
|
|
|
14
14
|
import { css } from "@emotion/react";
|
|
15
15
|
import * as React from "react";
|
|
16
16
|
import styled from "@emotion/styled";
|
|
17
|
-
import { CheckboxInput, ArrowRightSLineIcon, HOVER, } from "../../..";
|
|
18
17
|
import { useContext, useRef } from "react";
|
|
19
|
-
import
|
|
18
|
+
import DropdownMenu from "../DropdownMenu";
|
|
20
19
|
import DropdownContext from "../DropdownContext";
|
|
21
20
|
import { getSelected, setSelected } from "./selected";
|
|
21
|
+
import CheckboxInput from "../../../components/CheckboxInput";
|
|
22
|
+
import { ArrowRightSLineIcon } from "../../../icons";
|
|
23
|
+
import { HOVER } from "../../../utils/hover";
|
|
22
24
|
const TYPE_TO_COLOR = (theme, type) => {
|
|
23
25
|
return {
|
|
24
26
|
default: theme.color.foreground.neutralBase,
|
|
@@ -123,4 +125,4 @@ const Item = styled.div(({ theme, selected, disabled }) => css `
|
|
|
123
125
|
background-color: ${theme.color.background.neutralBase};
|
|
124
126
|
`}
|
|
125
127
|
`);
|
|
126
|
-
export
|
|
128
|
+
export default DropdownItem;
|
|
@@ -34,4 +34,4 @@ export interface DropdownMenuProps extends Omit<ModalProps, "open" | "onClose" |
|
|
|
34
34
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=106-1921&t=FwczLZ1IVvskUVbT-0)
|
|
35
35
|
*/
|
|
36
36
|
declare const DropdownMenu: React.ForwardRefExoticComponent<Omit<DropdownMenuProps, "ref"> & React.RefAttributes<any>>;
|
|
37
|
-
export
|
|
37
|
+
export default DropdownMenu;
|
|
@@ -14,10 +14,10 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
|
14
14
|
import styled from "@emotion/styled";
|
|
15
15
|
import { css } from "@emotion/react";
|
|
16
16
|
import React, { useContext } from "react";
|
|
17
|
-
import { shadows } from "../../..";
|
|
18
17
|
import { Modal as MuiModal, Grow as MuiGrow, Portal, } from "@mui/material";
|
|
19
18
|
import { ORIGIN_PROPS_TO_POSITION, ORIGIN_PROPS_TO_TRANSFORM, } from "./style";
|
|
20
19
|
import DropdownContext from "../DropdownContext";
|
|
20
|
+
import shadows from "../../../foundation/shadows";
|
|
21
21
|
export const DROPDOWN_MENU_WIDTH = 124;
|
|
22
22
|
export const DROPDOWN_MENU_MAX_HEIGHT = 160;
|
|
23
23
|
/**
|
|
@@ -89,4 +89,4 @@ const Menu = styled.div(({ theme }) => css `
|
|
|
89
89
|
// 최상위 메뉴의 mui modal 백드롭의 z-index는 1300입니다.
|
|
90
90
|
z-index: 1300;
|
|
91
91
|
`);
|
|
92
|
-
export
|
|
92
|
+
export default DropdownMenu;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Controller } from "react-hook-form";
|
|
3
|
+
import Dropdown from "../../../../Dropdown";
|
|
3
4
|
import { css, useTheme } from "@emotion/react";
|
|
4
|
-
import
|
|
5
|
+
import DropdownItem from "../../../../Dropdown/DropdownItem";
|
|
5
6
|
export default function TextTypeDropdown(props) {
|
|
6
7
|
const theme = useTheme();
|
|
7
8
|
const { index, control, disabled } = props;
|
|
@@ -30,7 +30,7 @@ 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
|
-
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 })));
|
|
33
|
+
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 })));
|
|
34
34
|
});
|
|
35
35
|
const StyledButton = styled(Button, {
|
|
36
36
|
shouldForwardProp: (prop) => prop !== "isActive",
|
|
@@ -7,7 +7,7 @@ import React from "react";
|
|
|
7
7
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
|
|
8
8
|
*/
|
|
9
9
|
export const SegmentedControlGroup = React.forwardRef(function SegmentedControlGroup(props, ref) {
|
|
10
|
-
const { component: Component = "div", className, children, fullWidth, multiSelect, } = props;
|
|
10
|
+
const { component: Component = "div", className, children, fullWidth, disabled, multiSelect, } = props;
|
|
11
11
|
const theme = useTheme();
|
|
12
12
|
return (_jsx(Component, Object.assign({ ref: ref, className: className, css: css `
|
|
13
13
|
display: flex;
|