linkup-lib 0.1.1 → 0.1.2

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.
Files changed (44) hide show
  1. package/dist/CustomButton.d.ts +6 -0
  2. package/dist/CustomButton.js +21 -0
  3. package/dist/LinkupButton.d.ts +7 -0
  4. package/dist/LinkupButton.js +8 -0
  5. package/dist/Registry.d.ts +9 -0
  6. package/dist/Registry.js +16 -0
  7. package/dist/color.d.ts +7 -0
  8. package/dist/color.js +15 -0
  9. package/dist/compoenets/registry/AntdRegistry.d.ts +9 -0
  10. package/dist/compoenets/registry/AntdRegistry.js +13 -0
  11. package/dist/compoenets/registry/ErrorHandler.d.ts +2 -0
  12. package/dist/compoenets/registry/ErrorHandler.js +10 -0
  13. package/dist/compoenets/registry/NextAuthRegistry.d.ts +7 -0
  14. package/dist/compoenets/registry/NextAuthRegistry.js +13 -0
  15. package/dist/compoenets/registry/ReactQueryRegistry.d.ts +6 -0
  16. package/dist/compoenets/registry/ReactQueryRegistry.js +56 -0
  17. package/dist/compoenets/ui/header.d.ts +2 -0
  18. package/dist/compoenets/ui/header.js +29 -0
  19. package/dist/components/registry/AntdRegistry.d.ts +9 -0
  20. package/dist/components/registry/AntdRegistry.js +13 -0
  21. package/dist/components/registry/ErrorHandler.d.ts +2 -0
  22. package/dist/components/registry/ErrorHandler.js +10 -0
  23. package/dist/components/registry/ErrorRegistry.d.ts +5 -0
  24. package/dist/components/registry/ErrorRegistry.js +13 -0
  25. package/dist/components/registry/NextAuthRegistry.d.ts +7 -0
  26. package/dist/components/registry/NextAuthRegistry.js +13 -0
  27. package/dist/components/registry/ReactQueryRegistry.d.ts +6 -0
  28. package/dist/components/registry/ReactQueryRegistry.js +56 -0
  29. package/dist/components/ui/Aside.d.ts +14 -0
  30. package/dist/components/ui/Aside.js +133 -0
  31. package/dist/components/ui/Header.d.ts +5 -0
  32. package/dist/components/ui/Header.js +45 -0
  33. package/dist/components/ui/Header2.d.ts +5 -0
  34. package/dist/components/ui/Header2.js +20 -0
  35. package/dist/components/ui/Page.d.ts +5 -0
  36. package/dist/components/ui/Page.js +15 -0
  37. package/dist/components/ui/PageTitle.d.ts +7 -0
  38. package/dist/components/ui/PageTitle.js +21 -0
  39. package/dist/image.js +55 -15
  40. package/dist/index.d.ts +33 -0
  41. package/dist/index.js +24 -4
  42. package/dist/util.d.ts +26 -0
  43. package/dist/util.js +52 -2
  44. package/package.json +24 -1
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ButtonProps } from 'antd';
3
+ export interface CustomButtonProps extends ButtonProps {
4
+ customLabel?: string;
5
+ }
6
+ export declare const CustomButton: React.FC<CustomButtonProps>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.CustomButton = void 0;
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ const antd_1 = require("antd");
17
+ const CustomButton = (_a) => {
18
+ var { customLabel, children } = _a, props = __rest(_a, ["customLabel", "children"]);
19
+ return ((0, jsx_runtime_1.jsxs)(antd_1.Button, Object.assign({}, props, { type: "primary", children: [customLabel ? `[${customLabel}] ` : '', children] })));
20
+ };
21
+ exports.CustomButton = CustomButton;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface LinkupButtonProps {
3
+ onClick?: () => void;
4
+ children: React.ReactNode;
5
+ style?: React.CSSProperties;
6
+ }
7
+ export declare const LinkupButton: React.FC<LinkupButtonProps>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkupButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const LinkupButton = ({ onClick, children, style }) => {
6
+ return ((0, jsx_runtime_1.jsx)("button", { onClick: onClick, style: Object.assign({ padding: '10px 20px', backgroundColor: '#0070f3', color: 'white', border: 'none', borderRadius: '5px', cursor: 'pointer' }, style), children: children }));
7
+ };
8
+ exports.LinkupButton = LinkupButton;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ThemeConfig } from 'antd';
3
+ export interface RegistryProps {
4
+ size?: 'small' | 'middle' | 'large';
5
+ theme: ThemeConfig;
6
+ children: React.ReactNode;
7
+ }
8
+ declare const Registry: ({ size, theme, children }: RegistryProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default Registry;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const NextAuthRegistry_1 = __importDefault(require("./components/registry/NextAuthRegistry"));
9
+ const AntdRegistry_1 = __importDefault(require("./components/registry/AntdRegistry"));
10
+ const ReactQueryRegistry_1 = __importDefault(require("./components/registry/ReactQueryRegistry"));
11
+ const react_error_boundary_1 = require("react-error-boundary");
12
+ const ErrorHandler_1 = __importDefault(require("./components/registry/ErrorHandler"));
13
+ const Registry = ({ size, theme, children }) => {
14
+ return ((0, jsx_runtime_1.jsx)(NextAuthRegistry_1.default, { session: true, children: (0, jsx_runtime_1.jsx)(AntdRegistry_1.default, { theme: theme, size: size, children: (0, jsx_runtime_1.jsx)(ReactQueryRegistry_1.default, { children: (0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorHandler_1.default, children: children }) }) }) }));
15
+ };
16
+ exports.default = Registry;
@@ -0,0 +1,7 @@
1
+ declare const primary = "#E2702F";
2
+ declare const secondary = "#0F1C43";
3
+ declare const bg100 = "#2F3539";
4
+ declare const bg200 = "#434B59";
5
+ declare const bg300 = "#495160";
6
+ declare const bg900 = "#EEF0F5";
7
+ export { primary, secondary, bg100, bg200, bg300, bg900 };
package/dist/color.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bg900 = exports.bg300 = exports.bg200 = exports.bg100 = exports.secondary = exports.primary = void 0;
4
+ const primary = "#E2702F";
5
+ exports.primary = primary;
6
+ const secondary = "#0F1C43";
7
+ exports.secondary = secondary;
8
+ const bg100 = "#2F3539";
9
+ exports.bg100 = bg100;
10
+ const bg200 = "#434B59";
11
+ exports.bg200 = bg200;
12
+ const bg300 = "#495160";
13
+ exports.bg300 = bg300;
14
+ const bg900 = "#EEF0F5";
15
+ exports.bg900 = bg900;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ThemeConfig } from 'antd';
3
+ interface RootLayoutProps {
4
+ size?: 'small' | 'middle' | 'large';
5
+ theme: ThemeConfig;
6
+ children: React.ReactNode;
7
+ }
8
+ declare const RootLayout: ({ size, theme, children }: RootLayoutProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default RootLayout;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const antd_1 = require("antd");
9
+ const nextjs_registry_1 = require("@ant-design/nextjs-registry");
10
+ // 한국어
11
+ const ko_KR_1 = __importDefault(require("antd/es/locale/ko_KR"));
12
+ const RootLayout = ({ size = 'small', theme, children }) => ((0, jsx_runtime_1.jsx)(nextjs_registry_1.AntdRegistry, { children: (0, jsx_runtime_1.jsx)(antd_1.ConfigProvider, { componentSize: size, theme: theme, locale: ko_KR_1.default, children: children }) }));
13
+ exports.default = RootLayout;
@@ -0,0 +1,2 @@
1
+ declare const ErrorHandler: ({ error, resetErrorBoundary }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default ErrorHandler;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const antd_1 = require("antd");
6
+ const tb_1 = require("react-icons/tb");
7
+ const ErrorHandler = ({ error, resetErrorBoundary }) => {
8
+ return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', paddingBottom: '30vh' }, children: (0, jsx_runtime_1.jsx)(antd_1.Result, { status: "error", title: "Error", subTitle: "\uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.", extra: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("pre", { style: { padding: 20, background: '#f9f9f9', borderRadius: 12 }, children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Text, { style: { fontSize: 12, color: '#999' }, children: typeof error === "string" ? error : error.message }) }), (0, jsx_runtime_1.jsx)("div", { style: { height: 20 } }), (0, jsx_runtime_1.jsx)(antd_1.Button, { onClick: resetErrorBoundary, icon: (0, jsx_runtime_1.jsx)(tb_1.TbRefresh, {}), children: "\uC7AC\uC2DC\uB3C4" })] }) }) }));
9
+ };
10
+ exports.default = ErrorHandler;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface Props {
3
+ session: any;
4
+ children: ReactNode | ReactNode[];
5
+ }
6
+ declare const _default: React.MemoExoticComponent<({ children }: Props) => import("react/jsx-runtime").JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("next-auth/react");
9
+ const react_2 = __importDefault(require("react"));
10
+ const Components = ({ children }) => {
11
+ return ((0, jsx_runtime_1.jsx)(react_1.SessionProvider, { children: children }));
12
+ };
13
+ exports.default = react_2.default.memo(Components);
@@ -0,0 +1,6 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface Props {
3
+ children: ReactNode | ReactNode[];
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ children }: Props) => import("react/jsx-runtime").JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_query_1 = require("@tanstack/react-query");
9
+ const react_1 = __importDefault(require("react"));
10
+ const Components = ({ children }) => {
11
+ const errorHandler = (error) => {
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13
+ // 401 에러 처리
14
+ if (((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) === 401 || ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.status) === 419) {
15
+ alert("접근 권한이 없습니다.\n다시 로그인 해주세요.");
16
+ window.location.href = '/auth/signin';
17
+ }
18
+ // 404 에러 처리
19
+ else if (((_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.status) === 404) {
20
+ alert("잘못된 접근입니다.");
21
+ }
22
+ // 400 에러 처리
23
+ else if (((_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.status) === 400) {
24
+ alert(((_f = (_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.message) || "잘못된 요청입니다.");
25
+ }
26
+ // 500 에러 처리
27
+ else if (((_g = error === null || error === void 0 ? void 0 : error.response) === null || _g === void 0 ? void 0 : _g.status) === 500) {
28
+ alert(((_j = (_h = error === null || error === void 0 ? void 0 : error.response) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.message) || "잘못된 요청입니다.");
29
+ }
30
+ else {
31
+ alert("잘못된 요청입니다.");
32
+ }
33
+ };
34
+ const queryClient = new react_query_1.QueryClient({
35
+ defaultOptions: {
36
+ queries: {
37
+ // 모든 Query의 오류를 공통으로 처리한다.
38
+ throwOnError(error, query) {
39
+ // 에러 처리
40
+ errorHandler(error);
41
+ return false;
42
+ },
43
+ retry: process.env.NODE_ENV === 'production' ? 3 : 0, // 프로덕션 환경에서만 재시도
44
+ retryDelay: attemptIndex => Math.min(1000 * 2 ** attemptIndex, 30000), // 지수 백오프 전략
45
+ },
46
+ mutations: {
47
+ onError(error, variables, onMutateResult, context) {
48
+ // 에러 처리
49
+ errorHandler(error);
50
+ },
51
+ }
52
+ },
53
+ });
54
+ return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: children }));
55
+ };
56
+ exports.default = react_1.default.memo(Components);
@@ -0,0 +1,2 @@
1
+ declare const Component: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Component;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const antd_1 = require("antd");
6
+ const react_1 = require("next-auth/react");
7
+ const navigation_1 = require("next/navigation");
8
+ const Component = () => {
9
+ var _a;
10
+ // 라우터
11
+ const router = (0, navigation_1.useRouter)();
12
+ // 세션
13
+ const session = (0, react_1.useSession)();
14
+ const user = (_a = session.data) === null || _a === void 0 ? void 0 : _a.user;
15
+ // 로그아웃
16
+ const handleLogout = () => {
17
+ (0, react_1.signOut)();
18
+ };
19
+ return ((0, jsx_runtime_1.jsxs)("header", { className: "bg-bg-300 w-full h-14 flex fixed top-0 left-0 z-10 items-center", children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center pl-6 gap-2 cursor-pointer", onClick: () => {
20
+ router.push('/');
21
+ }, children: [(0, jsx_runtime_1.jsx)(antd_1.Image, { preview: false, height: 423 / 12, width: 821 / 12, src: "https://secret-order.s3.ap-northeast-2.amazonaws.com/banner/20260107141238977.webp" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-0.5", children: (0, jsx_runtime_1.jsx)("p", { className: `text-2xl text-zinc-200 font-semibold`, children: "\uC720\uD1B5\uC0AC \uAD00\uB9AC\uC790" }) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1" }), (0, jsx_runtime_1.jsx)("div", { className: "pr-6", children:
22
+ // 로그인 됨
23
+ user ?
24
+ (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "cursor-pointer", children: (0, jsx_runtime_1.jsxs)("p", { className: "text-white", children: [user.id, " \uB2D8"] }) }), (0, jsx_runtime_1.jsx)("div", { className: "cursor-pointer", onClick: handleLogout, children: (0, jsx_runtime_1.jsx)("p", { className: "text-white", children: "\uB85C\uADF8\uC544\uC6C3" }) })] })
25
+ :
26
+ // 로그인 안됨
27
+ (0, jsx_runtime_1.jsx)("div", {}) })] }));
28
+ };
29
+ exports.default = Component;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ThemeConfig } from 'antd';
3
+ export interface RootLayoutProps {
4
+ size?: 'small' | 'middle' | 'large';
5
+ theme: ThemeConfig;
6
+ children: React.ReactNode;
7
+ }
8
+ declare const RootLayout: ({ size, theme, children }: RootLayoutProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default RootLayout;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const antd_1 = require("antd");
9
+ const nextjs_registry_1 = require("@ant-design/nextjs-registry");
10
+ // 한국어
11
+ const ko_KR_1 = __importDefault(require("antd/es/locale/ko_KR"));
12
+ const RootLayout = ({ size = 'small', theme, children }) => ((0, jsx_runtime_1.jsx)(nextjs_registry_1.AntdRegistry, { children: (0, jsx_runtime_1.jsx)(antd_1.ConfigProvider, { componentSize: size, theme: theme, locale: ko_KR_1.default, children: children }) }));
13
+ exports.default = RootLayout;
@@ -0,0 +1,2 @@
1
+ declare const ErrorHandler: ({ error, resetErrorBoundary }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default ErrorHandler;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const antd_1 = require("antd");
6
+ const tb_1 = require("react-icons/tb");
7
+ const ErrorHandler = ({ error, resetErrorBoundary }) => {
8
+ return ((0, jsx_runtime_1.jsx)("div", { style: { minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', paddingBottom: '30vh' }, children: (0, jsx_runtime_1.jsx)(antd_1.Result, { status: "error", title: "Error", subTitle: "\uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.", extra: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("pre", { style: { padding: 20, background: '#f9f9f9', borderRadius: 12 }, children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Text, { style: { fontSize: 12, color: '#999' }, children: typeof error === "string" ? error : error.message }) }), (0, jsx_runtime_1.jsx)("div", { style: { height: 20 } }), (0, jsx_runtime_1.jsx)(antd_1.Button, { onClick: resetErrorBoundary, icon: (0, jsx_runtime_1.jsx)(tb_1.TbRefresh, {}), children: "\uC7AC\uC2DC\uB3C4" })] }) }) }));
9
+ };
10
+ exports.default = ErrorHandler;
@@ -0,0 +1,5 @@
1
+ export interface Props {
2
+ children: React.ReactNode | React.ReactNode[];
3
+ }
4
+ declare const Component: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default Component;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_error_boundary_1 = require("react-error-boundary");
9
+ const ErrorHandler_1 = __importDefault(require("./ErrorHandler"));
10
+ const Component = ({ children }) => {
11
+ return ((0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorHandler_1.default, children: children }));
12
+ };
13
+ exports.default = Component;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface Props {
3
+ session: any;
4
+ children: ReactNode | ReactNode[];
5
+ }
6
+ declare const _default: React.MemoExoticComponent<({ children }: Props) => import("react/jsx-runtime").JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("next-auth/react");
9
+ const react_2 = __importDefault(require("react"));
10
+ const Components = ({ children }) => {
11
+ return ((0, jsx_runtime_1.jsx)(react_1.SessionProvider, { children: children }));
12
+ };
13
+ exports.default = react_2.default.memo(Components);
@@ -0,0 +1,6 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface Props {
3
+ children: ReactNode | ReactNode[];
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ children }: Props) => import("react/jsx-runtime").JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ "use client";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_query_1 = require("@tanstack/react-query");
9
+ const react_1 = __importDefault(require("react"));
10
+ const Components = ({ children }) => {
11
+ const errorHandler = (error) => {
12
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13
+ // 401 에러 처리
14
+ if (((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status) === 401 || ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.status) === 419) {
15
+ alert("접근 권한이 없습니다.\n다시 로그인 해주세요.");
16
+ window.location.href = '/auth/signin';
17
+ }
18
+ // 404 에러 처리
19
+ else if (((_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.status) === 404) {
20
+ alert("잘못된 접근입니다.");
21
+ }
22
+ // 400 에러 처리
23
+ else if (((_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.status) === 400) {
24
+ alert(((_f = (_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.message) || "잘못된 요청입니다.");
25
+ }
26
+ // 500 에러 처리
27
+ else if (((_g = error === null || error === void 0 ? void 0 : error.response) === null || _g === void 0 ? void 0 : _g.status) === 500) {
28
+ alert(((_j = (_h = error === null || error === void 0 ? void 0 : error.response) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.message) || "잘못된 요청입니다.");
29
+ }
30
+ else {
31
+ alert("잘못된 요청입니다.");
32
+ }
33
+ };
34
+ const queryClient = new react_query_1.QueryClient({
35
+ defaultOptions: {
36
+ queries: {
37
+ // 모든 Query의 오류를 공통으로 처리한다.
38
+ throwOnError(error, query) {
39
+ // 에러 처리
40
+ errorHandler(error);
41
+ return false;
42
+ },
43
+ retry: process.env.NODE_ENV === 'production' ? 3 : 0, // 프로덕션 환경에서만 재시도
44
+ retryDelay: attemptIndex => Math.min(1000 * 2 ** attemptIndex, 30000), // 지수 백오프 전략
45
+ },
46
+ mutations: {
47
+ onError(error, variables, onMutateResult, context) {
48
+ // 에러 처리
49
+ errorHandler(error);
50
+ },
51
+ }
52
+ },
53
+ });
54
+ return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: children }));
55
+ };
56
+ exports.default = react_1.default.memo(Components);
@@ -0,0 +1,14 @@
1
+ export declare const asideAtom: import("jotai").PrimitiveAtom<boolean> & {
2
+ init: boolean;
3
+ };
4
+ interface MenusProps {
5
+ key: string;
6
+ label: string;
7
+ items?: MenusProps[];
8
+ }
9
+ export interface AsideProps {
10
+ primaryColor?: string;
11
+ menus: MenusProps[];
12
+ }
13
+ declare const Component: ({ primaryColor, menus }: AsideProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default Component;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.asideAtom = void 0;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("next-auth/react");
7
+ const navigation_1 = require("next/navigation");
8
+ const react_2 = require("react");
9
+ const fi_1 = require("react-icons/fi");
10
+ const im_1 = require("react-icons/im");
11
+ const jotai_1 = require("jotai");
12
+ exports.asideAtom = (0, jotai_1.atom)(true);
13
+ const Component = ({ primaryColor = "#E2702F", menus }) => {
14
+ var _a;
15
+ // 세션
16
+ const session = (0, react_1.useSession)();
17
+ const user = (_a = session.data) === null || _a === void 0 ? void 0 : _a.user;
18
+ // 사이드바 열림 상태
19
+ const [asideOpen, setAsideOpen] = (0, jotai_1.useAtom)(exports.asideAtom);
20
+ return ((0, jsx_runtime_1.jsxs)("aside", { style: {
21
+ position: "fixed",
22
+ top: 0,
23
+ left: 0,
24
+ width: asideOpen ? 210 : 0,
25
+ minHeight: "100dvh",
26
+ height: '100dvh',
27
+ overflow: 'auto',
28
+ backgroundColor: "#434B59",
29
+ zIndex: 10,
30
+ paddingTop: 56,
31
+ transition: 'all 300ms',
32
+ scrollbarWidth: 'none',
33
+ }, children: [(0, jsx_runtime_1.jsx)("style", { children: `
34
+ aside::-webkit-scrollbar {
35
+ display: none;
36
+ }
37
+ ` }), (0, jsx_runtime_1.jsxs)("div", { style: {
38
+ padding: '0px 0px',
39
+ minWidth: 210,
40
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
41
+ display: 'flex',
42
+ flexDirection: 'column',
43
+ alignItems: 'center',
44
+ justifyContent: 'center',
45
+ padding: '30px 12px'
46
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
47
+ width: 80, height: 80,
48
+ borderRadius: "100%",
49
+ background: '#EBF0F1',
50
+ marginBottom: 20,
51
+ display: 'flex',
52
+ alignItems: 'flex-end',
53
+ justifyContent: 'center',
54
+ overflow: 'hidden',
55
+ }, children: (0, jsx_runtime_1.jsx)(im_1.ImUser, { style: { fontSize: 75, color: "#C7CAD2", transform: "translateY(6px)" } }) }), (0, jsx_runtime_1.jsx)("p", { style: { color: 'white', fontSize: 15, fontWeight: 'bold' }, children: user ? user.name : "" }), (0, jsx_runtime_1.jsx)("p", { style: { color: '#bbb', fontSize: 12 }, children: user ? user.levelName : "" })] }), (0, jsx_runtime_1.jsx)("ul", { style: {
56
+ borderTop: '1px solid #5F6673',
57
+ }, children: menus.map((r, idx) => {
58
+ return ((0, jsx_runtime_1.jsx)(Menu, { menu: r, primaryColor: primaryColor }, `menu-${r.key}`));
59
+ }) })] })] }));
60
+ };
61
+ // 메뉴 컴포넌트
62
+ const Menu = ({ menu, primaryColor }) => {
63
+ // 활성 메뉴
64
+ const pathname = (0, navigation_1.usePathname)();
65
+ const isActive = (0, react_2.useMemo)(() => {
66
+ if (!pathname)
67
+ return "";
68
+ const pathArr = pathname.split('/');
69
+ if (pathArr[1] === "")
70
+ return false;
71
+ return pathArr[1] === menu.key;
72
+ }, [pathname, menu.key]);
73
+ const [open, setOpen] = (0, react_2.useState)(isActive);
74
+ const router = (0, navigation_1.useRouter)();
75
+ return ((0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
76
+ height: 48,
77
+ width: '100%',
78
+ display: 'flex',
79
+ alignItems: 'center',
80
+ justifyContent: 'space-between',
81
+ borderBottom: '1px solid #5F6673',
82
+ padding: '0px 20px',
83
+ cursor: 'pointer',
84
+ }, onClick: () => {
85
+ if (menu.items && menu.items.length > 0)
86
+ setOpen(!open);
87
+ else
88
+ router.push(`/${menu.key}`);
89
+ }, children: [(0, jsx_runtime_1.jsx)("p", { style: { color: 'white', fontWeight: 'bold', fontSize: '15px' }, children: menu.label }), menu.items && menu.items.length > 0 ?
90
+ (0, jsx_runtime_1.jsx)(fi_1.FiChevronDown, { style: { color: '#6B7280', transition: '300ms', rotate: open ? '180deg' : '0deg' } })
91
+ : null] }), menu.items ?
92
+ (0, jsx_runtime_1.jsx)("ul", { style: {
93
+ width: '100%', backgroundColor: '#484E5C', maxHeight: open ? 500 : 0, overflow: 'hidden', transition: '300ms',
94
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
95
+ padding: '10px 16px',
96
+ borderBottom: '1px solid #5F6673',
97
+ }, children: menu.items.map((r, i) => {
98
+ return ((0, jsx_runtime_1.jsx)(SubMenu, { menu: r, primaryColor: primaryColor }, `sub-menu-${i}-${r.key}`));
99
+ }) }) })
100
+ : null] }));
101
+ };
102
+ const SubMenu = ({ menu, primaryColor }) => {
103
+ // 호버 상태
104
+ const [isHover, setIsHover] = (0, react_2.useState)(false);
105
+ const router = (0, navigation_1.useRouter)();
106
+ // 활성 메뉴
107
+ const pathname = (0, navigation_1.usePathname)();
108
+ const isActive = (0, react_2.useMemo)(() => {
109
+ if (!pathname)
110
+ return "";
111
+ const pathArr = pathname.split('/');
112
+ if (pathArr[1] === "")
113
+ return false;
114
+ else
115
+ return `${pathArr[1]}/${pathArr[2]}` === menu.key;
116
+ }, [pathname, menu.key]);
117
+ return ((0, jsx_runtime_1.jsx)("li", { style: {
118
+ height: 48,
119
+ display: 'flex',
120
+ alignItems: 'center',
121
+ cursor: 'pointer',
122
+ }, onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), onClick: () => router.push(`/${menu.key}`), children: (0, jsx_runtime_1.jsx)("div", { style: {
123
+ width: '100%',
124
+ padding: '10px 14px',
125
+ borderRadius: 8,
126
+ background: isActive ? '#2A2F37' : 'transparent',
127
+ }, children: (0, jsx_runtime_1.jsx)("p", { style: {
128
+ fontWeight: isActive ? '900' : '600',
129
+ color: isHover || isActive ? primaryColor : 'rgb(211, 218, 223)',
130
+ fontSize: 14,
131
+ }, children: menu.label }) }) }));
132
+ };
133
+ exports.default = Component;
@@ -0,0 +1,5 @@
1
+ export interface HeaderProps {
2
+ logo: React.ReactNode;
3
+ }
4
+ declare const Component: ({ logo }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default Component;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("next-auth/react");
6
+ const navigation_1 = require("next/navigation");
7
+ const color_1 = require("../../color");
8
+ const Component = ({ logo }) => {
9
+ var _a;
10
+ // 라우터
11
+ const router = (0, navigation_1.useRouter)();
12
+ // 세션
13
+ const session = (0, react_1.useSession)();
14
+ const user = (_a = session.data) === null || _a === void 0 ? void 0 : _a.user;
15
+ // 로그아웃
16
+ const handleLogout = () => {
17
+ (0, react_1.signOut)();
18
+ };
19
+ return ((0, jsx_runtime_1.jsxs)("header", { style: {
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ width: '100%',
23
+ height: '56px',
24
+ position: 'fixed',
25
+ top: 0,
26
+ left: 0,
27
+ zIndex: 20,
28
+ background: color_1.bg100,
29
+ }, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", { style: {
30
+ display: 'flex',
31
+ alignItems: 'center',
32
+ justifyContent: 'center',
33
+ paddingLeft: '24px',
34
+ cursor: 'pointer',
35
+ }, onClick: () => {
36
+ router.push('/');
37
+ }, children: logo }) }), (0, jsx_runtime_1.jsx)("div", { style: { flex: 1 } }), (0, jsx_runtime_1.jsx)("div", { style: { paddingRight: '24px' }, children:
38
+ // 로그인 됨
39
+ user ?
40
+ (0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: '16px' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { cursor: 'pointer' }, children: (0, jsx_runtime_1.jsxs)("p", { style: { color: 'white' }, children: [user.id, " \uB2D8"] }) }), (0, jsx_runtime_1.jsx)("div", { style: { cursor: 'pointer' }, onClick: handleLogout, children: (0, jsx_runtime_1.jsx)("p", { style: { color: 'white' }, children: "\uB85C\uADF8\uC544\uC6C3" }) })] })
41
+ :
42
+ // 로그인 안됨
43
+ (0, jsx_runtime_1.jsx)("div", {}) })] }));
44
+ };
45
+ exports.default = Component;
@@ -0,0 +1,5 @@
1
+ export interface Header2Props {
2
+ logo: React.ReactNode;
3
+ }
4
+ declare const Component: ({ logo }: Header2Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default Component;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Component = ({ logo }) => {
6
+ return ((0, jsx_runtime_1.jsx)("header", { style: {
7
+ width: '100%',
8
+ height: '56px',
9
+ background: 'white',
10
+ borderBottom: `1px solid #E4E4E7`,
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ justifyContent: 'center',
14
+ }, children: (0, jsx_runtime_1.jsx)("div", { style: {
15
+ display: 'flex',
16
+ alignItems: 'center',
17
+ justifyContent: 'center',
18
+ }, children: logo }) }));
19
+ };
20
+ exports.default = Component;
@@ -0,0 +1,5 @@
1
+ export interface PageProps {
2
+ children?: React.ReactNode;
3
+ }
4
+ declare const Component: ({ children }: PageProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default Component;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Aside_1 = require("./Aside");
6
+ const jotai_1 = require("jotai");
7
+ const Component = ({ children }) => {
8
+ // 사이드바 열림 상태
9
+ const [asideOpen, setAsideOpen] = (0, jotai_1.useAtom)(Aside_1.asideAtom);
10
+ return ((0, jsx_runtime_1.jsx)("div", { style: {
11
+ padding: `56px 0px 0px ${asideOpen ? 210 : 0}px`, minHeight: "100dvh",
12
+ transition: 'all 0.3s',
13
+ }, children: children }));
14
+ };
15
+ exports.default = Component;
@@ -0,0 +1,7 @@
1
+ export interface PageTitleProps {
2
+ title: string;
3
+ section1?: React.ReactNode;
4
+ section2?: React.ReactNode;
5
+ }
6
+ declare const Component: ({ title, section1, section2 }: PageTitleProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default Component;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cg_1 = require("react-icons/cg");
6
+ const Aside_1 = require("./Aside");
7
+ const jotai_1 = require("jotai");
8
+ const Component = ({ title, section1, section2 }) => {
9
+ // 사이드바 열림 상태
10
+ const [asideOpen, setAsideOpen] = (0, jotai_1.useAtom)(Aside_1.asideAtom);
11
+ return ((0, jsx_runtime_1.jsxs)("section", { style: {
12
+ display: 'flex', alignItems: 'center',
13
+ width: '100%', height: 60, background: '#fff',
14
+ transition: 'all 0.3s',
15
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
16
+ width: 26, height: 60, background: '#EEF0F5',
17
+ borderRight: '1px solid #DCDDE2', borderBottom: '1px solid #DCDDE2',
18
+ display: 'flex', justifyContent: 'center', alignItems: 'center', cursor: 'pointer'
19
+ }, onClick: () => setAsideOpen(!asideOpen), children: (0, jsx_runtime_1.jsx)(cg_1.CgChevronLeft, { style: { color: '#616673', fontSize: 16, transform: asideOpen ? 'rotate(0deg)' : 'rotate(180deg)', transition: 'transform 0.3s ease' } }) }), (0, jsx_runtime_1.jsxs)("div", { style: { flex: 1, display: 'flex', alignItems: 'center', height: '100%', borderBottom: '1px solid #E4E7EE', }, children: [(0, jsx_runtime_1.jsx)("div", { style: { padding: '0px 30px' }, children: (0, jsx_runtime_1.jsx)("p", { style: { fontSize: 20, fontWeight: '600' }, children: title }) }), (0, jsx_runtime_1.jsx)("section", { style: { flex: 1 }, children: section1 }), (0, jsx_runtime_1.jsx)("section", { style: { flex: 1 }, children: section2 })] })] }));
20
+ };
21
+ exports.default = Component;
package/dist/image.js CHANGED
@@ -1,4 +1,37 @@
1
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -15,21 +48,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
48
  exports.deleteS3Object = exports.convertWebpAndUploadBuffer = exports.convertWebpAndUploadFile = void 0;
16
49
  const dayjs_1 = __importDefault(require("dayjs"));
17
50
  const client_s3_1 = require("@aws-sdk/client-s3");
18
- const sharp_1 = __importDefault(require("sharp"));
19
51
  const Bucket = process.env.AWS_S3_BUCKET || ""; // 'secret-order';
20
- const s3 = new client_s3_1.S3Client({
21
- region: process.env.AWS_REGION || "",
22
- credentials: {
23
- accessKeyId: process.env.AWS_ACCESS_KEY_ID || "",
24
- secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || "",
25
- },
26
- });
52
+ let s3 = null;
53
+ const getS3Client = () => {
54
+ if (!s3) {
55
+ s3 = new client_s3_1.S3Client({
56
+ region: process.env.AWS_REGION || "",
57
+ credentials: {
58
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID || "",
59
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || "",
60
+ },
61
+ });
62
+ }
63
+ return s3;
64
+ };
27
65
  // 이미지를 webp로 변환 후 업로드
28
66
  const convertWebpAndUploadFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, path, fileName, size }) {
29
67
  try {
30
68
  const buffer = yield file.arrayBuffer();
31
69
  // 이미지를 webp로 변환
32
- const convert = yield (0, sharp_1.default)(buffer).webp({
70
+ const sharp = (yield Promise.resolve().then(() => __importStar(require("sharp")))).default;
71
+ const convert = yield sharp(buffer).webp({
33
72
  quality: 90,
34
73
  // lossless: true,
35
74
  // nearLossless: true,
@@ -39,7 +78,7 @@ const convertWebpAndUploadFile = (_a) => __awaiter(void 0, [_a], void 0, functio
39
78
  if (!convert) {
40
79
  throw new Error('이미지 변환에 실패했습니다.');
41
80
  }
42
- const resized = size ? yield (0, sharp_1.default)(convert)
81
+ const resized = size ? yield sharp(convert)
43
82
  .resize({ width: size, withoutEnlargement: true })
44
83
  .toBuffer() : convert;
45
84
  if (!fileName)
@@ -47,7 +86,7 @@ const convertWebpAndUploadFile = (_a) => __awaiter(void 0, [_a], void 0, functio
47
86
  // 스트림을 사용하여 S3에 업로드
48
87
  const Key = `${path}/${fileName}.webp`;
49
88
  // S3에 업로드하고 결과 출력
50
- const res = yield s3.send(new client_s3_1.PutObjectCommand({
89
+ const res = yield getS3Client().send(new client_s3_1.PutObjectCommand({
51
90
  Bucket,
52
91
  Key,
53
92
  Body: resized,
@@ -65,7 +104,8 @@ exports.convertWebpAndUploadFile = convertWebpAndUploadFile;
65
104
  const convertWebpAndUploadBuffer = (_a) => __awaiter(void 0, [_a], void 0, function* ({ buffer, path, fileName, size }) {
66
105
  try {
67
106
  // 이미지를 webp로 변환
68
- const convert = yield (0, sharp_1.default)(buffer).webp({
107
+ const sharp = (yield Promise.resolve().then(() => __importStar(require("sharp")))).default;
108
+ const convert = yield sharp(buffer).webp({
69
109
  quality: 90,
70
110
  // lossless: true,
71
111
  // nearLossless: true,
@@ -75,7 +115,7 @@ const convertWebpAndUploadBuffer = (_a) => __awaiter(void 0, [_a], void 0, funct
75
115
  if (!convert) {
76
116
  throw new Error('이미지 변환에 실패했습니다.');
77
117
  }
78
- const resized = size ? yield (0, sharp_1.default)(convert)
118
+ const resized = size ? yield sharp(convert)
79
119
  .resize({ width: size, withoutEnlargement: true })
80
120
  .toBuffer() : convert;
81
121
  if (!fileName)
@@ -83,7 +123,7 @@ const convertWebpAndUploadBuffer = (_a) => __awaiter(void 0, [_a], void 0, funct
83
123
  // 스트림을 사용하여 S3에 업로드
84
124
  const Key = `${path}/${fileName}.webp`;
85
125
  // S3에 업로드하고 결과 출력
86
- const res = yield s3.send(new client_s3_1.PutObjectCommand({
126
+ const res = yield getS3Client().send(new client_s3_1.PutObjectCommand({
87
127
  Bucket,
88
128
  Key,
89
129
  Body: resized,
@@ -99,7 +139,7 @@ const convertWebpAndUploadBuffer = (_a) => __awaiter(void 0, [_a], void 0, funct
99
139
  exports.convertWebpAndUploadBuffer = convertWebpAndUploadBuffer;
100
140
  const deleteS3Object = (key) => __awaiter(void 0, void 0, void 0, function* () {
101
141
  try {
102
- const res = yield s3.send(new client_s3_1.DeleteObjectCommand({
142
+ const res = yield getS3Client().send(new client_s3_1.DeleteObjectCommand({
103
143
  Bucket,
104
144
  Key: key,
105
145
  }));
package/dist/index.d.ts CHANGED
@@ -1,3 +1,15 @@
1
+ import util from './util';
2
+ import image from './image';
3
+ import Registry from './Registry';
4
+ import ReactQueryRegistry from './components/registry/ReactQueryRegistry';
5
+ import AntdRegistry from "./components/registry/AntdRegistry";
6
+ import NextAuthRegistry from './components/registry/NextAuthRegistry';
7
+ import ErrorRegistry from './components/registry/ErrorRegistry';
8
+ import PageTitle from './components/ui/PageTitle';
9
+ import Header from './components/ui/Header';
10
+ import Header2 from './components/ui/Header2';
11
+ import Aside from './components/ui/Aside';
12
+ import Page from './components/ui/Page';
1
13
  declare const _default: {
2
14
  util: {
3
15
  format: {
@@ -30,6 +42,16 @@ declare const _default: {
30
42
  time: (sec: number) => string;
31
43
  diffProperties: (prev: any, next: any) => any;
32
44
  };
45
+ validate: {
46
+ id: (value: string) => {
47
+ message: string;
48
+ result: boolean;
49
+ };
50
+ password: (value: string) => {
51
+ message: string;
52
+ result: boolean;
53
+ };
54
+ };
33
55
  };
34
56
  image: {
35
57
  convertWebpAndUploadFile: ({ file, path, fileName, size }: {
@@ -96,5 +118,16 @@ declare const _default: {
96
118
  $metadata: import("@smithy/types").ResponseMetadata;
97
119
  }>;
98
120
  };
121
+ Registry: ({ size, theme, children }: import("./Registry").RegistryProps) => import("react/jsx-runtime").JSX.Element;
122
+ Header: ({ logo }: import("./components/ui/Header").HeaderProps) => import("react/jsx-runtime").JSX.Element;
123
+ Header2: ({ logo }: import("./components/ui/Header2").Header2Props) => import("react/jsx-runtime").JSX.Element;
124
+ Aside: ({ primaryColor, menus }: import("./components/ui/Aside").AsideProps) => import("react/jsx-runtime").JSX.Element;
125
+ Page: ({ children }: import("./components/ui/Page").PageProps) => import("react/jsx-runtime").JSX.Element;
126
+ PageTitle: ({ title, section1, section2 }: import("./components/ui/PageTitle").PageTitleProps) => import("react/jsx-runtime").JSX.Element;
127
+ ReactQueryRegistry: import("react").MemoExoticComponent<({ children }: import("./components/registry/ReactQueryRegistry").Props) => import("react/jsx-runtime").JSX.Element>;
128
+ AntdRegistry: ({ size, theme, children }: import("./components/registry/AntdRegistry").RootLayoutProps) => import("react/jsx-runtime").JSX.Element;
129
+ NextAuthRegistry: import("react").MemoExoticComponent<({ children }: import("./components/registry/NextAuthRegistry").Props) => import("react/jsx-runtime").JSX.Element>;
130
+ ErrorRegistry: ({ children }: import("./components/registry/ErrorRegistry").Props) => import("react/jsx-runtime").JSX.Element;
99
131
  };
100
132
  export default _default;
133
+ export { util, image, Registry, Header, Header2, Aside, Page, PageTitle, ReactQueryRegistry, AntdRegistry, NextAuthRegistry, ErrorRegistry };
package/dist/index.js CHANGED
@@ -3,9 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ErrorRegistry = exports.NextAuthRegistry = exports.AntdRegistry = exports.ReactQueryRegistry = exports.PageTitle = exports.Page = exports.Aside = exports.Header2 = exports.Header = exports.Registry = exports.image = exports.util = void 0;
6
7
  const util_1 = __importDefault(require("./util"));
8
+ exports.util = util_1.default;
7
9
  const image_1 = __importDefault(require("./image"));
8
- exports.default = {
9
- util: util_1.default,
10
- image: image_1.default,
11
- };
10
+ exports.image = image_1.default;
11
+ const Registry_1 = __importDefault(require("./Registry"));
12
+ exports.Registry = Registry_1.default;
13
+ const ReactQueryRegistry_1 = __importDefault(require("./components/registry/ReactQueryRegistry"));
14
+ exports.ReactQueryRegistry = ReactQueryRegistry_1.default;
15
+ const AntdRegistry_1 = __importDefault(require("./components/registry/AntdRegistry"));
16
+ exports.AntdRegistry = AntdRegistry_1.default;
17
+ const NextAuthRegistry_1 = __importDefault(require("./components/registry/NextAuthRegistry"));
18
+ exports.NextAuthRegistry = NextAuthRegistry_1.default;
19
+ const ErrorRegistry_1 = __importDefault(require("./components/registry/ErrorRegistry"));
20
+ exports.ErrorRegistry = ErrorRegistry_1.default;
21
+ const PageTitle_1 = __importDefault(require("./components/ui/PageTitle"));
22
+ exports.PageTitle = PageTitle_1.default;
23
+ const Header_1 = __importDefault(require("./components/ui/Header"));
24
+ exports.Header = Header_1.default;
25
+ const Header2_1 = __importDefault(require("./components/ui/Header2"));
26
+ exports.Header2 = Header2_1.default;
27
+ const Aside_1 = __importDefault(require("./components/ui/Aside"));
28
+ exports.Aside = Aside_1.default;
29
+ const Page_1 = __importDefault(require("./components/ui/Page"));
30
+ exports.Page = Page_1.default;
31
+ exports.default = { util: util_1.default, image: image_1.default, Registry: Registry_1.default, Header: Header_1.default, Header2: Header2_1.default, Aside: Aside_1.default, Page: Page_1.default, PageTitle: PageTitle_1.default, ReactQueryRegistry: ReactQueryRegistry_1.default, AntdRegistry: AntdRegistry_1.default, NextAuthRegistry: NextAuthRegistry_1.default, ErrorRegistry: ErrorRegistry_1.default };
package/dist/util.d.ts CHANGED
@@ -1,3 +1,16 @@
1
+ export declare const validate: {
2
+ /**
3
+ * 아이디 검증
4
+ */
5
+ id: (value: string) => {
6
+ message: string;
7
+ result: boolean;
8
+ };
9
+ password: (value: string) => {
10
+ message: string;
11
+ result: boolean;
12
+ };
13
+ };
1
14
  export declare const format: {
2
15
  /**
3
16
  * 숫자에 3자리마다 콤마(,) 추가
@@ -65,5 +78,18 @@ declare const _default: {
65
78
  time: (sec: number) => string;
66
79
  diffProperties: (prev: any, next: any) => any;
67
80
  };
81
+ validate: {
82
+ /**
83
+ * 아이디 검증
84
+ */
85
+ id: (value: string) => {
86
+ message: string;
87
+ result: boolean;
88
+ };
89
+ password: (value: string) => {
90
+ message: string;
91
+ result: boolean;
92
+ };
93
+ };
68
94
  };
69
95
  export default _default;
package/dist/util.js CHANGED
@@ -1,6 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get = exports.feature = exports.is = exports.format = void 0;
3
+ exports.get = exports.feature = exports.is = exports.format = exports.validate = void 0;
4
+ exports.validate = {
5
+ /**
6
+ * 아이디 검증
7
+ */
8
+ id: (value) => {
9
+ let message = "";
10
+ let result = false;
11
+ value = value.trim();
12
+ if (value.length === 0) {
13
+ message = "아이디를 입력해주세요.";
14
+ result = false;
15
+ }
16
+ else if (value.length < 5 || value.length >= 50) {
17
+ message = "아이디는 5자 이상 50자 미만이어야 합니다.";
18
+ result = false;
19
+ }
20
+ else if (!/^[a-z]/.test(value)) {
21
+ message = "아이디는 영소문자로 시작해야 합니다.";
22
+ result = false;
23
+ }
24
+ else {
25
+ message = "";
26
+ result = true;
27
+ }
28
+ return { message, result };
29
+ },
30
+ password: (value) => {
31
+ let message = "";
32
+ let result = false;
33
+ value = value.trim();
34
+ if (value.length === 0) {
35
+ message = "비밀번호를 입력해주세요.";
36
+ result = false;
37
+ }
38
+ else if (value.length < 6 || value.length > 20) {
39
+ message = "비밀번호는 6자 이상 20자 이하이어야 합니다.";
40
+ result = false;
41
+ }
42
+ else if (!/^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!@#$%^&*()_+|<>?:{}])/.test(value)) {
43
+ message = "비밀번호는 영문, 숫자, 특수문자를 포함해야 합니다.";
44
+ result = false;
45
+ }
46
+ else {
47
+ message = "";
48
+ result = true;
49
+ }
50
+ return { message, result };
51
+ }
52
+ };
4
53
  exports.format = {
5
54
  /**
6
55
  * 숫자에 3자리마다 콤마(,) 추가
@@ -200,5 +249,6 @@ exports.default = {
200
249
  format: exports.format,
201
250
  is: exports.is,
202
251
  feature: exports.feature,
203
- get: exports.get
252
+ get: exports.get,
253
+ validate: exports.validate,
204
254
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkup-lib",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "링크업 패키지",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,6 +13,9 @@
13
13
  "files": [
14
14
  "dist"
15
15
  ],
16
+ "browser": {
17
+ "sharp": false
18
+ },
16
19
  "scripts": {
17
20
  "build": "tsc",
18
21
  "prepublishOnly": "npm run build",
@@ -25,13 +28,33 @@
25
28
  "license": "MIT",
26
29
  "devDependencies": {
27
30
  "@types/node": "^25.0.3",
31
+ "@types/react": "^19.2.7",
32
+ "@types/react-dom": "^19.2.3",
33
+ "antd": "^6.1.4",
34
+ "autoprefixer": "^10.4.23",
35
+ "postcss": "^8.5.6",
36
+ "react": "^19.2.3",
37
+ "react-dom": "^19.2.3",
38
+ "tailwindcss": "^3.4.19",
28
39
  "typescript": "^5.9.3"
29
40
  },
30
41
  "dependencies": {
42
+ "@ant-design/nextjs-registry": "^1.3.0",
31
43
  "@aws-sdk/client-s3": "^3.962.0",
44
+ "@tanstack/react-query": "^5.90.16",
45
+ "ahooks": "^3.9.6",
32
46
  "axios": "^1.13.2",
33
47
  "dayjs": "^1.11.19",
48
+ "jotai": "^2.16.1",
34
49
  "mysql2": "^3.16.0",
50
+ "next-auth": "^4.24.13",
51
+ "react-error-boundary": "^6.0.2",
52
+ "react-icons": "^5.5.0",
35
53
  "sharp": "^0.34.5"
54
+ },
55
+ "peerDependencies": {
56
+ "antd": ">=5.0.0",
57
+ "react": ">=16.8.0",
58
+ "react-dom": ">=16.8.0"
36
59
  }
37
60
  }