@0610studio/zs-ui 0.18.0 → 0.18.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/ZsUiModule.d.ts.map +1 -1
- package/build/ZsUiModule.js +0 -2
- package/build/ZsUiModule.js.map +1 -1
- package/build/assets/SvgExclamation.d.ts.map +1 -1
- package/build/assets/SvgExclamation.js.map +1 -1
- package/build/context/OverlayContext.d.ts.map +1 -1
- package/build/context/OverlayContext.js +11 -14
- package/build/context/OverlayContext.js.map +1 -1
- package/build/context/ThemeContext.d.ts +9 -0
- package/build/context/ThemeContext.d.ts.map +1 -1
- package/build/context/ThemeContext.js +8 -11
- package/build/context/ThemeContext.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -7
- package/build/index.js.map +1 -1
- package/build/model/globalOverlay.d.ts +0 -8
- package/build/model/globalOverlay.d.ts.map +1 -1
- package/build/model/globalOverlay.js +0 -9
- package/build/model/globalOverlay.js.map +1 -1
- package/build/model/types.d.ts +1 -1
- package/build/model/types.d.ts.map +1 -1
- package/build/model/types.js.map +1 -1
- package/build/model/useKeyboard.d.ts.map +1 -1
- package/build/model/useKeyboard.js +8 -4
- package/build/model/useKeyboard.js.map +1 -1
- package/build/model/utils.d.ts +1 -1
- package/build/model/utils.d.ts.map +1 -1
- package/build/model/utils.js +2 -1
- package/build/model/utils.js.map +1 -1
- package/build/overlay/AlertOverlay/index.d.ts.map +1 -1
- package/build/overlay/AlertOverlay/index.js +2 -2
- 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 +18 -8
- package/build/overlay/BottomSheetOverlay/index.js.map +1 -1
- package/build/overlay/Modality/index.d.ts.map +1 -1
- package/build/overlay/Modality/index.js +3 -9
- 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 +3 -6
- package/build/overlay/PopOver/PopOverMenu.js.map +1 -1
- package/build/overlay/SnackbarNotify/index.d.ts +3 -3
- package/build/overlay/SnackbarNotify/index.d.ts.map +1 -1
- package/build/overlay/SnackbarNotify/index.js +5 -4
- package/build/overlay/SnackbarNotify/index.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/overlay/ZSPortal/index.d.ts.map +1 -1
- package/build/overlay/ZSPortal/index.js +15 -4
- package/build/overlay/ZSPortal/index.js.map +1 -1
- package/build/overlay/ui/ModalBackground.js.map +1 -1
- package/build/theme/elevation.d.ts +94 -10
- package/build/theme/elevation.d.ts.map +1 -1
- package/build/theme/elevation.js +39 -35
- package/build/theme/elevation.js.map +1 -1
- package/build/theme/palette.d.ts +1 -5
- package/build/theme/palette.d.ts.map +1 -1
- package/build/theme/palette.js +3 -12
- package/build/theme/palette.js.map +1 -1
- package/build/theme/resolveColor.d.ts +4 -0
- package/build/theme/resolveColor.d.ts.map +1 -0
- package/build/theme/resolveColor.js +29 -0
- package/build/theme/resolveColor.js.map +1 -0
- package/build/ui/ZSBlockButton/index.d.ts +4 -2
- package/build/ui/ZSBlockButton/index.d.ts.map +1 -1
- package/build/ui/ZSBlockButton/index.js +31 -79
- package/build/ui/ZSBlockButton/index.js.map +1 -1
- package/build/ui/ZSContainer/index.d.ts +20 -0
- package/build/ui/ZSContainer/index.d.ts.map +1 -1
- package/build/ui/ZSContainer/index.js +28 -15
- 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 +0 -2
- package/build/ui/ZSPressable/index.js.map +1 -1
- package/build/ui/ZSRadioGroup/index.d.ts +3 -2
- package/build/ui/ZSRadioGroup/index.d.ts.map +1 -1
- package/build/ui/ZSRadioGroup/index.js +64 -52
- package/build/ui/ZSRadioGroup/index.js.map +1 -1
- package/build/ui/ZSSkeleton/index.d.ts +2 -1
- package/build/ui/ZSSkeleton/index.d.ts.map +1 -1
- package/build/ui/ZSSkeleton/index.js +2 -2
- package/build/ui/ZSSkeleton/index.js.map +1 -1
- package/build/ui/ZSSkeletonBox/index.d.ts +2 -1
- package/build/ui/ZSSkeletonBox/index.d.ts.map +1 -1
- package/build/ui/ZSSkeletonBox/index.js +7 -5
- 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 +2 -2
- package/build/ui/ZSSwitch/index.js.map +1 -1
- package/build/ui/ZSText/index.d.ts +3 -2
- package/build/ui/ZSText/index.d.ts.map +1 -1
- package/build/ui/ZSText/index.js +5 -16
- package/build/ui/ZSText/index.js.map +1 -1
- package/build/ui/ZSTextField/index.d.ts.map +1 -1
- package/build/ui/ZSTextField/index.js +41 -28
- package/build/ui/ZSTextField/index.js.map +1 -1
- package/build/ui/ZSView/index.d.ts +3 -2
- package/build/ui/ZSView/index.d.ts.map +1 -1
- package/build/ui/ZSView/index.js +7 -8
- package/build/ui/ZSView/index.js.map +1 -1
- package/build/ui/atoms/AnimatedWrapper.d.ts.map +1 -1
- package/build/ui/atoms/AnimatedWrapper.js +33 -40
- package/build/ui/atoms/AnimatedWrapper.js.map +1 -1
- package/build/ui/atoms/TextAtom.d.ts +1 -2
- package/build/ui/atoms/TextAtom.d.ts.map +1 -1
- package/build/ui/atoms/TextAtom.js.map +1 -1
- package/build/ui/atoms/ViewAtom.d.ts +1 -2
- package/build/ui/atoms/ViewAtom.d.ts.map +1 -1
- package/build/ui/atoms/ViewAtom.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZsUiModule.d.ts","sourceRoot":"","sources":["../src/ZsUiModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,iBAAiB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtD;
|
|
1
|
+
{"version":3,"file":"ZsUiModule.d.ts","sourceRoot":"","sources":["../src/ZsUiModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,iBAAiB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtD;AAED,QAAA,MAAM,UAAU,EAAkC,mBAAmB,CAAC;AAEtE,eAAe,UAAU,CAAC"}
|
package/build/ZsUiModule.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
-
// It loads the native module object from the JSI or falls back to
|
|
3
|
-
// the bridge module (from NativeModulesProxy) if the remote debugger is on.
|
|
4
2
|
const ZsUiModule = requireNativeModule('ZsUi');
|
|
5
3
|
export default ZsUiModule;
|
|
6
4
|
//# sourceMappingURL=ZsUiModule.js.map
|
package/build/ZsUiModule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZsUiModule.js","sourceRoot":"","sources":["../src/ZsUiModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOxD,
|
|
1
|
+
{"version":3,"file":"ZsUiModule.js","sourceRoot":"","sources":["../src/ZsUiModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOxD,MAAM,UAAU,GAAG,mBAAmB,CAAC,MAAM,CAAwB,CAAC;AAEtE,eAAe,UAAU,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\nimport { NativeFoldingStateInfo } from './model/types';\n\ninterface ZsUiModuleInterface {\n getFoldingFeature(): Promise<NativeFoldingStateInfo>;\n}\n\nconst ZsUiModule = requireNativeModule('ZsUi') as ZsUiModuleInterface;\n\nexport default ZsUiModule;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgExclamation.d.ts","sourceRoot":"","sources":["../../src/assets/SvgExclamation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,cAAc,GAAI;;;;CAIvB,
|
|
1
|
+
{"version":3,"file":"SvgExclamation.d.ts","sourceRoot":"","sources":["../../src/assets/SvgExclamation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,cAAc,GAAI;;;;CAIvB,sBA4BA,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgExclamation.js","sourceRoot":"","sources":["../../src/assets/SvgExclamation.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,cAAc,GAAG,CAAC,EACtB,IAAI,GAAG,EAAE,EACT,eAAe,GAAG,SAAS,EAC3B,gBAAgB,GAAG,SAAS,GAC7B,EAAE,EAAE;IACH,OAAO,CACL,MAAC,GAAG,IACF,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"SvgExclamation.js","sourceRoot":"","sources":["../../src/assets/SvgExclamation.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,cAAc,GAAG,CAAC,EACtB,IAAI,GAAG,EAAE,EACT,eAAe,GAAG,SAAS,EAC3B,gBAAgB,GAAG,SAAS,GAC7B,EAAE,EAAE;IACH,OAAO,CACL,MAAC,GAAG,IACF,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,aAEnB,KAAC,MAAM,IACL,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,IAAI,EAAE,eAAe,GACrB,EAEF,KAAC,IAAI,IACH,CAAC,EAAC,WAAW,EACb,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,GACrB,EACF,KAAC,MAAM,IACL,EAAE,EAAC,MAAM,EACT,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,KAAK,EACP,IAAI,EAAE,gBAAgB,GACtB,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React from 'react';\nimport Svg, { Path, Circle } from 'react-native-svg';\n\nconst SvgExclamation = ({ \n size = 24,\n backgroundColor = '#FF4D4F',\n exclamationColor = '#FFFFFF',\n}) => {\n return (\n <Svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n >\n <Circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n fill={backgroundColor}\n />\n \n <Path\n d=\"M12 6.5v6\"\n stroke={exclamationColor}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n />\n <Circle\n cx=\"12.1\"\n cy=\"17\"\n r=\"1.5\"\n fill={exclamationColor}\n />\n </Svg>\n );\n};\n\nexport default SvgExclamation;"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayContext.d.ts","sourceRoot":"","sources":["../../src/context/OverlayContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverlayContext.d.ts","sourceRoot":"","sources":["../../src/context/OverlayContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAkF,oBAAoB,EAAwF,MAAM,gBAAgB,CAAC;AAkB5N,wBAAgB,eAAe,CAAC,EAC9B,cAAc,EACd,gBAAoB,EACpB,eAAe,EACf,QAAQ,EACT,EAAE,oBAAoB,+BAgStB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { BackHandler,
|
|
2
|
+
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { BackHandler, Keyboard, useWindowDimensions } from 'react-native';
|
|
4
4
|
import { AlertContext, SnackbarContext, BottomSheetContext, PopOverContext, ModalityContext, LoaderContext, OverlayContext } from '../model/useOverlay';
|
|
5
5
|
import AlertOverlay from '../overlay/AlertOverlay';
|
|
6
6
|
import SnackbarNotify from '../overlay/SnackbarNotify';
|
|
@@ -10,9 +10,15 @@ import PopOverMenu from '../overlay/PopOver/PopOverMenu';
|
|
|
10
10
|
import Modality from '../overlay/Modality';
|
|
11
11
|
import { PortalProvider } from '../overlay/ZSPortal';
|
|
12
12
|
import { setGlobalOverlayRef } from '../model/globalOverlay';
|
|
13
|
+
const MemoizedAlertOverlay = memo(AlertOverlay);
|
|
14
|
+
const MemoizedSnackbarNotify = memo(SnackbarNotify);
|
|
15
|
+
const MemoizedBottomSheetOverlay = memo(BottomSheetOverlay);
|
|
16
|
+
const MemoizedLoadingNotify = memo(LoadingNotify);
|
|
17
|
+
const MemoizedPopOverMenu = memo(PopOverMenu);
|
|
18
|
+
const MemoizedModality = memo(Modality);
|
|
19
|
+
const EMPTY_ALERT_ACTIONS = {};
|
|
13
20
|
export function OverlayProvider({ customSnackbar, maxSnackbarCount = 3, loaderComponent, children }) {
|
|
14
|
-
const defaultBottomSheetMaxHeight =
|
|
15
|
-
// Alert
|
|
21
|
+
const { height: defaultBottomSheetMaxHeight } = useWindowDimensions();
|
|
16
22
|
const [title, setTitle] = useState('');
|
|
17
23
|
const [informative, setInformative] = useState('');
|
|
18
24
|
const [alertVisible, setAlertVisible] = useState(false);
|
|
@@ -23,22 +29,17 @@ export function OverlayProvider({ customSnackbar, maxSnackbarCount = 3, loaderCo
|
|
|
23
29
|
const [secondaryButtonStyle, setSecondaryButtonStyle] = useState();
|
|
24
30
|
const [primaryButtonStyle, setPrimaryButtonStyle] = useState();
|
|
25
31
|
const [secondaryButtonTextStyle, setSecondaryButtonTextStyle] = useState();
|
|
26
|
-
// Snackbar
|
|
27
32
|
const [snackItemStack, setSnackItemStack] = useState([]);
|
|
28
|
-
// BottomSheet
|
|
29
33
|
const [bottomSheetVisible, setBottomSheetVisible] = useState(false);
|
|
30
34
|
const [bottomSheetComponent, setBottomSheetComponent] = useState(null);
|
|
31
35
|
const [bottomSheetHeader, setBottomSheetHeader] = useState(null);
|
|
32
36
|
const [bottomSheetOptions, setBottomSheetOptions] = useState();
|
|
33
37
|
const [bottomSheetHeight, setBottomSheetHeight] = useState(300);
|
|
34
38
|
const [bottomSheetMaxHeight, setBottomSheetMaxHeight] = useState(defaultBottomSheetMaxHeight);
|
|
35
|
-
// Loading
|
|
36
39
|
const [loaderVisible, setLoaderVisible] = useState(false);
|
|
37
|
-
// PopOver
|
|
38
40
|
const [popOverVisible, setPopOverVisible] = useState(false);
|
|
39
41
|
const [popOverLocation, setPopOverLocation] = useState({ px: 0, py: 0 });
|
|
40
42
|
const [popOverComponent, setPopOverComponent] = useState(false);
|
|
41
|
-
// Modality
|
|
42
43
|
const [modalityVisible, setModalityVisible] = useState(false);
|
|
43
44
|
const [modalityComponent, setModalityComponent] = useState(false);
|
|
44
45
|
const [modalityFoldableSingleScreen, setModalityFoldableSingleScreen] = useState(false);
|
|
@@ -122,7 +123,6 @@ export function OverlayProvider({ customSnackbar, maxSnackbarCount = 3, loaderCo
|
|
|
122
123
|
}
|
|
123
124
|
;
|
|
124
125
|
}, []);
|
|
125
|
-
// 안드로이드 뒤로가기 버튼 제어
|
|
126
126
|
const backPressHandler = useCallback(() => {
|
|
127
127
|
if (loaderVisible) {
|
|
128
128
|
return true;
|
|
@@ -137,7 +137,6 @@ export function OverlayProvider({ customSnackbar, maxSnackbarCount = 3, loaderCo
|
|
|
137
137
|
const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);
|
|
138
138
|
return () => backHandler.remove();
|
|
139
139
|
}, [backPressHandler]);
|
|
140
|
-
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
141
140
|
const overlayContextValue = useMemo(() => ({
|
|
142
141
|
hideOverlay,
|
|
143
142
|
showAlert,
|
|
@@ -147,10 +146,8 @@ export function OverlayProvider({ customSnackbar, maxSnackbarCount = 3, loaderCo
|
|
|
147
146
|
showModality,
|
|
148
147
|
showLoader,
|
|
149
148
|
}), [hideOverlay, showAlert, showSnackBar, showBottomSheet, showPopOverMenu, showModality, showLoader]);
|
|
150
|
-
// Global overlay reference 업데이트
|
|
151
149
|
useEffect(() => {
|
|
152
150
|
setGlobalOverlayRef(overlayContextValue);
|
|
153
|
-
// Cleanup 시 global reference 제거
|
|
154
151
|
return () => {
|
|
155
152
|
setGlobalOverlayRef(null);
|
|
156
153
|
};
|
|
@@ -203,6 +200,6 @@ export function OverlayProvider({ customSnackbar, maxSnackbarCount = 3, loaderCo
|
|
|
203
200
|
loaderVisible,
|
|
204
201
|
setLoaderVisible,
|
|
205
202
|
]);
|
|
206
|
-
return (_jsx(OverlayContext.Provider, { value: overlayContextValue, children: _jsx(AlertContext.Provider, { value: alertContextValue, children: _jsx(SnackbarContext.Provider, { value: snackbarContextValue, children: _jsx(BottomSheetContext.Provider, { value: bottomSheetContextValue, children: _jsx(PopOverContext.Provider, { value: popOverContextValue, children: _jsx(ModalityContext.Provider, { value: modalityContextValue, children: _jsx(LoaderContext.Provider, { value: loaderContextValue, children: _jsxs(PortalProvider, { children: [children, _jsx(
|
|
203
|
+
return (_jsx(OverlayContext.Provider, { value: overlayContextValue, children: _jsx(AlertContext.Provider, { value: alertContextValue, children: _jsx(SnackbarContext.Provider, { value: snackbarContextValue, children: _jsx(BottomSheetContext.Provider, { value: bottomSheetContextValue, children: _jsx(PopOverContext.Provider, { value: popOverContextValue, children: _jsx(ModalityContext.Provider, { value: modalityContextValue, children: _jsx(LoaderContext.Provider, { value: loaderContextValue, children: _jsxs(PortalProvider, { children: [children, _jsx(MemoizedModality, { modalityComponent: modalityComponent, foldableSingleScreen: modalityFoldableSingleScreen }), _jsx(MemoizedBottomSheetOverlay, { headerComponent: bottomSheetHeader, component: bottomSheetComponent, options: bottomSheetOptions }), _jsx(MemoizedPopOverMenu, { px: popOverLocation?.px, py: popOverLocation?.py, component: popOverComponent }), _jsx(MemoizedAlertOverlay, { title: title, informative: informative, actions: actions || EMPTY_ALERT_ACTIONS, isBackgroundTouchClose: isBackgroundTouchClose, titleStyle: titleStyle, informativeStyle: informativeStyle, secondaryButtonStyle: secondaryButtonStyle, primaryButtonStyle: primaryButtonStyle, secondaryButtonTextStyle: secondaryButtonTextStyle }), _jsx(MemoizedSnackbarNotify, { customSnackbar: customSnackbar }), _jsx(MemoizedLoadingNotify, { loaderComponent: loaderComponent })] }) }) }) }) }) }) }) }));
|
|
207
204
|
}
|
|
208
205
|
//# sourceMappingURL=OverlayContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayContext.js","sourceRoot":"","sources":["../../src/context/OverlayContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAoC,MAAM,cAAc,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAExJ,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,kBAAkB,MAAM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AC,cAAc,eACZ,QAAQ,EAET,KAAC,QAAQ,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,4BAA4B,GAAI,EAEtG,KAAC,kBAAkB,IACjB,eAAe,EAAE,iBAAiB,EAClC,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,kBAAkB,GAC3B,EAEF,KAAC,WAAW,IACV,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,SAAS,EAAE,gBAAgB,GAC3B,EAEF,KAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,IAAI,EAAkB,EACtC,sBAAsB,EAAE,sBAAsB,EAC9C,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,EACtC,wBAAwB,EAAE,wBAAwB,GAClD,EAEF,KAAC,cAAc,IACb,cAAc,EAAE,cAAc,GAC9B,EAEF,KAAC,aAAa,IACZ,eAAe,EAAE,eAAe,GAChC,IACa,GACM,GACA,GACH,GACE,GACL,GACL,GACA,CAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { BackHandler, Dimensions, Keyboard, TextProps, TouchableOpacityProps } from 'react-native';\nimport { AlertContext, SnackbarContext, BottomSheetContext, PopOverContext, ModalityContext, LoaderContext, OverlayContext } from '../model/useOverlay';\nimport { AlertActions, BottomSheetHeight, BottomSheetOptions, HideOption, ModalityProps, OverlayProviderProps, PopOverMenuProps, ShowAlertProps, ShowBottomSheetProps, ShowSnackBarProps, SnackItem } from '../model/types';\nimport AlertOverlay from '../overlay/AlertOverlay';\nimport SnackbarNotify from '../overlay/SnackbarNotify';\nimport BottomSheetOverlay from '../overlay/BottomSheetOverlay';\nimport LoadingNotify from '../overlay/LoadingNotify';\nimport PopOverMenu from '../overlay/PopOver/PopOverMenu';\nimport Modality from '../overlay/Modality';\nimport { PortalProvider } from '../overlay/ZSPortal';\nimport { setGlobalOverlayRef } from '../model/globalOverlay';\n\nexport function OverlayProvider({\n customSnackbar,\n maxSnackbarCount = 3,\n loaderComponent,\n children\n}: OverlayProviderProps) {\n const defaultBottomSheetMaxHeight = Dimensions.get('window').height;\n\n // Alert\n const [title, setTitle] = useState<string>('');\n const [informative, setInformative] = useState<string>('');\n const [alertVisible, setAlertVisible] = useState<boolean>(false);\n const [actions, setActions] = useState<AlertActions>();\n const [isBackgroundTouchClose, setIsBackgroundTouchClose] = useState<boolean>(true);\n const [titleStyle, setTitleStyle] = useState<TextProps['style']>();\n const [informativeStyle, setInformativeStyle] = useState<TextProps['style']>();\n const [secondaryButtonStyle, setSecondaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [primaryButtonStyle, setPrimaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [secondaryButtonTextStyle, setSecondaryButtonTextStyle] = useState<TextProps['style']>();\n\n // Snackbar\n const [snackItemStack, setSnackItemStack] = useState<SnackItem[]>([]);\n\n // BottomSheet\n const [bottomSheetVisible, setBottomSheetVisible] = useState<boolean>(false);\n const [bottomSheetComponent, setBottomSheetComponent] = useState<React.ReactNode>(null);\n const [bottomSheetHeader, setBottomSheetHeader] = useState<React.ReactNode>(null);\n const [bottomSheetOptions, setBottomSheetOptions] = useState<BottomSheetOptions>();\n const [bottomSheetHeight, setBottomSheetHeight] = useState<BottomSheetHeight>(300);\n const [bottomSheetMaxHeight, setBottomSheetMaxHeight] = useState<number>(defaultBottomSheetMaxHeight);\n\n // Loading\n const [loaderVisible, setLoaderVisible] = useState<boolean>(false);\n\n // PopOver\n const [popOverVisible, setPopOverVisible] = useState<boolean>(false);\n const [popOverLocation, setPopOverLocation] = useState<{ px: PopOverMenuProps['px'], py: PopOverMenuProps['py'] }>({ px: 0, py: 0 });\n const [popOverComponent, setPopOverComponent] = useState<React.ReactNode>(false);\n\n // Modality\n const [modalityVisible, setModalityVisible] = useState<boolean>(false);\n const [modalityComponent, setModalityComponent] = useState<React.ReactNode>(false);\n const [modalityFoldableSingleScreen, setModalityFoldableSingleScreen] = useState<boolean>(false);\n\n const showAlert = useCallback(({\n title,\n informative,\n actions,\n isBackgroundTouchClose = true,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n }: ShowAlertProps) => {\n Keyboard.dismiss();\n setTitle(title || '');\n setInformative(informative || '');\n setActions(actions || {} as AlertActions);\n setIsBackgroundTouchClose(isBackgroundTouchClose);\n setAlertVisible(true);\n\n setTitleStyle(titleStyle);\n setInformativeStyle(informativeStyle);\n setSecondaryButtonStyle(secondaryButtonStyle);\n setPrimaryButtonStyle(primaryButtonStyle);\n setSecondaryButtonTextStyle(secondaryButtonTextStyle);\n }, []);\n\n const showBottomSheet = useCallback(({\n headerComponent,\n component,\n options,\n }: ShowBottomSheetProps) => {\n Keyboard.dismiss();\n setBottomSheetComponent(component);\n setBottomSheetHeader(headerComponent);\n setBottomSheetOptions(options);\n setBottomSheetHeight(options?.height ?? 300);\n setBottomSheetMaxHeight(options?.maxHeight ?? defaultBottomSheetMaxHeight);\n setBottomSheetVisible(true);\n }, [defaultBottomSheetMaxHeight]);\n\n const showLoader = useCallback(() => {\n setLoaderVisible(true);\n }, []);\n\n const showPopOverMenu = useCallback(({\n px,\n py,\n component\n }: PopOverMenuProps) => {\n Keyboard.dismiss();\n setPopOverLocation({ px, py });\n setPopOverComponent(component);\n setPopOverVisible(true);\n }, []);\n\n const showModality = useCallback(({\n component,\n foldableSingleScreen\n }: ModalityProps) => {\n Keyboard.dismiss();\n setModalityComponent(component);\n setModalityVisible(true);\n setModalityFoldableSingleScreen(foldableSingleScreen || false);\n }, []);\n\n const showSnackBar = useCallback(({\n message,\n type = 'success',\n index = Date.now(),\n snackbarDuration = 3500\n }: ShowSnackBarProps) => {\n setSnackItemStack((prev) => {\n const newStack = [...prev, { message, type, index: index, snackbarDuration: snackbarDuration }];\n return newStack.length > maxSnackbarCount ? newStack.slice(1) : newStack;\n });\n }, [maxSnackbarCount]);\n\n const hideSnackBar = useCallback((index: number) => {\n setSnackItemStack((prev) => prev.filter((item) => item.index !== index));\n }, []);\n\n const hideOverlay = useCallback((option: HideOption) => {\n Keyboard.dismiss();\n switch (option) {\n case 'alert':\n setAlertVisible(false);\n break;\n case 'modal':\n setModalityVisible(false);\n break;\n case 'snack':\n setSnackItemStack([]);\n break;\n case 'bottomSheet':\n setBottomSheetVisible(false);\n break;\n case 'loader':\n setLoaderVisible(false);\n break;\n case 'popOver':\n setPopOverVisible(false);\n break;\n case 'all':\n setModalityVisible(false);\n setAlertVisible(false);\n setSnackItemStack([]);\n setLoaderVisible(false);\n setPopOverVisible(false);\n setBottomSheetVisible(false);\n break;\n default:\n break;\n };\n }, []);\n\n // 안드로이드 뒤로가기 버튼 제어\n const backPressHandler = useCallback(() => {\n if (loaderVisible) {\n return true;\n }\n if (alertVisible || modalityVisible || popOverVisible || bottomSheetVisible) {\n hideOverlay('all');\n return true;\n }\n return false;\n }, [alertVisible, loaderVisible, modalityVisible, popOverVisible, bottomSheetVisible, hideOverlay]);\n\n useEffect(() => {\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);\n return () => backHandler.remove();\n }, [backPressHandler]);\n\n // ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n const overlayContextValue = useMemo(() => ({\n hideOverlay,\n showAlert,\n showSnackBar,\n showBottomSheet,\n showPopOverMenu,\n showModality,\n showLoader,\n }), [hideOverlay, showAlert, showSnackBar, showBottomSheet, showPopOverMenu, showModality, showLoader]);\n\n // Global overlay reference 업데이트\n useEffect(() => {\n setGlobalOverlayRef(overlayContextValue);\n\n // Cleanup 시 global reference 제거\n return () => {\n setGlobalOverlayRef(null);\n };\n }, [overlayContextValue]);\n\n const alertContextValue = useMemo(() => ({\n alertVisible,\n setAlertVisible,\n }), [\n alertVisible,\n setAlertVisible,\n ]);\n\n const snackbarContextValue = useMemo(() => ({\n snackItemStack,\n hideSnackBar,\n }), [\n snackItemStack,\n hideSnackBar,\n ]);\n\n const bottomSheetContextValue = useMemo(() => ({\n bottomSheetVisible,\n setBottomSheetVisible,\n height: bottomSheetHeight,\n setHeight: setBottomSheetHeight,\n maxHeight: bottomSheetMaxHeight,\n }), [\n bottomSheetVisible,\n setBottomSheetVisible,\n bottomSheetHeight,\n setBottomSheetHeight,\n bottomSheetMaxHeight,\n ]);\n\n const popOverContextValue = useMemo(() => ({\n popOverVisible,\n setPopOverVisible,\n }), [\n popOverVisible,\n setPopOverVisible,\n ]);\n\n const modalityContextValue = useMemo(() => ({\n modalityVisible,\n setModalityVisible,\n }), [\n modalityVisible,\n setModalityVisible,\n ]);\n\n const loaderContextValue = useMemo(() => ({\n loaderVisible,\n setLoaderVisible,\n }), [\n loaderVisible,\n setLoaderVisible,\n ]);\n\n return (\n <OverlayContext.Provider value={overlayContextValue}>\n <AlertContext.Provider value={alertContextValue}>\n <SnackbarContext.Provider value={snackbarContextValue}>\n <BottomSheetContext.Provider value={bottomSheetContextValue}>\n <PopOverContext.Provider value={popOverContextValue}>\n <ModalityContext.Provider value={modalityContextValue}>\n <LoaderContext.Provider value={loaderContextValue}>\n <PortalProvider>\n {children}\n\n <Modality modalityComponent={modalityComponent} foldableSingleScreen={modalityFoldableSingleScreen} />\n\n <BottomSheetOverlay\n headerComponent={bottomSheetHeader}\n component={bottomSheetComponent}\n options={bottomSheetOptions}\n />\n\n <PopOverMenu\n px={popOverLocation?.px}\n py={popOverLocation?.py}\n component={popOverComponent}\n />\n\n <AlertOverlay\n title={title}\n informative={informative}\n actions={actions || {} as AlertActions}\n isBackgroundTouchClose={isBackgroundTouchClose}\n titleStyle={titleStyle}\n informativeStyle={informativeStyle}\n secondaryButtonStyle={secondaryButtonStyle}\n primaryButtonStyle={primaryButtonStyle}\n secondaryButtonTextStyle={secondaryButtonTextStyle}\n />\n\n <SnackbarNotify\n customSnackbar={customSnackbar}\n />\n\n <LoadingNotify\n loaderComponent={loaderComponent}\n />\n </PortalProvider>\n </LoaderContext.Provider>\n </ModalityContext.Provider>\n </PopOverContext.Provider>\n </BottomSheetContext.Provider>\n </SnackbarContext.Provider>\n </AlertContext.Provider>\n </OverlayContext.Provider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OverlayContext.js","sourceRoot":"","sources":["../../src/context/OverlayContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAoC,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAExJ,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,oBAAoB,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;AAChD,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;AACpD,MAAM,0BAA0B,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAC5D,MAAM,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;AAClD,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;AAC9C,MA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E,eAAe,EAAE,EAAE,EACvB,SAAS,EAAE,gBAAgB,GAC3B,EAEF,KAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,IAAI,mBAAmB,EACvC,sBAAsB,EAAE,sBAAsB,EAC9C,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB,EACtC,wBAAwB,EAAE,wBAAwB,GAClD,EAEF,KAAC,sBAAsB,IACrB,cAAc,EAAE,cAAc,GAC9B,EAEF,KAAC,qBAAqB,IACpB,eAAe,EAAE,eAAe,GAChC,IACa,GACM,GACA,GACH,GACE,GACL,GACL,GACA,CAC3B,CAAC;AACJ,CAAC","sourcesContent":["import { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { BackHandler, Keyboard, TextProps, TouchableOpacityProps, useWindowDimensions } from 'react-native';\nimport { AlertContext, SnackbarContext, BottomSheetContext, PopOverContext, ModalityContext, LoaderContext, OverlayContext } from '../model/useOverlay';\nimport { AlertActions, BottomSheetHeight, BottomSheetOptions, HideOption, ModalityProps, OverlayProviderProps, PopOverMenuProps, ShowAlertProps, ShowBottomSheetProps, ShowSnackBarProps, SnackItem } from '../model/types';\nimport AlertOverlay from '../overlay/AlertOverlay';\nimport SnackbarNotify from '../overlay/SnackbarNotify';\nimport BottomSheetOverlay from '../overlay/BottomSheetOverlay';\nimport LoadingNotify from '../overlay/LoadingNotify';\nimport PopOverMenu from '../overlay/PopOver/PopOverMenu';\nimport Modality from '../overlay/Modality';\nimport { PortalProvider } from '../overlay/ZSPortal';\nimport { setGlobalOverlayRef } from '../model/globalOverlay';\n\nconst MemoizedAlertOverlay = memo(AlertOverlay);\nconst MemoizedSnackbarNotify = memo(SnackbarNotify);\nconst MemoizedBottomSheetOverlay = memo(BottomSheetOverlay);\nconst MemoizedLoadingNotify = memo(LoadingNotify);\nconst MemoizedPopOverMenu = memo(PopOverMenu);\nconst MemoizedModality = memo(Modality);\nconst EMPTY_ALERT_ACTIONS = {} as AlertActions;\n\nexport function OverlayProvider({\n customSnackbar,\n maxSnackbarCount = 3,\n loaderComponent,\n children\n}: OverlayProviderProps) {\n const { height: defaultBottomSheetMaxHeight } = useWindowDimensions();\n\n const [title, setTitle] = useState<string>('');\n const [informative, setInformative] = useState<string>('');\n const [alertVisible, setAlertVisible] = useState<boolean>(false);\n const [actions, setActions] = useState<AlertActions>();\n const [isBackgroundTouchClose, setIsBackgroundTouchClose] = useState<boolean>(true);\n const [titleStyle, setTitleStyle] = useState<TextProps['style']>();\n const [informativeStyle, setInformativeStyle] = useState<TextProps['style']>();\n const [secondaryButtonStyle, setSecondaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [primaryButtonStyle, setPrimaryButtonStyle] = useState<TouchableOpacityProps['style']>();\n const [secondaryButtonTextStyle, setSecondaryButtonTextStyle] = useState<TextProps['style']>();\n\n const [snackItemStack, setSnackItemStack] = useState<SnackItem[]>([]);\n\n const [bottomSheetVisible, setBottomSheetVisible] = useState<boolean>(false);\n const [bottomSheetComponent, setBottomSheetComponent] = useState<ReactNode>(null);\n const [bottomSheetHeader, setBottomSheetHeader] = useState<ReactNode>(null);\n const [bottomSheetOptions, setBottomSheetOptions] = useState<BottomSheetOptions>();\n const [bottomSheetHeight, setBottomSheetHeight] = useState<BottomSheetHeight>(300);\n const [bottomSheetMaxHeight, setBottomSheetMaxHeight] = useState<number>(defaultBottomSheetMaxHeight);\n\n const [loaderVisible, setLoaderVisible] = useState<boolean>(false);\n\n const [popOverVisible, setPopOverVisible] = useState<boolean>(false);\n const [popOverLocation, setPopOverLocation] = useState<{ px: PopOverMenuProps['px'], py: PopOverMenuProps['py'] }>({ px: 0, py: 0 });\n const [popOverComponent, setPopOverComponent] = useState<ReactNode>(false);\n\n const [modalityVisible, setModalityVisible] = useState<boolean>(false);\n const [modalityComponent, setModalityComponent] = useState<ReactNode>(false);\n const [modalityFoldableSingleScreen, setModalityFoldableSingleScreen] = useState<boolean>(false);\n\n const showAlert = useCallback(({\n title,\n informative,\n actions,\n isBackgroundTouchClose = true,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n }: ShowAlertProps) => {\n Keyboard.dismiss();\n setTitle(title || '');\n setInformative(informative || '');\n setActions(actions || {} as AlertActions);\n setIsBackgroundTouchClose(isBackgroundTouchClose);\n setAlertVisible(true);\n\n setTitleStyle(titleStyle);\n setInformativeStyle(informativeStyle);\n setSecondaryButtonStyle(secondaryButtonStyle);\n setPrimaryButtonStyle(primaryButtonStyle);\n setSecondaryButtonTextStyle(secondaryButtonTextStyle);\n }, []);\n\n const showBottomSheet = useCallback(({\n headerComponent,\n component,\n options,\n }: ShowBottomSheetProps) => {\n Keyboard.dismiss();\n setBottomSheetComponent(component);\n setBottomSheetHeader(headerComponent);\n setBottomSheetOptions(options);\n setBottomSheetHeight(options?.height ?? 300);\n setBottomSheetMaxHeight(options?.maxHeight ?? defaultBottomSheetMaxHeight);\n setBottomSheetVisible(true);\n }, [defaultBottomSheetMaxHeight]);\n\n const showLoader = useCallback(() => {\n setLoaderVisible(true);\n }, []);\n\n const showPopOverMenu = useCallback(({\n px,\n py,\n component\n }: PopOverMenuProps) => {\n Keyboard.dismiss();\n setPopOverLocation({ px, py });\n setPopOverComponent(component);\n setPopOverVisible(true);\n }, []);\n\n const showModality = useCallback(({\n component,\n foldableSingleScreen\n }: ModalityProps) => {\n Keyboard.dismiss();\n setModalityComponent(component);\n setModalityVisible(true);\n setModalityFoldableSingleScreen(foldableSingleScreen || false);\n }, []);\n\n const showSnackBar = useCallback(({\n message,\n type = 'success',\n index = Date.now(),\n snackbarDuration = 3500\n }: ShowSnackBarProps) => {\n setSnackItemStack((prev) => {\n const newStack = [...prev, { message, type, index: index, snackbarDuration: snackbarDuration }];\n return newStack.length > maxSnackbarCount ? newStack.slice(1) : newStack;\n });\n }, [maxSnackbarCount]);\n\n const hideSnackBar = useCallback((index: number) => {\n setSnackItemStack((prev) => prev.filter((item) => item.index !== index));\n }, []);\n\n const hideOverlay = useCallback((option: HideOption) => {\n Keyboard.dismiss();\n switch (option) {\n case 'alert':\n setAlertVisible(false);\n break;\n case 'modal':\n setModalityVisible(false);\n break;\n case 'snack':\n setSnackItemStack([]);\n break;\n case 'bottomSheet':\n setBottomSheetVisible(false);\n break;\n case 'loader':\n setLoaderVisible(false);\n break;\n case 'popOver':\n setPopOverVisible(false);\n break;\n case 'all':\n setModalityVisible(false);\n setAlertVisible(false);\n setSnackItemStack([]);\n setLoaderVisible(false);\n setPopOverVisible(false);\n setBottomSheetVisible(false);\n break;\n default:\n break;\n };\n }, []);\n\n const backPressHandler = useCallback(() => {\n if (loaderVisible) {\n return true;\n }\n if (alertVisible || modalityVisible || popOverVisible || bottomSheetVisible) {\n hideOverlay('all');\n return true;\n }\n return false;\n }, [alertVisible, loaderVisible, modalityVisible, popOverVisible, bottomSheetVisible, hideOverlay]);\n\n useEffect(() => {\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);\n return () => backHandler.remove();\n }, [backPressHandler]);\n\n const overlayContextValue = useMemo(() => ({\n hideOverlay,\n showAlert,\n showSnackBar,\n showBottomSheet,\n showPopOverMenu,\n showModality,\n showLoader,\n }), [hideOverlay, showAlert, showSnackBar, showBottomSheet, showPopOverMenu, showModality, showLoader]);\n\n useEffect(() => {\n setGlobalOverlayRef(overlayContextValue);\n\n return () => {\n setGlobalOverlayRef(null);\n };\n }, [overlayContextValue]);\n\n const alertContextValue = useMemo(() => ({\n alertVisible,\n setAlertVisible,\n }), [\n alertVisible,\n setAlertVisible,\n ]);\n\n const snackbarContextValue = useMemo(() => ({\n snackItemStack,\n hideSnackBar,\n }), [\n snackItemStack,\n hideSnackBar,\n ]);\n\n const bottomSheetContextValue = useMemo(() => ({\n bottomSheetVisible,\n setBottomSheetVisible,\n height: bottomSheetHeight,\n setHeight: setBottomSheetHeight,\n maxHeight: bottomSheetMaxHeight,\n }), [\n bottomSheetVisible,\n setBottomSheetVisible,\n bottomSheetHeight,\n setBottomSheetHeight,\n bottomSheetMaxHeight,\n ]);\n\n const popOverContextValue = useMemo(() => ({\n popOverVisible,\n setPopOverVisible,\n }), [\n popOverVisible,\n setPopOverVisible,\n ]);\n\n const modalityContextValue = useMemo(() => ({\n modalityVisible,\n setModalityVisible,\n }), [\n modalityVisible,\n setModalityVisible,\n ]);\n\n const loaderContextValue = useMemo(() => ({\n loaderVisible,\n setLoaderVisible,\n }), [\n loaderVisible,\n setLoaderVisible,\n ]);\n\n return (\n <OverlayContext.Provider value={overlayContextValue}>\n <AlertContext.Provider value={alertContextValue}>\n <SnackbarContext.Provider value={snackbarContextValue}>\n <BottomSheetContext.Provider value={bottomSheetContextValue}>\n <PopOverContext.Provider value={popOverContextValue}>\n <ModalityContext.Provider value={modalityContextValue}>\n <LoaderContext.Provider value={loaderContextValue}>\n <PortalProvider>\n {children}\n\n <MemoizedModality modalityComponent={modalityComponent} foldableSingleScreen={modalityFoldableSingleScreen} />\n\n <MemoizedBottomSheetOverlay\n headerComponent={bottomSheetHeader}\n component={bottomSheetComponent}\n options={bottomSheetOptions}\n />\n\n <MemoizedPopOverMenu\n px={popOverLocation?.px}\n py={popOverLocation?.py}\n component={popOverComponent}\n />\n\n <MemoizedAlertOverlay\n title={title}\n informative={informative}\n actions={actions || EMPTY_ALERT_ACTIONS}\n isBackgroundTouchClose={isBackgroundTouchClose}\n titleStyle={titleStyle}\n informativeStyle={informativeStyle}\n secondaryButtonStyle={secondaryButtonStyle}\n primaryButtonStyle={primaryButtonStyle}\n secondaryButtonTextStyle={secondaryButtonTextStyle}\n />\n\n <MemoizedSnackbarNotify\n customSnackbar={customSnackbar}\n />\n\n <MemoizedLoadingNotify\n loaderComponent={loaderComponent}\n />\n </PortalProvider>\n </LoaderContext.Provider>\n </ModalityContext.Provider>\n </PopOverContext.Provider>\n </BottomSheetContext.Provider>\n </SnackbarContext.Provider>\n </AlertContext.Provider>\n </OverlayContext.Provider>\n );\n}\n"]}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Theme, ThemeFonts, TypographyVariantsProps } from '../theme/types';
|
|
3
3
|
import { ElevationStyles } from '../theme/elevation';
|
|
4
|
+
export interface FoldableConfig {
|
|
5
|
+
/**
|
|
6
|
+
* 언폴딩 상태에서 rightComponent가 없을 때(단일 화면) 콘텐츠 최대 가로 길이(px).
|
|
7
|
+
* 미주입(undefined) 또는 false면 전폭으로 늘린다. 폭을 제한하려면 반드시 값을 주입해야 한다.
|
|
8
|
+
*/
|
|
9
|
+
unfoldedSinglePaneMaxWidth?: number | false;
|
|
10
|
+
}
|
|
4
11
|
export interface ThemeProviderProps {
|
|
5
12
|
themeFonts?: ThemeFonts;
|
|
6
13
|
children: React.ReactNode;
|
|
@@ -12,11 +19,13 @@ export interface ThemeProviderProps {
|
|
|
12
19
|
dark?: Theme;
|
|
13
20
|
};
|
|
14
21
|
}) => Theme;
|
|
22
|
+
foldable?: FoldableConfig;
|
|
15
23
|
}
|
|
16
24
|
export interface ThemeProps {
|
|
17
25
|
palette: Palette;
|
|
18
26
|
typography: TypographyVariantsProps;
|
|
19
27
|
elevation: ElevationStyles;
|
|
28
|
+
foldable: FoldableConfig;
|
|
20
29
|
}
|
|
21
30
|
export interface Palette extends Theme {
|
|
22
31
|
mode: 'light' | 'dark';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../src/context/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiF,MAAM,OAAO,CAAC;AAKtG,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,OAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IACjC,U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Q,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,CAyGtD,CAAA"}
|
|
@@ -38,15 +38,14 @@ export const useTheme = () => {
|
|
|
38
38
|
}
|
|
39
39
|
return context;
|
|
40
40
|
};
|
|
41
|
-
export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true, customPalette }) => {
|
|
42
|
-
const systemColorScheme = useColorScheme();
|
|
41
|
+
export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true, customPalette, foldable }) => {
|
|
42
|
+
const systemColorScheme = useColorScheme();
|
|
43
43
|
const systemMode = getSystemMode(systemColorScheme);
|
|
44
44
|
const [themeState, dispatchTheme] = useReducer(themeReducer, {
|
|
45
45
|
isUsingSystemColorScheme: isDarkModeEnabled,
|
|
46
46
|
mode: isDarkModeEnabled ? systemMode : 'light',
|
|
47
47
|
});
|
|
48
48
|
const { isUsingSystemColorScheme, mode } = themeState;
|
|
49
|
-
// AsyncStorage에서 시스템 모드 사용 설정 값 로드
|
|
50
49
|
useEffect(() => {
|
|
51
50
|
let isMounted = true;
|
|
52
51
|
const loadSettings = async () => {
|
|
@@ -88,30 +87,27 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
88
87
|
isMounted = false;
|
|
89
88
|
};
|
|
90
89
|
}, [isDarkModeEnabled, systemMode]);
|
|
91
|
-
// 시스템 다크 모드 변경에 따른 효과 적용
|
|
92
90
|
useEffect(() => {
|
|
93
91
|
dispatchTheme({ type: 'SYNC_SYSTEM_MODE', systemMode });
|
|
94
92
|
}, [systemMode]);
|
|
95
|
-
// 안드로이드 하단 제스쳐 영역 스타일
|
|
96
93
|
useEffect(() => {
|
|
97
94
|
if (Platform.OS === 'android') {
|
|
98
95
|
NavigationBar.setStyle(mode);
|
|
99
96
|
}
|
|
100
97
|
}, [mode]);
|
|
101
|
-
// 테마 토글 함수
|
|
102
98
|
const toggleTheme = useCallback(async () => {
|
|
103
99
|
const newMode = mode === 'light' ? 'dark' : 'light';
|
|
104
|
-
dispatchTheme({ type: 'TOGGLE_THEME' });
|
|
100
|
+
dispatchTheme({ type: 'TOGGLE_THEME' });
|
|
105
101
|
await AsyncStorage.multiSet([
|
|
106
102
|
['useSystemColorScheme', 'false'],
|
|
107
103
|
['themeMode', newMode],
|
|
108
104
|
]);
|
|
109
105
|
}, [mode]);
|
|
110
|
-
// 시스템 모드 사용 설정 변경 함수
|
|
111
106
|
const handleSetUseSystemColorScheme = useCallback(async (useSystem) => {
|
|
112
107
|
dispatchTheme({ type: 'SET_USE_SYSTEM_COLOR_SCHEME', useSystem, systemMode });
|
|
113
108
|
await AsyncStorage.setItem('useSystemColorScheme', useSystem.toString());
|
|
114
109
|
}, [systemMode]);
|
|
110
|
+
const unfoldedSinglePaneMaxWidth = foldable?.unfoldedSinglePaneMaxWidth;
|
|
115
111
|
const themeValue = useMemo(() => {
|
|
116
112
|
const currentPalette = customPalette ? customPalette({ mode }) : palette({ mode });
|
|
117
113
|
return {
|
|
@@ -119,12 +115,13 @@ export const ThemeProvider = ({ themeFonts, children, isDarkModeEnabled = true,
|
|
|
119
115
|
isUsingSystemColorScheme,
|
|
120
116
|
setUseSystemColorScheme: handleSetUseSystemColorScheme,
|
|
121
117
|
toggleTheme,
|
|
122
|
-
...currentPalette,
|
|
118
|
+
...currentPalette,
|
|
123
119
|
},
|
|
124
120
|
typography: typography({ themeFonts }),
|
|
125
|
-
elevation: elevation(currentPalette)
|
|
121
|
+
elevation: elevation(currentPalette),
|
|
122
|
+
foldable: { unfoldedSinglePaneMaxWidth },
|
|
126
123
|
};
|
|
127
|
-
}, [mode, isUsingSystemColorScheme, themeFonts, customPalette, handleSetUseSystemColorScheme, toggleTheme]);
|
|
124
|
+
}, [mode, isUsingSystemColorScheme, themeFonts, customPalette, handleSetUseSystemColorScheme, toggleTheme, unfoldedSinglePaneMaxWidth]);
|
|
128
125
|
return (_jsx(ThemeContext.Provider, { value: themeValue, children: children }));
|
|
129
126
|
};
|
|
130
127
|
//# 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;AAsBhE,MAAM,YAAY,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAc5D,MAAM,aAAa,GAAG,CAAC,iBAAoD,EAAa,EAAE,CACxF,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAElD,SAAS,YAAY,CAAC,KAAiB,EAAE,MAAmB;IAC1D,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,KAAK,kBAAkB;YACrB,OAAO,KAAK,CAAC,wBAAwB;gBACnC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,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M,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,EAAE,oBAAoB;aACxC;YACD,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;YACtC,SAAS,EAAE,SAAS,CAAC,cAAc,CAAC;SACrC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,UAAU,EAAE,aAAa,EAAE,6BAA6B,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5G,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 ThemeProviderProps {\n themeFonts?: ThemeFonts;\n children: React.ReactNode;\n isDarkModeEnabled?: boolean;\n customPalette?: (config: { mode?: 'light' | 'dark'; themeColors?: { light?: Theme; dark?: Theme } }) => Theme;\n}\n\nexport interface ThemeProps {\n palette: Palette;\n typography: TypographyVariantsProps;\n elevation: ElevationStyles;\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 }) => {\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 // AsyncStorage에서 시스템 모드 사용 설정 값 로드\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 // 시스템 다크 모드 변경에 따른 효과 적용\n useEffect(() => {\n dispatchTheme({ type: 'SYNC_SYSTEM_MODE', systemMode });\n }, [systemMode]);\n\n // 안드로이드 하단 제스쳐 영역 스타일\n useEffect(() => {\n if (Platform.OS === 'android') {\n NavigationBar.setStyle(mode);\n }\n }, [mode])\n\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 // 시스템 모드 사용 설정 변경 함수\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 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 };\n }, [mode, isUsingSystemColorScheme, themeFonts, customPalette, handleSetUseSystemColorScheme, toggleTheme]);\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,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,iBAAoD,EAAa,EAAE,CACxF,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAElD,SAAS,YAAY,CAAC,KAAiB,EAAE,MAAmB;IAC1D,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,KAAK,kBAAkB;YACrB,OAAO,KAAK,CAAC,wBAAwB;gBACnC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE;gBACvC,CAAC,CAAC,KAAK,CAAC;QACZ,KAAK,6BAA6B;YAChC,OAAO;gBACL,GAAG,KAAK;gBACR,wBAAwB,EAAE,MAAM,CAAC,SAAS;gBAC1C,IAAI,EAAE,MAAM,CA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,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"]}
|
package/build/index.d.ts
CHANGED
|
@@ -23,10 +23,10 @@ import ZSBlockButton from './ui/ZSBlockButton';
|
|
|
23
23
|
import ZSSkeleton from './ui/ZSSkeleton';
|
|
24
24
|
import ZSSkeletonBox from './ui/ZSSkeletonBox';
|
|
25
25
|
export { useTheme, useFoldingState, ThemeProvider, OverlayProvider, themeFactory, ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ZSTextField, ZSRadioGroup, ZSSwitch, ErrorComponent, ZSAboveKeyboard, ZSBlockButton, ZSSkeleton, ZSSkeletonBox, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal, GlobalOverlay, useStyleSheetCreate, };
|
|
26
|
-
import type { ThemeProviderProps, ThemeProps, Palette } from "./context/ThemeContext";
|
|
26
|
+
import type { ThemeProviderProps, ThemeProps, Palette, FoldableConfig } from "./context/ThemeContext";
|
|
27
27
|
import { ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TypoColorOptions, ShadowLevel, ShadowStyle } from "./theme/types";
|
|
28
28
|
import { ThemeFactoryColors, ThemeFactoryConfig } from "./theme/palette";
|
|
29
29
|
import { SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetOptions, FoldingStateInfo } from "./model/types";
|
|
30
30
|
import { RadioOption } from "./ui/types";
|
|
31
|
-
export type { ThemeProviderProps, ThemeProps, Palette, 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, };
|
|
31
|
+
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, };
|
|
32
32
|
//# 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,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AAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,EACL,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,WAAW,EACX,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,YAAY,EACV,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,GACjB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -19,11 +19,5 @@ import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverBu
|
|
|
19
19
|
import ZSBlockButton from './ui/ZSBlockButton';
|
|
20
20
|
import ZSSkeleton from './ui/ZSSkeleton';
|
|
21
21
|
import ZSSkeletonBox from './ui/ZSSkeletonBox';
|
|
22
|
-
export { useTheme, useFoldingState, ThemeProvider, OverlayProvider, themeFactory,
|
|
23
|
-
// ---
|
|
24
|
-
ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ZSTextField, ZSRadioGroup, ZSSwitch, ErrorComponent, ZSAboveKeyboard, ZSBlockButton, ZSSkeleton, ZSSkeletonBox,
|
|
25
|
-
// ---
|
|
26
|
-
AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal,
|
|
27
|
-
// Global overlay functions
|
|
28
|
-
GlobalOverlay, useStyleSheetCreate, };
|
|
22
|
+
export { useTheme, useFoldingState, ThemeProvider, OverlayProvider, themeFactory, ZSView, AnimatedWrapper, TextAtom, ZSContainer, ZSPressable, ZSText, ZSTextField, ZSRadioGroup, ZSSwitch, ErrorComponent, ZSAboveKeyboard, ZSBlockButton, ZSSkeleton, ZSSkeletonBox, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlay, PopOverButton, PopOverMenu, ZSPortal, GlobalOverlay, useStyleSheetCreate, };
|
|
29
23
|
//# 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,O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C;AAC3C,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,WAAW,MAAM,kBAAkB,CAAC;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,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,eAAe,EACf,YAAY,EACZ,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,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 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 ZSSkeleton from './ui/ZSSkeleton';\nimport ZSSkeletonBox from './ui/ZSSkeletonBox';\n\nexport {\n useTheme,\n useFoldingState,\n ThemeProvider,\n OverlayProvider,\n themeFactory,\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 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\";\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};\n"]}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { OverlayContextProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Global overlay context를 설정합니다.
|
|
4
|
-
* OverlayProvider에서 내부적으로 호출되며, 사용자가 직접 호출할 필요는 없습니다.
|
|
5
|
-
*/
|
|
6
2
|
export declare const setGlobalOverlayRef: (ref: OverlayContextProps | null) => void;
|
|
7
|
-
/**
|
|
8
|
-
* Global overlay context를 가져옵니다.
|
|
9
|
-
* 주로 내부적으로 사용되며, 사용자는 아래의 개별 함수들을 사용하는 것을 권장합니다.
|
|
10
|
-
*/
|
|
11
3
|
export declare const getGlobalOverlayRef: () => OverlayContextProps | null;
|
|
12
4
|
export declare const GlobalOverlay: {
|
|
13
5
|
showAlert: (props: import("./types").ShowAlertProps) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalOverlay.d.ts","sourceRoot":"","sources":["../../src/model/globalOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"globalOverlay.d.ts","sourceRoot":"","sources":["../../src/model/globalOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,mBAAmB,GAAI,KAAK,mBAAmB,GAAG,IAAI,SAElE,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,mBAAmB,GAAG,IAE5D,CAAC;AAgEF,eAAO,MAAM,aAAa;;;;;;;;CAQzB,CAAC"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
// Global overlay context reference
|
|
2
1
|
let globalOverlayRef = null;
|
|
3
|
-
/**
|
|
4
|
-
* Global overlay context를 설정합니다.
|
|
5
|
-
* OverlayProvider에서 내부적으로 호출되며, 사용자가 직접 호출할 필요는 없습니다.
|
|
6
|
-
*/
|
|
7
2
|
export const setGlobalOverlayRef = (ref) => {
|
|
8
3
|
globalOverlayRef = ref;
|
|
9
4
|
};
|
|
10
|
-
/**
|
|
11
|
-
* Global overlay context를 가져옵니다.
|
|
12
|
-
* 주로 내부적으로 사용되며, 사용자는 아래의 개별 함수들을 사용하는 것을 권장합니다.
|
|
13
|
-
*/
|
|
14
5
|
export const getGlobalOverlayRef = () => {
|
|
15
6
|
return globalOverlayRef;
|
|
16
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalOverlay.js","sourceRoot":"","sources":["../../src/model/globalOverlay.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"globalOverlay.js","sourceRoot":"","sources":["../../src/model/globalOverlay.ts"],"names":[],"mappings":"AAEA,IAAI,gBAAgB,GAA+B,IAAI,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAA+B,EAAE,EAAE;IACrE,gBAAgB,GAAG,GAAG,CAAC;AACzB,CAAC,CAA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,CAAC;AAEF,MAAM,UAAU,GAAsC,GAAG,EAAE;IACzD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,2BAA2B,EAAE,CAAC;QAC9B,OAAO;IACT,CAAC;IACD,gBAAgB,CAAC,UAAU,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAuC,CAAC,MAAM,EAAE,EAAE;IACjE,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,2BAA2B,EAAE,CAAC;QAC9B,OAAO;IACT,CAAC;IACD,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,YAAY;IACZ,eAAe;IACf,eAAe;IACf,YAAY;IACZ,UAAU;IACV,WAAW;CACZ,CAAC","sourcesContent":["import { OverlayContextProps } from './types';\n\nlet globalOverlayRef: OverlayContextProps | null = null;\n\nexport const setGlobalOverlayRef = (ref: OverlayContextProps | null) => {\n globalOverlayRef = ref;\n};\n\nexport const getGlobalOverlayRef = (): OverlayContextProps | null => {\n return globalOverlayRef;\n};\n\nconst getOverlayNotAvailableError = () => {\n throw new Error(\n 'Overlay functions are not available. Please make sure OverlayProvider is properly set up in your app root.'\n );\n};\n\nconst showAlert: OverlayContextProps['showAlert'] = (props) => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.showAlert(props);\n};\n\nconst showSnackBar: OverlayContextProps['showSnackBar'] = (props) => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.showSnackBar(props);\n};\n\nconst showBottomSheet: OverlayContextProps['showBottomSheet'] = (props) => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.showBottomSheet(props);\n};\n\nconst showPopOverMenu: OverlayContextProps['showPopOverMenu'] = (props) => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.showPopOverMenu(props);\n};\n\nconst showModality: OverlayContextProps['showModality'] = (props) => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.showModality(props);\n};\n\nconst showLoader: OverlayContextProps['showLoader'] = () => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.showLoader();\n};\n\nconst hideOverlay: OverlayContextProps['hideOverlay'] = (option) => {\n if (!globalOverlayRef) {\n getOverlayNotAvailableError();\n return;\n }\n globalOverlayRef.hideOverlay(option);\n};\n\nexport const GlobalOverlay = {\n showAlert,\n showSnackBar,\n showBottomSheet,\n showPopOverMenu,\n showModality,\n showLoader,\n hideOverlay,\n};\n"]}
|
package/build/model/types.d.ts
CHANGED
|
@@ -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,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IA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D,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":"AAqIA,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}\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'
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model/types.ts"],"names":[],"mappings":"AAqIA,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}\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":"useKeyboard.d.ts","sourceRoot":"","sources":["../../src/model/useKeyboard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,UAAU,iBAAiB;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAKD,QAAA,MAAM,WAAW,GAAI,8CAGlB,gBAAqB,KAAG,
|
|
1
|
+
{"version":3,"file":"useKeyboard.d.ts","sourceRoot":"","sources":["../../src/model/useKeyboard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,UAAU,iBAAiB;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAKD,QAAA,MAAM,WAAW,GAAI,8CAGlB,gBAAqB,KAAG,iBAmC1B,CAAC;AAEF,eAAe,WAAW,CAAC"}
|