@pfct/purple 1.3.8-rc.0 → 1.3.8-rc.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.
- package/dist/components/NavigationBar/BottomNavigationBar/index.d.ts +14 -0
- package/dist/components/NavigationBar/BottomNavigationBar/index.js +44 -0
- package/dist/components/NavigationBar/BottomNavigationBar/index.stories.d.ts +6 -0
- package/dist/components/NavigationBar/BottomNavigationBar/index.stories.js +43 -0
- package/dist/components/NavigationBar/BottomNavigationBar/index.styled.d.ts +17 -0
- package/dist/components/NavigationBar/BottomNavigationBar/index.styled.js +29 -0
- package/dist/components/NavigationBar/PageNavigationBar/constant.d.ts +7 -0
- package/dist/components/NavigationBar/PageNavigationBar/constant.js +18 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.d.ts +34 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.js +88 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.spec.d.ts +1 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.spec.js +20 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.stories.d.ts +18 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.stories.js +146 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.styled.d.ts +41 -0
- package/dist/components/NavigationBar/PageNavigationBar/index.styled.js +48 -0
- package/dist/components/NavigationBar/TitleNavigationBar/index.d.ts +14 -0
- package/dist/components/NavigationBar/TitleNavigationBar/index.js +59 -0
- package/dist/components/NavigationBar/TitleNavigationBar/index.stories.d.ts +7 -0
- package/dist/components/NavigationBar/TitleNavigationBar/index.stories.js +54 -0
- package/dist/components/NavigationBar/TitleNavigationBar/index.styled.d.ts +23 -0
- package/dist/components/NavigationBar/TitleNavigationBar/index.styled.js +25 -0
- package/dist/components/NavigationBar/index.d.ts +3 -0
- package/dist/components/NavigationBar/index.js +19 -0
- package/dist/library/ShareUI/Buttons.d.ts +7 -0
- package/dist/library/ShareUI/Buttons.js +20 -0
- package/dist/library/ShareUI/index.d.ts +14 -0
- package/dist/library/ShareUI/index.js +59 -0
- package/dist/library/ShareUI/index.stories.d.ts +6 -0
- package/dist/library/ShareUI/index.stories.js +32 -0
- package/dist/library/ShareUI/index.styled.d.ts +60 -0
- package/dist/library/ShareUI/index.styled.js +60 -0
- package/dist/library/Spacing/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../../Icon';
|
|
3
|
+
type BottomNavigationBarProps = {
|
|
4
|
+
value: string;
|
|
5
|
+
list: {
|
|
6
|
+
Icon: React.FC<IconProps>;
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const BottomNavigationBar: React.FC<BottomNavigationBarProps>;
|
|
13
|
+
export type { BottomNavigationBarProps };
|
|
14
|
+
export { BottomNavigationBar };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.BottomNavigationBar = void 0;
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
31
|
+
const Styled = __importStar(require("./index.styled"));
|
|
32
|
+
const core_1 = require("../../../core");
|
|
33
|
+
const BottomNavigationBar = (props) => {
|
|
34
|
+
const count = props.list.length;
|
|
35
|
+
return (react_1.default.createElement(Styled.Container, { count: count }, props.list.map((item, key) => {
|
|
36
|
+
const fillColor = props.value === item.value ? core_1.basicColors.gray900 : core_1.basicColors.gray200;
|
|
37
|
+
return (react_1.default.createElement(Styled.MenuItemWrapper, { key: key, onClick: () => {
|
|
38
|
+
props.onChange(item.value);
|
|
39
|
+
} },
|
|
40
|
+
react_1.default.createElement(item.Icon, { fillColor: fillColor }),
|
|
41
|
+
react_1.default.createElement(Styled.Label, { fontColor: fillColor }, item.label)));
|
|
42
|
+
})));
|
|
43
|
+
};
|
|
44
|
+
exports.BottomNavigationBar = BottomNavigationBar;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Story1 = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const _1 = require(".");
|
|
9
|
+
const Icon_1 = require("../../../Icon");
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Component/NavigationBar/BottomNavigationBar(개발중)',
|
|
12
|
+
component: _1.BottomNavigationBar,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
};
|
|
15
|
+
exports.default = meta;
|
|
16
|
+
const BottomNavigationBarComponent = (props) => {
|
|
17
|
+
const [value, setValue] = react_1.default.useState(props.value);
|
|
18
|
+
return react_1.default.createElement(_1.BottomNavigationBar, Object.assign({}, props, { value: value, onChange: setValue }));
|
|
19
|
+
};
|
|
20
|
+
// Props 교체 가능
|
|
21
|
+
exports.Story1 = {
|
|
22
|
+
render: (props) => react_1.default.createElement(BottomNavigationBarComponent, Object.assign({}, props)),
|
|
23
|
+
args: {
|
|
24
|
+
value: '0',
|
|
25
|
+
list: [
|
|
26
|
+
{
|
|
27
|
+
Icon: Icon_1.PlusMIcon,
|
|
28
|
+
label: '서비스',
|
|
29
|
+
value: '0',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
Icon: Icon_1.AlarmFillIcon,
|
|
33
|
+
label: '알림',
|
|
34
|
+
value: '1',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
Icon: Icon_1.MenuIcon,
|
|
38
|
+
label: '메뉴',
|
|
39
|
+
value: '2',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
count: number;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const MenuItemWrapper: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const Label: import("@emotion/styled").StyledComponent<{
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
as?: import("react").ElementType<any> | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
fontColor: string;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Label = exports.MenuItemWrapper = exports.Container = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const core_1 = require("../../../core");
|
|
9
|
+
exports.Container = styled_1.default.div `
|
|
10
|
+
border-top: 1px solid ${core_1.basicColors.gray200};
|
|
11
|
+
background-color: ${core_1.basicColors.white};
|
|
12
|
+
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: repeat(${({ count }) => count}, 1fr);
|
|
15
|
+
`;
|
|
16
|
+
exports.MenuItemWrapper = styled_1.default.div `
|
|
17
|
+
padding: 5px;
|
|
18
|
+
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
`;
|
|
24
|
+
exports.Label = styled_1.default.div `
|
|
25
|
+
/* TODO: caption style */
|
|
26
|
+
|
|
27
|
+
padding-top: 5px;
|
|
28
|
+
color: ${({ fontColor }) => fontColor};
|
|
29
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTENT_COLOR_MAP = void 0;
|
|
4
|
+
const Colors_1 = require("../../../core/Colors");
|
|
5
|
+
exports.CONTENT_COLOR_MAP = {
|
|
6
|
+
white: {
|
|
7
|
+
icon: Colors_1.basicColors.white,
|
|
8
|
+
title: Colors_1.basicColors.white,
|
|
9
|
+
rightText: Colors_1.basicColors.white,
|
|
10
|
+
backgroundColor: Colors_1.basicColors.gray900,
|
|
11
|
+
},
|
|
12
|
+
gray: {
|
|
13
|
+
icon: Colors_1.basicColors.gray900,
|
|
14
|
+
title: Colors_1.basicColors.gray900,
|
|
15
|
+
rightText: Colors_1.basicColors.gray700,
|
|
16
|
+
backgroundColor: Colors_1.basicColors.white,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../../Icon';
|
|
3
|
+
import { NavigationContentColor } from './constant';
|
|
4
|
+
type BaseNavigationProps = {
|
|
5
|
+
title?: string;
|
|
6
|
+
titleColor: string;
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
leftChildren: React.ReactNode;
|
|
9
|
+
rightChildren: React.ReactNode;
|
|
10
|
+
zIndex?: number;
|
|
11
|
+
};
|
|
12
|
+
type PageNavigationProps = Pick<BaseNavigationProps, 'title' | 'zIndex'> & {
|
|
13
|
+
contentColor: NavigationContentColor;
|
|
14
|
+
hasBackgroundColor: boolean;
|
|
15
|
+
leftArea?: {
|
|
16
|
+
type: 'backIcon';
|
|
17
|
+
handleClickButton: () => void;
|
|
18
|
+
};
|
|
19
|
+
rightArea?: {
|
|
20
|
+
type: 'closeIcon';
|
|
21
|
+
handleClickButton: () => void;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'icon';
|
|
24
|
+
children: React.FC<IconProps>;
|
|
25
|
+
handleClickButton: () => void;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'text';
|
|
28
|
+
children: string;
|
|
29
|
+
handleClickButton: () => void;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
declare const PageNavigationBar: React.FC<PageNavigationProps>;
|
|
33
|
+
export type { PageNavigationProps };
|
|
34
|
+
export { PageNavigationBar };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.PageNavigationBar = void 0;
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const Icon_1 = require("../../../Icon");
|
|
40
|
+
const Typography_1 = require("../../../core/Typography");
|
|
41
|
+
const constant_1 = require("./constant");
|
|
42
|
+
const style_constants_1 = require("../../../constants/style.constants");
|
|
43
|
+
const Styled = __importStar(require("./index.styled"));
|
|
44
|
+
const BaseNavigation = ({ title, titleColor, leftChildren, rightChildren, zIndex = style_constants_1.zIndex.gnb, backgroundColor, }) => {
|
|
45
|
+
return (react_1.default.createElement(Styled.Wrapper, { backgroundColor: backgroundColor, zIndex: zIndex },
|
|
46
|
+
leftChildren && react_1.default.createElement(Styled.LeftChildrenWrapper, null, leftChildren),
|
|
47
|
+
title && react_1.default.createElement(Typography_1.Headline5, { color: titleColor }, title),
|
|
48
|
+
rightChildren && react_1.default.createElement(Styled.RightChildrenWrapper, null, rightChildren)));
|
|
49
|
+
};
|
|
50
|
+
const PageNavigationBar = (_a) => {
|
|
51
|
+
var { contentColor, hasBackgroundColor, leftArea, rightArea } = _a, commonProps = __rest(_a, ["contentColor", "hasBackgroundColor", "leftArea", "rightArea"]);
|
|
52
|
+
const iconColor = constant_1.CONTENT_COLOR_MAP[contentColor].icon;
|
|
53
|
+
const titleColor = constant_1.CONTENT_COLOR_MAP[contentColor].title;
|
|
54
|
+
const rightTextColor = constant_1.CONTENT_COLOR_MAP[contentColor].rightText;
|
|
55
|
+
const backgroundColor = constant_1.CONTENT_COLOR_MAP[contentColor].backgroundColor;
|
|
56
|
+
const leftChildren = (0, react_1.useMemo)(() => {
|
|
57
|
+
const handleClickButton = () => {
|
|
58
|
+
leftArea === null || leftArea === void 0 ? void 0 : leftArea.handleClickButton();
|
|
59
|
+
};
|
|
60
|
+
switch (leftArea === null || leftArea === void 0 ? void 0 : leftArea.type) {
|
|
61
|
+
case 'backIcon':
|
|
62
|
+
return (react_1.default.createElement(Styled.IconWrapper, { onClick: handleClickButton },
|
|
63
|
+
react_1.default.createElement(Icon_1.ChevronLeftMIcon, { fillColor: titleColor })));
|
|
64
|
+
default:
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
}, [leftArea, titleColor]);
|
|
68
|
+
const rightChildren = (0, react_1.useMemo)(() => {
|
|
69
|
+
const handleClickButton = () => {
|
|
70
|
+
rightArea === null || rightArea === void 0 ? void 0 : rightArea.handleClickButton();
|
|
71
|
+
};
|
|
72
|
+
switch (rightArea === null || rightArea === void 0 ? void 0 : rightArea.type) {
|
|
73
|
+
case 'closeIcon':
|
|
74
|
+
return (react_1.default.createElement(Styled.IconWrapper, { onClick: handleClickButton },
|
|
75
|
+
react_1.default.createElement(Icon_1.CancelMIcon, { fillColor: iconColor })));
|
|
76
|
+
case 'icon':
|
|
77
|
+
return (react_1.default.createElement(Styled.IconWrapper, { onClick: handleClickButton },
|
|
78
|
+
react_1.default.createElement(rightArea.children, { fillColor: titleColor })));
|
|
79
|
+
case 'text':
|
|
80
|
+
return (react_1.default.createElement(Styled.TextWrapper, { onClick: handleClickButton },
|
|
81
|
+
react_1.default.createElement(Typography_1.Title3, { color: rightTextColor }, rightArea.children)));
|
|
82
|
+
default:
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
}, [iconColor, titleColor, rightTextColor, rightArea]);
|
|
86
|
+
return (react_1.default.createElement(BaseNavigation, Object.assign({ backgroundColor: hasBackgroundColor ? backgroundColor : 'transparent', leftChildren: leftChildren, titleColor: titleColor, rightChildren: rightChildren }, commonProps)));
|
|
87
|
+
};
|
|
88
|
+
exports.PageNavigationBar = PageNavigationBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_2 = require("@testing-library/react");
|
|
8
|
+
const _1 = require(".");
|
|
9
|
+
const props = {
|
|
10
|
+
contentColor: 'gray',
|
|
11
|
+
hasBackgroundColor: true,
|
|
12
|
+
};
|
|
13
|
+
describe('<PageNavigationBar />', () => {
|
|
14
|
+
it('렌더링 체크', () => {
|
|
15
|
+
(0, react_2.render)(react_1.default.createElement(react_1.default.Fragment, null,
|
|
16
|
+
"\uD655\uC778",
|
|
17
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props))));
|
|
18
|
+
expect(react_2.screen.getByText('확인')).toBeInTheDocument();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PageNavigationProps } from '.';
|
|
3
|
+
type Story = StoryObj<PageNavigationProps>;
|
|
4
|
+
/**
|
|
5
|
+
* updated 230523
|
|
6
|
+
*
|
|
7
|
+
* 현재 사용자가 위치한 화면의 정보와 액션 기능을 담고 있는 컴포넌트입니다.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: Meta<PageNavigationProps>;
|
|
11
|
+
export default meta;
|
|
12
|
+
export declare const Story1: Story;
|
|
13
|
+
export declare const Story2: Story;
|
|
14
|
+
export declare const Story3: Story;
|
|
15
|
+
export declare const Story4: Story;
|
|
16
|
+
export declare const Story5: Story;
|
|
17
|
+
export declare const Story6: Story;
|
|
18
|
+
export declare const Story7: Story;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Story7 = exports.Story6 = exports.Story5 = exports.Story4 = exports.Story3 = exports.Story2 = exports.Story1 = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const _1 = require(".");
|
|
9
|
+
/**
|
|
10
|
+
* updated 230523
|
|
11
|
+
*
|
|
12
|
+
* 현재 사용자가 위치한 화면의 정보와 액션 기능을 담고 있는 컴포넌트입니다.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
const meta = {
|
|
16
|
+
title: 'Component/NavigationBar/PageNavigationBar(개발중)',
|
|
17
|
+
component: _1.PageNavigationBar,
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
};
|
|
20
|
+
exports.default = meta;
|
|
21
|
+
// Props 교체 가능
|
|
22
|
+
exports.Story1 = {
|
|
23
|
+
render: (props) => react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)),
|
|
24
|
+
args: {
|
|
25
|
+
contentColor: 'gray',
|
|
26
|
+
hasBackgroundColor: true,
|
|
27
|
+
title: '타이틀',
|
|
28
|
+
leftArea: {
|
|
29
|
+
type: 'backIcon',
|
|
30
|
+
handleClickButton: () => {
|
|
31
|
+
console.log('left button click');
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
rightArea: {
|
|
35
|
+
type: 'text',
|
|
36
|
+
children: '텍스트',
|
|
37
|
+
handleClickButton: () => {
|
|
38
|
+
console.log('right button click');
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
exports.Story1.storyName = '배경컬러 있음';
|
|
44
|
+
exports.Story2 = {
|
|
45
|
+
render: (props) => (react_1.default.createElement("div", { style: { background: 'transparent' } },
|
|
46
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)))),
|
|
47
|
+
args: {
|
|
48
|
+
contentColor: 'gray',
|
|
49
|
+
hasBackgroundColor: false,
|
|
50
|
+
title: '타이틀',
|
|
51
|
+
leftArea: {
|
|
52
|
+
type: 'backIcon',
|
|
53
|
+
handleClickButton: () => {
|
|
54
|
+
console.log('left button click');
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
rightArea: {
|
|
58
|
+
type: 'text',
|
|
59
|
+
children: '텍스트',
|
|
60
|
+
handleClickButton: () => {
|
|
61
|
+
console.log('right button click');
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
exports.Story2.storyName = '배경컬러 없음';
|
|
67
|
+
exports.Story3 = {
|
|
68
|
+
render: (props) => (react_1.default.createElement("div", { style: { background: 'transparent' } },
|
|
69
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)))),
|
|
70
|
+
args: {
|
|
71
|
+
contentColor: 'gray',
|
|
72
|
+
hasBackgroundColor: true,
|
|
73
|
+
title: '타이틀',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
exports.Story3.storyName = 'leftArea / rightArea - 없음';
|
|
77
|
+
exports.Story4 = {
|
|
78
|
+
render: (props) => (react_1.default.createElement("div", { style: { background: 'transparent' } },
|
|
79
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)))),
|
|
80
|
+
args: {
|
|
81
|
+
contentColor: 'gray',
|
|
82
|
+
hasBackgroundColor: true,
|
|
83
|
+
title: '타이틀',
|
|
84
|
+
rightArea: {
|
|
85
|
+
type: 'text',
|
|
86
|
+
children: '텍스트',
|
|
87
|
+
handleClickButton: () => {
|
|
88
|
+
console.log('right button click');
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
exports.Story4.storyName = 'rightArea - Text';
|
|
94
|
+
exports.Story5 = {
|
|
95
|
+
render: (props) => (react_1.default.createElement("div", { style: { background: 'transparent' } },
|
|
96
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)))),
|
|
97
|
+
args: {
|
|
98
|
+
contentColor: 'gray',
|
|
99
|
+
hasBackgroundColor: true,
|
|
100
|
+
title: '타이틀',
|
|
101
|
+
rightArea: {
|
|
102
|
+
type: 'closeIcon',
|
|
103
|
+
handleClickButton: () => {
|
|
104
|
+
console.log('right button click');
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
exports.Story5.storyName = 'rightArea - 취소 아이콘';
|
|
110
|
+
exports.Story6 = {
|
|
111
|
+
render: (props) => (react_1.default.createElement("div", { style: { background: 'transparent' } },
|
|
112
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)))),
|
|
113
|
+
args: {
|
|
114
|
+
contentColor: 'white',
|
|
115
|
+
hasBackgroundColor: true,
|
|
116
|
+
title: '타이틀',
|
|
117
|
+
rightArea: {
|
|
118
|
+
type: 'closeIcon',
|
|
119
|
+
handleClickButton: () => {
|
|
120
|
+
console.log('right button click');
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
exports.Story6.storyName = 'contentColor - white';
|
|
126
|
+
exports.Story7 = {
|
|
127
|
+
render: (props) => (react_1.default.createElement("div", { style: { background: 'transparent' } },
|
|
128
|
+
react_1.default.createElement(_1.PageNavigationBar, Object.assign({}, props)))),
|
|
129
|
+
args: {
|
|
130
|
+
contentColor: 'gray',
|
|
131
|
+
hasBackgroundColor: true,
|
|
132
|
+
leftArea: {
|
|
133
|
+
type: 'backIcon',
|
|
134
|
+
handleClickButton: () => {
|
|
135
|
+
console.log('left button click');
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
rightArea: {
|
|
139
|
+
type: 'closeIcon',
|
|
140
|
+
handleClickButton: () => {
|
|
141
|
+
console.log('right button click');
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
exports.Story7.storyName = 'title 없음';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type WrapperProps = {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
zIndex?: number;
|
|
5
|
+
};
|
|
6
|
+
type ClickableProps = {
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
as?: import("react").ElementType<any> | undefined;
|
|
12
|
+
} & WrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const LeftChildrenWrapper: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
as?: import("react").ElementType<any> | undefined;
|
|
16
|
+
} & ClickableProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
} & {
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
}, {}, {}>;
|
|
21
|
+
export declare const RightChildrenWrapper: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
23
|
+
as?: import("react").ElementType<any> | undefined;
|
|
24
|
+
} & ClickableProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
children?: import("react").ReactNode;
|
|
26
|
+
} & {
|
|
27
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
28
|
+
}, {}, {}>;
|
|
29
|
+
export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
|
|
30
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
+
as?: import("react").ElementType<any> | undefined;
|
|
32
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
33
|
+
export declare const TextWrapper: import("@emotion/styled").StyledComponent<{
|
|
34
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
35
|
+
as?: import("react").ElementType<any> | undefined;
|
|
36
|
+
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
37
|
+
children?: import("react").ReactNode;
|
|
38
|
+
} & {
|
|
39
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TextWrapper = exports.IconWrapper = exports.RightChildrenWrapper = exports.LeftChildrenWrapper = exports.Wrapper = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
exports.Wrapper = styled_1.default.div `
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 55px;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
top: ${({ zIndex }) => (zIndex && zIndex > 0 ? '0' : 'initial')};
|
|
13
|
+
position: ${({ zIndex }) => (zIndex && zIndex > 0 ? 'sticky' : 'relative')};
|
|
14
|
+
z-index: ${({ zIndex }) => zIndex || 'initial'};
|
|
15
|
+
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
|
|
20
|
+
background-color: ${({ backgroundColor }) => backgroundColor};
|
|
21
|
+
|
|
22
|
+
padding: 15px 0;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
`;
|
|
25
|
+
const CommonChildrenWrapper = styled_1.default.div `
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
|
|
30
|
+
cursor: ${({ onClick }) => (onClick ? 'pointer' : 'auto')};
|
|
31
|
+
`;
|
|
32
|
+
exports.LeftChildrenWrapper = (0, styled_1.default)(CommonChildrenWrapper) `
|
|
33
|
+
left: 15px;
|
|
34
|
+
`;
|
|
35
|
+
exports.RightChildrenWrapper = (0, styled_1.default)(CommonChildrenWrapper) `
|
|
36
|
+
right: 15px;
|
|
37
|
+
`;
|
|
38
|
+
// Extra
|
|
39
|
+
const VerticalCenterizeWrapper = styled_1.default.div `
|
|
40
|
+
height: 100%;
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
`;
|
|
45
|
+
exports.IconWrapper = VerticalCenterizeWrapper;
|
|
46
|
+
exports.TextWrapper = (0, styled_1.default)(VerticalCenterizeWrapper) `
|
|
47
|
+
margin-right: 5px;
|
|
48
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../../Icon';
|
|
3
|
+
type TitleNavigationBarProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
iconList?: {
|
|
6
|
+
Icon: React.FC<IconProps>;
|
|
7
|
+
handleClick: () => void;
|
|
8
|
+
}[];
|
|
9
|
+
contentsColor: 'white' | 'gray';
|
|
10
|
+
hasBackgroundColor: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const TitleNavigationBar: React.FC<TitleNavigationBarProps>;
|
|
13
|
+
export type { TitleNavigationBarProps };
|
|
14
|
+
export { TitleNavigationBar };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.TitleNavigationBar = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const core_1 = require("../../../core");
|
|
29
|
+
const Styled = __importStar(require("./index.styled"));
|
|
30
|
+
const TitleNavigationBar = (props) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const styleProps = (0, react_1.useMemo)(() => {
|
|
33
|
+
let fontColor = '';
|
|
34
|
+
let backgroundColor = '';
|
|
35
|
+
let iconColor = '';
|
|
36
|
+
switch (props.contentsColor) {
|
|
37
|
+
case 'white':
|
|
38
|
+
fontColor = core_1.basicColors.white;
|
|
39
|
+
backgroundColor = core_1.basicColors.gray900;
|
|
40
|
+
iconColor = core_1.basicColors.white;
|
|
41
|
+
break;
|
|
42
|
+
case 'gray':
|
|
43
|
+
fontColor = core_1.basicColors.gray900;
|
|
44
|
+
backgroundColor = core_1.basicColors.white;
|
|
45
|
+
iconColor = core_1.basicColors.gray200;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
fontColor,
|
|
50
|
+
backgroundColor: props.hasBackgroundColor ? backgroundColor : 'transparent',
|
|
51
|
+
iconColor,
|
|
52
|
+
};
|
|
53
|
+
}, [props]);
|
|
54
|
+
return (react_1.default.createElement(Styled.Container, Object.assign({}, styleProps),
|
|
55
|
+
react_1.default.createElement(Styled.Title, Object.assign({}, styleProps), props.title),
|
|
56
|
+
props.iconList && (react_1.default.createElement(Styled.IconListWrapper, Object.assign({}, styleProps), (_a = props.iconList) === null || _a === void 0 ? void 0 : _a.map((item, index) => (react_1.default.createElement(Styled.IconWrapper, { key: index, onClick: item.handleClick },
|
|
57
|
+
react_1.default.createElement(item.Icon, { fillColor: styleProps.iconColor }))))))));
|
|
58
|
+
};
|
|
59
|
+
exports.TitleNavigationBar = TitleNavigationBar;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { TitleNavigationBarProps } from '.';
|
|
3
|
+
type Story = StoryObj<TitleNavigationBarProps>;
|
|
4
|
+
declare const meta: Meta<TitleNavigationBarProps>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Story1: Story;
|
|
7
|
+
export declare const Story2: Story;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Story2 = exports.Story1 = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const _1 = require(".");
|
|
9
|
+
const Icon_1 = require("../../../Icon");
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Component/NavigationBar/TitleNavigationBar(개발중)',
|
|
12
|
+
component: _1.TitleNavigationBar,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
};
|
|
15
|
+
exports.default = meta;
|
|
16
|
+
// Props 교체 가능
|
|
17
|
+
exports.Story1 = {
|
|
18
|
+
render: (props) => react_1.default.createElement(_1.TitleNavigationBar, Object.assign({}, props)),
|
|
19
|
+
args: {
|
|
20
|
+
title: '타이틀',
|
|
21
|
+
iconList: [
|
|
22
|
+
{
|
|
23
|
+
Icon: Icon_1.PlusMIcon,
|
|
24
|
+
handleClick: () => {
|
|
25
|
+
console.log('handleClick');
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
Icon: Icon_1.AlarmFillIcon,
|
|
30
|
+
handleClick: () => {
|
|
31
|
+
console.log('handleClick');
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
Icon: Icon_1.MenuIcon,
|
|
36
|
+
handleClick: () => {
|
|
37
|
+
console.log('handleClick');
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
hasBackgroundColor: true,
|
|
42
|
+
contentsColor: 'gray',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
exports.Story1.storyName = '아이콘 3개';
|
|
46
|
+
exports.Story2 = {
|
|
47
|
+
render: (props) => react_1.default.createElement(_1.TitleNavigationBar, Object.assign({}, props)),
|
|
48
|
+
args: {
|
|
49
|
+
title: '타이틀',
|
|
50
|
+
hasBackgroundColor: true,
|
|
51
|
+
contentsColor: 'white',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
exports.Story2.storyName = '아이콘 0개';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type StyleProps = {
|
|
3
|
+
fontColor: string;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
iconColor: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const Title: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
9
|
+
as?: import("react").ElementType<any> | undefined;
|
|
10
|
+
} & StyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
} & StyleProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
15
|
+
export declare const IconListWrapper: import("@emotion/styled").StyledComponent<{
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
as?: import("react").ElementType<any> | undefined;
|
|
18
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
19
|
+
export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
|
|
20
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
+
as?: import("react").ElementType<any> | undefined;
|
|
22
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IconWrapper = exports.IconListWrapper = exports.Container = exports.Title = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const core_1 = require("../../../core");
|
|
9
|
+
exports.Title = styled_1.default.div `
|
|
10
|
+
${({ fontColor }) => (0, core_1.headline3)({ color: fontColor })}
|
|
11
|
+
`;
|
|
12
|
+
exports.Container = styled_1.default.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
padding: 30px 20px 15px 25px;
|
|
16
|
+
background-color: ${({ backgroundColor }) => backgroundColor};
|
|
17
|
+
`;
|
|
18
|
+
exports.IconListWrapper = styled_1.default.div `
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 15px;
|
|
22
|
+
`;
|
|
23
|
+
exports.IconWrapper = styled_1.default.div `
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./PageNavigationBar"), exports);
|
|
18
|
+
__exportStar(require("./TitleNavigationBar"), exports);
|
|
19
|
+
__exportStar(require("./BottomNavigationBar"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ShareButton = exports.KakaoButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const KakaoButton = ({ handleClickButton }) => (react_1.default.createElement("svg", { onClick: handleClickButton, width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
react_1.default.createElement("g", { id: "Kakaotalk_Icon_Button" },
|
|
10
|
+
react_1.default.createElement("circle", { id: "Ellipse 1", cx: "20", cy: "20", r: "20", fill: "#F9E000" }),
|
|
11
|
+
react_1.default.createElement("path", { id: "Vector", d: "M20.0006 10.7233C14.0824 10.7233 9.28516 14.3347 9.28516 18.7921C9.28516 21.6924 11.3166 24.2343 14.3677 25.6565C14.1431 26.4524 13.5564 28.5433 13.439 28.9904C13.2933 29.5454 13.6515 29.5377 13.8882 29.3893C14.0723 29.2717 16.824 27.4892 18.0117 26.7202C18.6571 26.8108 19.3208 26.859 20.0006 26.859C25.9188 26.859 30.7161 23.2476 30.7161 18.7921C30.7161 14.3366 25.9188 10.7233 20.0006 10.7233Z", fill: "#371C1D" }))));
|
|
12
|
+
exports.KakaoButton = KakaoButton;
|
|
13
|
+
const ShareButton = ({ handleClickButton }) => (react_1.default.createElement("svg", { onClick: handleClickButton, width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
14
|
+
react_1.default.createElement("g", { id: "Share_Icon_Button" },
|
|
15
|
+
react_1.default.createElement("circle", { id: "Ellipse 1", cx: "20", cy: "20", r: "20", fill: "#D0D8DC" }),
|
|
16
|
+
react_1.default.createElement("g", { id: "link icon" },
|
|
17
|
+
react_1.default.createElement("path", { id: "Rectangle 3961 (Stroke)", fillRule: "evenodd", clipRule: "evenodd", d: "M13.7902 22.6446C12.8058 23.629 12.8058 25.225 13.7902 26.2094C14.7746 27.1937 16.3706 27.1937 17.355 26.2094L20.1367 23.4277C20.6639 22.9005 21.5187 22.9005 22.0459 23.4277C22.5731 23.9549 22.5731 24.8096 22.0459 25.3369L19.2642 28.1186C17.2254 30.1574 13.9198 30.1574 11.881 28.1185C9.84223 26.0797 9.84223 22.7742 11.881 20.7354L14.6627 17.9537C15.1899 17.4265 16.0447 17.4265 16.5719 17.9537C17.0991 18.4809 17.0991 19.3357 16.5719 19.8629L13.7902 22.6446Z", fill: "white" }),
|
|
18
|
+
react_1.default.createElement("path", { id: "Rectangle 3961 (Stroke)_2", fillRule: "evenodd", clipRule: "evenodd", d: "M22.6434 13.791C23.6278 12.8067 25.2238 12.8067 26.2082 13.791C27.1926 14.7754 27.1926 16.3714 26.2082 17.3558L23.4265 20.1375C22.8993 20.6647 22.8993 21.5195 23.4265 22.0467C23.9537 22.5739 24.8085 22.5739 25.3357 22.0467L28.1174 19.265C30.1562 17.2262 30.1562 13.9207 28.1174 11.8819C26.0786 9.84305 22.773 9.84305 20.7342 11.8819L17.9525 14.6635C17.4253 15.1908 17.4253 16.0455 17.9525 16.5727C18.4797 17.0999 19.3345 17.0999 19.8617 16.5727L22.6434 13.791Z", fill: "white" }),
|
|
19
|
+
react_1.default.createElement("rect", { id: "Rectangle 3962", x: "15.3301", y: "22.8126", width: "10.5061", height: "2.62656", rx: "1.31328", transform: "rotate(-45 15.3301 22.8126)", fill: "white" })))));
|
|
20
|
+
exports.ShareButton = ShareButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Styled from './index.styled';
|
|
3
|
+
type ShareUIBaseProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
textToCopy: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const ShareUIBase: React.FC<ShareUIBaseProps>;
|
|
9
|
+
type ShareUIListProps = ShareUIBaseProps;
|
|
10
|
+
declare const ShareUIList: React.FC<ShareUIListProps>;
|
|
11
|
+
type ShareUICardProps = ShareUIBaseProps & Styled.CardContainerStyleProps;
|
|
12
|
+
declare const ShareUICard: React.FC<ShareUICardProps>;
|
|
13
|
+
export type { ShareUIListProps, ShareUICardProps };
|
|
14
|
+
export { ShareUIBase, ShareUIList, ShareUICard };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ShareUICard = exports.ShareUIList = exports.ShareUIBase = void 0;
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
31
|
+
const Styled = __importStar(require("./index.styled"));
|
|
32
|
+
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
33
|
+
const Buttons_1 = require("./Buttons");
|
|
34
|
+
const ShareUIBase = ({ title, description, textToCopy }) => {
|
|
35
|
+
const handleClickKaKaoButton = () => {
|
|
36
|
+
console.log('TODO: 카카오 공유하기');
|
|
37
|
+
};
|
|
38
|
+
const handleClickLinkButton = () => {
|
|
39
|
+
(0, copy_to_clipboard_1.default)(textToCopy);
|
|
40
|
+
};
|
|
41
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
|
+
react_1.default.createElement(Styled.TitleWrapper, null,
|
|
43
|
+
description && react_1.default.createElement(Styled.SubTitle, null, description),
|
|
44
|
+
react_1.default.createElement(Styled.Title, null, title)),
|
|
45
|
+
react_1.default.createElement(Styled.IconWrapper, null,
|
|
46
|
+
react_1.default.createElement(Buttons_1.KakaoButton, { handleClickButton: handleClickKaKaoButton }),
|
|
47
|
+
react_1.default.createElement(Buttons_1.ShareButton, { handleClickButton: handleClickLinkButton }))));
|
|
48
|
+
};
|
|
49
|
+
exports.ShareUIBase = ShareUIBase;
|
|
50
|
+
const ShareUIList = (props) => {
|
|
51
|
+
return (react_1.default.createElement(Styled.ListContainer, null,
|
|
52
|
+
react_1.default.createElement(ShareUIBase, Object.assign({}, props))));
|
|
53
|
+
};
|
|
54
|
+
exports.ShareUIList = ShareUIList;
|
|
55
|
+
const ShareUICard = (props) => {
|
|
56
|
+
return (react_1.default.createElement(Styled.CardContainer, { background: props.background },
|
|
57
|
+
react_1.default.createElement(ShareUIBase, Object.assign({}, props))));
|
|
58
|
+
};
|
|
59
|
+
exports.ShareUICard = ShareUICard;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ShareUICardProps, ShareUIListProps } from '.';
|
|
3
|
+
declare const meta: Meta<ShareUICardProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Story2: StoryObj<ShareUICardProps>;
|
|
6
|
+
export declare const Story1: StoryObj<ShareUIListProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Story1 = exports.Story2 = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const _1 = require(".");
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Library/ShareUI(개발중)',
|
|
11
|
+
component: _1.ShareUICard,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
};
|
|
14
|
+
exports.default = meta;
|
|
15
|
+
exports.Story2 = {
|
|
16
|
+
render: (props) => react_1.default.createElement(_1.ShareUICard, Object.assign({}, props)),
|
|
17
|
+
args: {
|
|
18
|
+
title: '최대 두 줄까지 작성 권장',
|
|
19
|
+
description: '설명 최대 한 줄 권장(optional)',
|
|
20
|
+
textToCopy: `[챌린지] 요즘 용돈 버는 법, 알려드릴게요!\nhttps://naver.com`,
|
|
21
|
+
background: 'gray',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
exports.Story2.storyName = 'ShareUICard';
|
|
25
|
+
exports.Story1 = {
|
|
26
|
+
render: (props) => react_1.default.createElement(_1.ShareUIList, Object.assign({}, props)),
|
|
27
|
+
args: {
|
|
28
|
+
title: '최대 두 줄까지 작성 권장',
|
|
29
|
+
textToCopy: `[챌린지] 요즘 용돈 버는 법, 알려드릴게요!\nhttps://naver.com`,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
exports.Story1.storyName = 'ShareUIList';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TitleWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Title: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
lg?: "Headline1" | "Headline2" | "Headline3" | "Headline4" | "Headline5" | "Headline6" | "Title1" | "Title2" | "Title3" | "Title4" | "Body1" | "Body2" | undefined;
|
|
8
|
+
sm?: "Headline1" | "Headline2" | "Headline3" | "Headline4" | "Headline5" | "Headline6" | "Title1" | "Title2" | "Title3" | "Title4" | "Body1" | "Body2" | undefined;
|
|
9
|
+
color?: string | undefined;
|
|
10
|
+
textAlign?: string | undefined;
|
|
11
|
+
fontWeight?: string | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
element?: string | undefined;
|
|
14
|
+
'data-element-name'?: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
children?: import("react").ReactNode;
|
|
17
|
+
} & {
|
|
18
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
19
|
+
}, {}, {}>;
|
|
20
|
+
export declare const SubTitle: import("@emotion/styled").StyledComponent<{
|
|
21
|
+
lg?: "Headline1" | "Headline2" | "Headline3" | "Headline4" | "Headline5" | "Headline6" | "Title1" | "Title2" | "Title3" | "Title4" | "Body1" | "Body2" | undefined;
|
|
22
|
+
sm?: "Headline1" | "Headline2" | "Headline3" | "Headline4" | "Headline5" | "Headline6" | "Title1" | "Title2" | "Title3" | "Title4" | "Body1" | "Body2" | undefined;
|
|
23
|
+
color?: string | undefined;
|
|
24
|
+
textAlign?: string | undefined;
|
|
25
|
+
fontWeight?: string | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
element?: string | undefined;
|
|
28
|
+
'data-element-name'?: string | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
children?: import("react").ReactNode;
|
|
31
|
+
} & {
|
|
32
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
+
}, {}, {}>;
|
|
34
|
+
export declare const IconWrapper: import("@emotion/styled").StyledComponent<{
|
|
35
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
36
|
+
as?: import("react").ElementType<any> | undefined;
|
|
37
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
38
|
+
export declare const CommonContainer: import("@emotion/styled").StyledComponent<{
|
|
39
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
40
|
+
as?: import("react").ElementType<any> | undefined;
|
|
41
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
42
|
+
export declare const ListContainer: import("@emotion/styled").StyledComponent<{
|
|
43
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
44
|
+
as?: import("react").ElementType<any> | undefined;
|
|
45
|
+
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
46
|
+
children?: import("react").ReactNode;
|
|
47
|
+
} & {
|
|
48
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
49
|
+
}, {}, {}>;
|
|
50
|
+
export type CardContainerStyleProps = {
|
|
51
|
+
background: 'default' | 'gray';
|
|
52
|
+
};
|
|
53
|
+
export declare const CardContainer: import("@emotion/styled").StyledComponent<{
|
|
54
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
55
|
+
as?: import("react").ElementType<any> | undefined;
|
|
56
|
+
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
57
|
+
children?: import("react").ReactNode;
|
|
58
|
+
} & {
|
|
59
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
60
|
+
} & CardContainerStyleProps, {}, {}>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CardContainer = exports.ListContainer = exports.CommonContainer = exports.IconWrapper = exports.SubTitle = exports.Title = exports.TitleWrapper = void 0;
|
|
7
|
+
const react_1 = require("@emotion/react");
|
|
8
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
+
const core_1 = require("../../core");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
exports.TitleWrapper = styled_1.default.div `
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
`;
|
|
16
|
+
exports.Title = (0, styled_1.default)(core_1.Headline6) `
|
|
17
|
+
color: ${core_1.basicColors.gray900};
|
|
18
|
+
`;
|
|
19
|
+
exports.SubTitle = (0, styled_1.default)(core_1.Title4) `
|
|
20
|
+
color: ${core_1.basicColors.gray600};
|
|
21
|
+
margin-bottom: 5px;
|
|
22
|
+
`;
|
|
23
|
+
exports.IconWrapper = styled_1.default.div `
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: 15px;
|
|
26
|
+
align-items: center;
|
|
27
|
+
|
|
28
|
+
svg {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
exports.CommonContainer = styled_1.default.div `
|
|
33
|
+
display: flex;
|
|
34
|
+
width: 100%;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
`;
|
|
37
|
+
exports.ListContainer = (0, styled_1.default)(exports.CommonContainer) `
|
|
38
|
+
padding: 20px;
|
|
39
|
+
|
|
40
|
+
${(0, utils_1.Larger)((0, react_1.css) `
|
|
41
|
+
padding: 20px 80px;
|
|
42
|
+
`)}
|
|
43
|
+
`;
|
|
44
|
+
exports.CardContainer = (0, styled_1.default)(exports.CommonContainer) `
|
|
45
|
+
padding: 20px;
|
|
46
|
+
border-radius: 10px;
|
|
47
|
+
|
|
48
|
+
${({ background }) => {
|
|
49
|
+
switch (background) {
|
|
50
|
+
case 'gray':
|
|
51
|
+
return (0, react_1.css) `
|
|
52
|
+
background-color: ${core_1.basicColors.gray25};
|
|
53
|
+
`;
|
|
54
|
+
default:
|
|
55
|
+
return (0, react_1.css) `
|
|
56
|
+
background-color: ${core_1.basicColors.white};
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
}}
|
|
60
|
+
`;
|