@team-monolith/cds 0.27.0 → 0.28.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/README.md +10 -1
- package/dist/components/Popover.d.ts +16 -0
- package/dist/components/Popover.js +40 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,4 +23,13 @@
|
|
|
23
23
|
- 네이밍은 remixicon 라이브러리의 svg 파일 이름에서 다음과 같이 변환됩니다.
|
|
24
24
|
- string 형태로 export되는 값은 다음 예시와 같이 camel case로 네이밍됩니다. (예: `arrowDownCircleFillSvg`)
|
|
25
25
|
- React JSX 형태로 export되는 값은 다음 예시와 같이 pascal case로 네이밍됩니다. (예: `ArrowDownCircleFillIcon`)
|
|
26
|
-
- svg 파일 이름이 숫자로 시작하는 경우, 제일 앞에 `i`를 붙입니다. (예: `4k-fill.svg` -> `i4KFillSvg`, `I4KFillIcon`)
|
|
26
|
+
- svg 파일 이름이 숫자로 시작하는 경우, 제일 앞에 `i`를 붙입니다. (예: `4k-fill.svg` -> `i4KFillSvg`, `I4KFillIcon`)
|
|
27
|
+
|
|
28
|
+
### 개발 및 배포 절차
|
|
29
|
+
|
|
30
|
+
`npm run storybook` 을 실행하면 스토리북이 실행됩니다. 이곳에서 디버깅을 진행합니다.
|
|
31
|
+
|
|
32
|
+
패키지 특성상 개발환경이 따로 존재하지 않으며 `npm run compile` 후 `npm publish` 를 사용하여 npm 에 배포합니다.
|
|
33
|
+
|
|
34
|
+
이때 npm team-monolith 에 소속되어 있어야 합니다.
|
|
35
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PopoverProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** 제목 */
|
|
5
|
+
headline?: React.ReactNode;
|
|
6
|
+
/** 내용 */
|
|
7
|
+
content?: React.ReactNode;
|
|
8
|
+
/** 좌측 아이콘 */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** 우측 버튼 텍스트 */
|
|
11
|
+
buttonLabel?: string;
|
|
12
|
+
/** 우측 버튼 클릭시 동작 */
|
|
13
|
+
onButtonClick?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export default Popover;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import styled from "@emotion/styled";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import shadows from "../foundation/shadows";
|
|
20
|
+
import { RESET_BUTTON } from "../utils/reset";
|
|
21
|
+
import { HOVER } from "../utils/hover";
|
|
22
|
+
import { css } from "@emotion/react";
|
|
23
|
+
var Popover = React.forwardRef(function (props, ref) {
|
|
24
|
+
var className = props.className, headline = props.headline, content = props.content, icon = props.icon, buttonLabel = props.buttonLabel, onButtonClick = props.onButtonClick;
|
|
25
|
+
return (_jsxs(Container, __assign({ ref: ref, className: className }, { children: [icon != null && _jsx(Icon, { children: icon }), _jsxs(ContentArea, { children: [headline != null && _jsx(Headline, { children: headline }), content != null && _jsx(Content, { children: content })] }), buttonLabel != null && (_jsx(PopoverButton, __assign({ type: "button", onClick: onButtonClick }, { children: buttonLabel })))] })));
|
|
26
|
+
});
|
|
27
|
+
export default Popover;
|
|
28
|
+
var Container = styled.div(function (_a) {
|
|
29
|
+
var theme = _a.theme;
|
|
30
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n width: auto;\n padding: 6px 16px;\n gap: 12px;\n border-radius: 100px;\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n "], ["\n display: inline-flex;\n align-items: center;\n width: auto;\n padding: 6px 16px;\n gap: 12px;\n border-radius: 100px;\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n "])), theme.color.foreground.neutralBase, theme.color.background.neutralBase, shadows.shadow32);
|
|
31
|
+
});
|
|
32
|
+
var Icon = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n width: 20px;\n height: 20px;\n svg {\n width: 100%;\n height: 100%;\n }\n"], ["\n display: block;\n width: 20px;\n height: 20px;\n svg {\n width: 100%;\n height: 100%;\n }\n"])));
|
|
33
|
+
var ContentArea = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1 0 auto;\n font-size: 14px;\n line-height: 20px;\n"], ["\n flex: 1 0 auto;\n font-size: 14px;\n line-height: 20px;\n"])));
|
|
34
|
+
var Headline = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-bottom: 2px;\n font-weight: 700;\n"], ["\n margin-bottom: 2px;\n font-weight: 700;\n"])));
|
|
35
|
+
var Content = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-weight: 400;\n"], ["\n font-weight: 400;\n"])));
|
|
36
|
+
var PopoverButton = styled.button(function (_a) {
|
|
37
|
+
var theme = _a.theme;
|
|
38
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n margin: 4px;\n padding: 6px 8px;\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 16px;\n border-radius: 8px;\n ", "\n "], ["\n ", "\n margin: 4px;\n padding: 6px 8px;\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n font-size: 14px;\n line-height: 16px;\n border-radius: 8px;\n ", "\n "])), RESET_BUTTON, theme.color.background.primary, theme.color.background.neutralAlt, HOVER(css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n "], ["\n color: ", ";\n background: ", ";\n "])), theme.color.foreground.neutralAlt, theme.color.background.primaryActive)));
|
|
39
|
+
});
|
|
40
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export { default as Pagination } from "./components/Pagination";
|
|
|
12
12
|
export * from "./components/Pagination";
|
|
13
13
|
export { default as PinInput } from "./components/PinInput";
|
|
14
14
|
export * from "./components/PinInput";
|
|
15
|
+
export { default as Popover } from "./components/Popover";
|
|
16
|
+
export * from "./components/Popover";
|
|
15
17
|
export { default as RadioInput } from "./components/RadioInput";
|
|
16
18
|
export * from "./components/RadioInput";
|
|
17
19
|
export { default as SquareButton } from "./components/SquareButton";
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,8 @@ export { default as Pagination } from "./components/Pagination";
|
|
|
12
12
|
export * from "./components/Pagination";
|
|
13
13
|
export { default as PinInput } from "./components/PinInput";
|
|
14
14
|
export * from "./components/PinInput";
|
|
15
|
+
export { default as Popover } from "./components/Popover";
|
|
16
|
+
export * from "./components/Popover";
|
|
15
17
|
export { default as RadioInput } from "./components/RadioInput";
|
|
16
18
|
export * from "./components/RadioInput";
|
|
17
19
|
export { default as SquareButton } from "./components/SquareButton";
|