@team-monolith/cds 1.108.0 → 1.109.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.
@@ -0,0 +1,19 @@
1
+ import { ReactNode, MouseEvent } from "react";
2
+ export type TabsProps = {
3
+ /** 현재 활성화된 탭의 키 */
4
+ activeKey: string;
5
+ /** 탭 클릭 시 호출되는 콜백 함수 */
6
+ onTabClick?: (key: string, event: MouseEvent<HTMLLIElement>) => void;
7
+ /** 탭 아이템 목록 */
8
+ items: {
9
+ key: string;
10
+ label: string;
11
+ children: ReactNode;
12
+ }[];
13
+ };
14
+ /**
15
+ * 탭 컴포넌트
16
+ * - https://www.figma.com/design/cxqE6nECkuqOlfdMOWjIZE/2025---Design-Working-file?node-id=2596-24381&m=dev
17
+ * - /images/2025-08-04-09-37-39.png
18
+ */
19
+ export declare function Tabs({ activeKey, onTabClick, items }: TabsProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { css } from "@emotion/react";
4
+ import styled from "@emotion/styled";
5
+ import { HOVER } from "../utils/hover";
6
+ /**
7
+ * 탭 컴포넌트
8
+ * - https://www.figma.com/design/cxqE6nECkuqOlfdMOWjIZE/2025---Design-Working-file?node-id=2596-24381&m=dev
9
+ * - /images/2025-08-04-09-37-39.png
10
+ */
11
+ export function Tabs({ activeKey, onTabClick, items }) {
12
+ var _a;
13
+ return (_jsxs(Wrapper, { children: [_jsx(TabBar, { children: items.map((item) => (_jsxs(Tab, { onClick: (event) => onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(item.key, event), active: activeKey === item.key, children: [item.label, activeKey === item.key && _jsx(ActiveIndicator, {})] }, item.key))) }), (_a = items.find((item) => item.key === activeKey)) === null || _a === void 0 ? void 0 : _a.children] }));
14
+ }
15
+ const Wrapper = styled.div `
16
+ display: flex;
17
+ flex-direction: column;
18
+ `;
19
+ const TabBar = styled.ul(({ theme }) => css `
20
+ display: flex;
21
+ gap: 16px;
22
+ list-style: none;
23
+ padding: 0;
24
+ margin: 4px 0;
25
+ border-bottom: 1px solid ${theme.color.background.neutralAltActive};
26
+ position: relative;
27
+ `);
28
+ const Tab = styled.li(({ theme, active }) => css `
29
+ padding: 8px 12px;
30
+ cursor: pointer;
31
+ color: ${theme.color.foreground.neutralBase};
32
+ text-align: center;
33
+ position: relative;
34
+
35
+ /* Default/Paragraph/14px-Bd */
36
+ font-family: ${theme.fontFamily.ui};
37
+ font-size: 14px;
38
+ font-style: normal;
39
+ font-weight: 400;
40
+ line-height: 20px; /* 142.857% */
41
+
42
+ border-radius: 8px;
43
+
44
+ ${HOVER(css `
45
+ background: ${theme.color.background.neutralAltActive};
46
+ `)}
47
+ ${active &&
48
+ css `
49
+ font-weight: 700;
50
+ `}
51
+ &:focus {
52
+ outline: 2px solid ${theme.color.background.primary};
53
+ }
54
+ `);
55
+ const ActiveIndicator = styled.span(({ theme }) => css `
56
+ position: absolute;
57
+ bottom: -1px;
58
+ left: 8px;
59
+ right: 8px;
60
+ height: 2px;
61
+ background-color: ${theme.color.background.primary};
62
+ `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.108.0",
3
+ "version": "1.109.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,