goodchuck-utils 1.4.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/components/dev/ApiLogger.d.ts +136 -0
  2. package/dist/components/dev/ApiLogger.d.ts.map +1 -0
  3. package/dist/components/dev/ApiLogger.js +408 -0
  4. package/dist/components/dev/DevPanel.d.ts +32 -0
  5. package/dist/components/dev/DevPanel.d.ts.map +1 -0
  6. package/dist/components/dev/DevPanel.js +196 -0
  7. package/dist/components/dev/FormDevTools/FormDevTools.d.ts +75 -0
  8. package/dist/components/dev/FormDevTools/FormDevTools.d.ts.map +1 -0
  9. package/dist/components/dev/FormDevTools/FormDevTools.js +218 -0
  10. package/dist/components/dev/FormDevTools/index.d.ts +3 -0
  11. package/dist/components/dev/FormDevTools/index.d.ts.map +1 -0
  12. package/dist/components/dev/FormDevTools/index.js +1 -0
  13. package/dist/components/dev/FormDevTools/styles.d.ts +45 -0
  14. package/dist/components/dev/FormDevTools/styles.d.ts.map +1 -0
  15. package/dist/components/dev/FormDevTools/styles.js +187 -0
  16. package/dist/components/dev/FormDevTools.d.ts +76 -0
  17. package/dist/components/dev/FormDevTools.d.ts.map +1 -0
  18. package/dist/components/dev/FormDevTools.js +399 -0
  19. package/dist/components/dev/IdSelector.d.ts +50 -0
  20. package/dist/components/dev/IdSelector.d.ts.map +1 -0
  21. package/dist/components/dev/IdSelector.js +129 -0
  22. package/dist/components/dev/WindowSizeDisplay.d.ts +44 -0
  23. package/dist/components/dev/WindowSizeDisplay.d.ts.map +1 -0
  24. package/dist/components/dev/WindowSizeDisplay.js +74 -0
  25. package/dist/components/dev/ZIndexDebugger.d.ts +32 -0
  26. package/dist/components/dev/ZIndexDebugger.d.ts.map +1 -0
  27. package/dist/components/dev/ZIndexDebugger.js +184 -0
  28. package/dist/components/dev/index.d.ts +15 -0
  29. package/dist/components/dev/index.d.ts.map +1 -0
  30. package/dist/components/dev/index.js +12 -0
  31. package/dist/components/index.d.ts +8 -0
  32. package/dist/components/index.d.ts.map +1 -0
  33. package/dist/components/index.js +7 -0
  34. package/dist/hooks/index.d.ts +8 -0
  35. package/dist/hooks/index.d.ts.map +1 -1
  36. package/dist/hooks/index.js +11 -0
  37. package/dist/hooks/useCopyToClipboard.d.ts +67 -0
  38. package/dist/hooks/useCopyToClipboard.d.ts.map +1 -0
  39. package/dist/hooks/useCopyToClipboard.js +79 -0
  40. package/dist/hooks/useDebounce.d.ts +47 -0
  41. package/dist/hooks/useDebounce.d.ts.map +1 -0
  42. package/dist/hooks/useDebounce.js +60 -0
  43. package/dist/hooks/useEventListener.d.ts +79 -0
  44. package/dist/hooks/useEventListener.d.ts.map +1 -0
  45. package/dist/hooks/useEventListener.js +33 -0
  46. package/dist/hooks/useIntersectionObserver.d.ts +109 -0
  47. package/dist/hooks/useIntersectionObserver.d.ts.map +1 -0
  48. package/dist/hooks/useIntersectionObserver.js +128 -0
  49. package/dist/hooks/usePrevious.d.ts +58 -0
  50. package/dist/hooks/usePrevious.d.ts.map +1 -0
  51. package/dist/hooks/usePrevious.js +67 -0
  52. package/dist/hooks/useThrottle.d.ts +57 -0
  53. package/dist/hooks/useThrottle.d.ts.map +1 -0
  54. package/dist/hooks/useThrottle.js +80 -0
  55. package/dist/hooks/useToggle.d.ts +49 -0
  56. package/dist/hooks/useToggle.d.ts.map +1 -0
  57. package/dist/hooks/useToggle.js +56 -0
  58. package/dist/hooks/useWindowSize.d.ts +58 -0
  59. package/dist/hooks/useWindowSize.d.ts.map +1 -0
  60. package/dist/hooks/useWindowSize.js +79 -0
  61. package/package.json +23 -2
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ type LoginInfo = {
3
+ id: string;
4
+ pw: string;
5
+ memo: string;
6
+ };
7
+ type Props = {
8
+ onLogin: (email: string, password: string) => Promise<void>;
9
+ infos: LoginInfo[];
10
+ };
11
+ /**
12
+ * 개발용 로그인 shortcut 컴포넌트
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * // Vite 프로젝트
17
+ * import { IdSelector } from 'goodchuck-utils/components/dev';
18
+ *
19
+ * function LoginPage() {
20
+ * const handleLogin = async (email: string, password: string) => {
21
+ * await loginAPI(email, password);
22
+ * };
23
+ *
24
+ * const devAccounts = [
25
+ * { id: 'admin@test.com', pw: 'admin123', memo: '관리자' },
26
+ * { id: 'user@test.com', pw: 'user123', memo: '일반 사용자' },
27
+ * ];
28
+ *
29
+ * return (
30
+ * <div>
31
+ * <LoginForm />
32
+ * {import.meta.env.DEV && (
33
+ * <IdSelector onLogin={handleLogin} infos={devAccounts} />
34
+ * )}
35
+ * </div>
36
+ * );
37
+ * }
38
+ * ```
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * // Create React App 프로젝트
43
+ * {process.env.NODE_ENV === 'development' && (
44
+ * <IdSelector onLogin={handleLogin} infos={devAccounts} />
45
+ * )}
46
+ * ```
47
+ */
48
+ export default function IdSelector({ onLogin, infos }: Props): React.JSX.Element;
49
+ export {};
50
+ //# sourceMappingURL=IdSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdSelector.d.ts","sourceRoot":"","sources":["../../../src/components/dev/IdSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAEvD,KAAK,SAAS,GAAG;IACf,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,qBAuH3D"}
@@ -0,0 +1,129 @@
1
+ import React, { useState } from 'react';
2
+ /**
3
+ * 개발용 로그인 shortcut 컴포넌트
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * // Vite 프로젝트
8
+ * import { IdSelector } from 'goodchuck-utils/components/dev';
9
+ *
10
+ * function LoginPage() {
11
+ * const handleLogin = async (email: string, password: string) => {
12
+ * await loginAPI(email, password);
13
+ * };
14
+ *
15
+ * const devAccounts = [
16
+ * { id: 'admin@test.com', pw: 'admin123', memo: '관리자' },
17
+ * { id: 'user@test.com', pw: 'user123', memo: '일반 사용자' },
18
+ * ];
19
+ *
20
+ * return (
21
+ * <div>
22
+ * <LoginForm />
23
+ * {import.meta.env.DEV && (
24
+ * <IdSelector onLogin={handleLogin} infos={devAccounts} />
25
+ * )}
26
+ * </div>
27
+ * );
28
+ * }
29
+ * ```
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * // Create React App 프로젝트
34
+ * {process.env.NODE_ENV === 'development' && (
35
+ * <IdSelector onLogin={handleLogin} infos={devAccounts} />
36
+ * )}
37
+ * ```
38
+ */
39
+ export default function IdSelector({ onLogin, infos }) {
40
+ const [loading, setLoading] = useState(null);
41
+ const [hoveredIndex, setHoveredIndex] = useState(null);
42
+ const [hoveredButton, setHoveredButton] = useState(null);
43
+ const handleQuickLogin = async (info, index) => {
44
+ setLoading(index);
45
+ try {
46
+ await onLogin(info.id, info.pw);
47
+ }
48
+ finally {
49
+ setLoading(null);
50
+ }
51
+ };
52
+ const containerStyle = {
53
+ position: 'fixed',
54
+ top: '50%',
55
+ right: '16px',
56
+ transform: 'translateY(-50%)',
57
+ display: 'flex',
58
+ flexDirection: 'column',
59
+ gap: '12px',
60
+ padding: '16px',
61
+ backgroundColor: '#ffffff',
62
+ borderRadius: '12px',
63
+ boxShadow: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
64
+ border: '1px solid #e5e7eb',
65
+ minWidth: '280px',
66
+ zIndex: 9999,
67
+ };
68
+ const headerStyle = {
69
+ color: '#111827',
70
+ fontSize: '14px',
71
+ fontWeight: 'bold',
72
+ paddingBottom: '8px',
73
+ borderBottom: '1px solid #e5e7eb',
74
+ };
75
+ const getCardStyle = (index) => ({
76
+ display: 'flex',
77
+ flexDirection: 'column',
78
+ gap: '8px',
79
+ padding: '12px',
80
+ backgroundColor: '#f9fafb',
81
+ borderRadius: '8px',
82
+ border: hoveredIndex === index ? '1px solid #60a5fa' : '1px solid #e5e7eb',
83
+ transition: 'all 0.2s',
84
+ });
85
+ const getButtonStyle = (index) => ({
86
+ width: '100%',
87
+ padding: '8px 16px',
88
+ backgroundColor: loading === index ? '#9ca3af' : hoveredButton === index ? '#2563eb' : '#3b82f6',
89
+ color: 'white',
90
+ fontWeight: 600,
91
+ borderRadius: '8px',
92
+ border: 'none',
93
+ cursor: loading === index ? 'not-allowed' : 'pointer',
94
+ transition: 'background-color 0.2s',
95
+ });
96
+ const infoContainerStyle = {
97
+ display: 'flex',
98
+ flexDirection: 'column',
99
+ gap: '4px',
100
+ fontSize: '12px',
101
+ color: '#6b7280',
102
+ paddingLeft: '4px',
103
+ paddingRight: '4px',
104
+ };
105
+ const infoRowStyle = {
106
+ display: 'flex',
107
+ alignItems: 'center',
108
+ gap: '8px',
109
+ };
110
+ const labelStyle = {
111
+ fontWeight: 600,
112
+ minWidth: '24px',
113
+ };
114
+ const valueStyle = {
115
+ fontFamily: 'monospace',
116
+ color: '#374151',
117
+ };
118
+ return (React.createElement("div", { style: containerStyle },
119
+ React.createElement("div", { style: headerStyle }, "\uD83D\uDE80 \uAC1C\uBC1C\uC6A9 \uBE60\uB978 \uB85C\uADF8\uC778"),
120
+ infos.map((info, index) => (React.createElement("div", { key: index, style: getCardStyle(index), onMouseEnter: () => setHoveredIndex(index), onMouseLeave: () => setHoveredIndex(null) },
121
+ React.createElement("button", { onClick: () => handleQuickLogin(info, index), disabled: loading === index, style: getButtonStyle(index), onMouseEnter: () => setHoveredButton(index), onMouseLeave: () => setHoveredButton(null) }, loading === index ? '로그인 중...' : info.memo),
122
+ React.createElement("div", { style: infoContainerStyle },
123
+ React.createElement("div", { style: infoRowStyle },
124
+ React.createElement("span", { style: labelStyle }, "ID"),
125
+ React.createElement("span", { style: valueStyle }, info.id)),
126
+ React.createElement("div", { style: infoRowStyle },
127
+ React.createElement("span", { style: labelStyle }, "PW"),
128
+ React.createElement("span", { style: valueStyle }, info.pw))))))));
129
+ }
@@ -0,0 +1,44 @@
1
+ import React, { CSSProperties } from 'react';
2
+ type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
3
+ type Props = {
4
+ /** 표시 위치 (기본값: 'bottom-right') */
5
+ position?: Position;
6
+ /** 커스텀 스타일 */
7
+ style?: CSSProperties;
8
+ };
9
+ /**
10
+ * 현재 윈도우 크기를 화면에 표시하는 개발용 컴포넌트
11
+ * 반응형 디버깅에 유용합니다.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * // Vite 프로젝트
16
+ * import { WindowSizeDisplay } from 'goodchuck-utils/components/dev';
17
+ *
18
+ * function App() {
19
+ * return (
20
+ * <div>
21
+ * {import.meta.env.DEV && <WindowSizeDisplay />}
22
+ * </div>
23
+ * );
24
+ * }
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * // Create React App 프로젝트
30
+ * {process.env.NODE_ENV === 'development' && <WindowSizeDisplay />}
31
+ * ```
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * // 커스텀 스타일 및 위치
36
+ * <WindowSizeDisplay
37
+ * position="top-left"
38
+ * style={{ backgroundColor: 'red', color: 'white' }}
39
+ * />
40
+ * ```
41
+ */
42
+ export default function WindowSizeDisplay({ position, style }: Props): React.JSX.Element;
43
+ export {};
44
+ //# sourceMappingURL=WindowSizeDisplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WindowSizeDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/dev/WindowSizeDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG7C,KAAK,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAE1E,KAAK,KAAK,GAAG;IACX,kCAAkC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,cAAc;IACd,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AASF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EAAE,QAAyB,EAAE,KAAK,EAAE,EAAE,KAAK,qBAmCpF"}
@@ -0,0 +1,74 @@
1
+ import React from 'react';
2
+ import { useWindowSize } from '../../hooks/useWindowSize';
3
+ const positionStyles = {
4
+ 'top-left': { top: 16, left: 16 },
5
+ 'top-right': { top: 16, right: 16 },
6
+ 'bottom-left': { bottom: 16, left: 16 },
7
+ 'bottom-right': { bottom: 16, right: 16 },
8
+ };
9
+ /**
10
+ * 현재 윈도우 크기를 화면에 표시하는 개발용 컴포넌트
11
+ * 반응형 디버깅에 유용합니다.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * // Vite 프로젝트
16
+ * import { WindowSizeDisplay } from 'goodchuck-utils/components/dev';
17
+ *
18
+ * function App() {
19
+ * return (
20
+ * <div>
21
+ * {import.meta.env.DEV && <WindowSizeDisplay />}
22
+ * </div>
23
+ * );
24
+ * }
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * // Create React App 프로젝트
30
+ * {process.env.NODE_ENV === 'development' && <WindowSizeDisplay />}
31
+ * ```
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * // 커스텀 스타일 및 위치
36
+ * <WindowSizeDisplay
37
+ * position="top-left"
38
+ * style={{ backgroundColor: 'red', color: 'white' }}
39
+ * />
40
+ * ```
41
+ */
42
+ export default function WindowSizeDisplay({ position = 'bottom-right', style }) {
43
+ const { width, height } = useWindowSize();
44
+ const containerStyle = {
45
+ position: 'fixed',
46
+ ...positionStyles[position],
47
+ padding: '8px 12px',
48
+ backgroundColor: 'rgba(0, 0, 0, 0.8)',
49
+ color: 'white',
50
+ fontSize: '14px',
51
+ fontFamily: 'monospace',
52
+ borderRadius: '8px',
53
+ boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
54
+ zIndex: 9999,
55
+ backdropFilter: 'blur(4px)',
56
+ ...style,
57
+ };
58
+ const innerStyle = {
59
+ display: 'flex',
60
+ alignItems: 'center',
61
+ gap: '8px',
62
+ };
63
+ return (React.createElement("div", { style: containerStyle },
64
+ React.createElement("div", { style: innerStyle },
65
+ React.createElement("span", { style: { color: '#60a5fa' } }, "W:"),
66
+ React.createElement("span", { style: { fontWeight: 'bold' } },
67
+ width,
68
+ "px"),
69
+ React.createElement("span", { style: { color: '#9ca3af' } }, "\u00D7"),
70
+ React.createElement("span", { style: { color: '#4ade80' } }, "H:"),
71
+ React.createElement("span", { style: { fontWeight: 'bold' } },
72
+ height,
73
+ "px"))));
74
+ }
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ /** 표시 위치 (기본값: 'bottom-left') */
4
+ position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
5
+ };
6
+ /**
7
+ * z-index 값을 시각화하는 개발용 컴포넌트
8
+ * 페이지의 모든 요소의 z-index를 하이라이트하고 목록으로 표시합니다.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * // Vite 프로젝트
13
+ * import { ZIndexDebugger } from 'goodchuck-utils/components/dev';
14
+ *
15
+ * function App() {
16
+ * return (
17
+ * <div>
18
+ * {import.meta.env.DEV && <ZIndexDebugger />}
19
+ * </div>
20
+ * );
21
+ * }
22
+ * ```
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * // Create React App 프로젝트
27
+ * {process.env.NODE_ENV === 'development' && <ZIndexDebugger position="top-right" />}
28
+ * ```
29
+ */
30
+ export default function ZIndexDebugger({ position }: Props): React.JSX.Element;
31
+ export {};
32
+ //# sourceMappingURL=ZIndexDebugger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZIndexDebugger.d.ts","sourceRoot":"","sources":["../../../src/components/dev/ZIndexDebugger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,KAAK,KAAK,GAAG;IACX,iCAAiC;IACjC,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;CACtE,CAAC;AAUF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAwB,EAAE,EAAE,KAAK,qBAsNzE"}
@@ -0,0 +1,184 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ /**
3
+ * z-index 값을 시각화하는 개발용 컴포넌트
4
+ * 페이지의 모든 요소의 z-index를 하이라이트하고 목록으로 표시합니다.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * // Vite 프로젝트
9
+ * import { ZIndexDebugger } from 'goodchuck-utils/components/dev';
10
+ *
11
+ * function App() {
12
+ * return (
13
+ * <div>
14
+ * {import.meta.env.DEV && <ZIndexDebugger />}
15
+ * </div>
16
+ * );
17
+ * }
18
+ * ```
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * // Create React App 프로젝트
23
+ * {process.env.NODE_ENV === 'development' && <ZIndexDebugger position="top-right" />}
24
+ * ```
25
+ */
26
+ export default function ZIndexDebugger({ position = 'bottom-left' }) {
27
+ const [isActive, setIsActive] = useState(false);
28
+ const [elements, setElements] = useState([]);
29
+ const [hoveredElement, setHoveredElement] = useState(null);
30
+ useEffect(() => {
31
+ if (!isActive) {
32
+ setElements([]);
33
+ setHoveredElement(null);
34
+ return;
35
+ }
36
+ const scanElements = () => {
37
+ const allElements = document.querySelectorAll('*');
38
+ const elementsWithZIndex = [];
39
+ allElements.forEach((el) => {
40
+ if (!(el instanceof HTMLElement))
41
+ return;
42
+ const computedStyle = window.getComputedStyle(el);
43
+ const zIndex = computedStyle.zIndex;
44
+ // z-index가 설정된 요소만 수집 (auto가 아닌 경우)
45
+ if (zIndex !== 'auto' && zIndex !== '0') {
46
+ elementsWithZIndex.push({
47
+ element: el,
48
+ zIndex,
49
+ tagName: el.tagName.toLowerCase(),
50
+ id: el.id || undefined,
51
+ className: el.className || undefined,
52
+ });
53
+ }
54
+ });
55
+ // z-index 값으로 정렬 (높은 순)
56
+ elementsWithZIndex.sort((a, b) => {
57
+ const zA = parseInt(a.zIndex) || 0;
58
+ const zB = parseInt(b.zIndex) || 0;
59
+ return zB - zA;
60
+ });
61
+ setElements(elementsWithZIndex);
62
+ };
63
+ scanElements();
64
+ // DOM 변경 감지
65
+ const observer = new MutationObserver(scanElements);
66
+ observer.observe(document.body, {
67
+ childList: true,
68
+ subtree: true,
69
+ attributes: true,
70
+ attributeFilter: ['style', 'class'],
71
+ });
72
+ return () => observer.disconnect();
73
+ }, [isActive]);
74
+ // 호버된 요소 하이라이트
75
+ useEffect(() => {
76
+ if (!hoveredElement)
77
+ return;
78
+ const originalOutline = hoveredElement.style.outline;
79
+ const originalOutlineOffset = hoveredElement.style.outlineOffset;
80
+ hoveredElement.style.outline = '3px solid #f59e0b';
81
+ hoveredElement.style.outlineOffset = '2px';
82
+ return () => {
83
+ hoveredElement.style.outline = originalOutline;
84
+ hoveredElement.style.outlineOffset = originalOutlineOffset;
85
+ };
86
+ }, [hoveredElement]);
87
+ const positionStyles = {
88
+ 'top-left': { top: 16, left: 16 },
89
+ 'top-right': { top: 16, right: 16 },
90
+ 'bottom-left': { bottom: 16, left: 16 },
91
+ 'bottom-right': { bottom: 16, right: 16 },
92
+ };
93
+ const containerStyle = {
94
+ position: 'fixed',
95
+ ...positionStyles[position],
96
+ zIndex: 999999,
97
+ fontFamily: 'system-ui, -apple-system, sans-serif',
98
+ };
99
+ const buttonStyle = {
100
+ padding: '8px 16px',
101
+ backgroundColor: isActive ? '#ef4444' : '#3b82f6',
102
+ color: 'white',
103
+ border: 'none',
104
+ borderRadius: '8px',
105
+ cursor: 'pointer',
106
+ fontSize: '13px',
107
+ fontWeight: 600,
108
+ boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
109
+ transition: 'background-color 0.2s',
110
+ };
111
+ const panelStyle = {
112
+ marginTop: '8px',
113
+ backgroundColor: 'white',
114
+ borderRadius: '12px',
115
+ boxShadow: '0 10px 25px rgba(0, 0, 0, 0.15)',
116
+ border: '1px solid #e5e7eb',
117
+ width: '320px',
118
+ maxHeight: '400px',
119
+ overflow: 'hidden',
120
+ display: 'flex',
121
+ flexDirection: 'column',
122
+ };
123
+ const headerStyle = {
124
+ padding: '12px 16px',
125
+ borderBottom: '1px solid #e5e7eb',
126
+ fontWeight: 'bold',
127
+ fontSize: '14px',
128
+ color: '#111827',
129
+ backgroundColor: '#f9fafb',
130
+ };
131
+ const listContainerStyle = {
132
+ overflowY: 'auto',
133
+ maxHeight: '350px',
134
+ };
135
+ const itemStyle = (isHovered) => ({
136
+ padding: '10px 16px',
137
+ borderBottom: '1px solid #f3f4f6',
138
+ cursor: 'pointer',
139
+ backgroundColor: isHovered ? '#fef3c7' : 'white',
140
+ transition: 'background-color 0.15s',
141
+ });
142
+ const zIndexBadgeStyle = {
143
+ display: 'inline-block',
144
+ padding: '2px 8px',
145
+ backgroundColor: '#dbeafe',
146
+ color: '#1e40af',
147
+ borderRadius: '6px',
148
+ fontSize: '12px',
149
+ fontWeight: 'bold',
150
+ fontFamily: 'monospace',
151
+ marginRight: '8px',
152
+ };
153
+ const tagStyle = {
154
+ fontSize: '12px',
155
+ color: '#6b7280',
156
+ fontFamily: 'monospace',
157
+ };
158
+ const getElementLabel = (info) => {
159
+ let label = info.tagName;
160
+ if (info.id)
161
+ label += `#${info.id}`;
162
+ if (info.className && typeof info.className === 'string') {
163
+ const classes = info.className.split(' ').filter(Boolean).slice(0, 2);
164
+ if (classes.length > 0) {
165
+ label += `.${classes.join('.')}`;
166
+ }
167
+ }
168
+ return label.length > 40 ? label.slice(0, 40) + '...' : label;
169
+ };
170
+ const handleElementClick = (element) => {
171
+ element.scrollIntoView({ behavior: 'smooth', block: 'center' });
172
+ };
173
+ return (React.createElement("div", { style: containerStyle },
174
+ React.createElement("button", { onClick: () => setIsActive(!isActive), style: buttonStyle, onMouseEnter: (e) => (e.currentTarget.style.backgroundColor = isActive ? '#dc2626' : '#2563eb'), onMouseLeave: (e) => (e.currentTarget.style.backgroundColor = isActive ? '#ef4444' : '#3b82f6') }, isActive ? '🔴 Z-Index 디버거 종료' : '🔍 Z-Index 디버거'),
175
+ isActive && (React.createElement("div", { style: panelStyle },
176
+ React.createElement("div", { style: headerStyle },
177
+ "\uD83D\uDCCA Z-Index \uBAA9\uB85D (",
178
+ elements.length,
179
+ "\uAC1C)"),
180
+ React.createElement("div", { style: listContainerStyle }, elements.length === 0 ? (React.createElement("div", { style: { padding: '20px', textAlign: 'center', color: '#9ca3af', fontSize: '13px' } }, "z-index\uAC00 \uC124\uC815\uB41C \uC694\uC18C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")) : (elements.map((info, index) => (React.createElement("div", { key: index, style: itemStyle(hoveredElement === info.element), onMouseEnter: () => setHoveredElement(info.element), onMouseLeave: () => setHoveredElement(null), onClick: () => handleElementClick(info.element) },
181
+ React.createElement("div", null,
182
+ React.createElement("span", { style: zIndexBadgeStyle }, info.zIndex),
183
+ React.createElement("span", { style: tagStyle }, getElementLabel(info))))))))))));
184
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Development Components
3
+ *
4
+ * 개발 환경에서 사용하는 유틸리티 컴포넌트들입니다.
5
+ * production 환경에서는 제외하는 것을 권장합니다.
6
+ */
7
+ export { default as IdSelector } from './IdSelector';
8
+ export { default as WindowSizeDisplay } from './WindowSizeDisplay';
9
+ export { default as DevPanel } from './DevPanel';
10
+ export { default as ZIndexDebugger } from './ZIndexDebugger';
11
+ export { default as ApiLogger, addApiLog, clearApiLogs } from './ApiLogger';
12
+ export { default as FormDevTools } from './FormDevTools';
13
+ export type { FormDevToolsProps, FormState as FormDevToolsFormState } from './FormDevTools';
14
+ export type { ApiLogEntry } from './ApiLogger';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dev/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,SAAS,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5F,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Development Components
3
+ *
4
+ * 개발 환경에서 사용하는 유틸리티 컴포넌트들입니다.
5
+ * production 환경에서는 제외하는 것을 권장합니다.
6
+ */
7
+ export { default as IdSelector } from './IdSelector';
8
+ export { default as WindowSizeDisplay } from './WindowSizeDisplay';
9
+ export { default as DevPanel } from './DevPanel';
10
+ export { default as ZIndexDebugger } from './ZIndexDebugger';
11
+ export { default as ApiLogger, addApiLog, clearApiLogs } from './ApiLogger';
12
+ export { default as FormDevTools } from './FormDevTools';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * React Components
3
+ *
4
+ * Note: Requires React and React DOM as peer dependencies.
5
+ * Note: Uses Tailwind CSS classes - ensure Tailwind is configured in your project.
6
+ */
7
+ export * from './dev';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * React Components
3
+ *
4
+ * Note: Requires React and React DOM as peer dependencies.
5
+ * Note: Uses Tailwind CSS classes - ensure Tailwind is configured in your project.
6
+ */
7
+ export * from './dev';
@@ -8,4 +8,12 @@ export * from './useLocalStorage';
8
8
  export * from './useSessionStorage';
9
9
  export * from './useMediaQuery';
10
10
  export * from './useClickOutside';
11
+ export * from './useDebounce';
12
+ export * from './useToggle';
13
+ export * from './useCopyToClipboard';
14
+ export * from './useWindowSize';
15
+ export * from './usePrevious';
16
+ export * from './useThrottle';
17
+ export * from './useIntersectionObserver';
18
+ export * from './useEventListener';
11
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAG9B,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAG1C,cAAc,oBAAoB,CAAC"}
@@ -10,3 +10,14 @@ export * from './useSessionStorage';
10
10
  // UI/UX hooks
11
11
  export * from './useMediaQuery';
12
12
  export * from './useClickOutside';
13
+ // Utility hooks
14
+ export * from './useDebounce';
15
+ export * from './useToggle';
16
+ export * from './useCopyToClipboard';
17
+ export * from './useWindowSize';
18
+ export * from './usePrevious';
19
+ // Performance hooks
20
+ export * from './useThrottle';
21
+ export * from './useIntersectionObserver';
22
+ // Event hooks
23
+ export * from './useEventListener';