@0610studio/zs-ui 0.0.13 → 0.0.15
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/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -1
- package/build/index.js.map +1 -1
- package/build/model/index.d.ts +4 -0
- package/build/model/index.d.ts.map +1 -0
- package/build/model/index.js +4 -0
- package/build/model/index.js.map +1 -0
- package/build/types/index.d.ts +9 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +2 -0
- package/build/types/index.js.map +1 -0
- package/package.json +6 -1
- package/.eslintrc.js +0 -5
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +0 -43
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/kr/co/studio0610/zsui/ZsUiModule.kt +0 -47
- package/android/src/main/java/kr/co/studio0610/zsui/ZsUiView.kt +0 -7
- package/expo-module.config.json +0 -9
- package/ios/ZsUi.podspec +0 -27
- package/ios/ZsUiModule.swift +0 -44
- package/ios/ZsUiView.swift +0 -7
- package/src/ZsUi.types.ts +0 -7
- package/src/ZsUiModule.ts +0 -5
- package/src/ZsUiModule.web.ts +0 -13
- package/src/ZsUiView.tsx +0 -11
- package/src/ZsUiView.web.tsx +0 -11
- package/src/assets/SvgCheck.tsx +0 -16
- package/src/assets/SvgX.tsx +0 -22
- package/src/index.ts +0 -52
- package/src/model/types.ts +0 -104
- package/src/model/useNotify.ts +0 -14
- package/src/model/useNotifyProvider.tsx +0 -259
- package/src/model/useThemeProvider.tsx +0 -99
- package/src/model/utils.ts +0 -31
- package/src/notify/AlertNotify/index.tsx +0 -172
- package/src/notify/BottomSheetNotify/index.tsx +0 -177
- package/src/notify/BottomSheetNotify/model/useBottomSheetNotify.tsx +0 -270
- package/src/notify/BottomSheetNotify/types/index.ts +0 -3
- package/src/notify/BottomSheetNotify/ui/BSTextInput/index.tsx +0 -28
- package/src/notify/BottomSheetNotify/ui/ContentsComponent/index.tsx +0 -86
- package/src/notify/LoadingNotify/index.tsx +0 -46
- package/src/notify/PopOver/PopOverButton.tsx +0 -56
- package/src/notify/PopOver/PopOverMenu.tsx +0 -95
- package/src/notify/SnackbarNotify/index.tsx +0 -43
- package/src/notify/SnackbarNotify/ui/SnackbarItem.tsx +0 -103
- package/src/notify/index.ts +0 -21
- package/src/notify/ui/ModalBackground.tsx +0 -46
- package/src/theme/index.ts +0 -3
- package/src/theme/palette.ts +0 -384
- package/src/theme/types.ts +0 -170
- package/src/theme/typography.ts +0 -199
- package/src/ui/ThrottleButton/index.tsx +0 -119
- package/src/ui/ZSBottomButton/index.tsx +0 -151
- package/src/ui/ZSContainer/index.tsx +0 -92
- package/src/ui/ZSPressable/index.tsx +0 -82
- package/src/ui/ZSRadioGroup/index.tsx +0 -141
- package/src/ui/ZSText/index.tsx +0 -22
- package/src/ui/ZSTextField/index.tsx +0 -200
- package/src/ui/ZSTextField/ui/ButtonClose.tsx +0 -20
- package/src/ui/ZSTextField/ui/ErrorComponent.tsx +0 -25
- package/src/ui/ZSView/index.tsx +0 -30
- package/src/ui/atoms/AnimatedWrapper.tsx +0 -90
- package/src/ui/atoms/ScrollViewAtom.tsx +0 -17
- package/src/ui/atoms/TextAtom.tsx +0 -15
- package/src/ui/atoms/ViewAtom.tsx +0 -15
- package/src/ui/index.ts +0 -27
- package/src/ui/types.ts +0 -12
- package/tsconfig.json +0 -9
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { BackHandler, Dimensions, LayoutChangeEvent, Pressable } from "react-native";
|
|
3
|
-
import Animated, { FadeInUp, FadeOutUp } from "react-native-reanimated";
|
|
4
|
-
import { useNotify } from "../../model/useNotify";
|
|
5
|
-
import ModalBackground from "../ui/ModalBackground";
|
|
6
|
-
import { PopOverMenuProps } from "../../model/types";
|
|
7
|
-
|
|
8
|
-
// 화면 높이 가져오기
|
|
9
|
-
const WINDOW_HEIGHT = Dimensions.get('window').height;
|
|
10
|
-
|
|
11
|
-
function PopOverMenu({
|
|
12
|
-
px,
|
|
13
|
-
py,
|
|
14
|
-
component
|
|
15
|
-
}: PopOverMenuProps): JSX.Element | null {
|
|
16
|
-
const [isContentVisible, setIsContentVisible] = useState<boolean>(false);
|
|
17
|
-
const [contentWidth, setContentWidth] = useState<number>(0);
|
|
18
|
-
const [contentHeight, setContentHeight] = useState<number>(0);
|
|
19
|
-
const { popOverVisible, setPopOverVisible } = useNotify();
|
|
20
|
-
const timerRef = useRef<number | null>(null);
|
|
21
|
-
|
|
22
|
-
// 뒤로가기 버튼 처리 핸들러
|
|
23
|
-
const handleBackPress = useCallback((): boolean => {
|
|
24
|
-
if (popOverVisible) {
|
|
25
|
-
setIsContentVisible(false);
|
|
26
|
-
setPopOverVisible(false);
|
|
27
|
-
return true; // 뒤로가기 액션을 막음
|
|
28
|
-
}
|
|
29
|
-
return false; // 기본 동작 허용
|
|
30
|
-
}, [popOverVisible, setPopOverVisible]);
|
|
31
|
-
|
|
32
|
-
// 뒤로가기 이벤트 리스너 추가 및 제거
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
const backHandler = BackHandler.addEventListener('hardwareBackPress', handleBackPress);
|
|
35
|
-
|
|
36
|
-
return () => backHandler.remove();
|
|
37
|
-
}, [handleBackPress]);
|
|
38
|
-
|
|
39
|
-
// 레이아웃 크기 계산
|
|
40
|
-
const handleLayout = useCallback((event: LayoutChangeEvent): void => {
|
|
41
|
-
setContentWidth(event.nativeEvent.layout.width || 0);
|
|
42
|
-
setContentHeight(event.nativeEvent.layout.height || 0);
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
45
|
-
// PopOver가 보일 때 콘텐츠를 딜레이 후 보여줌
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (popOverVisible) {
|
|
48
|
-
if (timerRef.current) {
|
|
49
|
-
clearTimeout(timerRef.current);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
timerRef.current = setTimeout(() => {
|
|
53
|
-
setIsContentVisible(true);
|
|
54
|
-
}, 200);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return () => {
|
|
58
|
-
if (timerRef.current) {
|
|
59
|
-
clearTimeout(timerRef.current);
|
|
60
|
-
timerRef.current = null;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}, [popOverVisible]);
|
|
64
|
-
|
|
65
|
-
// 화면 크기에 따른 위치 조정
|
|
66
|
-
const isVerticalOverflow = WINDOW_HEIGHT < (py + contentHeight);
|
|
67
|
-
const isHorizontalOverflow = Dimensions.get('window').width > (px + contentWidth);
|
|
68
|
-
|
|
69
|
-
if (!popOverVisible) return null;
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<ModalBackground isCenter={false} onPress={() => setPopOverVisible(false)}>
|
|
73
|
-
{isContentVisible && (
|
|
74
|
-
<Animated.View
|
|
75
|
-
entering={FadeInUp}
|
|
76
|
-
exiting={FadeOutUp}
|
|
77
|
-
>
|
|
78
|
-
{/* PopOver의 위치를 세밀하게 조정 */}
|
|
79
|
-
<Pressable
|
|
80
|
-
style={{
|
|
81
|
-
position: 'absolute',
|
|
82
|
-
top: py - (isVerticalOverflow ? (contentHeight + 10) : 0),
|
|
83
|
-
left: px - contentWidth + (isHorizontalOverflow ? contentWidth : 0),
|
|
84
|
-
}}
|
|
85
|
-
onLayout={handleLayout}
|
|
86
|
-
>
|
|
87
|
-
{component}
|
|
88
|
-
</Pressable>
|
|
89
|
-
</Animated.View>
|
|
90
|
-
)}
|
|
91
|
-
</ModalBackground>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export default PopOverMenu;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
3
|
-
import { StyleSheet, View } from "react-native";
|
|
4
|
-
import { CustomSnackbarProps } from "../../model/types";
|
|
5
|
-
import SnackbarItem from "./ui/SnackbarItem";
|
|
6
|
-
import { useNotify } from "../../model/useNotify";
|
|
7
|
-
|
|
8
|
-
const SnackbarNotify = ({
|
|
9
|
-
customSnackbar
|
|
10
|
-
}: {
|
|
11
|
-
customSnackbar?: (props: CustomSnackbarProps) => ReactNode
|
|
12
|
-
}) => {
|
|
13
|
-
const { top } = useSafeAreaInsets();
|
|
14
|
-
const { snackItemStack, hideSnackBar } = useNotify();
|
|
15
|
-
|
|
16
|
-
return snackItemStack ? (
|
|
17
|
-
<View style={[styles.container, { paddingTop: top }]}>
|
|
18
|
-
{
|
|
19
|
-
snackItemStack.map((snackItem, index) => {
|
|
20
|
-
return (
|
|
21
|
-
<SnackbarItem
|
|
22
|
-
key={index}
|
|
23
|
-
customSnackbar={customSnackbar}
|
|
24
|
-
snackItem={snackItem}
|
|
25
|
-
hideSnackBar={hideSnackBar}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
</View>
|
|
31
|
-
) : null;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const styles = StyleSheet.create({
|
|
35
|
-
container: {
|
|
36
|
-
zIndex: 9997,
|
|
37
|
-
width: '100%',
|
|
38
|
-
alignItems: 'center',
|
|
39
|
-
position: 'absolute',
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export default SnackbarNotify;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode, useEffect, useCallback } from "react";
|
|
2
|
-
import { Platform, StyleSheet, TouchableOpacity } from "react-native";
|
|
3
|
-
import Animated, { FadeInUp, FadeOutUp } from "react-native-reanimated";
|
|
4
|
-
import { CustomSnackbarProps, SnackItem } from "../../../model/types";
|
|
5
|
-
import ViewAtom from "../../../ui/atoms/ViewAtom";
|
|
6
|
-
import { ZSText } from "../../../ui";
|
|
7
|
-
import { useTheme } from "../../../model/useThemeProvider";
|
|
8
|
-
|
|
9
|
-
const Snackbar = ({
|
|
10
|
-
customSnackbar,
|
|
11
|
-
snackItem,
|
|
12
|
-
hideSnackBar,
|
|
13
|
-
}: {
|
|
14
|
-
customSnackbar?: (props: CustomSnackbarProps) => ReactNode;
|
|
15
|
-
snackItem: SnackItem;
|
|
16
|
-
hideSnackBar: (index: number) => void;
|
|
17
|
-
}) => {
|
|
18
|
-
const { type, message, snackbarDuration } = snackItem;
|
|
19
|
-
const { palette } = useTheme();
|
|
20
|
-
|
|
21
|
-
const closeSnackbar = useCallback(() => {
|
|
22
|
-
hideSnackBar(snackItem.index);
|
|
23
|
-
}, [hideSnackBar, snackItem.index]);
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
const closeTimeout = setTimeout(closeSnackbar, snackbarDuration);
|
|
27
|
-
|
|
28
|
-
return () => clearTimeout(closeTimeout);
|
|
29
|
-
}, [snackbarDuration, closeSnackbar]);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Animated.View
|
|
33
|
-
style={[styles.container, styles.aosShadow, styles.snackbarWrapper]}
|
|
34
|
-
entering={FadeInUp}
|
|
35
|
-
exiting={FadeOutUp}
|
|
36
|
-
>
|
|
37
|
-
<TouchableOpacity
|
|
38
|
-
style={[styles.container, styles.iosShadow, styles.touchable]}
|
|
39
|
-
activeOpacity={1}
|
|
40
|
-
onPress={closeSnackbar}
|
|
41
|
-
>
|
|
42
|
-
{customSnackbar ? (
|
|
43
|
-
customSnackbar({ snackType: type, snackMessage: message })
|
|
44
|
-
) : (
|
|
45
|
-
<ViewAtom
|
|
46
|
-
style={[
|
|
47
|
-
styles.snackBar,
|
|
48
|
-
{ backgroundColor: type === "error" ? palette.background.danger : palette.background.success },
|
|
49
|
-
]}
|
|
50
|
-
>
|
|
51
|
-
<ViewAtom style={styles.messageContainer}>
|
|
52
|
-
<ZSText>{message}</ZSText>
|
|
53
|
-
</ViewAtom>
|
|
54
|
-
</ViewAtom>
|
|
55
|
-
)}
|
|
56
|
-
</TouchableOpacity>
|
|
57
|
-
</Animated.View>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const styles = StyleSheet.create({
|
|
62
|
-
container: {
|
|
63
|
-
borderRadius: 16,
|
|
64
|
-
backgroundColor: "white",
|
|
65
|
-
},
|
|
66
|
-
iosShadow: {
|
|
67
|
-
...Platform.select({
|
|
68
|
-
ios: {
|
|
69
|
-
shadowColor: "rgb(50, 50, 50)",
|
|
70
|
-
shadowOpacity: 0.12,
|
|
71
|
-
shadowRadius: 5,
|
|
72
|
-
shadowOffset: { height: 3, width: 0 },
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
aosShadow: {
|
|
77
|
-
...Platform.select({
|
|
78
|
-
android: { elevation: 5 },
|
|
79
|
-
}),
|
|
80
|
-
},
|
|
81
|
-
snackbarWrapper: {
|
|
82
|
-
width: "94%",
|
|
83
|
-
marginTop: 10,
|
|
84
|
-
},
|
|
85
|
-
touchable: {
|
|
86
|
-
width: "100%",
|
|
87
|
-
},
|
|
88
|
-
snackBar: {
|
|
89
|
-
borderRadius: 16,
|
|
90
|
-
paddingHorizontal: 10,
|
|
91
|
-
paddingVertical: 18,
|
|
92
|
-
flexDirection: "row",
|
|
93
|
-
alignItems: "center",
|
|
94
|
-
width: "100%",
|
|
95
|
-
},
|
|
96
|
-
messageContainer: {
|
|
97
|
-
flex: 1,
|
|
98
|
-
flexDirection: "column",
|
|
99
|
-
marginLeft: 10,
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
export default Snackbar;
|
package/src/notify/index.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import AlertNotify from './AlertNotify';
|
|
2
|
-
import BottomSheetNotify from './BottomSheetNotify';
|
|
3
|
-
import SnackbarNotify from './SnackbarNotify';
|
|
4
|
-
import BSTextInput from './BottomSheetNotify/ui/BSTextInput';
|
|
5
|
-
import * as useNotifyProvider from '../model/useNotifyProvider';
|
|
6
|
-
import { useNotify } from '../model/useNotify';
|
|
7
|
-
import PopOverButton from './PopOver/PopOverButton';
|
|
8
|
-
import PopOverMenu from './PopOver/PopOverMenu';
|
|
9
|
-
import * as types from '../model/types';
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
AlertNotify,
|
|
13
|
-
BottomSheetNotify,
|
|
14
|
-
SnackbarNotify,
|
|
15
|
-
useNotifyProvider,
|
|
16
|
-
useNotify,
|
|
17
|
-
BSTextInput,
|
|
18
|
-
PopOverButton,
|
|
19
|
-
PopOverMenu,
|
|
20
|
-
types,
|
|
21
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { Pressable, StyleSheet } from 'react-native';
|
|
3
|
-
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
4
|
-
import { useTheme } from '../../model/useThemeProvider';
|
|
5
|
-
|
|
6
|
-
interface ModalBackgroundProps {
|
|
7
|
-
isCenter?: boolean;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
onPress?: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function ModalBackground({ isCenter = true, children, onPress }: ModalBackgroundProps) {
|
|
13
|
-
const { palette: { modalBgColor } } = useTheme();
|
|
14
|
-
const styles = useMemo(() => createStyles(modalBgColor), [modalBgColor]);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Animated.View
|
|
18
|
-
style={styles.modalBg}
|
|
19
|
-
entering={FadeIn.duration(50)}
|
|
20
|
-
exiting={FadeOut.duration(50)}
|
|
21
|
-
>
|
|
22
|
-
<Pressable
|
|
23
|
-
style={[styles.fullScreen, isCenter && { justifyContent: 'center', alignItems: 'center' }]}
|
|
24
|
-
onPress={onPress ?? (() => { })}
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
</Pressable>
|
|
28
|
-
</Animated.View>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// 스타일을 생성하는 함수, 모달 배경 색상 인자로 받음
|
|
33
|
-
const createStyles = (modalBgColor: string) =>
|
|
34
|
-
StyleSheet.create({
|
|
35
|
-
modalBg: {
|
|
36
|
-
zIndex: 9997,
|
|
37
|
-
backgroundColor: modalBgColor,
|
|
38
|
-
...StyleSheet.absoluteFillObject,
|
|
39
|
-
},
|
|
40
|
-
// 화면 전체를 덮는 Pressable 스타일 추가
|
|
41
|
-
fullScreen: {
|
|
42
|
-
...StyleSheet.absoluteFillObject,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export default ModalBackground;
|
package/src/theme/index.ts
DELETED
package/src/theme/palette.ts
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import { Theme } from "./types";
|
|
2
|
-
|
|
3
|
-
export const transparency = {
|
|
4
|
-
'0%': '00', // 완전 투명
|
|
5
|
-
'2%': '05',
|
|
6
|
-
'4%': '0A',
|
|
7
|
-
'6%': '0F',
|
|
8
|
-
'8%': '14',
|
|
9
|
-
'10%': '1A',
|
|
10
|
-
'12%': '1F',
|
|
11
|
-
'14%': '24',
|
|
12
|
-
'16%': '29',
|
|
13
|
-
'18%': '2E',
|
|
14
|
-
'20%': '33',
|
|
15
|
-
'22%': '38',
|
|
16
|
-
'24%': '3D',
|
|
17
|
-
'26%': '42',
|
|
18
|
-
'28%': '47',
|
|
19
|
-
'30%': '4D',
|
|
20
|
-
'32%': '52',
|
|
21
|
-
'34%': '57',
|
|
22
|
-
'36%': '5C',
|
|
23
|
-
'38%': '61',
|
|
24
|
-
'40%': '66',
|
|
25
|
-
'42%': '6B',
|
|
26
|
-
'44%': '70',
|
|
27
|
-
'46%': '75',
|
|
28
|
-
'48%': '7A',
|
|
29
|
-
'50%': '80',
|
|
30
|
-
'52%': '85',
|
|
31
|
-
'54%': '8A',
|
|
32
|
-
'56%': '8F',
|
|
33
|
-
'58%': '94',
|
|
34
|
-
'60%': '99',
|
|
35
|
-
'62%': '9E',
|
|
36
|
-
'64%': 'A3',
|
|
37
|
-
'66%': 'A8',
|
|
38
|
-
'68%': 'AD',
|
|
39
|
-
'70%': 'B3',
|
|
40
|
-
'72%': 'B8',
|
|
41
|
-
'74%': 'BD',
|
|
42
|
-
'76%': 'C2',
|
|
43
|
-
'78%': 'C7',
|
|
44
|
-
'80%': 'CC',
|
|
45
|
-
'82%': 'D1',
|
|
46
|
-
'84%': 'D6',
|
|
47
|
-
'86%': 'DB',
|
|
48
|
-
'88%': 'E0',
|
|
49
|
-
'90%': 'E6',
|
|
50
|
-
'92%': 'EB',
|
|
51
|
-
'94%': 'F0',
|
|
52
|
-
'96%': 'F5',
|
|
53
|
-
'98%': 'FA',
|
|
54
|
-
'100%': 'FF' // 완전 불투명
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const MODAL_BG_COLOR = {
|
|
58
|
-
light: '#212B3688',
|
|
59
|
-
dark: '#00000088'
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const SHADOW_COLORS = {
|
|
63
|
-
light: [
|
|
64
|
-
'rgba(0, 0, 0, 0.18)',
|
|
65
|
-
'rgba(0, 0, 0, 0.20)',
|
|
66
|
-
'rgba(0, 0, 0, 0.22)',
|
|
67
|
-
'rgba(0, 0, 0, 0.23)',
|
|
68
|
-
'rgba(0, 0, 0, 0.25)',
|
|
69
|
-
'rgba(0, 0, 0, 0.27)',
|
|
70
|
-
'rgba(0, 0, 0, 0.29)',
|
|
71
|
-
'rgba(0, 0, 0, 0.30)',
|
|
72
|
-
'rgba(0, 0, 0, 0.32)',
|
|
73
|
-
'rgba(0, 0, 0, 0.34)',
|
|
74
|
-
],
|
|
75
|
-
dark: [
|
|
76
|
-
'rgba(255, 255, 255, 0.58)',
|
|
77
|
-
'rgba(255, 255, 255, 0.60)',
|
|
78
|
-
'rgba(255, 255, 255, 0.62)',
|
|
79
|
-
'rgba(255, 255, 255, 0.63)',
|
|
80
|
-
'rgba(255, 255, 255, 0.65)',
|
|
81
|
-
'rgba(255, 255, 255, 0.67)',
|
|
82
|
-
'rgba(255, 255, 255, 0.69)',
|
|
83
|
-
'rgba(255, 255, 255, 0.70)',
|
|
84
|
-
'rgba(255, 255, 255, 0.72)',
|
|
85
|
-
'rgba(255, 255, 255, 0.74)',
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const LIGHT_COLORS = {
|
|
90
|
-
primary: {
|
|
91
|
-
0: '#FFF7E6',
|
|
92
|
-
5: '#FCEDD0',
|
|
93
|
-
10: '#F9DAA3', // p-lighter
|
|
94
|
-
20: '#F5BF64', // p-light
|
|
95
|
-
30: '#fca54c',
|
|
96
|
-
40: '#ff9225',
|
|
97
|
-
50: '#FF9F06', // p-main
|
|
98
|
-
60: '#DD9434', // p-dark
|
|
99
|
-
70: '#AC7326', // p-darker
|
|
100
|
-
80: '#c46500',
|
|
101
|
-
90: '#995400',
|
|
102
|
-
100: '#663800',
|
|
103
|
-
lighter: '#F9DAA3',
|
|
104
|
-
light: '#F5BF64',
|
|
105
|
-
main: '#FF9F06',
|
|
106
|
-
dark: '#DD9434',
|
|
107
|
-
darker: '#AC7326',
|
|
108
|
-
},
|
|
109
|
-
secondary: {
|
|
110
|
-
0: '#E6F7FF',
|
|
111
|
-
5: '#D1EDFF',
|
|
112
|
-
10: '#ADE2FF',
|
|
113
|
-
20: '#85D4FF',
|
|
114
|
-
30: '#5CC5FF',
|
|
115
|
-
40: '#33B7FF',
|
|
116
|
-
50: '#007FFF',
|
|
117
|
-
60: '#0075E6',
|
|
118
|
-
70: '#006ACC',
|
|
119
|
-
80: '#005FB3',
|
|
120
|
-
90: '#005499',
|
|
121
|
-
100: '#003866',
|
|
122
|
-
main: '#007FFF',
|
|
123
|
-
},
|
|
124
|
-
danger: {
|
|
125
|
-
0: '#FFF5F7',
|
|
126
|
-
5: '#FEECF0',
|
|
127
|
-
10: '#FCD4DE',
|
|
128
|
-
20: '#F799B1',
|
|
129
|
-
30: '#F36689',
|
|
130
|
-
40: '#EF3E5E',
|
|
131
|
-
50: '#EB003B',
|
|
132
|
-
60: '#D50136',
|
|
133
|
-
70: '#8D0023',
|
|
134
|
-
80: '#5E0018',
|
|
135
|
-
90: '#2F000C',
|
|
136
|
-
100: '#1A0008',
|
|
137
|
-
main: '#EB003B',
|
|
138
|
-
},
|
|
139
|
-
warning: {
|
|
140
|
-
0: '#FFFBF2',
|
|
141
|
-
5: '#FFF8E9',
|
|
142
|
-
10: '#FFEAC1',
|
|
143
|
-
20: '#FFE2A7',
|
|
144
|
-
30: '#FFD47C',
|
|
145
|
-
40: '#FFC550',
|
|
146
|
-
50: '#FFB724',
|
|
147
|
-
60: '#98690A',
|
|
148
|
-
70: '#66490E',
|
|
149
|
-
80: '#4D370B',
|
|
150
|
-
90: '#332507',
|
|
151
|
-
100: '#1F1805',
|
|
152
|
-
main: '#FFB724',
|
|
153
|
-
},
|
|
154
|
-
success: {
|
|
155
|
-
0: '#F5FBF6',
|
|
156
|
-
5: '#EEF7F0',
|
|
157
|
-
10: '#CEE9D4',
|
|
158
|
-
20: '#B2DCBB',
|
|
159
|
-
30: '#8CCA99',
|
|
160
|
-
40: '#33A14B',
|
|
161
|
-
50: '#008A1E',
|
|
162
|
-
60: '#006E18',
|
|
163
|
-
70: '#005312',
|
|
164
|
-
80: '#00370C',
|
|
165
|
-
90: '#002207',
|
|
166
|
-
100: '#001804',
|
|
167
|
-
main: '#008A1E',
|
|
168
|
-
},
|
|
169
|
-
information: {
|
|
170
|
-
0: '#F3F8FF',
|
|
171
|
-
5: '#E9F0FF',
|
|
172
|
-
10: '#D4E1FF',
|
|
173
|
-
20: '#A9C3FF',
|
|
174
|
-
30: '#7DA4FF',
|
|
175
|
-
40: '#5286FF',
|
|
176
|
-
50: '#2768FF',
|
|
177
|
-
60: '#1F53CC',
|
|
178
|
-
70: '#173E99',
|
|
179
|
-
80: '#0C1F4D',
|
|
180
|
-
90: '#040A1A',
|
|
181
|
-
100: '#020510',
|
|
182
|
-
main: '#2768FF',
|
|
183
|
-
},
|
|
184
|
-
grey: {
|
|
185
|
-
0: '#FFFFFF',
|
|
186
|
-
5: '#F8F8F8',
|
|
187
|
-
10: '#F9FAFB',
|
|
188
|
-
20: '#F4F6F8',
|
|
189
|
-
30: '#DFE3E8',
|
|
190
|
-
40: '#C4CDD5',
|
|
191
|
-
50: '#919EAB',
|
|
192
|
-
60: '#637381',
|
|
193
|
-
70: '#454F5B',
|
|
194
|
-
80: '#1C252E',
|
|
195
|
-
90: '#141A21',
|
|
196
|
-
100: '#000000',
|
|
197
|
-
main: '#F4F6F8',
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const DARK_COLORS = {
|
|
202
|
-
primary: {
|
|
203
|
-
...LIGHT_COLORS.primary,
|
|
204
|
-
main: '#FF9F06',
|
|
205
|
-
},
|
|
206
|
-
secondary: {
|
|
207
|
-
...LIGHT_COLORS.secondary,
|
|
208
|
-
main: '#007FFF',
|
|
209
|
-
},
|
|
210
|
-
danger: {
|
|
211
|
-
...LIGHT_COLORS.danger,
|
|
212
|
-
main: '#EB003B',
|
|
213
|
-
},
|
|
214
|
-
warning: {
|
|
215
|
-
...LIGHT_COLORS.warning,
|
|
216
|
-
main: '#FFB724',
|
|
217
|
-
},
|
|
218
|
-
success: {
|
|
219
|
-
...LIGHT_COLORS.success,
|
|
220
|
-
main: '#008A1E',
|
|
221
|
-
},
|
|
222
|
-
information: {
|
|
223
|
-
...LIGHT_COLORS.information,
|
|
224
|
-
main: '#2768FF',
|
|
225
|
-
},
|
|
226
|
-
grey: {
|
|
227
|
-
0: '#000000',
|
|
228
|
-
5: '#141414', // layer1
|
|
229
|
-
10: '#1F1F1F', // layer2
|
|
230
|
-
20: '#2C2C2C', // neutral
|
|
231
|
-
30: '#3D3D3D',
|
|
232
|
-
40: '#4F4F4F',
|
|
233
|
-
50: '#606060',
|
|
234
|
-
60: '#737373',
|
|
235
|
-
70: '#8C8C8C',
|
|
236
|
-
80: '#bfbfbf',
|
|
237
|
-
90: '#ededed',
|
|
238
|
-
100: '#FFFFFF',
|
|
239
|
-
main: '#2C2C2C',
|
|
240
|
-
},
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
const MAIN_COLORS = {
|
|
244
|
-
light: {
|
|
245
|
-
primary: LIGHT_COLORS.primary.main,
|
|
246
|
-
secondary: LIGHT_COLORS.secondary.main,
|
|
247
|
-
danger: LIGHT_COLORS.danger.main,
|
|
248
|
-
warning: LIGHT_COLORS.warning.main,
|
|
249
|
-
success: LIGHT_COLORS.success.main,
|
|
250
|
-
information: LIGHT_COLORS.information.main,
|
|
251
|
-
grey: LIGHT_COLORS.grey.main
|
|
252
|
-
},
|
|
253
|
-
dark: {
|
|
254
|
-
primary: DARK_COLORS.primary.main,
|
|
255
|
-
secondary: DARK_COLORS.secondary.main,
|
|
256
|
-
danger: DARK_COLORS.danger.main,
|
|
257
|
-
warning: DARK_COLORS.warning.main,
|
|
258
|
-
success: DARK_COLORS.success.main,
|
|
259
|
-
information: DARK_COLORS.information.main,
|
|
260
|
-
grey: DARK_COLORS.grey.main
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const TEXT_COLORS = {
|
|
265
|
-
light: {
|
|
266
|
-
main: LIGHT_COLORS.primary.main,
|
|
267
|
-
primary: LIGHT_COLORS.grey[80],
|
|
268
|
-
secondary: LIGHT_COLORS.grey[60],
|
|
269
|
-
disabled: LIGHT_COLORS.grey[50],
|
|
270
|
-
danger: LIGHT_COLORS.danger[60],
|
|
271
|
-
warning: LIGHT_COLORS.warning[60],
|
|
272
|
-
success: LIGHT_COLORS.success[60],
|
|
273
|
-
information: LIGHT_COLORS.information[60],
|
|
274
|
-
white: '#FFFFFF',
|
|
275
|
-
black: '#000000',
|
|
276
|
-
},
|
|
277
|
-
dark: {
|
|
278
|
-
main: LIGHT_COLORS.primary.main,
|
|
279
|
-
primary: DARK_COLORS.grey[90],
|
|
280
|
-
secondary: DARK_COLORS.grey[70],
|
|
281
|
-
disabled: DARK_COLORS.grey[50],
|
|
282
|
-
danger: DARK_COLORS.danger[30],
|
|
283
|
-
warning: DARK_COLORS.warning[30],
|
|
284
|
-
success: DARK_COLORS.success[30],
|
|
285
|
-
information: DARK_COLORS.information[30],
|
|
286
|
-
white: '#FFFFFF',
|
|
287
|
-
black: '#000000',
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
const BORDER_COLORS = {
|
|
292
|
-
light: {
|
|
293
|
-
box: LIGHT_COLORS.grey[20],
|
|
294
|
-
active: LIGHT_COLORS.primary[50],
|
|
295
|
-
base: LIGHT_COLORS.grey[60],
|
|
296
|
-
danger: LIGHT_COLORS.danger[10],
|
|
297
|
-
warning: LIGHT_COLORS.warning[10],
|
|
298
|
-
success: LIGHT_COLORS.success[10],
|
|
299
|
-
information: LIGHT_COLORS.information[10],
|
|
300
|
-
},
|
|
301
|
-
dark: {
|
|
302
|
-
box: DARK_COLORS.grey[30],
|
|
303
|
-
active: DARK_COLORS.primary[50],
|
|
304
|
-
base: DARK_COLORS.grey[60],
|
|
305
|
-
danger: DARK_COLORS.danger[70],
|
|
306
|
-
warning: DARK_COLORS.warning[70],
|
|
307
|
-
success: DARK_COLORS.success[70],
|
|
308
|
-
information: DARK_COLORS.information[70],
|
|
309
|
-
},
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
const BACKGROUND_COLORS = {
|
|
313
|
-
light: {
|
|
314
|
-
layer1: LIGHT_COLORS.grey[5],
|
|
315
|
-
layer2: LIGHT_COLORS.grey[20],
|
|
316
|
-
neutral: LIGHT_COLORS.grey[30],
|
|
317
|
-
base: LIGHT_COLORS.grey[0],
|
|
318
|
-
danger: LIGHT_COLORS.danger[5],
|
|
319
|
-
warning: LIGHT_COLORS.warning[5],
|
|
320
|
-
success: LIGHT_COLORS.success[5],
|
|
321
|
-
information: LIGHT_COLORS.information[5],
|
|
322
|
-
},
|
|
323
|
-
dark: {
|
|
324
|
-
layer1: DARK_COLORS.grey[5],
|
|
325
|
-
layer2: DARK_COLORS.grey[20],
|
|
326
|
-
neutral: DARK_COLORS.grey[30],
|
|
327
|
-
base: DARK_COLORS.grey[0],
|
|
328
|
-
danger: DARK_COLORS.danger[80],
|
|
329
|
-
warning: DARK_COLORS.warning[80],
|
|
330
|
-
success: DARK_COLORS.success[80],
|
|
331
|
-
information: DARK_COLORS.information[80],
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
const ACTION_COLORS = {
|
|
336
|
-
light: {
|
|
337
|
-
hover: LIGHT_COLORS.primary[60],
|
|
338
|
-
pressed: LIGHT_COLORS.primary[70],
|
|
339
|
-
disable: LIGHT_COLORS.grey[20],
|
|
340
|
-
},
|
|
341
|
-
dark: {
|
|
342
|
-
hover: DARK_COLORS.primary[60],
|
|
343
|
-
pressed: DARK_COLORS.primary[70],
|
|
344
|
-
disable: DARK_COLORS.grey[30],
|
|
345
|
-
},
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
const DIVIDER_COLOR = {
|
|
349
|
-
light: LIGHT_COLORS.grey[50] + transparency['20%'],
|
|
350
|
-
dark: DARK_COLORS.grey[50] + transparency['20%'],
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
export default function palette({
|
|
354
|
-
mode = 'light',
|
|
355
|
-
themeColors = {},
|
|
356
|
-
}: {
|
|
357
|
-
mode?: 'light' | 'dark';
|
|
358
|
-
themeColors?: { light?: Theme; dark?: Theme };
|
|
359
|
-
} = {}): Theme {
|
|
360
|
-
const colors = mode === 'light' ? LIGHT_COLORS : DARK_COLORS;
|
|
361
|
-
|
|
362
|
-
const theme: Theme = {
|
|
363
|
-
mode,
|
|
364
|
-
...colors,
|
|
365
|
-
text: TEXT_COLORS[mode],
|
|
366
|
-
border: BORDER_COLORS[mode],
|
|
367
|
-
background: BACKGROUND_COLORS[mode],
|
|
368
|
-
action: ACTION_COLORS[mode],
|
|
369
|
-
divider: DIVIDER_COLOR[mode],
|
|
370
|
-
elevationShadow: SHADOW_COLORS[mode],
|
|
371
|
-
modalBgColor: MODAL_BG_COLOR[mode],
|
|
372
|
-
mainColor: MAIN_COLORS[mode]
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
// 사용자 정의 테마 컬러가 있을 경우 병합
|
|
376
|
-
if (themeColors?.[mode]) {
|
|
377
|
-
return {
|
|
378
|
-
...theme,
|
|
379
|
-
...themeColors[mode],
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
return theme;
|
|
384
|
-
}
|