@0610studio/zs-ui 0.18.1 → 0.19.1
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/assets/SvgTooltipTail.d.ts +7 -0
- package/build/assets/SvgTooltipTail.d.ts.map +1 -0
- package/build/assets/SvgTooltipTail.js +7 -0
- package/build/assets/SvgTooltipTail.js.map +1 -0
- package/build/context/ThemeContext.d.ts.map +1 -1
- package/build/context/ThemeContext.js +17 -5
- package/build/context/ThemeContext.js.map +1 -1
- package/build/index.d.ts +15 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build/model/types.d.ts +1 -0
- package/build/model/types.d.ts.map +1 -1
- package/build/model/types.js.map +1 -1
- package/build/model/useFoldingState.d.ts.map +1 -1
- package/build/model/useFoldingState.js +51 -32
- package/build/model/useFoldingState.js.map +1 -1
- package/build/overlay/AlertOverlay/index.d.ts +1 -2
- package/build/overlay/AlertOverlay/index.d.ts.map +1 -1
- package/build/overlay/AlertOverlay/index.js +11 -9
- package/build/overlay/AlertOverlay/index.js.map +1 -1
- package/build/overlay/BottomSheetOverlay/index.d.ts.map +1 -1
- package/build/overlay/BottomSheetOverlay/index.js +4 -3
- package/build/overlay/BottomSheetOverlay/index.js.map +1 -1
- package/build/overlay/LoadingNotify/index.d.ts +2 -2
- package/build/overlay/LoadingNotify/index.d.ts.map +1 -1
- package/build/overlay/LoadingNotify/index.js +2 -2
- package/build/overlay/LoadingNotify/index.js.map +1 -1
- package/build/overlay/Modality/index.d.ts.map +1 -1
- package/build/overlay/Modality/index.js +3 -3
- package/build/overlay/Modality/index.js.map +1 -1
- package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -1
- package/build/overlay/PopOver/PopOverMenu.js +5 -3
- package/build/overlay/PopOver/PopOverMenu.js.map +1 -1
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts +3 -3
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts.map +1 -1
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.js +5 -5
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.js.map +1 -1
- package/build/theme/intentColors.d.ts +9 -0
- package/build/theme/intentColors.d.ts.map +1 -0
- package/build/theme/intentColors.js +30 -0
- package/build/theme/intentColors.js.map +1 -0
- package/build/theme/tokens.d.ts +35 -0
- package/build/theme/tokens.d.ts.map +1 -0
- package/build/theme/tokens.js +35 -0
- package/build/theme/tokens.js.map +1 -0
- package/build/theme/typography.d.ts.map +1 -1
- package/build/theme/typography.js +36 -72
- package/build/theme/typography.js.map +1 -1
- package/build/ui/ZSBlockButton/index.d.ts.map +1 -1
- package/build/ui/ZSBlockButton/index.js +4 -19
- package/build/ui/ZSBlockButton/index.js.map +1 -1
- package/build/ui/ZSBorderBeam/index.d.ts +48 -0
- package/build/ui/ZSBorderBeam/index.d.ts.map +1 -0
- package/build/ui/ZSBorderBeam/index.js +136 -0
- package/build/ui/ZSBorderBeam/index.js.map +1 -0
- package/build/ui/ZSCheckBox/index.d.ts +18 -0
- package/build/ui/ZSCheckBox/index.d.ts.map +1 -0
- package/build/ui/ZSCheckBox/index.js +60 -0
- package/build/ui/ZSCheckBox/index.js.map +1 -0
- package/build/ui/ZSChip/index.d.ts +28 -0
- package/build/ui/ZSChip/index.d.ts.map +1 -0
- package/build/ui/ZSChip/index.js +76 -0
- package/build/ui/ZSChip/index.js.map +1 -0
- package/build/ui/ZSContainer/index.d.ts +0 -1
- package/build/ui/ZSContainer/index.d.ts.map +1 -1
- package/build/ui/ZSContainer/index.js +3 -2
- package/build/ui/ZSContainer/index.js.map +1 -1
- package/build/ui/ZSPressable/index.d.ts.map +1 -1
- package/build/ui/ZSPressable/index.js +9 -4
- package/build/ui/ZSPressable/index.js.map +1 -1
- package/build/ui/ZSRadioGroup/index.d.ts +2 -3
- package/build/ui/ZSRadioGroup/index.d.ts.map +1 -1
- package/build/ui/ZSRadioGroup/index.js +12 -4
- package/build/ui/ZSRadioGroup/index.js.map +1 -1
- package/build/ui/ZSSegmented/index.d.ts +26 -0
- package/build/ui/ZSSegmented/index.d.ts.map +1 -0
- package/build/ui/ZSSegmented/index.js +124 -0
- package/build/ui/ZSSegmented/index.js.map +1 -0
- package/build/ui/ZSSkeleton/SkiaShimmer.d.ts +18 -0
- package/build/ui/ZSSkeleton/SkiaShimmer.d.ts.map +1 -0
- package/build/ui/ZSSkeleton/SkiaShimmer.js +73 -0
- package/build/ui/ZSSkeleton/SkiaShimmer.js.map +1 -0
- package/build/ui/ZSSkeleton/index.d.ts +7 -2
- package/build/ui/ZSSkeleton/index.d.ts.map +1 -1
- package/build/ui/ZSSkeleton/index.js +12 -43
- package/build/ui/ZSSkeleton/index.js.map +1 -1
- package/build/ui/ZSSkeletonBox/index.d.ts +8 -2
- package/build/ui/ZSSkeletonBox/index.d.ts.map +1 -1
- package/build/ui/ZSSkeletonBox/index.js +6 -46
- package/build/ui/ZSSkeletonBox/index.js.map +1 -1
- package/build/ui/ZSSwitch/index.d.ts +2 -1
- package/build/ui/ZSSwitch/index.d.ts.map +1 -1
- package/build/ui/ZSSwitch/index.js +6 -4
- package/build/ui/ZSSwitch/index.js.map +1 -1
- package/build/ui/ZSTextField/index.d.ts.map +1 -1
- package/build/ui/ZSTextField/index.js +17 -13
- package/build/ui/ZSTextField/index.js.map +1 -1
- package/build/ui/ZSTextField/ui/ButtonClose.d.ts.map +1 -1
- package/build/ui/ZSTextField/ui/ButtonClose.js +4 -1
- package/build/ui/ZSTextField/ui/ButtonClose.js.map +1 -1
- package/build/ui/ZSTooltip/index.d.ts +38 -0
- package/build/ui/ZSTooltip/index.d.ts.map +1 -0
- package/build/ui/ZSTooltip/index.js +99 -0
- package/build/ui/ZSTooltip/index.js.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 툴팁 말풍선 꼬리 — 아래를 향하는 삼각형, 끝이 살짝 둥글다 (위 방향은 사용처에서 180도 회전) */
|
|
2
|
+
export declare const SvgTooltipTail: ({ width, height, color }: {
|
|
3
|
+
width?: number | undefined;
|
|
4
|
+
height?: number | undefined;
|
|
5
|
+
color?: string | undefined;
|
|
6
|
+
}) => import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=SvgTooltipTail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgTooltipTail.d.ts","sourceRoot":"","sources":["../../src/assets/SvgTooltipTail.tsx"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,eAAO,MAAM,cAAc,GAAI;;;;CAA6C,gCAS3E,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Svg, { Path } from 'react-native-svg';
|
|
3
|
+
/** 툴팁 말풍선 꼬리 — 아래를 향하는 삼각형, 끝이 살짝 둥글다 (위 방향은 사용처에서 180도 회전) */
|
|
4
|
+
export const SvgTooltipTail = ({ width = 12, height = 7, color = '#141A21' }) => {
|
|
5
|
+
return (_jsx(Svg, { width: width, height: height, viewBox: "0 0 12 7", fill: "none", children: _jsx(Path, { d: "M0 0 H12 L7.04 5.79 Q6 7 4.96 5.79 Z", fill: color }) }));
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=SvgTooltipTail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgTooltipTail.js","sourceRoot":"","sources":["../../src/assets/SvgTooltipTail.tsx"],"names":[],"mappings":";AAAA,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,EAAE,EAAE,EAAE;IAC9E,OAAO,CACL,KAAC,GAAG,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,YAC/D,KAAC,IAAI,IACH,CAAC,EAAC,sCAAsC,EACxC,IAAI,EAAE,KAAK,GACX,GACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import Svg, { Path } from 'react-native-svg';\n\n/** 툴팁 말풍선 꼬리 — 아래를 향하는 삼각형, 끝이 살짝 둥글다 (위 방향은 사용처에서 180도 회전) */\nexport const SvgTooltipTail = ({ width = 12, height = 7, color = '#141A21' }) => {\n return (\n <Svg width={width} height={height} viewBox=\"0 0 12 7\" fill=\"none\">\n <Path\n d=\"M0 0 H12 L7.04 5.79 Q6 7 4.96 5.79 Z\"\n fill={color}\n />\n </Svg>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/context/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/context/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyF,MAAM,OAAO,CAAC;AAK9G,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,KAAK,CAAC;YAAC,IAAI,CAAC,EAAE,KAAK,CAAA;SAAE,CAAA;KAAE,KAAK,KAAK,CAAC;IAC9G,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,SAAS,EAAE,eAAe,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,OAAQ,SAAQ,KAAK;IACpC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,uBAAuB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AA2CD,eAAO,MAAM,QAAQ,kBAMpB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuHtD,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext, useMemo, useReducer, useEffect, useCallback } from 'react';
|
|
2
|
+
import { createContext, useContext, useMemo, useReducer, useEffect, useCallback, useRef } from 'react';
|
|
3
3
|
import { Platform, useColorScheme } from 'react-native';
|
|
4
4
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
5
5
|
import * as NavigationBar from 'expo-navigation-bar';
|
|
@@ -46,6 +46,11 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
46
46
|
mode: isDarkModeEnabled ? systemMode : 'light',
|
|
47
47
|
});
|
|
48
48
|
const { isUsingSystemColorScheme, mode } = themeState;
|
|
49
|
+
// hydrate 는 마운트(또는 isDarkModeEnabled 변경) 시 1회만 수행한다.
|
|
50
|
+
// 이후 시스템 모드 동기화는 아래 SYNC_SYSTEM_MODE effect 가 담당하므로,
|
|
51
|
+
// systemMode 변경마다 AsyncStorage 를 다시 읽지 않도록 ref 로 최신 값만 참조한다.
|
|
52
|
+
const systemModeRef = useRef(systemMode);
|
|
53
|
+
systemModeRef.current = systemMode;
|
|
49
54
|
useEffect(() => {
|
|
50
55
|
let isMounted = true;
|
|
51
56
|
const loadSettings = async () => {
|
|
@@ -74,7 +79,7 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
74
79
|
type: 'HYDRATE',
|
|
75
80
|
state: {
|
|
76
81
|
isUsingSystemColorScheme,
|
|
77
|
-
mode: isUsingSystemColorScheme ?
|
|
82
|
+
mode: isUsingSystemColorScheme ? systemModeRef.current : savedMode ?? systemModeRef.current,
|
|
78
83
|
},
|
|
79
84
|
});
|
|
80
85
|
}
|
|
@@ -86,7 +91,7 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
86
91
|
return () => {
|
|
87
92
|
isMounted = false;
|
|
88
93
|
};
|
|
89
|
-
}, [isDarkModeEnabled
|
|
94
|
+
}, [isDarkModeEnabled]);
|
|
90
95
|
useEffect(() => {
|
|
91
96
|
dispatchTheme({ type: 'SYNC_SYSTEM_MODE', systemMode });
|
|
92
97
|
}, [systemMode]);
|
|
@@ -108,8 +113,15 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
108
113
|
await AsyncStorage.setItem('useSystemColorScheme', useSystem.toString());
|
|
109
114
|
}, [systemMode]);
|
|
110
115
|
const unfoldedSinglePaneMaxWidth = foldable?.unfoldedSinglePaneMaxWidth;
|
|
116
|
+
// customPalette 를 인라인 함수로 넘겨도 컨텍스트 값이 매 렌더 재생성되어
|
|
117
|
+
// useTheme 구독 컴포넌트 전체가 리렌더되지 않도록, 함수 identity 대신 ref 로 최신 함수를 참조한다.
|
|
118
|
+
// (함수 identity 변경만으로는 재계산되지 않고, mode 등 다른 의존성 변경 시 최신 함수가 반영된다)
|
|
119
|
+
const customPaletteRef = useRef(customPalette);
|
|
120
|
+
customPaletteRef.current = customPalette;
|
|
121
|
+
const hasCustomPalette = Boolean(customPalette);
|
|
111
122
|
const themeValue = useMemo(() => {
|
|
112
|
-
const
|
|
123
|
+
const paletteFactory = customPaletteRef.current;
|
|
124
|
+
const currentPalette = paletteFactory ? paletteFactory({ mode }) : palette({ mode });
|
|
113
125
|
return {
|
|
114
126
|
palette: {
|
|
115
127
|
isUsingSystemColorScheme,
|
|
@@ -121,7 +133,7 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
121
133
|
elevation: elevation(currentPalette),
|
|
122
134
|
foldable: { unfoldedSinglePaneMaxWidth },
|
|
123
135
|
};
|
|
124
|
-
}, [mode, isUsingSystemColorScheme, themeFonts,
|
|
136
|
+
}, [mode, isUsingSystemColorScheme, themeFonts, hasCustomPalette, handleSetUseSystemColorScheme, toggleTheme, unfoldedSinglePaneMaxWidth]);
|
|
125
137
|
return (_jsx(ThemeContext.Provider, { value: themeValue, children: children }));
|
|
126
138
|
};
|
|
127
139
|
//# sourceMappingURL=ThemeContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../../src/context/ThemeContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,YAAY,MAAM,2CAA2C,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,SAA8B,MAAM,oBAAoB,CAAC;AAgChE,MAAM,YAAY,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAc5D,MAAM,aAAa,GAAG,CAAC,iBAA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AE,6BAA6B,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;QAC9E,MAAM,YAAY,CAAC,OAAO,CAAC,sBAAsB,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,0BAA0B,GAAG,QAAQ,EAAE,0BAA0B,CAAC;IAExE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,MAAM,cAAc,GAAG,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACnF,OAAO;YACL,OAAO,EAAE;gBACP,wBAAwB;gBACxB,uBAAuB,EAAE,6BAA6B;gBACtD,WAAW;gBACX,GAAG,cAAc;aAClB;YACD,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;YACtC,SAAS,EAAE,SAAS,CAAC,cAAc,CAAC;YACpC,QAAQ,EAAE,EAAE,0BAA0B,EAAE;SACzC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,UAAU,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,EAAE,0BAA0B,CAAC,CAAC,CAAC;IAExI,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YACrC,QAAQ,GACa,CACzB,CAAC;AACJ,CAAC,CAAA","sourcesContent":["import React, { createContext, useContext, useMemo, useReducer, useEffect, useCallback } from 'react';\nimport { Platform, useColorScheme } from 'react-native';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport * as NavigationBar from 'expo-navigation-bar';\nimport palette from '../theme/palette';\nimport { Theme, ThemeFonts, TypographyVariantsProps } from '../theme/types';\nimport typography from '../theme/typography';\nimport elevation, { ElevationStyles } from '../theme/elevation';\n\nexport interface FoldableConfig {\n /**\n * 언폴딩 상태에서 rightComponent가 없을 때(단일 화면) 콘텐츠 최대 가로 길이(px).\n * 미주입(undefined) 또는 false면 전폭으로 늘린다. 폭을 제한하려면 반드시 값을 주입해야 한다.\n */\n unfoldedSinglePaneMaxWidth?: number | false;\n}\n\nexport interface ThemeProviderProps {\n themeFonts?: ThemeFonts;\n children: React.ReactNode;\n isDarkModeEnabled?: boolean;\n customPalette?: (config: { mode?: 'light' | 'dark'; themeColors?: { light?: Theme; dark?: Theme } }) => Theme;\n foldable?: FoldableConfig;\n}\n\nexport interface ThemeProps {\n palette: Palette;\n typography: TypographyVariantsProps;\n elevation: ElevationStyles;\n foldable: FoldableConfig;\n}\n\nexport interface Palette extends Theme {\n mode: 'light' | 'dark';\n isUsingSystemColorScheme: boolean;\n setUseSystemColorScheme: (useSystem: boolean) => void;\n toggleTheme: () => void;\n}\n\nconst ThemeContext = createContext<ThemeProps | null>(null);\ntype ThemeMode = 'light' | 'dark';\n\ntype ThemeState = {\n mode: ThemeMode;\n isUsingSystemColorScheme: boolean;\n};\n\ntype ThemeAction =\n | { type: 'HYDRATE'; state: ThemeState }\n | { type: 'SYNC_SYSTEM_MODE'; systemMode: ThemeMode }\n | { type: 'SET_USE_SYSTEM_COLOR_SCHEME'; useSystem: boolean; systemMode: ThemeMode }\n | { type: 'TOGGLE_THEME' };\n\nconst getSystemMode = (systemColorScheme: ReturnType<typeof useColorScheme>): ThemeMode =>\n systemColorScheme === 'dark' ? 'dark' : 'light';\n\nfunction themeReducer(state: ThemeState, action: ThemeAction): ThemeState {\n switch (action.type) {\n case 'HYDRATE':\n return action.state;\n case 'SYNC_SYSTEM_MODE':\n return state.isUsingSystemColorScheme\n ? { ...state, mode: action.systemMode }\n : state;\n case 'SET_USE_SYSTEM_COLOR_SCHEME':\n return {\n ...state,\n isUsingSystemColorScheme: action.useSystem,\n mode: action.useSystem ? action.systemMode : state.mode,\n };\n case 'TOGGLE_THEME':\n return {\n isUsingSystemColorScheme: false,\n mode: state.mode === 'light' ? 'dark' : 'light',\n };\n default:\n return state;\n }\n}\n\nexport const useTheme = () => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ themeFonts, children, isDarkModeEnabled = true, customPalette, foldable }) => {\n const systemColorScheme = useColorScheme();\n const systemMode = getSystemMode(systemColorScheme);\n const [themeState, dispatchTheme] = useReducer(\n themeReducer,\n {\n isUsingSystemColorScheme: isDarkModeEnabled,\n mode: isDarkModeEnabled ? systemMode : 'light',\n }\n );\n const { isUsingSystemColorScheme, mode } = themeState;\n\n useEffect(() => {\n let isMounted = true;\n\n const loadSettings = async () => {\n try {\n if (!isMounted) return;\n \n if (!isDarkModeEnabled) {\n dispatchTheme({\n type: 'HYDRATE',\n state: {\n isUsingSystemColorScheme: false,\n mode: 'light',\n },\n });\n return;\n }\n\n const storedUseSystemColorScheme = await AsyncStorage.getItem('useSystemColorScheme');\n const storedMode = await AsyncStorage.getItem('themeMode');\n\n if (!isMounted) return;\n\n const isUsingSystemColorScheme = storedUseSystemColorScheme === null\n ? true\n : storedUseSystemColorScheme === 'true';\n const savedMode = storedMode === 'dark' || storedMode === 'light' ? storedMode : undefined;\n\n dispatchTheme({\n type: 'HYDRATE',\n state: {\n isUsingSystemColorScheme,\n mode: isUsingSystemColorScheme ? systemMode : savedMode ?? systemMode,\n },\n });\n } catch (error) {\n console.error('Failed to load theme settings', error);\n }\n };\n\n loadSettings();\n\n return () => {\n isMounted = false;\n };\n }, [isDarkModeEnabled, systemMode]);\n\n useEffect(() => {\n dispatchTheme({ type: 'SYNC_SYSTEM_MODE', systemMode });\n }, [systemMode]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n NavigationBar.setStyle(mode);\n }\n }, [mode])\n\n const toggleTheme = useCallback(async () => {\n const newMode = mode === 'light' ? 'dark' : 'light';\n dispatchTheme({ type: 'TOGGLE_THEME' });\n await AsyncStorage.multiSet([\n ['useSystemColorScheme', 'false'],\n ['themeMode', newMode],\n ]);\n }, [mode]);\n\n const handleSetUseSystemColorScheme = useCallback(async (useSystem: boolean) => {\n dispatchTheme({ type: 'SET_USE_SYSTEM_COLOR_SCHEME', useSystem, systemMode });\n await AsyncStorage.setItem('useSystemColorScheme', useSystem.toString());\n }, [systemMode]);\n\n const unfoldedSinglePaneMaxWidth = foldable?.unfoldedSinglePaneMaxWidth;\n\n const themeValue = useMemo(() => {\n const currentPalette = customPalette ? customPalette({ mode }) : palette({ mode });\n return {\n palette: {\n isUsingSystemColorScheme,\n setUseSystemColorScheme: handleSetUseSystemColorScheme,\n toggleTheme,\n ...currentPalette,\n },\n typography: typography({ themeFonts }),\n elevation: elevation(currentPalette),\n foldable: { unfoldedSinglePaneMaxWidth },\n };\n }, [mode, isUsingSystemColorScheme, themeFonts, customPalette, handleSetUseSystemColorScheme, toggleTheme, unfoldedSinglePaneMaxWidth]);\n\n return (\n <ThemeContext.Provider value={themeValue}>\n {children}\n </ThemeContext.Provider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ThemeContext.js","sourceRoot":"","sources":["../../src/context/ThemeContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,YAAY,MAAM,2CAA2C,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,SAA8B,MAAM,oBAAoB,CAAC;AAgChE,MAAM,YAAY,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAc5D,MAAM,aAAa,GAAG,CAAC,iBAAoD,EAAa,EAAE,CACxF,iB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AAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YACrC,QAAQ,GACa,CACzB,CAAC;AACJ,CAAC,CAAA","sourcesContent":["import React, { createContext, useContext, useMemo, useReducer, useEffect, useCallback, useRef } from 'react';\nimport { Platform, useColorScheme } from 'react-native';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport * as NavigationBar from 'expo-navigation-bar';\nimport palette from '../theme/palette';\nimport { Theme, ThemeFonts, TypographyVariantsProps } from '../theme/types';\nimport typography from '../theme/typography';\nimport elevation, { ElevationStyles } from '../theme/elevation';\n\nexport interface FoldableConfig {\n /**\n * 언폴딩 상태에서 rightComponent가 없을 때(단일 화면) 콘텐츠 최대 가로 길이(px).\n * 미주입(undefined) 또는 false면 전폭으로 늘린다. 폭을 제한하려면 반드시 값을 주입해야 한다.\n */\n unfoldedSinglePaneMaxWidth?: number | false;\n}\n\nexport interface ThemeProviderProps {\n themeFonts?: ThemeFonts;\n children: React.ReactNode;\n isDarkModeEnabled?: boolean;\n customPalette?: (config: { mode?: 'light' | 'dark'; themeColors?: { light?: Theme; dark?: Theme } }) => Theme;\n foldable?: FoldableConfig;\n}\n\nexport interface ThemeProps {\n palette: Palette;\n typography: TypographyVariantsProps;\n elevation: ElevationStyles;\n foldable: FoldableConfig;\n}\n\nexport interface Palette extends Theme {\n mode: 'light' | 'dark';\n isUsingSystemColorScheme: boolean;\n setUseSystemColorScheme: (useSystem: boolean) => void;\n toggleTheme: () => void;\n}\n\nconst ThemeContext = createContext<ThemeProps | null>(null);\ntype ThemeMode = 'light' | 'dark';\n\ntype ThemeState = {\n mode: ThemeMode;\n isUsingSystemColorScheme: boolean;\n};\n\ntype ThemeAction =\n | { type: 'HYDRATE'; state: ThemeState }\n | { type: 'SYNC_SYSTEM_MODE'; systemMode: ThemeMode }\n | { type: 'SET_USE_SYSTEM_COLOR_SCHEME'; useSystem: boolean; systemMode: ThemeMode }\n | { type: 'TOGGLE_THEME' };\n\nconst getSystemMode = (systemColorScheme: ReturnType<typeof useColorScheme>): ThemeMode =>\n systemColorScheme === 'dark' ? 'dark' : 'light';\n\nfunction themeReducer(state: ThemeState, action: ThemeAction): ThemeState {\n switch (action.type) {\n case 'HYDRATE':\n return action.state;\n case 'SYNC_SYSTEM_MODE':\n return state.isUsingSystemColorScheme\n ? { ...state, mode: action.systemMode }\n : state;\n case 'SET_USE_SYSTEM_COLOR_SCHEME':\n return {\n ...state,\n isUsingSystemColorScheme: action.useSystem,\n mode: action.useSystem ? action.systemMode : state.mode,\n };\n case 'TOGGLE_THEME':\n return {\n isUsingSystemColorScheme: false,\n mode: state.mode === 'light' ? 'dark' : 'light',\n };\n default:\n return state;\n }\n}\n\nexport const useTheme = () => {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n return context;\n}\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ themeFonts, children, isDarkModeEnabled = true, customPalette, foldable }) => {\n const systemColorScheme = useColorScheme();\n const systemMode = getSystemMode(systemColorScheme);\n const [themeState, dispatchTheme] = useReducer(\n themeReducer,\n {\n isUsingSystemColorScheme: isDarkModeEnabled,\n mode: isDarkModeEnabled ? systemMode : 'light',\n }\n );\n const { isUsingSystemColorScheme, mode } = themeState;\n\n // hydrate 는 마운트(또는 isDarkModeEnabled 변경) 시 1회만 수행한다.\n // 이후 시스템 모드 동기화는 아래 SYNC_SYSTEM_MODE effect 가 담당하므로,\n // systemMode 변경마다 AsyncStorage 를 다시 읽지 않도록 ref 로 최신 값만 참조한다.\n const systemModeRef = useRef(systemMode);\n systemModeRef.current = systemMode;\n\n useEffect(() => {\n let isMounted = true;\n\n const loadSettings = async () => {\n try {\n if (!isMounted) return;\n\n if (!isDarkModeEnabled) {\n dispatchTheme({\n type: 'HYDRATE',\n state: {\n isUsingSystemColorScheme: false,\n mode: 'light',\n },\n });\n return;\n }\n\n const storedUseSystemColorScheme = await AsyncStorage.getItem('useSystemColorScheme');\n const storedMode = await AsyncStorage.getItem('themeMode');\n\n if (!isMounted) return;\n\n const isUsingSystemColorScheme = storedUseSystemColorScheme === null\n ? true\n : storedUseSystemColorScheme === 'true';\n const savedMode = storedMode === 'dark' || storedMode === 'light' ? storedMode : undefined;\n\n dispatchTheme({\n type: 'HYDRATE',\n state: {\n isUsingSystemColorScheme,\n mode: isUsingSystemColorScheme ? systemModeRef.current : savedMode ?? systemModeRef.current,\n },\n });\n } catch (error) {\n console.error('Failed to load theme settings', error);\n }\n };\n\n loadSettings();\n\n return () => {\n isMounted = false;\n };\n }, [isDarkModeEnabled]);\n\n useEffect(() => {\n dispatchTheme({ type: 'SYNC_SYSTEM_MODE', systemMode });\n }, [systemMode]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n NavigationBar.setStyle(mode);\n }\n }, [mode])\n\n const toggleTheme = useCallback(async () => {\n const newMode = mode === 'light' ? 'dark' : 'light';\n dispatchTheme({ type: 'TOGGLE_THEME' });\n await AsyncStorage.multiSet([\n ['useSystemColorScheme', 'false'],\n ['themeMode', newMode],\n ]);\n }, [mode]);\n\n const handleSetUseSystemColorScheme = useCallback(async (useSystem: boolean) => {\n dispatchTheme({ type: 'SET_USE_SYSTEM_COLOR_SCHEME', useSystem, systemMode });\n await AsyncStorage.setItem('useSystemColorScheme', useSystem.toString());\n }, [systemMode]);\n\n const unfoldedSinglePaneMaxWidth = foldable?.unfoldedSinglePaneMaxWidth;\n\n // customPalette 를 인라인 함수로 넘겨도 컨텍스트 값이 매 렌더 재생성되어\n // useTheme 구독 컴포넌트 전체가 리렌더되지 않도록, 함수 identity 대신 ref 로 최신 함수를 참조한다.\n // (함수 identity 변경만으로는 재계산되지 않고, mode 등 다른 의존성 변경 시 최신 함수가 반영된다)\n const customPaletteRef = useRef(customPalette);\n customPaletteRef.current = customPalette;\n const hasCustomPalette = Boolean(customPalette);\n\n const themeValue = useMemo(() => {\n const paletteFactory = customPaletteRef.current;\n const currentPalette = paletteFactory ? paletteFactory({ mode }) : palette({ mode });\n return {\n palette: {\n isUsingSystemColorScheme,\n setUseSystemColorScheme: handleSetUseSystemColorScheme,\n toggleTheme,\n ...currentPalette,\n },\n typography: typography({ themeFonts }),\n elevation: elevation(currentPalette),\n foldable: { unfoldedSinglePaneMaxWidth },\n };\n }, [mode, isUsingSystemColorScheme, themeFonts, hasCustomPalette, handleSetUseSystemColorScheme, toggleTheme, unfoldedSinglePaneMaxWidth]);\n\n return (\n <ThemeContext.Provider value={themeValue}>\n {children}\n </ThemeContext.Provider>\n );\n}\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { OverlayProvider } from "./context/OverlayContext";
|
|
|
4
4
|
import { ThemeProvider, useTheme } from "./context/ThemeContext";
|
|
5
5
|
import { useFoldingState } from './model/useFoldingState';
|
|
6
6
|
import { themeFactory } from './theme/palette';
|
|
7
|
+
import { RADIUS, DURATION, DISABLED_OPACITY } from './theme/tokens';
|
|
7
8
|
import ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';
|
|
8
9
|
import ZSContainer from './ui/ZSContainer';
|
|
9
10
|
import ZSPressable from './ui/ZSPressable';
|
|
@@ -20,13 +21,25 @@ import { ZSTextProps } from "./ui/ZSText";
|
|
|
20
21
|
import { BoxStyle, ZSTextFieldRef } from "./ui/ZSTextField";
|
|
21
22
|
import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal } from './overlay';
|
|
22
23
|
import ZSBlockButton from './ui/ZSBlockButton';
|
|
24
|
+
import ZSTooltip from './ui/ZSTooltip';
|
|
23
25
|
import ZSSkeleton from './ui/ZSSkeleton';
|
|
24
26
|
import ZSSkeletonBox from './ui/ZSSkeletonBox';
|
|
25
|
-
|
|
27
|
+
import ZSBorderBeam from './ui/ZSBorderBeam';
|
|
28
|
+
import ZSSegmented from './ui/ZSSegmented';
|
|
29
|
+
import ZSChip from './ui/ZSChip';
|
|
30
|
+
import ZSCheckBox from './ui/ZSCheckBox';
|
|
31
|
+
export { useTheme, useFoldingState, ThemeProvider, OverlayProvider, themeFactory, RADIUS, DURATION, DISABLED_OPACITY, ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ZSTextField, ZSRadioGroup, ZSSwitch, ErrorComponent, ZSAboveKeyboard, ZSBlockButton, ZSSkeleton, ZSSkeletonBox, ZSBorderBeam, ZSSegmented, ZSCheckBox, ZSChip, ZSTooltip, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal, GlobalOverlay, useStyleSheetCreate, };
|
|
26
32
|
import type { ThemeProviderProps, ThemeProps, Palette, FoldableConfig } from "./context/ThemeContext";
|
|
27
33
|
import { ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TypoColorOptions, ShadowLevel, ShadowStyle } from "./theme/types";
|
|
28
34
|
import { ThemeFactoryColors, ThemeFactoryConfig } from "./theme/palette";
|
|
29
35
|
import { SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetOptions, FoldingStateInfo } from "./model/types";
|
|
30
36
|
import { RadioOption } from "./ui/types";
|
|
31
|
-
|
|
37
|
+
import { ZSBorderBeamProps, ZSBorderBeamGlowConfig } from "./ui/ZSBorderBeam";
|
|
38
|
+
import { ZSSegmentedProps, ZSSegmentedTextSize } from "./ui/ZSSegmented";
|
|
39
|
+
import { ZSChipProps, ZSChipVariant } from "./ui/ZSChip";
|
|
40
|
+
import { ZSSkeletonProps } from "./ui/ZSSkeleton";
|
|
41
|
+
import { ZSSkeletonBoxProps } from "./ui/ZSSkeletonBox";
|
|
42
|
+
import { ZSCheckBoxProps } from "./ui/ZSCheckBox";
|
|
43
|
+
import { ZSTooltipProps, ZSTooltipPlacement, ZSTooltipTailAlign } from "./ui/ZSTooltip";
|
|
44
|
+
export type { ThemeProviderProps, ThemeProps, Palette, FoldableConfig, ZSTextProps, BoxStyle, ZSTextFieldRef, ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TypoColorOptions, ThemeFactoryColors, ThemeFactoryConfig, SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetOptions, RadioOption, ShadowLevel, ShadowStyle, ZSContainerRef, FoldingStateInfo, ZSBorderBeamProps, ZSBorderBeamGlowConfig, ZSSegmentedProps, ZSSegmentedTextSize, ZSChipProps, ZSChipVariant, ZSSkeletonProps, ZSSkeletonBoxProps, ZSCheckBoxProps, ZSTooltipProps, ZSTooltipPlacement, ZSTooltipTailAlign, };
|
|
32
45
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAChE,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,MAAM,MAAM,aAAa,CAAC;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kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { OverlayProvider } from "./context/OverlayContext";
|
|
|
4
4
|
import { ThemeProvider, useTheme } from "./context/ThemeContext";
|
|
5
5
|
import { useFoldingState } from './model/useFoldingState';
|
|
6
6
|
import { themeFactory } from './theme/palette';
|
|
7
|
+
import { RADIUS, DURATION, DISABLED_OPACITY } from './theme/tokens';
|
|
7
8
|
import ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';
|
|
8
9
|
import ZSContainer from './ui/ZSContainer';
|
|
9
10
|
import ZSPressable from './ui/ZSPressable';
|
|
@@ -17,7 +18,12 @@ import TextAtom from './ui/atoms/TextAtom';
|
|
|
17
18
|
import ZSAboveKeyboard from "./ui/ZSAboveKeyboard";
|
|
18
19
|
import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal } from './overlay';
|
|
19
20
|
import ZSBlockButton from './ui/ZSBlockButton';
|
|
21
|
+
import ZSTooltip from './ui/ZSTooltip';
|
|
20
22
|
import ZSSkeleton from './ui/ZSSkeleton';
|
|
21
23
|
import ZSSkeletonBox from './ui/ZSSkeletonBox';
|
|
22
|
-
|
|
24
|
+
import ZSBorderBeam from './ui/ZSBorderBeam';
|
|
25
|
+
import ZSSegmented from './ui/ZSSegmented';
|
|
26
|
+
import ZSChip from './ui/ZSChip';
|
|
27
|
+
import ZSCheckBox from './ui/ZSCheckBox';
|
|
28
|
+
export { useTheme, useFoldingState, ThemeProvider, OverlayProvider, themeFactory, RADIUS, DURATION, DISABLED_OPACITY, ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ZSTextField, ZSRadioGroup, ZSSwitch, ErrorComponent, ZSAboveKeyboard, ZSBlockButton, ZSSkeleton, ZSSkeletonBox, ZSBorderBeam, ZSSegmented, ZSCheckBox, ZSChip, ZSTooltip, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal, GlobalOverlay, useStyleSheetCreate, };
|
|
23
29
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAChE,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,WAAW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;AAC3C,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAInD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC/H,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,eAAe,EACf,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,UAAU,EACV,MAAM,EACN,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,aAAa,EACb,WAAW,EACX,QAAQ,EACR,aAAa,EACb,mBAAmB,GACpB,CAAC","sourcesContent":["import { GlobalOverlay } from './model/globalOverlay'\nimport { useStyleSheetCreate } from './model/useStyleSheetCreate'\nimport { OverlayProvider } from \"./context/OverlayContext\";\nimport { ThemeProvider, useTheme } from \"./context/ThemeContext\";\nimport { useFoldingState } from './model/useFoldingState'\nimport { themeFactory } from './theme/palette';\nimport { RADIUS, DURATION, DISABLED_OPACITY } from './theme/tokens';\nimport ErrorComponent from './ui/ZSTextField/ui/ErrorComponent';\nimport ZSContainer from './ui/ZSContainer';\nimport ZSPressable from './ui/ZSPressable';\nimport ZSText from './ui/ZSText';\nimport ZSTextField from './ui/ZSTextField';\nimport ZSRadioGroup from './ui/ZSRadioGroup';\nimport ZSSwitch from './ui/ZSSwitch';\nimport ZSView from './ui/ZSView';\nimport AnimatedWrapper from './ui/atoms/AnimatedWrapper';\nimport TextAtom from './ui/atoms/TextAtom';\nimport ZSAboveKeyboard from \"./ui/ZSAboveKeyboard\";\nimport { ZSContainerRef } from \"./ui/ZSContainer\";\nimport { ZSTextProps } from \"./ui/ZSText\";\nimport { BoxStyle, ZSTextFieldRef } from \"./ui/ZSTextField\";\nimport { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal } from './overlay';\nimport ZSBlockButton from './ui/ZSBlockButton';\nimport ZSTooltip from './ui/ZSTooltip';\nimport ZSSkeleton from './ui/ZSSkeleton';\nimport ZSSkeletonBox from './ui/ZSSkeletonBox';\nimport ZSBorderBeam from './ui/ZSBorderBeam';\nimport ZSSegmented from './ui/ZSSegmented';\nimport ZSChip from './ui/ZSChip';\nimport ZSCheckBox from './ui/ZSCheckBox';\n\nexport {\n useTheme,\n useFoldingState,\n ThemeProvider,\n OverlayProvider,\n themeFactory,\n RADIUS,\n DURATION,\n DISABLED_OPACITY,\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ZSTextField,\n ZSRadioGroup,\n ZSSwitch,\n ErrorComponent,\n ZSAboveKeyboard,\n ZSBlockButton,\n ZSSkeleton,\n ZSSkeletonBox,\n ZSBorderBeam,\n ZSSegmented,\n ZSCheckBox,\n ZSChip,\n ZSTooltip,\n AlertOverlay,\n BottomSheetOverlay,\n SnackbarNotify,\n useOverlay,\n PopOverButton,\n PopOverMenu,\n ZSPortal,\n GlobalOverlay,\n useStyleSheetCreate,\n};\n\nimport type { ThemeProviderProps, ThemeProps, Palette, FoldableConfig } from \"./context/ThemeContext\";\nimport {\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TypoColorOptions,\n ShadowLevel,\n ShadowStyle,\n} from \"./theme/types\";\nimport { ThemeFactoryColors, ThemeFactoryConfig } from \"./theme/palette\";\nimport {\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetOptions,\n FoldingStateInfo\n} from \"./model/types\";\nimport { RadioOption } from \"./ui/types\";\nimport { ZSBorderBeamProps, ZSBorderBeamGlowConfig } from \"./ui/ZSBorderBeam\";\nimport { ZSSegmentedProps, ZSSegmentedTextSize } from \"./ui/ZSSegmented\";\nimport { ZSChipProps, ZSChipVariant } from \"./ui/ZSChip\";\nimport { ZSSkeletonProps } from \"./ui/ZSSkeleton\";\nimport { ZSSkeletonBoxProps } from \"./ui/ZSSkeletonBox\";\nimport { ZSCheckBoxProps } from \"./ui/ZSCheckBox\";\nimport { ZSTooltipProps, ZSTooltipPlacement, ZSTooltipTailAlign } from \"./ui/ZSTooltip\";\n\nexport type {\n ThemeProviderProps,\n ThemeProps,\n Palette,\n FoldableConfig,\n ZSTextProps,\n BoxStyle,\n ZSTextFieldRef,\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TypoColorOptions,\n ThemeFactoryColors,\n ThemeFactoryConfig,\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetOptions,\n RadioOption,\n ShadowLevel,\n ShadowStyle,\n ZSContainerRef,\n FoldingStateInfo,\n ZSBorderBeamProps,\n ZSBorderBeamGlowConfig,\n ZSSegmentedProps,\n ZSSegmentedTextSize,\n ZSChipProps,\n ZSChipVariant,\n ZSSkeletonProps,\n ZSSkeletonBoxProps,\n ZSCheckBoxProps,\n ZSTooltipProps,\n ZSTooltipPlacement,\n ZSTooltipTailAlign,\n};\n"]}
|
package/build/model/types.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export interface ShowAlertProps {
|
|
|
69
69
|
secondaryButtonStyle?: TouchableOpacityProps['style'];
|
|
70
70
|
primaryButtonStyle?: TouchableOpacityProps['style'];
|
|
71
71
|
secondaryButtonTextStyle?: TextProps['style'];
|
|
72
|
+
primaryButtonTextStyle?: TextProps['style'];
|
|
72
73
|
}
|
|
73
74
|
export interface AlertActions {
|
|
74
75
|
primary: AlertAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnD,eAAe,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,CAA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AAE,MAAM,CAAC;CAC7B;AAED,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IAC1C,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;IACnD,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/build/model/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAsIA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;AACvB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB","sourcesContent":["import { ReactNode } from \"react\";\nimport { TextProps, TouchableOpacityProps } from \"react-native\";\n\nexport interface OverlayContextProps {\n showLoader: () => void;\n showModality: (props: ModalityProps) => void;\n showPopOverMenu: (props: PopOverMenuProps) => void;\n showBottomSheet: (props: ShowBottomSheetProps) => void;\n showSnackBar: (props: ShowSnackBarProps) => void;\n showAlert: (props: ShowAlertProps) => void;\n hideOverlay: (option: HideOption) => void;\n}\n\nexport interface AlertContextProps {\n alertVisible: boolean;\n setAlertVisible: (visible: boolean) => void;\n}\n\nexport interface SnackbarContextProps {\n snackItemStack: SnackItem[];\n hideSnackBar: (index: number) => void;\n}\n\nexport interface BottomSheetContextProps {\n bottomSheetVisible: boolean;\n setBottomSheetVisible: (visible: boolean) => void;\n height: BottomSheetHeight;\n setHeight: (height: BottomSheetHeight) => void;\n maxHeight: number;\n}\n\nexport interface PopOverContextProps {\n popOverVisible: boolean;\n setPopOverVisible: (visible: boolean) => void;\n}\n\nexport interface ModalityContextProps {\n modalityVisible: boolean;\n setModalityVisible: (visible: boolean) => void;\n}\n\nexport interface LoaderContextProps {\n loaderVisible: boolean;\n setLoaderVisible: (visible: boolean) => void;\n}\n\nexport interface PopOverMenuProps {\n px: number;\n py: number;\n component: React.ReactNode;\n}\n\nexport interface ModalityProps {\n component: React.ReactNode;\n foldableSingleScreen?: boolean;\n}\n\nexport interface CustomSnackbarProps {\n snackType: SnackType;\n snackMessage: string;\n}\n\nexport interface OverlayProviderProps {\n children: ReactNode;\n customSnackbar?: (props: CustomSnackbarProps) => React.ReactNode;\n loaderComponent?: () => React.ReactNode;\n maxSnackbarCount?: number;\n}\n\nexport interface AlertAction {\n label: string;\n onPress?: () => void;\n}\n\nexport interface ShowAlertProps {\n title?: string;\n informative?: string;\n actions?: AlertActions;\n isBackgroundTouchClose?: boolean;\n titleStyle?: TextProps['style'];\n informativeStyle?: TextProps['style'];\n secondaryButtonStyle?: TouchableOpacityProps['style'];\n primaryButtonStyle?: TouchableOpacityProps['style'];\n secondaryButtonTextStyle?: TextProps['style'];\n primaryButtonTextStyle?: TextProps['style'];\n}\n\nexport interface AlertActions {\n primary: AlertAction;\n secondary?: AlertAction;\n}\n\nexport interface SnackItem {\n message: string;\n type: SnackType;\n index: number;\n snackbarDuration?: number;\n}\n\nexport type SnackType = 'success' | 'error' | '';\n\nexport type HideOption = 'all' | 'snack' | 'alert' | 'bottomSheet' | 'loader' | 'popOver' | 'modal' | 'aboveKeyboard';\n\nexport interface ShowSnackBarProps {\n message: string;\n type?: SnackType;\n index?: number;\n snackbarDuration?: number;\n}\n\nexport interface BottomSheetOptions {\n isBackgroundTouchClose?: boolean;\n marginHorizontal?: number;\n marginBottom?: number;\n height?: BottomSheetHeight;\n maxHeight?: number;\n padding?: number;\n foldableSingleScreen?: boolean;\n type?: 'floating' | 'fixed';\n}\n\nexport type BottomSheetHeight = number | 'auto';\n\nexport interface ShowBottomSheetProps {\n headerComponent?: React.ReactNode;\n component: React.ReactNode;\n options?: BottomSheetOptions;\n}\n\nexport interface AboveKeyboardOptions {\n keyboardShowOffset?: number;\n keyboardHideOffset?: number;\n}\n\nexport enum FoldingState {\n FOLDED = 'folded',\n UNFOLDED = 'unfolded',\n}\n\nexport interface FoldingFeatureData {\n state: 'flat' | 'half_opened' | 'unknown';\n orientation: 'horizontal' | 'vertical' | 'unknown';\n isSeparating: boolean;\n bounds: {\n left: number;\n top: number;\n right: number;\n bottom: number;\n };\n}\n\nexport interface NativeFoldingStateInfo {\n foldingFeature: FoldingFeatureData | null;\n width: number;\n}\n\nexport interface FoldingStateInfo {\n foldingState: FoldingState;\n width: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFoldingState.d.ts","sourceRoot":"","sources":["../../src/model/useFoldingState.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgB,gBAAgB,EAA0B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useFoldingState.d.ts","sourceRoot":"","sources":["../../src/model/useFoldingState.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgB,gBAAgB,EAA0B,MAAM,SAAS,CAAC;AA8DjF,wBAAgB,eAAe,IAAI,gBAAgB,CAElD;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,40 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
2
|
import { Dimensions, Platform } from 'react-native';
|
|
3
3
|
import ZsUiModule from '../ZsUiModule';
|
|
4
4
|
import { FoldingState } from './types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
// 모듈 레벨 단일 스토어 — 훅 인스턴스마다 Dimensions 리스너와
|
|
6
|
+
// 네이티브 getFoldingFeature 호출이 중복되지 않도록 구독자 전체가 상태를 공유한다.
|
|
7
|
+
let foldingStateInfo = {
|
|
8
|
+
foldingState: FoldingState.FOLDED,
|
|
9
|
+
width: Dimensions.get('window').width,
|
|
10
|
+
};
|
|
11
|
+
const listeners = new Set();
|
|
12
|
+
let dimensionsSubscription = null;
|
|
13
|
+
function setFoldingStateInfo(next) {
|
|
14
|
+
if (next.foldingState === foldingStateInfo.foldingState &&
|
|
15
|
+
next.width === foldingStateInfo.width) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
foldingStateInfo = next;
|
|
19
|
+
listeners.forEach((listener) => listener());
|
|
20
|
+
}
|
|
21
|
+
async function updateFoldingState(fallbackWidth = Dimensions.get('window').width) {
|
|
22
|
+
// 폴딩 감지는 Android 전용이지만 width 는 전 플랫폼에서 추적한다.
|
|
23
|
+
if (Platform.OS !== 'android') {
|
|
24
|
+
setFoldingStateInfo({ foldingState: FoldingState.FOLDED, width: fallbackWidth });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const result = await ZsUiModule.getFoldingFeature();
|
|
29
|
+
setFoldingStateInfo({
|
|
30
|
+
foldingState: result?.foldingFeature ? FoldingState.UNFOLDED : FoldingState.FOLDED,
|
|
31
|
+
width: result?.width || fallbackWidth,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error('getFoldingFeature 호출 실패:', error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function subscribe(listener) {
|
|
39
|
+
listeners.add(listener);
|
|
40
|
+
if (listeners.size === 1) {
|
|
41
|
+
dimensionsSubscription = Dimensions.addEventListener('change', ({ window }) => {
|
|
30
42
|
updateFoldingState(window.width);
|
|
31
43
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
updateFoldingState();
|
|
45
|
+
}
|
|
46
|
+
return () => {
|
|
47
|
+
listeners.delete(listener);
|
|
48
|
+
if (listeners.size === 0) {
|
|
49
|
+
dimensionsSubscription?.remove();
|
|
50
|
+
dimensionsSubscription = null;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const getSnapshot = () => foldingStateInfo;
|
|
55
|
+
export function useFoldingState() {
|
|
56
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
38
57
|
}
|
|
39
58
|
export default useFoldingState;
|
|
40
59
|
//# sourceMappingURL=useFoldingState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFoldingState.js","sourceRoot":"","sources":["../../src/model/useFoldingState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useFoldingState.js","sourceRoot":"","sources":["../../src/model/useFoldingState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAA4C,MAAM,SAAS,CAAC;AAEjF,0CAA0C;AAC1C,wDAAwD;AACxD,IAAI,gBAAgB,GAAqB;IACvC,YAAY,EAA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AG,CAAC,QAAQ,CAAC,CAAC;IAExB,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACzB,sBAAsB,GAAG,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YAC5E,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,kBAAkB,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,GAAG,EAAE;QACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACzB,sBAAsB,EAAE,MAAM,EAAE,CAAC;YACjC,sBAAsB,GAAG,IAAI,CAAC;QAChC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC;AAE3C,MAAM,UAAU,eAAe;IAC7B,OAAO,oBAAoB,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["import { useSyncExternalStore } from 'react';\nimport { Dimensions, Platform } from 'react-native';\nimport ZsUiModule from '../ZsUiModule';\nimport { FoldingState, FoldingStateInfo, NativeFoldingStateInfo } from './types';\n\n// 모듈 레벨 단일 스토어 — 훅 인스턴스마다 Dimensions 리스너와\n// 네이티브 getFoldingFeature 호출이 중복되지 않도록 구독자 전체가 상태를 공유한다.\nlet foldingStateInfo: FoldingStateInfo = {\n foldingState: FoldingState.FOLDED,\n width: Dimensions.get('window').width,\n};\n\nconst listeners = new Set<() => void>();\nlet dimensionsSubscription: { remove: () => void } | null = null;\n\nfunction setFoldingStateInfo(next: FoldingStateInfo) {\n if (\n next.foldingState === foldingStateInfo.foldingState &&\n next.width === foldingStateInfo.width\n ) {\n return;\n }\n foldingStateInfo = next;\n listeners.forEach((listener) => listener());\n}\n\nasync function updateFoldingState(fallbackWidth = Dimensions.get('window').width) {\n // 폴딩 감지는 Android 전용이지만 width 는 전 플랫폼에서 추적한다.\n if (Platform.OS !== 'android') {\n setFoldingStateInfo({ foldingState: FoldingState.FOLDED, width: fallbackWidth });\n return;\n }\n\n try {\n const result = await ZsUiModule.getFoldingFeature() as NativeFoldingStateInfo | null;\n setFoldingStateInfo({\n foldingState: result?.foldingFeature ? FoldingState.UNFOLDED : FoldingState.FOLDED,\n width: result?.width || fallbackWidth,\n });\n } catch (error) {\n console.error('getFoldingFeature 호출 실패:', error);\n }\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n\n if (listeners.size === 1) {\n dimensionsSubscription = Dimensions.addEventListener('change', ({ window }) => {\n updateFoldingState(window.width);\n });\n updateFoldingState();\n }\n\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0) {\n dimensionsSubscription?.remove();\n dimensionsSubscription = null;\n }\n };\n}\n\nconst getSnapshot = () => foldingStateInfo;\n\nexport function useFoldingState(): FoldingStateInfo {\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n}\n\nexport default useFoldingState;\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ShowAlertProps } from '../../model/types';
|
|
3
|
-
declare function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, }: ShowAlertProps):
|
|
2
|
+
declare function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, }: ShowAlertProps): import("react").JSX.Element | null;
|
|
4
3
|
export default AlertOverlay;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUjE,iBAAS,YAAY,CAAC,EACpB,OAAO,EACP,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,GACvB,EAAE,cAAc,sCAyDhB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
3
|
import { StyleSheet, TouchableOpacity, useWindowDimensions } from 'react-native';
|
|
4
4
|
import Animated, { FadeInDown, FadeOutDown } from 'react-native-reanimated';
|
|
@@ -7,8 +7,9 @@ import { useTheme } from '../../context/ThemeContext';
|
|
|
7
7
|
import ModalBackground from '../ui/ModalBackground';
|
|
8
8
|
import ViewAtom from '../../ui/atoms/ViewAtom';
|
|
9
9
|
import { Z_INDEX_VALUE } from '../../model/utils';
|
|
10
|
+
import { DURATION, RADIUS } from '../../theme/tokens';
|
|
10
11
|
import ZSText from '../../ui/ZSText';
|
|
11
|
-
function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, }) {
|
|
12
|
+
function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, }) {
|
|
12
13
|
const { alertVisible, setAlertVisible } = useAlert();
|
|
13
14
|
const { palette: { background, primary: primaryColor, modalBgColor } } = useTheme();
|
|
14
15
|
const styles = useMemo(() => createStyles({ background }), [background]);
|
|
@@ -22,11 +23,11 @@ function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, tit
|
|
|
22
23
|
}, [setAlertVisible]);
|
|
23
24
|
return (!alertVisible ? null :
|
|
24
25
|
_jsx(ModalBackground, { zIndex: Z_INDEX_VALUE.ALERT, modalBgColor: modalBgColor, onPress: () => { if (isBackgroundTouchClose)
|
|
25
|
-
setAlertVisible(false); }, children: _jsxs(Animated.View, { entering: FadeInDown.duration(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
setAlertVisible(false); }, children: _jsxs(Animated.View, { entering: FadeInDown.duration(DURATION.enter), exiting: FadeOutDown.duration(DURATION.press), style: [styles.contentContainer, { width: modalWidth }], children: [title && (_jsx(ZSText, { typo: 'subTitle.1', style: [styles.title, titleStyle], children: title })), informative && (_jsx(ZSText, { typo: 'body.2', style: [styles.informative, informativeStyle], children: informative })), actions && (_jsxs(ViewAtom, { style: styles.buttonContainer, children: [secondary && (_jsx(TouchableOpacity, { style: [
|
|
27
|
+
styles.button,
|
|
28
|
+
{ backgroundColor: background.neutral },
|
|
29
|
+
secondaryButtonStyle
|
|
30
|
+
], onPress: handleButtonPress(secondary?.onPress), children: _jsx(ZSText, { typo: 'label.2', style: [secondaryButtonTextStyle], children: secondary.label }) })), _jsx(TouchableOpacity, { style: [styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle], onPress: handleButtonPress(primary?.onPress), children: _jsx(ZSText, { typo: 'label.2', color: 'white', style: [primaryButtonTextStyle], children: primary?.label || '확인' }) })] }))] }) }, alertVisible ? 'visibleao' : 'hiddenao'));
|
|
30
31
|
}
|
|
31
32
|
export default AlertOverlay;
|
|
32
33
|
const createStyles = ({ background }) => StyleSheet.create({
|
|
@@ -46,13 +47,14 @@ const createStyles = ({ background }) => StyleSheet.create({
|
|
|
46
47
|
marginTop: 24,
|
|
47
48
|
alignItems: 'center',
|
|
48
49
|
justifyContent: 'flex-end',
|
|
50
|
+
gap: 8,
|
|
49
51
|
},
|
|
50
52
|
button: {
|
|
51
53
|
flex: 1,
|
|
52
54
|
justifyContent: 'center',
|
|
53
55
|
alignItems: 'center',
|
|
54
56
|
paddingVertical: 14,
|
|
55
|
-
borderRadius:
|
|
57
|
+
borderRadius: RADIUS.md,
|
|
56
58
|
},
|
|
57
59
|
avoidingView: {
|
|
58
60
|
flex: 1,
|
|
@@ -61,7 +63,7 @@ const createStyles = ({ background }) => StyleSheet.create({
|
|
|
61
63
|
contentContainer: {
|
|
62
64
|
alignItems: 'center',
|
|
63
65
|
backgroundColor: background.base,
|
|
64
|
-
borderRadius:
|
|
66
|
+
borderRadius: RADIUS.xxl,
|
|
65
67
|
paddingBottom: 18,
|
|
66
68
|
paddingTop: 24,
|
|
67
69
|
paddingHorizontal: 20,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,eAAe,MAAM,uBAAuB,CAAC;AACpD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAA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,IArCX,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAsC5B,CACrB,CAAA;AACH,CAAC;AAED,eAAe,YAAY,CAAC;AAE5B,MAAM,YAAY,GAAG,CAAC,EAAE,UAAU,EAAoC,EAAE,EAAE,CACxE,UAAU,CAAC,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,MAAM;QACb,iBAAiB,EAAE,CAAC;KACrB;IACD,WAAW,EAAE;QACX,SAAS,EAAE,CAAC;QACZ,KAAK,EAAE,MAAM;QACb,iBAAiB,EAAE,CAAC;KACrB;IACD,eAAe,EAAE;QACf,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,UAAU;QAC1B,GAAG,EAAE,CAAC;KACP;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,MAAM,CAAC,EAAE;KACxB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;IACD,gBAAgB,EAAE;QAChB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,UAAU,CAAC,IAAI;QAChC,YAAY,EAAE,MAAM,CAAC,GAAG;QACxB,aAAa,EAAE,EAAE;QACjB,UAAU,EAAE,EAAE;QACd,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC,CAAC","sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { StyleSheet, TouchableOpacity, useWindowDimensions } from 'react-native';\nimport Animated, { FadeInDown, FadeOutDown } from 'react-native-reanimated';\nimport { AlertActions, ShowAlertProps } from '../../model/types';\nimport { useAlert } from '../../model/useOverlay';\nimport { useTheme } from '../../context/ThemeContext';\nimport { ThemeBackground } from '../../theme/types';\nimport ModalBackground from '../ui/ModalBackground';\nimport ViewAtom from '../../ui/atoms/ViewAtom';\nimport { Z_INDEX_VALUE } from '../../model/utils';\nimport { DURATION, RADIUS } from '../../theme/tokens';\nimport ZSText from '../../ui/ZSText';\n\nfunction AlertOverlay({\n actions,\n title,\n informative,\n isBackgroundTouchClose,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n primaryButtonTextStyle,\n}: ShowAlertProps) {\n const { alertVisible, setAlertVisible } = useAlert();\n const { palette: { background, primary: primaryColor, modalBgColor } } = useTheme();\n const styles = useMemo(() => createStyles({ background }), [background]);\n const { width: windowWidth } = useWindowDimensions();\n const modalWidth = Math.min(windowWidth - 60, 400);\n const { primary, secondary } = actions || {} as AlertActions;\n\n const handleButtonPress = useCallback((onPressFunction?: () => void) => () => {\n if (onPressFunction) onPressFunction();\n setAlertVisible(false);\n }, [setAlertVisible]);\n\n return (\n !alertVisible ? null :\n <ModalBackground\n zIndex={Z_INDEX_VALUE.ALERT}\n key={alertVisible ? 'visibleao' : 'hiddenao'}\n modalBgColor={modalBgColor}\n onPress={() => { if (isBackgroundTouchClose) setAlertVisible(false); }}\n >\n <Animated.View\n entering={FadeInDown.duration(DURATION.enter)}\n exiting={FadeOutDown.duration(DURATION.press)}\n style={[styles.contentContainer, { width: modalWidth }]}\n >\n {title && (\n <ZSText typo='subTitle.1' style={[styles.title, titleStyle]}>{title}</ZSText>\n )}\n {informative && (\n <ZSText typo='body.2' style={[styles.informative, informativeStyle]}>{informative}</ZSText>\n )}\n {actions && (\n <ViewAtom style={styles.buttonContainer}>\n {secondary && (\n <TouchableOpacity\n style={[\n styles.button,\n { backgroundColor: background.neutral },\n secondaryButtonStyle\n ]}\n onPress={handleButtonPress(secondary?.onPress)}\n >\n <ZSText typo='label.2' style={[secondaryButtonTextStyle]}>{secondary.label}</ZSText>\n </TouchableOpacity>\n )}\n <TouchableOpacity\n style={[styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle]}\n onPress={handleButtonPress(primary?.onPress)}\n >\n <ZSText typo='label.2' color='white' style={[primaryButtonTextStyle]}>{primary?.label || '확인'}</ZSText>\n </TouchableOpacity>\n </ViewAtom>\n )}\n </Animated.View>\n </ModalBackground>\n )\n}\n\nexport default AlertOverlay;\n\nconst createStyles = ({ background }: { background: ThemeBackground; }) =>\n StyleSheet.create({\n title: {\n marginBottom: 8,\n width: '100%',\n paddingHorizontal: 4\n },\n informative: {\n marginTop: 8,\n width: '100%',\n paddingHorizontal: 4\n },\n buttonContainer: {\n flexDirection: 'row',\n width: '100%',\n marginTop: 24,\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 8,\n },\n button: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 14,\n borderRadius: RADIUS.md,\n },\n avoidingView: {\n flex: 1,\n justifyContent: 'center'\n },\n contentContainer: {\n alignItems: 'center',\n backgroundColor: background.base,\n borderRadius: RADIUS.xxl,\n paddingBottom: 18,\n paddingTop: 24,\n paddingHorizontal: 20,\n },\n });\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/BottomSheetOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/BottomSheetOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAOjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAkDzD,iBAAS,kBAAkB,CAAC,EAC1B,eAAe,EACf,SAAS,EACT,OAAY,GACb,EAAE,oBAAoB,4BAgRtB;AA0CD,eAAe,kBAAkB,CAAC"}
|