@team-monolith/cds 1.17.3 → 1.18.1

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.
@@ -7,10 +7,8 @@ export interface PopoverProps {
7
7
  content?: React.ReactNode;
8
8
  /** 좌측 아이콘 */
9
9
  icon?: React.ReactNode;
10
- /** 우측 버튼 텍스트 */
11
- buttonLabel?: string;
12
- /** 우측 버튼 클릭시 동작 */
13
- onButtonClick?: () => void;
10
+ /** 우측 버튼 */
11
+ button?: React.ReactNode;
14
12
  }
15
13
  declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
16
14
  export default Popover;
@@ -2,12 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "@emotion/styled";
3
3
  import React from "react";
4
4
  import shadows from "../foundation/shadows";
5
- import { RESET_BUTTON } from "../utils/reset";
6
- import { HOVER } from "../utils/hover";
7
5
  import { css } from "@emotion/react";
8
6
  const Popover = React.forwardRef((props, ref) => {
9
- const { className, headline, content, icon, buttonLabel, onButtonClick } = props;
10
- return (_jsxs(Container, Object.assign({ ref: ref, className: className }, { children: [icon && _jsx(Icon, { children: icon }), _jsxs(ContentArea, { children: [headline && _jsx(Headline, { children: headline }), content && _jsx(Content, { children: content })] }), buttonLabel && (_jsx(PopoverButton, Object.assign({ type: "button", onClick: onButtonClick }, { children: buttonLabel })))] })));
7
+ const { className, headline, content, icon, button } = props;
8
+ return (_jsxs(Container, Object.assign({ ref: ref, className: className }, { children: [icon && _jsx(Icon, { children: icon }), _jsxs(ContentArea, { children: [headline && _jsx(Headline, { children: headline }), content && _jsx(Content, { children: content })] }), button] })));
11
9
  });
12
10
  export default Popover;
13
11
  const Container = styled.div(({ theme }) => css `
@@ -42,18 +40,3 @@ const Headline = styled.div `
42
40
  const Content = styled.div `
43
41
  font-weight: 400;
44
42
  `;
45
- const PopoverButton = styled.button(({ theme }) => css `
46
- ${RESET_BUTTON}
47
- margin: 4px;
48
- padding: 6px 8px;
49
- cursor: pointer;
50
- background-color: ${theme.color.background.primary};
51
- color: ${theme.color.background.neutralAlt};
52
- font-size: 14px;
53
- line-height: 16px;
54
- border-radius: 8px;
55
- ${HOVER(css `
56
- color: ${theme.color.foreground.neutralAlt};
57
- background: ${theme.color.background.primaryActive};
58
- `)}
59
- `);
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  export interface AccordionProps {
3
3
  className?: string;
4
+ gap?: number;
4
5
  icon?: React.ReactNode;
5
6
  title: React.ReactNode;
6
7
  children: React.ReactNode;
@@ -5,11 +5,11 @@ import styled from "@emotion/styled";
5
5
  import { ArrowDownSLineIcon, ArrowUpSLineIcon } from "../icons";
6
6
  /** 배너같이 생겼으나 누를 때마다 하단내용이 접힘(보이지않음)/펼침(보임) 상태가 바뀌는 컴포넌트입니다. */
7
7
  export function Accordion(props) {
8
- const { className, icon, title, children, open = false, onClick } = props;
8
+ const { className, icon, title, children, open = false, onClick, gap = 2, } = props;
9
9
  return (_jsxs("div", Object.assign({ css: css `
10
10
  display: flex;
11
11
  flex-direction: column;
12
- gap: 2px;
12
+ gap: ${gap}px;
13
13
  ` }, { children: [_jsxs(Container, Object.assign({ className: className, onClick: onClick }, { children: [_jsxs(Title, { children: [icon, title] }), open ? _jsx(ArrowUpSLineIcon, {}) : _jsx(ArrowDownSLineIcon, {})] })), open && children] })));
14
14
  }
15
15
  const Title = styled.div(({ theme }) => css `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.17.3",
3
+ "version": "1.18.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,