@sonhoseong/mfa-lib 1.2.5 → 1.2.6

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,32 @@
1
+ import React from 'react';
2
+ export interface AppNavbarProps {
3
+ /** 앱 이름/타이틀 */
4
+ appName?: string;
5
+ /** 로고 클릭 시 이동할 경로 */
6
+ homePath?: string;
7
+ /** 관리 페이지 경로 */
8
+ adminPath?: string;
9
+ /** 로그인 페이지 경로 */
10
+ loginPath?: string;
11
+ /** 인증 상태 */
12
+ isAuthenticated: boolean;
13
+ /** 사용자 이름 */
14
+ userName?: string;
15
+ /** 로그아웃 핸들러 */
16
+ onLogout: () => void;
17
+ /** 네비게이션 함수 */
18
+ onNavigate: (path: string) => void;
19
+ /** 추가 네비게이션 링크 */
20
+ extraLinks?: Array<{
21
+ label: string;
22
+ path: string;
23
+ isActive?: boolean;
24
+ }>;
25
+ }
26
+ /**
27
+ * 공통 네비게이션 바 - KOMCA 패턴
28
+ * Remote 앱 단독 실행 시 사용
29
+ */
30
+ export declare const AppNavbar: React.FC<AppNavbarProps>;
31
+ export default AppNavbar;
32
+ //# sourceMappingURL=AppNavbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppNavbar.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/AppNavbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc;IAC7B,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY;IACZ,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe;IACf,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,kBAAkB;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;CACJ;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAkJ9C,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * 공통 네비게이션 바 - KOMCA 패턴
4
+ * Remote 앱 단독 실행 시 사용
5
+ */
6
+ export const AppNavbar = ({ appName = '앱', homePath = '/', adminPath = '/admin', loginPath = '/login', isAuthenticated, userName, onLogout, onNavigate, extraLinks = [] }) => {
7
+ const styles = {
8
+ navbar: {
9
+ position: 'fixed',
10
+ top: 0,
11
+ left: 0,
12
+ right: 0,
13
+ zIndex: 1000,
14
+ background: 'rgba(255, 255, 255, 0.95)',
15
+ backdropFilter: 'blur(12px)',
16
+ WebkitBackdropFilter: 'blur(12px)',
17
+ borderBottom: '1px solid #E2E8F0',
18
+ },
19
+ inner: {
20
+ maxWidth: '1100px',
21
+ margin: '0 auto',
22
+ padding: '16px 24px',
23
+ display: 'flex',
24
+ alignItems: 'center',
25
+ justifyContent: 'space-between',
26
+ },
27
+ logoLink: {
28
+ display: 'flex',
29
+ alignItems: 'center',
30
+ gap: '8px',
31
+ textDecoration: 'none',
32
+ color: '#1E3A5F',
33
+ fontWeight: 600,
34
+ fontSize: '16px',
35
+ cursor: 'pointer',
36
+ background: 'none',
37
+ border: 'none',
38
+ padding: 0,
39
+ },
40
+ links: {
41
+ display: 'flex',
42
+ alignItems: 'center',
43
+ gap: '8px',
44
+ },
45
+ link: {
46
+ padding: '8px 16px',
47
+ color: '#64748B',
48
+ textDecoration: 'none',
49
+ fontSize: '14px',
50
+ fontWeight: 500,
51
+ borderRadius: '8px',
52
+ transition: 'all 0.2s ease',
53
+ background: 'transparent',
54
+ border: 'none',
55
+ cursor: 'pointer',
56
+ fontFamily: 'inherit',
57
+ },
58
+ linkActive: {
59
+ color: '#0EA5E9',
60
+ background: 'rgba(14, 165, 233, 0.1)',
61
+ },
62
+ };
63
+ return (_jsx("nav", { style: styles.navbar, children: _jsxs("div", { style: styles.inner, children: [_jsxs("button", { style: styles.logoLink, onClick: () => onNavigate(homePath), children: [_jsx("svg", { viewBox: "0 0 48 48", width: "24", height: "24", fill: "none", children: _jsx("path", { d: "M 8 40 L 24 8 L 40 40", stroke: "#1E3A5F", strokeWidth: "8", strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }) }), _jsx("span", { children: appName })] }), _jsxs("div", { style: styles.links, children: [_jsx("button", { style: styles.link, onClick: () => onNavigate(homePath), onMouseOver: (e) => (e.currentTarget.style.background = '#F8FAFC'), onMouseOut: (e) => (e.currentTarget.style.background = 'transparent'), children: "\uD648" }), extraLinks.map((link) => (_jsx("button", { style: {
64
+ ...styles.link,
65
+ ...(link.isActive ? styles.linkActive : {}),
66
+ }, onClick: () => onNavigate(link.path), children: link.label }, link.path))), isAuthenticated && (_jsx("button", { style: styles.link, onClick: () => onNavigate(adminPath), onMouseOver: (e) => (e.currentTarget.style.background = '#F8FAFC'), onMouseOut: (e) => (e.currentTarget.style.background = 'transparent'), children: "\uAD00\uB9AC" })), !isAuthenticated ? (_jsx("button", { style: {
67
+ ...styles.link,
68
+ background: '#1E3A5F',
69
+ color: 'white',
70
+ }, onClick: () => onNavigate(loginPath), onMouseOver: (e) => (e.currentTarget.style.background = '#0EA5E9'), onMouseOut: (e) => (e.currentTarget.style.background = '#1E3A5F'), children: "\uB85C\uADF8\uC778" })) : (_jsxs("button", { style: styles.link, onClick: onLogout, onMouseOver: (e) => (e.currentTarget.style.background = '#F8FAFC'), onMouseOut: (e) => (e.currentTarget.style.background = 'transparent'), children: ["\uB85C\uADF8\uC544\uC6C3 ", userName && `(${userName})`] }))] })] }) }));
71
+ };
72
+ export default AppNavbar;
@@ -1,2 +1,3 @@
1
1
  export * from './StickyNav';
2
+ export * from './AppNavbar';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './StickyNav';
2
+ export * from './AppNavbar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonhoseong/mfa-lib",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "MFA 공통 라이브러리 - KOMCA 패턴",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",