@pisodev/test-component-library 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Anchor/index.ts +1 -1
- package/components/Anchor/index.web.ts +2 -0
- package/components/index.web.ts +8 -0
- package/components/theme/ThemeContext.ts +15 -0
- package/components/theme/ThemeProvider.native.tsx +36 -0
- package/components/theme/ThemeProvider.web.tsx +67 -0
- package/components/theme/colors.ts +81 -0
- package/components/theme/colors.types.ts +48 -0
- package/components/theme/index.ts +4 -0
- package/components/theme/index.web.ts +4 -0
- package/components/theme/useTheme.ts +12 -0
- package/dist/Anchor/index.d.ts +1 -1
- package/dist/Anchor/index.web.d.ts +2 -0
- package/dist/index.esm.js +7 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.web.d.ts +3 -0
- package/dist/theme/ThemeContext.d.ts +7 -0
- package/dist/theme/ThemeProvider.native.d.ts +8 -0
- package/dist/theme/ThemeProvider.web.d.ts +7 -0
- package/dist/theme/colors.d.ts +3 -0
- package/dist/theme/colors.types.d.ts +43 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.web.d.ts +4 -0
- package/dist/theme/useTheme.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Anchor } from './Anchor';
|
|
1
|
+
export { Anchor } from './Anchor.native';
|
|
2
2
|
export type { AnchorProps } from './Anchor.types';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { Theme, ThemeMode } from './colors.types';
|
|
3
|
+
import { lightTheme } from './colors';
|
|
4
|
+
|
|
5
|
+
export interface ThemeContextType {
|
|
6
|
+
theme: Theme;
|
|
7
|
+
mode: ThemeMode;
|
|
8
|
+
setMode: (mode: ThemeMode) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ThemeContext = createContext<ThemeContextType>({
|
|
12
|
+
theme: lightTheme,
|
|
13
|
+
mode: 'light',
|
|
14
|
+
setMode: () => {},
|
|
15
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { useState, ReactNode } from 'react';
|
|
2
|
+
import { useColorScheme } from 'react-native';
|
|
3
|
+
import { ThemeContext } from './ThemeContext';
|
|
4
|
+
import { ThemeMode } from './colors.types';
|
|
5
|
+
import { lightTheme, darkTheme } from './colors';
|
|
6
|
+
|
|
7
|
+
export interface ThemeProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
initialMode?: ThemeMode;
|
|
10
|
+
followSystem?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
14
|
+
children,
|
|
15
|
+
initialMode,
|
|
16
|
+
followSystem = true,
|
|
17
|
+
}) => {
|
|
18
|
+
const systemColorScheme = useColorScheme();
|
|
19
|
+
const [manualMode, setManualMode] = useState<ThemeMode | null>(
|
|
20
|
+
initialMode || null
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const mode =
|
|
24
|
+
manualMode || (followSystem && systemColorScheme) || 'light';
|
|
25
|
+
const theme = mode === 'light' ? lightTheme : darkTheme;
|
|
26
|
+
|
|
27
|
+
const setMode = (newMode: ThemeMode) => {
|
|
28
|
+
setManualMode(newMode);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<ThemeContext.Provider value={{ theme, mode, setMode }}>
|
|
33
|
+
{children}
|
|
34
|
+
</ThemeContext.Provider>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { useState, useEffect, ReactNode } from 'react';
|
|
2
|
+
import { ThemeContext } from './ThemeContext';
|
|
3
|
+
import { ThemeMode } from './colors.types';
|
|
4
|
+
import { lightTheme, darkTheme } from './colors';
|
|
5
|
+
|
|
6
|
+
export interface ThemeProviderProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
initialMode?: ThemeMode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
12
|
+
children,
|
|
13
|
+
initialMode = 'light',
|
|
14
|
+
}) => {
|
|
15
|
+
const [mode, setMode] = useState<ThemeMode>(initialMode);
|
|
16
|
+
const theme = mode === 'light' ? lightTheme : darkTheme;
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
// HTML 클래스 업데이트
|
|
20
|
+
document.documentElement.classList.remove('light', 'dark');
|
|
21
|
+
document.documentElement.classList.add(mode);
|
|
22
|
+
|
|
23
|
+
// CSS Variables 업데이트
|
|
24
|
+
const root = document.documentElement;
|
|
25
|
+
|
|
26
|
+
// Gray colors
|
|
27
|
+
root.style.setProperty('--gray-50', theme.colors.gray[50]);
|
|
28
|
+
root.style.setProperty('--gray-100', theme.colors.gray[100]);
|
|
29
|
+
root.style.setProperty('--gray-200', theme.colors.gray[200]);
|
|
30
|
+
root.style.setProperty('--gray-400', theme.colors.gray[400]);
|
|
31
|
+
root.style.setProperty('--gray-600', theme.colors.gray[600]);
|
|
32
|
+
root.style.setProperty('--gray-800', theme.colors.gray[800]);
|
|
33
|
+
root.style.setProperty('--gray-900', theme.colors.gray[900]);
|
|
34
|
+
|
|
35
|
+
// Green colors
|
|
36
|
+
root.style.setProperty('--green-400', theme.colors.green[400]);
|
|
37
|
+
root.style.setProperty('--green-500', theme.colors.green[500]);
|
|
38
|
+
root.style.setProperty('--green-600', theme.colors.green[600]);
|
|
39
|
+
|
|
40
|
+
// Blue colors
|
|
41
|
+
root.style.setProperty('--blue-400', theme.colors.blue[400]);
|
|
42
|
+
root.style.setProperty('--blue-500', theme.colors.blue[500]);
|
|
43
|
+
root.style.setProperty('--blue-600', theme.colors.blue[600]);
|
|
44
|
+
|
|
45
|
+
// Red colors
|
|
46
|
+
root.style.setProperty('--red-400', theme.colors.red[400]);
|
|
47
|
+
root.style.setProperty('--red-500', theme.colors.red[500]);
|
|
48
|
+
root.style.setProperty('--red-600', theme.colors.red[600]);
|
|
49
|
+
|
|
50
|
+
// Semantic colors
|
|
51
|
+
root.style.setProperty('--color-info', theme.semantic.info);
|
|
52
|
+
root.style.setProperty('--color-success', theme.semantic.success);
|
|
53
|
+
root.style.setProperty('--color-error', theme.semantic.error);
|
|
54
|
+
root.style.setProperty('--color-warning', theme.semantic.warning);
|
|
55
|
+
|
|
56
|
+
// Paper colors
|
|
57
|
+
root.style.setProperty('--paper-default', theme.paper.default);
|
|
58
|
+
root.style.setProperty('--paper-neutral', theme.paper.neutral);
|
|
59
|
+
root.style.setProperty('--paper-dialog', theme.paper.dialog);
|
|
60
|
+
}, [mode, theme]);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<ThemeContext.Provider value={{ theme, mode, setMode }}>
|
|
64
|
+
{children}
|
|
65
|
+
</ThemeContext.Provider>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Theme } from './colors.types';
|
|
2
|
+
|
|
3
|
+
export const lightTheme: Theme = {
|
|
4
|
+
colors: {
|
|
5
|
+
gray: {
|
|
6
|
+
50: '#F6F8FA',
|
|
7
|
+
100: '#EEF0F2',
|
|
8
|
+
200: '#E6E8EA',
|
|
9
|
+
400: '#CED0D2',
|
|
10
|
+
600: '#86888A',
|
|
11
|
+
800: '#2C2E30',
|
|
12
|
+
900: '#0C0E10',
|
|
13
|
+
},
|
|
14
|
+
green: {
|
|
15
|
+
400: '#18C792',
|
|
16
|
+
500: '#16B383',
|
|
17
|
+
600: '#12976F',
|
|
18
|
+
},
|
|
19
|
+
blue: {
|
|
20
|
+
400: '#1473FF',
|
|
21
|
+
500: '#1267E6',
|
|
22
|
+
600: '#0F57C2',
|
|
23
|
+
},
|
|
24
|
+
red: {
|
|
25
|
+
400: '#EB4242',
|
|
26
|
+
500: '#D43B3B',
|
|
27
|
+
600: '#B33232',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
semantic: {
|
|
31
|
+
info: '#1473FF',
|
|
32
|
+
success: '#18C792',
|
|
33
|
+
error: '#EB4242',
|
|
34
|
+
warning: '#F0B800',
|
|
35
|
+
},
|
|
36
|
+
paper: {
|
|
37
|
+
default: '#FFFFFF',
|
|
38
|
+
neutral: '#F6F8FA',
|
|
39
|
+
dialog: '#FFFFFF',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const darkTheme: Theme = {
|
|
44
|
+
colors: {
|
|
45
|
+
gray: {
|
|
46
|
+
50: '#1A1C1E',
|
|
47
|
+
100: '#282A2C',
|
|
48
|
+
200: '#36383A',
|
|
49
|
+
400: '#525456',
|
|
50
|
+
600: '#888A8C',
|
|
51
|
+
800: '#CCCED0',
|
|
52
|
+
900: '#FFFFFF',
|
|
53
|
+
},
|
|
54
|
+
green: {
|
|
55
|
+
400: '#1EEEAF',
|
|
56
|
+
500: '#54F2C2',
|
|
57
|
+
600: '#73F4CD',
|
|
58
|
+
},
|
|
59
|
+
blue: {
|
|
60
|
+
400: '#1473FF',
|
|
61
|
+
500: '#4C95FF',
|
|
62
|
+
600: '#6DA8FF',
|
|
63
|
+
},
|
|
64
|
+
red: {
|
|
65
|
+
400: '#FF4848',
|
|
66
|
+
500: '#FF7474',
|
|
67
|
+
600: '#FF8E8E',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
semantic: {
|
|
71
|
+
info: '#1473FF',
|
|
72
|
+
success: '#1EEEAF',
|
|
73
|
+
error: '#FF4848',
|
|
74
|
+
warning: '#FFC400',
|
|
75
|
+
},
|
|
76
|
+
paper: {
|
|
77
|
+
default: '#0C0E10',
|
|
78
|
+
neutral: '#0C0E10',
|
|
79
|
+
dialog: '#1A1C1E',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// 간소화된 컬러 타입 (예시용)
|
|
2
|
+
export interface ColorScale {
|
|
3
|
+
gray: {
|
|
4
|
+
50: string;
|
|
5
|
+
100: string;
|
|
6
|
+
200: string;
|
|
7
|
+
400: string;
|
|
8
|
+
600: string;
|
|
9
|
+
800: string;
|
|
10
|
+
900: string;
|
|
11
|
+
};
|
|
12
|
+
green: {
|
|
13
|
+
400: string;
|
|
14
|
+
500: string;
|
|
15
|
+
600: string;
|
|
16
|
+
};
|
|
17
|
+
blue: {
|
|
18
|
+
400: string;
|
|
19
|
+
500: string;
|
|
20
|
+
600: string;
|
|
21
|
+
};
|
|
22
|
+
red: {
|
|
23
|
+
400: string;
|
|
24
|
+
500: string;
|
|
25
|
+
600: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SemanticColors {
|
|
30
|
+
info: string;
|
|
31
|
+
success: string;
|
|
32
|
+
error: string;
|
|
33
|
+
warning: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface PaperColors {
|
|
37
|
+
default: string;
|
|
38
|
+
neutral: string;
|
|
39
|
+
dialog: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Theme {
|
|
43
|
+
colors: ColorScale;
|
|
44
|
+
semantic: SemanticColors;
|
|
45
|
+
paper: PaperColors;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ThemeMode = 'light' | 'dark';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { ThemeContext } from './ThemeContext';
|
|
3
|
+
|
|
4
|
+
export const useTheme = () => {
|
|
5
|
+
const context = useContext(ThemeContext);
|
|
6
|
+
|
|
7
|
+
if (!context) {
|
|
8
|
+
throw new Error('useTheme must be used within ThemeProvider');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return context;
|
|
12
|
+
};
|
package/dist/Anchor/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Anchor } from './Anchor';
|
|
1
|
+
export { Anchor } from './Anchor.native';
|
|
2
2
|
export type { AnchorProps } from './Anchor.types';
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { StatusBar as StatusBar$1 } from 'react-native';
|
|
3
2
|
|
|
4
3
|
function styleInject(css, ref) {
|
|
5
4
|
if ( ref === void 0 ) ref = {};
|
|
@@ -54,8 +53,13 @@ const Tooltip = ({ children, content, position = 'top', }) => {
|
|
|
54
53
|
isVisible && (React.createElement("div", { className: `${styles.tooltip} ${styles[position]}` }, content))));
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
// 웹에서는 StatusBar 개념이 없음
|
|
57
|
+
const StatusBar = (_props) => {
|
|
58
|
+
if (process.env.NODE_ENV === 'development') {
|
|
59
|
+
console.warn('StatusBar is only available on React Native. ' +
|
|
60
|
+
'For web, you can use <meta name="theme-color"> in your HTML.');
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
59
63
|
};
|
|
60
64
|
|
|
61
65
|
export { Anchor, StatusBar, Tooltip };
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../node_modules/style-inject/dist/style-inject.es.js","../components/Anchor/Anchor.web.tsx","../components/Tooltip/Tooltip.tsx","../components/StatusBar/
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../node_modules/style-inject/dist/style-inject.es.js","../components/Anchor/Anchor.web.tsx","../components/Tooltip/Tooltip.tsx","../components/StatusBar/index.web.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from 'react';\nimport { AnchorProps } from './Anchor.types';\nimport styles from './Anchor.web.module.scss';\n\nexport const Anchor: React.FC<AnchorProps> = ({\n children,\n href,\n rel,\n title,\n target = '_self',\n className = '',\n onPress,\n}) => {\n const anchorClasses = [styles.anchor, className].filter(Boolean).join(' ');\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n if (onPress) {\n e.preventDefault();\n onPress();\n }\n };\n\n return (\n <a\n href={href}\n rel={rel}\n title={title}\n target={target}\n className={anchorClasses}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n};\n","import React, { useState } from 'react';\nimport { TooltipProps } from './Tooltip.types';\nimport styles from './Tooltip.module.scss';\n\nexport const Tooltip: React.FC<TooltipProps> = ({\n children,\n content,\n position = 'top',\n}) => {\n const [isVisible, setIsVisible] = useState(false);\n\n return (\n <div\n className={styles.tooltipWrapper}\n onMouseEnter={() => setIsVisible(true)}\n onMouseLeave={() => setIsVisible(false)}\n >\n {children}\n {isVisible && (\n <div className={`${styles.tooltip} ${styles[position]}`}>\n {content}\n </div>\n )}\n </div>\n );\n};\n","import { StatusBarProps } from './StatusBar.types';\n\n// 웹에서는 StatusBar 개념이 없음\nexport const StatusBar = (_props: StatusBarProps) => {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'StatusBar is only available on React Native. ' +\n 'For web, you can use <meta name=\"theme-color\"> in your HTML.'\n );\n }\n return null;\n};\n\nexport type { StatusBarProps };\n"],"names":["styles"],"mappings":";;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,O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AAE;QACX;AACF,IAAA,CAAC;AAED,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EACE,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EAAA,EAEnB,QAAQ,CACP;AAER;;;;;;AC9BO,MAAM,OAAO,GAA2B,CAAC,EAC9C,QAAQ,EACR,OAAO,EACP,QAAQ,GAAG,KAAK,GACjB,KAAI;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEjD,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,MAAM,CAAC,cAAc,EAChC,YAAY,EAAE,MAAM,YAAY,CAAC,IAAI,CAAC,EACtC,YAAY,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,EAAA;QAEtC,QAAQ;QACR,SAAS,KACR,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,OAAO,CAAA,CAAA,EAAI,MAAM,CAAC,QAAQ,CAAC,CAAA,CAAE,EAAA,EACpD,OAAO,CACJ,CACP,CACG;AAEV;;ACvBA;AACO,MAAM,SAAS,GAAG,CAAC,MAAsB,KAAI;IAClD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,OAAO,CAAC,IAAI,CACV,+CAA+C;AAC/C,YAAA,8DAA8D,CAC/D;IACH;AACA,IAAA,OAAO,IAAI;AACb;;;;","x_google_ignoreList":[0]}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var reactNative = require('react-native');
|
|
5
4
|
|
|
6
5
|
function styleInject(css, ref) {
|
|
7
6
|
if ( ref === void 0 ) ref = {};
|
|
@@ -56,8 +55,13 @@ const Tooltip = ({ children, content, position = 'top', }) => {
|
|
|
56
55
|
isVisible && (React.createElement("div", { className: `${styles.tooltip} ${styles[position]}` }, content))));
|
|
57
56
|
};
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// 웹에서는 StatusBar 개념이 없음
|
|
59
|
+
const StatusBar = (_props) => {
|
|
60
|
+
if (process.env.NODE_ENV === 'development') {
|
|
61
|
+
console.warn('StatusBar is only available on React Native. ' +
|
|
62
|
+
'For web, you can use <meta name="theme-color"> in your HTML.');
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
exports.Anchor = Anchor;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../node_modules/style-inject/dist/style-inject.es.js","../components/Anchor/Anchor.web.tsx","../components/Tooltip/Tooltip.tsx","../components/StatusBar/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../node_modules/style-inject/dist/style-inject.es.js","../components/Anchor/Anchor.web.tsx","../components/Tooltip/Tooltip.tsx","../components/StatusBar/index.web.ts"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from 'react';\nimport { AnchorProps } from './Anchor.types';\nimport styles from './Anchor.web.module.scss';\n\nexport const Anchor: React.FC<AnchorProps> = ({\n children,\n href,\n rel,\n title,\n target = '_self',\n className = '',\n onPress,\n}) => {\n const anchorClasses = [styles.anchor, className].filter(Boolean).join(' ');\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n if (onPress) {\n e.preventDefault();\n onPress();\n }\n };\n\n return (\n <a\n href={href}\n rel={rel}\n title={title}\n target={target}\n className={anchorClasses}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n};\n","import React, { useState } from 'react';\nimport { TooltipProps } from './Tooltip.types';\nimport styles from './Tooltip.module.scss';\n\nexport const Tooltip: React.FC<TooltipProps> = ({\n children,\n content,\n position = 'top',\n}) => {\n const [isVisible, setIsVisible] = useState(false);\n\n return (\n <div\n className={styles.tooltipWrapper}\n onMouseEnter={() => setIsVisible(true)}\n onMouseLeave={() => setIsVisible(false)}\n >\n {children}\n {isVisible && (\n <div className={`${styles.tooltip} ${styles[position]}`}>\n {content}\n </div>\n )}\n </div>\n );\n};\n","import { StatusBarProps } from './StatusBar.types';\n\n// 웹에서는 StatusBar 개념이 없음\nexport const StatusBar = (_props: StatusBarProps) => {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'StatusBar is only available on React Native. ' +\n 'For web, you can use <meta name=\"theme-color\"> in your HTML.'\n );\n }\n return null;\n};\n\nexport type { StatusBarProps };\n"],"names":["styles","useState"],"mappings":";;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,CAAC;;AAEzD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAA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;AAER;;;;;;AC9BO,MAAM,OAAO,GAA2B,CAAC,EAC9C,QAAQ,EACR,OAAO,EACP,QAAQ,GAAG,KAAK,GACjB,KAAI;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;IAEjD,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,MAAM,CAAC,cAAc,EAChC,YAAY,EAAE,MAAM,YAAY,CAAC,IAAI,CAAC,EACtC,YAAY,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,EAAA;QAEtC,QAAQ;QACR,SAAS,KACR,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,OAAO,CAAA,CAAA,EAAI,MAAM,CAAC,QAAQ,CAAC,CAAA,CAAE,EAAA,EACpD,OAAO,CACJ,CACP,CACG;AAEV;;ACvBA;AACO,MAAM,SAAS,GAAG,CAAC,MAAsB,KAAI;IAClD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,OAAO,CAAC,IAAI,CACV,+CAA+C;AAC/C,YAAA,8DAA8D,CAC/D;IACH;AACA,IAAA,OAAO,IAAI;AACb;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeMode } from './colors.types';
|
|
3
|
+
export interface ThemeProviderProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
initialMode?: ThemeMode;
|
|
6
|
+
followSystem?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ColorScale {
|
|
2
|
+
gray: {
|
|
3
|
+
50: string;
|
|
4
|
+
100: string;
|
|
5
|
+
200: string;
|
|
6
|
+
400: string;
|
|
7
|
+
600: string;
|
|
8
|
+
800: string;
|
|
9
|
+
900: string;
|
|
10
|
+
};
|
|
11
|
+
green: {
|
|
12
|
+
400: string;
|
|
13
|
+
500: string;
|
|
14
|
+
600: string;
|
|
15
|
+
};
|
|
16
|
+
blue: {
|
|
17
|
+
400: string;
|
|
18
|
+
500: string;
|
|
19
|
+
600: string;
|
|
20
|
+
};
|
|
21
|
+
red: {
|
|
22
|
+
400: string;
|
|
23
|
+
500: string;
|
|
24
|
+
600: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface SemanticColors {
|
|
28
|
+
info: string;
|
|
29
|
+
success: string;
|
|
30
|
+
error: string;
|
|
31
|
+
warning: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PaperColors {
|
|
34
|
+
default: string;
|
|
35
|
+
neutral: string;
|
|
36
|
+
dialog: string;
|
|
37
|
+
}
|
|
38
|
+
export interface Theme {
|
|
39
|
+
colors: ColorScale;
|
|
40
|
+
semantic: SemanticColors;
|
|
41
|
+
paper: PaperColors;
|
|
42
|
+
}
|
|
43
|
+
export type ThemeMode = 'light' | 'dark';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useTheme: () => import("./ThemeContext").ThemeContextType;
|