@team-monolith/cds 1.24.1 → 1.26.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.
Files changed (25) hide show
  1. package/dist/components/Button.d.ts +2 -0
  2. package/dist/components/Button.js +3 -3
  3. package/dist/patterns/Dropdown/DropdownContext.d.ts +1 -1
  4. package/dist/patterns/Dropdown/{DropdownItem/DropdownItem.d.ts → DropdownItemV2/DropdownItemV2.d.ts} +3 -3
  5. package/dist/patterns/Dropdown/{DropdownItem/DropdownItem.js → DropdownItemV2/DropdownItemV2.js} +3 -5
  6. package/dist/patterns/Dropdown/DropdownItemV2/index.d.ts +1 -0
  7. package/dist/patterns/Dropdown/DropdownItemV2/index.js +1 -0
  8. package/dist/patterns/Dropdown/{DropdownItem → DropdownItemV2}/selected.d.ts +1 -1
  9. package/dist/patterns/Dropdown/{DropdownMenu/DropdownMenu.d.ts → DropdownMenuV2/DropdownMenuV2.d.ts} +2 -2
  10. package/dist/patterns/Dropdown/{DropdownMenu/DropdownMenu.js → DropdownMenuV2/DropdownMenuV2.js} +2 -2
  11. package/dist/patterns/Dropdown/DropdownMenuV2/index.d.ts +1 -0
  12. package/dist/patterns/Dropdown/DropdownMenuV2/index.js +1 -0
  13. package/dist/patterns/Dropdown/{DropdownMenu → DropdownMenuV2}/style.js +1 -1
  14. package/dist/patterns/Dropdown/{Dropdown.d.ts → DropdownV2.d.ts} +5 -3
  15. package/dist/patterns/Dropdown/{Dropdown.js → DropdownV2.js} +5 -6
  16. package/dist/patterns/Dropdown/index.d.ts +3 -2
  17. package/dist/patterns/Dropdown/index.js +3 -2
  18. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +1 -2
  19. package/package.json +1 -1
  20. package/dist/patterns/Dropdown/DropdownItem/index.d.ts +0 -2
  21. package/dist/patterns/Dropdown/DropdownItem/index.js +0 -2
  22. package/dist/patterns/Dropdown/DropdownMenu/index.d.ts +0 -2
  23. package/dist/patterns/Dropdown/DropdownMenu/index.js +0 -2
  24. /package/dist/patterns/Dropdown/{DropdownItem → DropdownItemV2}/selected.js +0 -0
  25. /package/dist/patterns/Dropdown/{DropdownMenu → DropdownMenuV2}/style.d.ts +0 -0
@@ -17,6 +17,8 @@ export interface ButtonOwnProps<RootComponentType extends React.ElementType> {
17
17
  endIcon?: React.ReactNode;
18
18
  /** 컴포넌트 내 표기될 문자열 */
19
19
  label: React.ReactNode;
20
+ /** 버튼 텍스트 굵음 여부 */
21
+ bold?: boolean;
20
22
  /** 전체 너비 유무 */
21
23
  fullWidth?: boolean;
22
24
  }
@@ -201,7 +201,7 @@ const SIZE_TO_LABEL_STYLE = {
201
201
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=20-173&t=cXcCv3QijbX7MkoC-0)
202
202
  */
203
203
  const Button = React.forwardRef(function Button(props, ref) {
204
- const { className, component: Component = "button", disabled, color, size, startIcon, endIcon, label, fullWidth } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "startIcon", "endIcon", "label", "fullWidth"]);
204
+ const { className, component: Component = "button", disabled, color, size, startIcon, endIcon, label, fullWidth, bold = false } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "startIcon", "endIcon", "label", "fullWidth", "bold"]);
205
205
  const theme = useTheme();
206
206
  return (_jsxs(Component, Object.assign({ type: "button" }, other, { className: className, ref: ref, css: [
207
207
  css `
@@ -229,10 +229,10 @@ const Button = React.forwardRef(function Button(props, ref) {
229
229
  `,
230
230
  COLOR_TO_BUTTON_STYLE(theme, color, Boolean(disabled)),
231
231
  SIZE_TO_BUTTON_STYLE[size],
232
- ], disabled: disabled }, { children: [startIcon, _jsx(Label, Object.assign({ size: size }, { children: label })), endIcon] })));
232
+ ], disabled: disabled }, { children: [startIcon, _jsx(Label, Object.assign({ size: size, bold: bold }, { children: label })), endIcon] })));
233
233
  });
234
234
  const Label = styled.span `
235
- font-weight: 400;
235
+ font-weight: ${({ bold }) => (bold ? 700 : 400)};
236
236
  white-space: nowrap;
237
237
  ${({ size }) => SIZE_TO_LABEL_STYLE[size]}
238
238
  `;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ItemState } from "./DropdownItem";
2
+ import { ItemState } from "./DropdownItemV2";
3
3
  declare const DropdownContext: React.Context<{
4
4
  /** 최상위 드롭다운 메뉴의 open 여부 */
5
5
  open: boolean;
@@ -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 { DropdownMenuProps } from "../DropdownMenu";
5
- import { CheckboxInputProps } from "../../../components/CheckboxInput";
4
+ import { CheckboxInputProps } from "../../..";
5
+ import { DropdownMenuProps } from "../DropdownMenuV2";
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 default DropdownItem;
50
+ export { DropdownItem };
@@ -14,13 +14,11 @@ 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 "../../..";
17
18
  import { useContext, useRef } from "react";
18
- import DropdownMenu from "../DropdownMenu";
19
+ import { DropdownMenu } from "../DropdownMenuV2";
19
20
  import DropdownContext from "../DropdownContext";
20
21
  import { getSelected, setSelected } from "./selected";
21
- import CheckboxInput from "../../../components/CheckboxInput";
22
- import { ArrowRightSLineIcon } from "../../../icons";
23
- import { HOVER } from "../../../utils/hover";
24
22
  const TYPE_TO_COLOR = (theme, type) => {
25
23
  return {
26
24
  default: theme.color.foreground.neutralBase,
@@ -125,4 +123,4 @@ const Item = styled.div(({ theme, selected, disabled }) => css `
125
123
  background-color: ${theme.color.background.neutralBase};
126
124
  `}
127
125
  `);
128
- export default DropdownItem;
126
+ export { DropdownItem };
@@ -0,0 +1 @@
1
+ export * from "./DropdownItemV2";
@@ -0,0 +1 @@
1
+ export * from "./DropdownItemV2";
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ItemState } from "./DropdownItem";
2
+ import { ItemState } from "./DropdownItemV2";
3
3
  /** index에 해당하는 아이템의 open state를 리턴합니다. */
4
4
  export declare function getSelected(state: ItemState, index: string): boolean;
5
5
  /** index에 해당하는 아이템의 open state를 true로 업데이트합니다.
@@ -2,7 +2,7 @@ import { SerializedStyles } from "@emotion/react";
2
2
  import React from "react";
3
3
  import { ModalProps } from "@mui/material";
4
4
  import { OriginProps } from "./style";
5
- import { ItemState } from "../DropdownItem";
5
+ import { ItemState } from "../DropdownItemV2";
6
6
  export declare const DROPDOWN_MENU_WIDTH = 124;
7
7
  export declare const DROPDOWN_MENU_MAX_HEIGHT = 160;
8
8
  export interface DropdownMenuProps extends Omit<ModalProps, "open" | "onClose" | "children"> {
@@ -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 default DropdownMenu;
37
+ export { 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 "../../..";
17
18
  import { Modal as MuiModal, Grow as MuiGrow, Portal, } from "@mui/material";
18
19
  import { ORIGIN_PROPS_TO_POSITION, ORIGIN_PROPS_TO_TRANSFORM, } from "./style";
19
20
  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 default DropdownMenu;
92
+ export { DropdownMenu };
@@ -0,0 +1 @@
1
+ export * from "./DropdownMenuV2";
@@ -0,0 +1 @@
1
+ export * from "./DropdownMenuV2";
@@ -1,5 +1,5 @@
1
1
  import { css } from "@emotion/react";
2
- import { DROPDOWN_MENU_WIDTH } from "./DropdownMenu";
2
+ import { DROPDOWN_MENU_WIDTH } from "./DropdownMenuV2";
3
3
  /** anchor를 기준으로 드롭다운 메뉴 원점 위치 스타일을 리턴합니다. */
4
4
  export const ORIGIN_PROPS_TO_POSITION = (anchorOrigin, anchorRect, nested) => {
5
5
  const { vertical, horizontal } = anchorOrigin;
@@ -1,8 +1,8 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import React from "react";
3
- import { DropdownMenuProps } from "./DropdownMenu";
3
+ import { ButtonColor, ButtonSize } from "../..";
4
+ import { DropdownMenuProps } from "./DropdownMenuV2";
4
5
  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,6 +12,8 @@ export interface DropdownProps {
12
12
  color?: ButtonColor;
13
13
  /** 버튼 컴포넌트 크기 */
14
14
  size?: ButtonSize;
15
+ /** 버튼 컴포넌트 텍스트 굵음 여부 */
16
+ bold?: boolean;
15
17
  /** 버튼 컴포넌트 내 좌측에 표기될 아이콘 */
16
18
  startIcon?: React.ReactNode;
17
19
  /** 버튼 컴포넌트 내 우측에 표기될 아이콘 */
@@ -33,4 +35,4 @@ export interface DropdownProps {
33
35
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
34
36
  */
35
37
  declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<any>>;
36
- export default Dropdown;
38
+ export { Dropdown };
@@ -1,14 +1,13 @@
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 DropdownMenu from "./DropdownMenu";
5
- import Button from "../../components/Button";
6
- import { ArrowDropDownFillIcon } from "../../icons";
4
+ import { Button, ArrowDropDownFillIcon } from "../..";
5
+ import { DropdownMenu } from "./DropdownMenuV2";
7
6
  /**
8
7
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
9
8
  */
10
9
  const Dropdown = forwardRef((props, ref) => {
11
- const { className, component: Component = "div", disabled, color = "primary", size = "medium", startIcon, endIcon = _jsx(ArrowDropDownFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick, } = props;
10
+ const { className, component: Component = "div", disabled, color = "primary", size = "medium", bold, startIcon, endIcon = _jsx(ArrowDropDownFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick, } = props;
12
11
  const buttonProps = {
13
12
  disabled,
14
13
  color,
@@ -38,6 +37,6 @@ const Dropdown = forwardRef((props, ref) => {
38
37
  });
39
38
  (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
40
39
  };
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 }))] })));
40
+ return (_jsxs(Component, Object.assign({ className: className, ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { label: label, bold: bold, 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
41
  });
43
- export default Dropdown;
42
+ export { Dropdown };
@@ -1,2 +1,3 @@
1
- export * from "./Dropdown";
2
- export { default } from "./Dropdown";
1
+ export * from "./DropdownV2";
2
+ export * from "./DropdownItemV2";
3
+ export * from "./DropdownMenuV2";
@@ -1,2 +1,3 @@
1
- export * from "./Dropdown";
2
- export { default } from "./Dropdown";
1
+ export * from "./DropdownV2";
2
+ export * from "./DropdownItemV2";
3
+ export * from "./DropdownMenuV2";
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Controller } from "react-hook-form";
3
- import Dropdown from "../../../../Dropdown";
4
3
  import { css, useTheme } from "@emotion/react";
5
- import DropdownItem from "../../../../Dropdown/DropdownItem";
4
+ import { Dropdown, DropdownItem } from "../../../../..";
6
5
  export default function TextTypeDropdown(props) {
7
6
  const theme = useTheme();
8
7
  const { index, control, disabled } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.24.1",
3
+ "version": "1.26.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,
@@ -1,2 +0,0 @@
1
- export { default } from "./DropdownItem";
2
- export * from "./DropdownItem";
@@ -1,2 +0,0 @@
1
- export { default } from "./DropdownItem";
2
- export * from "./DropdownItem";
@@ -1,2 +0,0 @@
1
- export { default } from "./DropdownMenu";
2
- export * from "./DropdownMenu";
@@ -1,2 +0,0 @@
1
- export { default } from "./DropdownMenu";
2
- export * from "./DropdownMenu";