@0610studio/zs-ui 0.0.35 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +6 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/model/index.d.ts +2 -2
- package/build/model/index.d.ts.map +1 -1
- package/build/model/index.js +2 -2
- package/build/model/index.js.map +1 -1
- package/build/model/types.d.ts +11 -5
- package/build/model/types.d.ts.map +1 -1
- package/build/model/types.js.map +1 -1
- package/build/model/useOverlay.d.ts +5 -0
- package/build/model/useOverlay.d.ts.map +1 -0
- package/build/model/useOverlay.js +11 -0
- package/build/model/useOverlay.js.map +1 -0
- package/build/model/useOverlayProvider.d.ts +3 -0
- package/build/model/useOverlayProvider.d.ts.map +1 -0
- package/build/model/{useNotifyProvider.js → useOverlayProvider.js} +32 -14
- package/build/model/useOverlayProvider.js.map +1 -0
- package/build/overlay/AlertOverlay/index.d.ts +5 -0
- package/build/overlay/AlertOverlay/index.d.ts.map +1 -0
- package/build/{notify/AlertNotify → overlay/AlertOverlay}/index.js +4 -4
- package/build/overlay/AlertOverlay/index.js.map +1 -0
- package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/index.d.ts +2 -2
- package/build/overlay/BottomSheetOverlay/index.d.ts.map +1 -0
- package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/index.js +4 -4
- package/build/overlay/BottomSheetOverlay/index.js.map +1 -0
- package/build/{notify/BottomSheetNotify/model/useBottomSheetNotify.d.ts → overlay/BottomSheetOverlay/model/useBottomSheetOverlay.d.ts} +3 -3
- package/build/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.d.ts.map +1 -0
- package/build/{notify/BottomSheetNotify/model/useBottomSheetNotify.js → overlay/BottomSheetOverlay/model/useBottomSheetOverlay.js} +3 -3
- package/build/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.js.map +1 -0
- package/build/overlay/BottomSheetOverlay/types/index.d.ts +4 -0
- package/build/overlay/BottomSheetOverlay/types/index.d.ts.map +1 -0
- package/build/overlay/BottomSheetOverlay/types/index.js.map +1 -0
- package/build/overlay/BottomSheetOverlay/ui/BSTextInput/index.d.ts.map +1 -0
- package/build/overlay/BottomSheetOverlay/ui/BSTextInput/index.js.map +1 -0
- package/build/overlay/BottomSheetOverlay/ui/ContentsComponent/index.d.ts.map +1 -0
- package/build/overlay/BottomSheetOverlay/ui/ContentsComponent/index.js.map +1 -0
- package/build/overlay/LoadingNotify/index.d.ts.map +1 -0
- package/build/{notify → overlay}/LoadingNotify/index.js +2 -2
- package/build/overlay/LoadingNotify/index.js.map +1 -0
- package/build/overlay/Modality/index.d.ts +7 -0
- package/build/overlay/Modality/index.d.ts.map +1 -0
- package/build/overlay/Modality/index.js +127 -0
- package/build/overlay/Modality/index.js.map +1 -0
- package/build/overlay/PopOver/PopOverButton.d.ts.map +1 -0
- package/build/{notify → overlay}/PopOver/PopOverButton.js +2 -2
- package/build/overlay/PopOver/PopOverButton.js.map +1 -0
- package/build/overlay/PopOver/PopOverMenu.d.ts.map +1 -0
- package/build/{notify → overlay}/PopOver/PopOverMenu.js +2 -2
- package/build/overlay/PopOver/PopOverMenu.js.map +1 -0
- package/build/overlay/SnackbarNotify/index.d.ts.map +1 -0
- package/build/{notify → overlay}/SnackbarNotify/index.js +2 -2
- package/build/overlay/SnackbarNotify/index.js.map +1 -0
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.d.ts.map +1 -0
- package/build/overlay/SnackbarNotify/ui/SnackbarItem.js.map +1 -0
- package/build/overlay/index.d.ts +11 -0
- package/build/overlay/index.d.ts.map +1 -0
- package/build/overlay/index.js +11 -0
- package/build/overlay/index.js.map +1 -0
- package/build/overlay/ui/ModalBackground.d.ts.map +1 -0
- package/build/{notify → overlay}/ui/ModalBackground.js +0 -2
- package/build/overlay/ui/ModalBackground.js.map +1 -0
- package/build/ui/ZSBottomButton/index.d.ts.map +1 -1
- package/build/ui/ZSBottomButton/index.js +2 -3
- package/build/ui/ZSBottomButton/index.js.map +1 -1
- package/build/ui/ZSContainer/index.js +1 -1
- package/build/ui/ZSContainer/index.js.map +1 -1
- package/build/ui/ZSTextField/index.d.ts.map +1 -1
- package/build/ui/ZSTextField/index.js +1 -1
- package/build/ui/ZSTextField/index.js.map +1 -1
- package/package.json +1 -1
- package/build/model/useNotify.d.ts +0 -5
- package/build/model/useNotify.d.ts.map +0 -1
- package/build/model/useNotify.js +0 -11
- package/build/model/useNotify.js.map +0 -1
- package/build/model/useNotifyProvider.d.ts +0 -3
- package/build/model/useNotifyProvider.d.ts.map +0 -1
- package/build/model/useNotifyProvider.js.map +0 -1
- package/build/notify/AlertNotify/index.d.ts +0 -5
- package/build/notify/AlertNotify/index.d.ts.map +0 -1
- package/build/notify/AlertNotify/index.js.map +0 -1
- package/build/notify/BottomSheetNotify/index.d.ts.map +0 -1
- package/build/notify/BottomSheetNotify/index.js.map +0 -1
- package/build/notify/BottomSheetNotify/model/useBottomSheetNotify.d.ts.map +0 -1
- package/build/notify/BottomSheetNotify/model/useBottomSheetNotify.js.map +0 -1
- package/build/notify/BottomSheetNotify/types/index.d.ts +0 -4
- package/build/notify/BottomSheetNotify/types/index.d.ts.map +0 -1
- package/build/notify/BottomSheetNotify/types/index.js.map +0 -1
- package/build/notify/BottomSheetNotify/ui/BSTextInput/index.d.ts.map +0 -1
- package/build/notify/BottomSheetNotify/ui/BSTextInput/index.js.map +0 -1
- package/build/notify/BottomSheetNotify/ui/ContentsComponent/index.d.ts.map +0 -1
- package/build/notify/BottomSheetNotify/ui/ContentsComponent/index.js.map +0 -1
- package/build/notify/LoadingNotify/index.d.ts.map +0 -1
- package/build/notify/LoadingNotify/index.js.map +0 -1
- package/build/notify/PopOver/PopOverButton.d.ts.map +0 -1
- package/build/notify/PopOver/PopOverButton.js.map +0 -1
- package/build/notify/PopOver/PopOverMenu.d.ts.map +0 -1
- package/build/notify/PopOver/PopOverMenu.js.map +0 -1
- package/build/notify/SnackbarNotify/index.d.ts.map +0 -1
- package/build/notify/SnackbarNotify/index.js.map +0 -1
- package/build/notify/SnackbarNotify/ui/SnackbarItem.d.ts.map +0 -1
- package/build/notify/SnackbarNotify/ui/SnackbarItem.js.map +0 -1
- package/build/notify/index.d.ts +0 -11
- package/build/notify/index.d.ts.map +0 -1
- package/build/notify/index.js +0 -11
- package/build/notify/index.js.map +0 -1
- package/build/notify/ui/ModalBackground.d.ts.map +0 -1
- package/build/notify/ui/ModalBackground.js.map +0 -1
- /package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/types/index.js +0 -0
- /package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/ui/BSTextInput/index.d.ts +0 -0
- /package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/ui/BSTextInput/index.js +0 -0
- /package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/ui/ContentsComponent/index.d.ts +0 -0
- /package/build/{notify/BottomSheetNotify → overlay/BottomSheetOverlay}/ui/ContentsComponent/index.js +0 -0
- /package/build/{notify → overlay}/LoadingNotify/index.d.ts +0 -0
- /package/build/{notify → overlay}/PopOver/PopOverButton.d.ts +0 -0
- /package/build/{notify → overlay}/PopOver/PopOverMenu.d.ts +0 -0
- /package/build/{notify → overlay}/SnackbarNotify/index.d.ts +0 -0
- /package/build/{notify → overlay}/SnackbarNotify/ui/SnackbarItem.d.ts +0 -0
- /package/build/{notify → overlay}/SnackbarNotify/ui/SnackbarItem.js +0 -0
- /package/build/{notify → overlay}/ui/ModalBackground.d.ts +0 -0
package/build/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useTheme,
|
|
1
|
+
import { useTheme, OverlayProvider, ThemeProvider } from './model';
|
|
2
2
|
import { ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton } from './ui';
|
|
3
|
-
import {
|
|
4
|
-
export { useTheme,
|
|
5
|
-
import {
|
|
3
|
+
import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu } from './overlay';
|
|
4
|
+
export { useTheme, OverlayProvider, ThemeProvider, ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu, };
|
|
5
|
+
import { BottomSheetOverlayRef } from "./overlay/BottomSheetOverlay/types";
|
|
6
6
|
import type { ThemeProviderProps, ThemeProps, Palette } from "./model/useThemeProvider";
|
|
7
7
|
import { ZSTextProps } from "./ui/ZSText";
|
|
8
8
|
import { BoxStyle } from "./ui/ZSTextField";
|
|
9
9
|
import { ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBorderType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TextColorOptions } from "./theme/types";
|
|
10
|
-
import { SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps,
|
|
10
|
+
import { SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetRef } from "./model/types";
|
|
11
11
|
import { RadioOption, ShadowLevel, ShadowStyle } from "./ui/types";
|
|
12
|
-
export type {
|
|
12
|
+
export type { BottomSheetOverlayRef, ThemeProviderProps, ThemeProps, Palette, ZSTextProps, BoxStyle, ColorPalette, ColorPaletteExtend, ThemeTextType, ThemeBorderType, ThemeBackground, MainColors, Theme, TypographyVariants, ThemeFonts, TypoNumber, TypographyVariantsProps, TypoStyle, TypoOptions, TypoSubStyle, TextColorOptions, SnackItem, ShowAlertProps, ShowSnackBarProps, ShowBottomSheetProps, PopOverMenuProps, CustomSnackbarProps, OverlayProviderProps, AlertAction, AlertActions, SnackType, HideOption, BottomSheetRef, RadioOption, ShadowLevel, ShadowStyle };
|
|
13
13
|
//# 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,EACL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,MAAM,CAAC;AAEd,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EAEb,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,CAAC;AAIF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,OAAO,EACR,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,KAAK,EACL,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACd,WAAW,EACX,WAAW,EACX,WAAW,EACZ,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useTheme,
|
|
1
|
+
import { useTheme, OverlayProvider, ThemeProvider, } from './model';
|
|
2
2
|
import { ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton, } from './ui';
|
|
3
|
-
import {
|
|
4
|
-
export { useTheme,
|
|
3
|
+
import { AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu, } from './overlay';
|
|
4
|
+
export { useTheme, OverlayProvider, ThemeProvider,
|
|
5
5
|
// ---
|
|
6
6
|
ZSView, AnimatedWrapper, TextAtom, ScrollViewAtom, ZSContainer, ZSPressable, ZSText, ThrottleButton, ZSTextField, ZSRadioGroup, ZSBottomButton,
|
|
7
7
|
// ---
|
|
8
|
-
|
|
8
|
+
AlertOverlay, BottomSheetOverlay, SnackbarNotify, useOverlayProvider, useOverlay, BSTextInput, PopOverButton, PopOverMenu, };
|
|
9
9
|
//# 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,EACL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,GACd,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,MAAM,CAAC;AAEd,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa;AACb,MAAM;AACN,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,cAAc;AACd,MAAM;AACN,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,CAAC","sourcesContent":["import {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n} from './model'\n\nimport { \n ZSView,\n AnimatedWrapper,\n TextAtom,\n ScrollViewAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n} from './ui';\n\nimport { \n AlertOverlay, \n BottomSheetOverlay, \n SnackbarNotify, \n useOverlayProvider, \n useOverlay,\n BSTextInput,\n PopOverButton,\n PopOverMenu,\n} from './overlay';\n\nexport {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n // ---\n ZSView,\n AnimatedWrapper,\n TextAtom,\n ScrollViewAtom,\n ZSContainer,\n ZSPressable,\n ZSText,\n ThrottleButton,\n ZSTextField,\n ZSRadioGroup,\n ZSBottomButton,\n // ---\n AlertOverlay, \n BottomSheetOverlay, \n SnackbarNotify, \n useOverlayProvider, \n useOverlay, \n BSTextInput,\n PopOverButton,\n PopOverMenu,\n};\n\n// ------------------------------------------------------\n\nimport { BottomSheetOverlayRef } from \"./overlay/BottomSheetOverlay/types\";\nimport type {\n ThemeProviderProps,\n ThemeProps,\n Palette,\n} from \"./model/useThemeProvider\";\nimport { ZSTextProps } from \"./ui/ZSText\";\nimport { BoxStyle } from \"./ui/ZSTextField\";\nimport {\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBorderType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TextColorOptions\n} from \"./theme/types\";\nimport {\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetRef\n} from \"./model/types\";\nimport {\n RadioOption,\n ShadowLevel,\n ShadowStyle,\n} from \"./ui/types\";\n\nexport type {\n BottomSheetOverlayRef,\n ThemeProviderProps,\n ThemeProps,\n Palette,\n ZSTextProps,\n BoxStyle,\n ColorPalette,\n ColorPaletteExtend,\n ThemeTextType,\n ThemeBorderType,\n ThemeBackground,\n MainColors,\n Theme,\n TypographyVariants,\n ThemeFonts,\n TypoNumber,\n TypographyVariantsProps,\n TypoStyle,\n TypoOptions,\n TypoSubStyle,\n TextColorOptions,\n SnackItem,\n ShowAlertProps,\n ShowSnackBarProps,\n ShowBottomSheetProps,\n PopOverMenuProps,\n CustomSnackbarProps,\n OverlayProviderProps,\n AlertAction,\n AlertActions,\n SnackType,\n HideOption,\n BottomSheetRef,\n RadioOption,\n ShadowLevel,\n ShadowStyle\n};\n"]}
|
package/build/model/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OverlayProvider } from "./useOverlayProvider";
|
|
2
2
|
import { ThemeProvider, useTheme } from "./useThemeProvider";
|
|
3
|
-
export { useTheme,
|
|
3
|
+
export { useTheme, OverlayProvider, ThemeProvider, };
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,GACd,CAAA"}
|
package/build/model/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OverlayProvider } from "./useOverlayProvider";
|
|
2
2
|
import { ThemeProvider, useTheme } from "./useThemeProvider";
|
|
3
|
-
export { useTheme,
|
|
3
|
+
export { useTheme, OverlayProvider, ThemeProvider, };
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/build/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,GACd,CAAA","sourcesContent":["import { OverlayProvider } from \"./useOverlayProvider\"; \nimport { ThemeProvider, useTheme } from \"./useThemeProvider\";\n\nexport {\n useTheme,\n OverlayProvider,\n ThemeProvider,\n}\n"]}
|
package/build/model/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { TextProps, TouchableOpacityProps } from "react-native";
|
|
3
|
-
export interface
|
|
3
|
+
export interface OverlayProps {
|
|
4
4
|
alertVisible: boolean;
|
|
5
5
|
setAlertVisible: (visible: boolean) => void;
|
|
6
6
|
snackItemStack: SnackItem[];
|
|
@@ -8,20 +8,26 @@ export interface NotifyProps {
|
|
|
8
8
|
bottomSheetVisible: boolean;
|
|
9
9
|
setBottomSheetVisible: (visible: boolean) => void;
|
|
10
10
|
loaderVisible: boolean;
|
|
11
|
-
|
|
11
|
+
modalityVisible: boolean;
|
|
12
12
|
setPopOverVisible: (visible: boolean) => void;
|
|
13
|
+
popOverVisible: boolean;
|
|
14
|
+
setModalityVisible: (visible: boolean) => void;
|
|
13
15
|
showAlert: (props: ShowAlertProps) => void;
|
|
14
16
|
showSnackBar: (props: ShowSnackBarProps) => void;
|
|
15
17
|
showBottomSheet: (props: ShowBottomSheetProps) => void;
|
|
16
18
|
showLoader: () => void;
|
|
17
19
|
showPopOverMenu: (props: PopOverMenuProps) => void;
|
|
18
|
-
|
|
20
|
+
showModality: (props: ModalityProps) => void;
|
|
21
|
+
hideOverlay: (option: HideOption) => void;
|
|
19
22
|
}
|
|
20
23
|
export interface PopOverMenuProps {
|
|
21
24
|
px: number;
|
|
22
25
|
py: number;
|
|
23
26
|
component: React.ReactNode;
|
|
24
27
|
}
|
|
28
|
+
export interface ModalityProps {
|
|
29
|
+
component: React.ReactNode;
|
|
30
|
+
}
|
|
25
31
|
export interface ShowBottomSheetProps {
|
|
26
32
|
backgroundColor?: string;
|
|
27
33
|
isBottomRadius?: boolean;
|
|
@@ -40,7 +46,7 @@ export interface CustomSnackbarProps {
|
|
|
40
46
|
snackType: SnackType;
|
|
41
47
|
snackMessage: string;
|
|
42
48
|
}
|
|
43
|
-
export interface
|
|
49
|
+
export interface OverlayProviderProps {
|
|
44
50
|
children: ReactNode;
|
|
45
51
|
customSnackbar?: (props: CustomSnackbarProps) => React.ReactNode;
|
|
46
52
|
loaderComponent?: () => React.ReactNode;
|
|
@@ -73,7 +79,7 @@ export interface SnackItem {
|
|
|
73
79
|
snackbarDuration?: number;
|
|
74
80
|
}
|
|
75
81
|
export type SnackType = 'success' | 'error' | '';
|
|
76
|
-
export type HideOption = 'all' | 'snack' | 'alert' | 'bottomSheet' | 'loader' | 'popOver';
|
|
82
|
+
export type HideOption = 'all' | 'snack' | 'alert' | 'bottomSheet' | 'loader' | 'popOver' | 'modal';
|
|
77
83
|
export interface ShowSnackBarProps {
|
|
78
84
|
message: string;
|
|
79
85
|
type?: SnackType;
|
|
@@ -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,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AE,SAAS,CAAC,OAAO,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACtC,oBAAoB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACtD,kBAAkB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACpD,wBAAwB,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9C,sBAAsB,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5C,qBAAqB,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,EAAE,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpG,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC3B,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C"}
|
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":"AAsDC,CAAC;AAKD,CAAC;AAMD,CAAC;AAKD,CAAC;AAcD,CAAC;AAKD,CAAC;AAOD,CAAC;AAWD,CAAC;AAID,CAAC","sourcesContent":["import { ReactNode } from \"react\";\nimport { TextProps, TouchableOpacityProps } from \"react-native\";\n\nexport interface OverlayProps {\n alertVisible: boolean;\n setAlertVisible: (visible: boolean) => void;\n // ---\n snackItemStack: SnackItem[];\n hideSnackBar: (index: number) => void;\n // ---\n bottomSheetVisible: boolean;\n setBottomSheetVisible: (visible: boolean) => void;\n // ---\n loaderVisible: boolean;\n // ---\n modalityVisible: boolean;\n setPopOverVisible: (visible: boolean) => void;\n // ---\n popOverVisible: boolean;\n setModalityVisible: (visible: boolean) => void;\n // ---\n showAlert: (props: ShowAlertProps) => void;\n showSnackBar: (props: ShowSnackBarProps) => void;\n showBottomSheet: (props: ShowBottomSheetProps) => void;\n showLoader: () => void;\n showPopOverMenu: (props: PopOverMenuProps) => void;\n showModality: (props: ModalityProps) => void;\n // ---\n hideOverlay: (option: HideOption) => 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}\n\nexport interface ShowBottomSheetProps {\n backgroundColor?: string;\n isBottomRadius?: boolean;\n marginHorizontal?: number;\n isHandleVisible?: boolean;\n marginBottom?: number;\n padding?: number;\n component: React.ReactNode;\n contentsGestureEnable?: boolean;\n maxHeight?: number;\n isScrollView?: boolean;\n showsVerticalScrollIndicator?: boolean;\n headerComponent?: React.ReactNode;\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};\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 singleButtonTextStyle?: 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';\n\nexport interface ShowSnackBarProps {\n message: string;\n type?: SnackType;\n index?: number;\n snackbarDuration?: number;\n};\n\nexport interface BottomSheetRef {\n handleVisible: (isOpen: boolean) => void;\n};"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/model/useOverlay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,QAAA,MAAM,cAAc,8CAA2C,CAAC;AAEhE,eAAO,MAAM,UAAU,oBAMtB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
const OverlayContext = createContext(null);
|
|
3
|
+
export const useOverlay = () => {
|
|
4
|
+
const context = useContext(OverlayContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('useOverlay must be used within a OverlayProvider');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
};
|
|
10
|
+
export default OverlayContext;
|
|
11
|
+
//# sourceMappingURL=useOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlay.js","sourceRoot":"","sources":["../../src/model/useOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,MAAM,cAAc,GAAG,aAAa,CAAsB,IAAI,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { createContext, useContext } from 'react';\nimport { OverlayProps } from './types';\n\nconst OverlayContext = createContext<OverlayProps | null>(null);\n\nexport const useOverlay = () => {\n const context = useContext(OverlayContext);\n if (!context) {\n throw new Error('useOverlay must be used within a OverlayProvider');\n }\n return context;\n};\n\nexport default OverlayContext;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlayProvider.d.ts","sourceRoot":"","sources":["../../src/model/useOverlayProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2D,oBAAoB,EAAwF,MAAM,SAAS,CAAC;AAQ9L,wBAAgB,eAAe,CAAC,EAC5B,cAAc,EACd,eAAe,EACf,QAAQ,EACX,EAAE,oBAAoB,+BAuQtB"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useCallback, useRef, useState } from 'react';
|
|
2
2
|
import { Keyboard } from 'react-native';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import SnackbarNotify from '../
|
|
6
|
-
import
|
|
7
|
-
import LoadingNotify from '../
|
|
8
|
-
import PopOverMenu from '../
|
|
9
|
-
|
|
3
|
+
import OverlayContext from './useOverlay';
|
|
4
|
+
import AlertOverlay from '../overlay/AlertOverlay';
|
|
5
|
+
import SnackbarNotify from '../overlay/SnackbarNotify';
|
|
6
|
+
import BottomSheetOverlay from '../overlay/BottomSheetOverlay';
|
|
7
|
+
import LoadingNotify from '../overlay/LoadingNotify';
|
|
8
|
+
import PopOverMenu from '../overlay/PopOver/PopOverMenu';
|
|
9
|
+
import Modality from '../overlay/Modality';
|
|
10
|
+
export function OverlayProvider({ customSnackbar, loaderComponent, children }) {
|
|
10
11
|
// Alert
|
|
11
12
|
const [title, setTitle] = useState('');
|
|
12
13
|
const [informative, setInformative] = useState('');
|
|
@@ -43,6 +44,9 @@ export function NotifyProvider({ customSnackbar, loaderComponent, children }) {
|
|
|
43
44
|
const [popOverVisible, setPopOverVisible] = useState(false);
|
|
44
45
|
const [popOverLocation, setPopOverLocation] = useState({ px: 0, py: 0 });
|
|
45
46
|
const [popOverComponent, setPopOverComponent] = useState(false);
|
|
47
|
+
// Modality
|
|
48
|
+
const [modalityVisible, setModalityVisible] = useState(false);
|
|
49
|
+
const [modalityComponent, setModalityComponent] = useState(false);
|
|
46
50
|
// ---
|
|
47
51
|
const [fontFamily, setFontFamily] = useState(undefined);
|
|
48
52
|
const showAlert = ({ title, informative, actions, isBackgroundTouchClose = true, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, singleButtonTextStyle, }) => {
|
|
@@ -85,6 +89,10 @@ export function NotifyProvider({ customSnackbar, loaderComponent, children }) {
|
|
|
85
89
|
setPopOverComponent(component);
|
|
86
90
|
setPopOverVisible(true);
|
|
87
91
|
};
|
|
92
|
+
const showModality = ({ component }) => {
|
|
93
|
+
setModalityComponent(component);
|
|
94
|
+
setModalityVisible(true);
|
|
95
|
+
};
|
|
88
96
|
const showSnackBar = ({ message, type = 'success', index = Date.now(), snackbarDuration = 3000 }) => {
|
|
89
97
|
// TODO: 스택 쌓고싶은데 삭제될 때 참조를 잃어서 삭제가 안되는 문제가 있음.
|
|
90
98
|
setSnackItemStack((prev) => {
|
|
@@ -100,11 +108,14 @@ export function NotifyProvider({ customSnackbar, loaderComponent, children }) {
|
|
|
100
108
|
const hideSnackBar = (index) => {
|
|
101
109
|
setSnackItemStack((prev) => prev.filter((item) => item.index !== index));
|
|
102
110
|
};
|
|
103
|
-
const
|
|
111
|
+
const hideOverlay = useCallback((option) => {
|
|
104
112
|
switch (option) {
|
|
105
113
|
case 'alert':
|
|
106
114
|
setAlertVisible(false);
|
|
107
115
|
break;
|
|
116
|
+
case 'modal':
|
|
117
|
+
setModalityVisible(false);
|
|
118
|
+
break;
|
|
108
119
|
case 'snack':
|
|
109
120
|
setSnackItemStack([]);
|
|
110
121
|
break;
|
|
@@ -118,6 +129,7 @@ export function NotifyProvider({ customSnackbar, loaderComponent, children }) {
|
|
|
118
129
|
setPopOverVisible(false);
|
|
119
130
|
break;
|
|
120
131
|
case 'all':
|
|
132
|
+
setModalityVisible(false);
|
|
121
133
|
setAlertVisible(false);
|
|
122
134
|
setSnackItemStack([]);
|
|
123
135
|
setLoaderVisible(false);
|
|
@@ -129,7 +141,7 @@ export function NotifyProvider({ customSnackbar, loaderComponent, children }) {
|
|
|
129
141
|
}
|
|
130
142
|
;
|
|
131
143
|
}, []);
|
|
132
|
-
return (<
|
|
144
|
+
return (<OverlayContext.Provider value={{
|
|
133
145
|
alertVisible,
|
|
134
146
|
setAlertVisible,
|
|
135
147
|
// ---
|
|
@@ -144,25 +156,31 @@ export function NotifyProvider({ customSnackbar, loaderComponent, children }) {
|
|
|
144
156
|
popOverVisible,
|
|
145
157
|
setPopOverVisible,
|
|
146
158
|
// ---
|
|
159
|
+
modalityVisible,
|
|
160
|
+
setModalityVisible,
|
|
161
|
+
// ---
|
|
147
162
|
showAlert,
|
|
148
163
|
showSnackBar,
|
|
149
164
|
showBottomSheet,
|
|
150
165
|
showLoader,
|
|
151
166
|
showPopOverMenu,
|
|
167
|
+
showModality,
|
|
152
168
|
// ---
|
|
153
|
-
|
|
169
|
+
hideOverlay,
|
|
154
170
|
}}>
|
|
155
171
|
{children}
|
|
156
172
|
|
|
157
|
-
<
|
|
173
|
+
<BottomSheetOverlay ref={bottomSheetRef} bottomSheetComponent={bottomSheetComponent} contentsGestureEnable={contentsGestureEnable} bottomSheetPadding={bottomSheetPadding} marginBottomBS={marginBottomBS} isHandleVisible={handleVisible} bottomSheetMarginX={bottomSheetMarginX} isBottomRadius={isBottomRadius} bottomSheetBackgroundColor={bottomSheetBackgroundColor} maxHeight={bottomSheetMaxHeight} isScrollView={bottomSheetScrollView} showsVerticalScrollIndicator={showsVerticalScrollIndicator} headerComponent={headerComponent}/>
|
|
158
174
|
|
|
159
175
|
<PopOverMenu px={popOverLocation?.px} py={popOverLocation?.py} component={popOverComponent}/>
|
|
160
176
|
|
|
161
177
|
<SnackbarNotify customSnackbar={customSnackbar}/>
|
|
162
178
|
|
|
163
|
-
<
|
|
179
|
+
<AlertOverlay title={title} informative={informative} actions={actions || {}} isBackgroundTouchClose={isBackgroundTouchClose} titleStyle={titleStyle} informativeStyle={informativeStyle} secondaryButtonStyle={secondaryButtonStyle} primaryButtonStyle={primaryButtonStyle} secondaryButtonTextStyle={secondaryButtonTextStyle} primaryButtonTextStyle={primaryButtonTextStyle} singleButtonTextStyle={singleButtonTextStyle}/>
|
|
180
|
+
|
|
181
|
+
<Modality modalityComponent={modalityComponent}/>
|
|
164
182
|
|
|
165
183
|
<LoadingNotify loaderComponent={loaderComponent}/>
|
|
166
|
-
</
|
|
184
|
+
</OverlayContext.Provider>);
|
|
167
185
|
}
|
|
168
|
-
//# sourceMappingURL=
|
|
186
|
+
//# sourceMappingURL=useOverlayProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlayProvider.js","sourceRoot":"","sources":["../../src/model/useOverlayProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAoC,MAAM,cAAc,CAAC;AAC1E,OAAO,cAAc,MAAM,cAAc,CAAC;AAE1C,OAAO,YA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,CAAC,EAE/C;;YAAA,CAAC,aAAa,CACV,eAAe,CAAC,CAAC,eAAe,CAAC,EAEzC;QAAA,EAAE,cAAc,CAAC,QAAQ,CAAC,CAC7B,CAAC;AACN,CAAC","sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport { Keyboard, TextProps, TouchableOpacityProps } from 'react-native';\nimport OverlayContext from './useOverlay';\nimport { AlertActions, BottomSheetRef, HideOption, ModalityProps, OverlayProviderProps, PopOverMenuProps, ShowAlertProps, ShowBottomSheetProps, ShowSnackBarProps, SnackItem } from './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';\n\nexport function OverlayProvider({\n customSnackbar,\n loaderComponent,\n children\n}: OverlayProviderProps) {\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 const [primaryButtonTextStyle, setPrimaryButtonTextStyle] = useState<TextProps['style']>();\n const [singleButtonTextStyle, setSingleButtonTextStyle] = useState<TextProps['style']>();\n\n // Snackbar\n const [snackItemStack, setSnackItemStack] = useState<SnackItem[]>([]);\n\n // BottomSheet\n const [contentsGestureEnable, setContentsGestureEnable] = useState<boolean>(false);\n const [bottomSheetVisible, setBottomSheetVisible] = useState<boolean>(false);\n const [bottomSheetBackgroundColor, setBottomSheetBackgroundColor] = useState<string>();\n const [bottomSheetComponent, setBottomSheetComponent] = useState<React.ReactNode>(false);\n const [bottomSheetPadding, setBottomSheetPadding] = useState<number | undefined>(undefined);\n const [bottomSheetMarginX, setBottomSheetMarginX] = useState<number | undefined>(undefined);\n const [bottomSheetMaxHeight, setBottomSheetMaxHeight] = useState<number>();\n const [bottomSheetScrollView, setBottomSheetScrollView] = useState<boolean>(true);\n const [isBottomRadius, setIsBottomRadius] = useState<boolean>(true);\n const [handleVisible, setHandleVisible] = useState<boolean>(true);\n const [marginBottomBS, setMarginBottomBs] = useState<number | undefined>(undefined);\n const [showsVerticalScrollIndicator, setShowsVerticalScrollIndicator] = useState<boolean>(false);\n const [headerComponent, setHeaderComponent] = useState<React.ReactNode | undefined>(undefined);\n const bottomSheetRef = useRef<BottomSheetRef | null>(null);\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\n // ---\n const [fontFamily, setFontFamily] = useState<string | undefined | { title?: string; info?: string; label?: string; }>(undefined);\n\n\n const showAlert = ({\n title,\n informative,\n actions,\n isBackgroundTouchClose = true,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n primaryButtonTextStyle,\n singleButtonTextStyle,\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 setPrimaryButtonTextStyle(primaryButtonTextStyle);\n setSingleButtonTextStyle(singleButtonTextStyle);\n\n setFontFamily(fontFamily);\n };\n\n const showBottomSheet = ({\n isHandleVisible = true,\n component,\n contentsGestureEnable = true,\n marginHorizontal,\n padding,\n marginBottom,\n backgroundColor,\n isBottomRadius = true,\n maxHeight,\n isScrollView = true,\n showsVerticalScrollIndicator = false,\n headerComponent = undefined\n }: ShowBottomSheetProps) => {\n Keyboard.dismiss();\n padding && setBottomSheetPadding(padding);\n marginBottom && setMarginBottomBs(marginBottom);\n marginHorizontal && setBottomSheetMarginX(marginHorizontal);\n backgroundColor && setBottomSheetBackgroundColor(backgroundColor);\n maxHeight && setBottomSheetMaxHeight(maxHeight);\n setShowsVerticalScrollIndicator(showsVerticalScrollIndicator);\n setHeaderComponent(headerComponent);\n setContentsGestureEnable(contentsGestureEnable);\n setHandleVisible(isHandleVisible);\n setBottomSheetScrollView(isScrollView);\n setIsBottomRadius(isBottomRadius);\n setBottomSheetComponent(component);\n bottomSheetRef.current?.handleVisible(true);\n };\n\n const showLoader = () => {\n setLoaderVisible(true);\n };\n\n const showPopOverMenu = ({\n px,\n py,\n component\n }: PopOverMenuProps) => {\n setPopOverLocation({ px, py });\n setPopOverComponent(component);\n setPopOverVisible(true);\n }\n\n const showModality = ({\n component\n }: ModalityProps) => {\n setModalityComponent(component);\n setModalityVisible(true);\n }\n\n const showSnackBar = ({\n message,\n type = 'success',\n index = Date.now(),\n snackbarDuration = 3000\n }: ShowSnackBarProps) => {\n // TODO: 스택 쌓고싶은데 삭제될 때 참조를 잃어서 삭제가 안되는 문제가 있음.\n setSnackItemStack((prev) => {\n if (prev.length === 0) {\n return [...prev, { message, type, index: index, snackbarDuration: snackbarDuration }];\n } else {\n return prev;\n };\n });\n };\n\n const hideSnackBar = (index: number) => {\n setSnackItemStack((prev) => prev.filter((item) => item.index !== index));\n };\n\n const hideOverlay = useCallback((option: HideOption) => {\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 bottomSheetRef.current?.handleVisible(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 bottomSheetRef.current?.handleVisible(false);\n break;\n default:\n break;\n };\n }, []);\n\n\n return (\n <OverlayContext.Provider value={{\n alertVisible,\n setAlertVisible,\n // ---\n snackItemStack,\n hideSnackBar,\n // ---\n bottomSheetVisible,\n setBottomSheetVisible,\n // ---\n loaderVisible,\n // ---\n popOverVisible,\n setPopOverVisible,\n // ---\n modalityVisible,\n setModalityVisible,\n // ---\n showAlert,\n showSnackBar,\n showBottomSheet,\n showLoader,\n showPopOverMenu,\n showModality,\n // ---\n hideOverlay,\n }}>\n {children}\n\n <BottomSheetOverlay\n ref={bottomSheetRef}\n bottomSheetComponent={bottomSheetComponent}\n contentsGestureEnable={contentsGestureEnable}\n bottomSheetPadding={bottomSheetPadding}\n marginBottomBS={marginBottomBS}\n isHandleVisible={handleVisible}\n bottomSheetMarginX={bottomSheetMarginX}\n isBottomRadius={isBottomRadius}\n bottomSheetBackgroundColor={bottomSheetBackgroundColor}\n maxHeight={bottomSheetMaxHeight}\n isScrollView={bottomSheetScrollView}\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\n headerComponent={headerComponent}\n />\n\n <PopOverMenu\n px={popOverLocation?.px}\n py={popOverLocation?.py}\n component={popOverComponent}\n />\n\n <SnackbarNotify\n customSnackbar={customSnackbar}\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 primaryButtonTextStyle={primaryButtonTextStyle}\n singleButtonTextStyle={singleButtonTextStyle}\n />\n\n <Modality modalityComponent={modalityComponent} />\n\n <LoadingNotify\n loaderComponent={loaderComponent}\n />\n </OverlayContext.Provider>\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ShowAlertProps } from '../../model/types';
|
|
3
|
+
declare function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, singleButtonTextStyle, }: ShowAlertProps): React.JSX.Element | null;
|
|
4
|
+
export default AlertOverlay;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,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,EACtB,qBAAqB,GACtB,EAAE,cAAc,4BAmGhB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
2
2
|
import { Dimensions, KeyboardAvoidingView, Platform, Pressable, StyleSheet, TouchableOpacity, BackHandler } from 'react-native';
|
|
3
3
|
import Animated, { FadeInDown, FadeOutDown } from 'react-native-reanimated';
|
|
4
|
-
import {
|
|
4
|
+
import { useOverlay } from '../../model/useOverlay';
|
|
5
5
|
import { useTheme } from '../../model/useThemeProvider';
|
|
6
6
|
import { ZSText } from '../../ui';
|
|
7
7
|
import ModalBackground from '../ui/ModalBackground';
|
|
8
8
|
import ViewAtom from '../../ui/atoms/ViewAtom';
|
|
9
9
|
const modalWidth = Dimensions.get('window').width - 60;
|
|
10
|
-
function
|
|
11
|
-
const { alertVisible, setAlertVisible } =
|
|
10
|
+
function AlertOverlay({ actions, title, informative, isBackgroundTouchClose, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, singleButtonTextStyle, }) {
|
|
11
|
+
const { alertVisible, setAlertVisible } = useOverlay();
|
|
12
12
|
const { palette: { background, text, primary: primaryColor } } = useTheme();
|
|
13
13
|
const styles = useMemo(() => createStyles({ background }), [background, text, primaryColor]);
|
|
14
14
|
// 버튼 클릭 핸들러 함수, 콜백 메모이제이션으로 성능 최적화
|
|
@@ -65,7 +65,7 @@ function AlertNotify({ actions, title, informative, isBackgroundTouchClose, titl
|
|
|
65
65
|
</KeyboardAvoidingView>
|
|
66
66
|
</ModalBackground>) : null;
|
|
67
67
|
}
|
|
68
|
-
export default
|
|
68
|
+
export default AlertOverlay;
|
|
69
69
|
const createStyles = ({ background, }) => StyleSheet.create({
|
|
70
70
|
title: {
|
|
71
71
|
marginBottom: 8,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/overlay/AlertOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAQ,MAAM,cAAc,C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,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;KAC3B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;KACjB;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,EAAE;QAChB,aAAa,EAAE,EAAE;QACjB,UAAU,EAAE,EAAE;QACd,iBAAiB,EAAE,EAAE;KACtB;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useMemo } from 'react';\nimport { Dimensions, KeyboardAvoidingView, Platform, Pressable, StyleSheet, TouchableOpacity, BackHandler, Text } from 'react-native';\nimport Animated, { FadeInDown, FadeOutDown } from 'react-native-reanimated';\nimport { AlertActions, ShowAlertProps } from '../../model/types';\nimport { useOverlay } from '../../model/useOverlay';\nimport { useTheme } from '../../model/useThemeProvider';\nimport { ThemeBackground } from '../../theme';\nimport { ZSText } from '../../ui';\nimport ModalBackground from '../ui/ModalBackground';\nimport ViewAtom from '../../ui/atoms/ViewAtom';\n\nconst modalWidth = Dimensions.get('window').width - 60;\n\nfunction AlertOverlay({\n actions,\n title,\n informative,\n isBackgroundTouchClose,\n titleStyle,\n informativeStyle,\n secondaryButtonStyle,\n primaryButtonStyle,\n secondaryButtonTextStyle,\n primaryButtonTextStyle,\n singleButtonTextStyle,\n}: ShowAlertProps) {\n const { alertVisible, setAlertVisible } = useOverlay();\n const { palette: { background, text, primary: primaryColor } } = useTheme();\n\n const styles = useMemo(\n () => createStyles({ background }),\n [background, text, primaryColor]\n );\n\n // 버튼 클릭 핸들러 함수, 콜백 메모이제이션으로 성능 최적화\n const handleButtonPress = useCallback(\n (onPressFunction?: () => void) => () => {\n if (onPressFunction) {\n onPressFunction();\n }\n setAlertVisible(false);\n },\n [setAlertVisible]\n );\n\n // 뒤로가기 버튼 핸들러 함수\n const backPressHandler = useCallback(() => {\n if (alertVisible) {\n setAlertVisible(false);\n return true;\n }\n return false;\n }, [alertVisible, setAlertVisible]);\n\n // 뒤로가기 버튼 리스너 설정\n useEffect(() => {\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backPressHandler);\n return () => backHandler.remove();\n }, [backPressHandler]);\n\n // content를 useMemo로 감싸서 불필요한 재렌더링 방지\n const content = useMemo(() => {\n const { primary, secondary } = actions || {} as AlertActions;\n\n return (\n <Animated.View\n entering={FadeInDown.duration(300)}\n exiting={FadeOutDown.duration(100)}\n >\n <Pressable style={[styles.contentContainer, { width: modalWidth }]}>\n {title && (\n <ZSText typo='title.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 <>\n <TouchableOpacity\n style={[\n styles.button,\n { backgroundColor: background.neutral, marginRight: 8 },\n secondaryButtonStyle\n ]}\n onPress={handleButtonPress(secondary?.onPress)}\n >\n <ZSText typo='subTitle.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='subTitle.2' color='white' style={[secondaryButtonTextStyle]}>{primary?.label || '확인'}</ZSText>\n </TouchableOpacity>\n </>\n ) : (\n <TouchableOpacity\n style={[styles.button, { backgroundColor: primaryColor.main }, primaryButtonStyle]}\n onPress={handleButtonPress(primary?.onPress)}\n >\n <ZSText typo='subTitle.2' color='white' style={[secondaryButtonTextStyle]}>{primary?.label || '확인'}</ZSText>\n </TouchableOpacity>\n )}\n </ViewAtom>\n )}\n </Pressable>\n </Animated.View>\n );\n }, [title, informative, actions, handleButtonPress, titleStyle, informativeStyle, secondaryButtonStyle, primaryButtonStyle, secondaryButtonTextStyle, primaryButtonTextStyle, singleButtonTextStyle]);\n\n return alertVisible ? (\n <ModalBackground onPress={() => { if (isBackgroundTouchClose) setAlertVisible(false); }}>\n <KeyboardAvoidingView\n style={styles.avoidingView}\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n enabled\n >\n {content}\n </KeyboardAvoidingView>\n </ModalBackground>\n ) : null;\n}\n\nexport default AlertOverlay;\n\nconst createStyles = ({\n background,\n}: {\n background: ThemeBackground;\n}) =>\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 },\n button: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 14,\n borderRadius: 12,\n },\n avoidingView: {\n flex: 1,\n justifyContent: 'center'\n },\n contentContainer: {\n alignItems: 'center',\n backgroundColor: background.base,\n borderRadius: 22,\n paddingBottom: 18,\n paddingTop: 24,\n paddingHorizontal: 20\n },\n });\n\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ViewProps } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { BottomSheetOverlayRef } from './types';
|
|
4
4
|
interface Props extends ViewProps {
|
|
5
5
|
marginBottomBS?: number;
|
|
6
6
|
bottomSheetBackgroundColor?: string;
|
|
@@ -16,6 +16,6 @@ interface Props extends ViewProps {
|
|
|
16
16
|
showsVerticalScrollIndicator: boolean;
|
|
17
17
|
headerComponent?: React.ReactNode;
|
|
18
18
|
}
|
|
19
|
-
declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<
|
|
19
|
+
declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<BottomSheetOverlayRef>>;
|
|
20
20
|
export default _default;
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/overlay/BottomSheetOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAA0B,SAAS,EAAY,MAAM,cAAc,CAAC;AAI3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWhD,UAAU,KAAM,SAAQ,SAAS;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,EAAE,KAAK,CAAC,SAAS,CAAC;IACtC,4BAA4B,EAAE,OAAO,CAAC;IACtC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC;;AAoJD,wBAA8C"}
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
|
2
2
|
import { StyleSheet, Dimensions, Keyboard } from 'react-native';
|
|
3
3
|
import { GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
4
4
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
5
|
-
import
|
|
5
|
+
import useBottomSheetOverlay from './model/useBottomSheetOverlay';
|
|
6
6
|
import ContentsComponent from './ui/ContentsComponent';
|
|
7
7
|
import { useTheme } from '../../model/useThemeProvider';
|
|
8
8
|
import ViewAtom from '../../ui/atoms/ViewAtom';
|
|
@@ -10,9 +10,9 @@ import { ZSView } from '../../ui';
|
|
|
10
10
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
11
11
|
const DEFAULT_BORDER_RADIUS = 24;
|
|
12
12
|
const BS_MAX_HEIGHT = Dimensions.get('window').height - 80;
|
|
13
|
-
function
|
|
13
|
+
function BottomSheetOverlay(props, ref) {
|
|
14
14
|
const { marginBottomBS = 15, bottomSheetPadding = 20, bottomSheetBackgroundColor, closeOffset = Dimensions.get('window').height, contentsGestureEnable = true, isHandleVisible = true, bottomSheetMarginX = 10, isBottomRadius = true, isScrollView = true, maxHeight = BS_MAX_HEIGHT, bottomSheetComponent, showsVerticalScrollIndicator, headerComponent } = props;
|
|
15
|
-
const { HANDLE_HEIGHT, bottomSheetVisible, bsAnimatedStyle, onGestureEvent, handleVisible, onTapEvent, openPosition, screenWidth, screenHeight, panGestureRef, listScrollPosition, bsModalBgStyle, backgroundPressHandler } =
|
|
15
|
+
const { HANDLE_HEIGHT, bottomSheetVisible, bsAnimatedStyle, onGestureEvent, handleVisible, onTapEvent, openPosition, screenWidth, screenHeight, panGestureRef, listScrollPosition, bsModalBgStyle, backgroundPressHandler } = useBottomSheetOverlay({
|
|
16
16
|
bottomSheetPadding,
|
|
17
17
|
closeOffset,
|
|
18
18
|
contentsGestureEnable,
|
|
@@ -87,5 +87,5 @@ const createStyles = ({ background, }) => StyleSheet.create({
|
|
|
87
87
|
height: '100%',
|
|
88
88
|
},
|
|
89
89
|
});
|
|
90
|
-
export default forwardRef(
|
|
90
|
+
export default forwardRef(BottomSheetOverlay);
|
|
91
91
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/overlay/BottomSheetOverlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAa,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAElE,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;AAkB3D,SAAS,kBAAkB,CAAC,KAAY,EAAE,GAAqC;IAC7E,MAAM,EACJ,cAAc,GAAG,EAAE,EACnB,kBAAkB,GAAG,EAAE,EACvB,0BAA0B,EAC1B,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,EAC7C,qBAAqB,GAAG,IAAI,EAC5B,eAAe,GAAG,IAAI,EACtB,kBAAkB,GAAG,EAAE,EACvB,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,IAAI,EACnB,SAAS,GAAG,aAAa,EACzB,oBAAoB,E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wardRef, useImperativeHandle, useMemo } from 'react';\nimport { StyleSheet, Dimensions, ViewProps, Keyboard } from 'react-native';\nimport { GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';\nimport Animated, { FadeIn, FadeOut } from 'react-native-reanimated';\nimport useBottomSheetOverlay from './model/useBottomSheetOverlay';\nimport { BottomSheetOverlayRef } from './types';\nimport ContentsComponent from './ui/ContentsComponent';\nimport { useTheme } from '../../model/useThemeProvider';\nimport { ThemeBackground } from '../../theme';\nimport ViewAtom from '../../ui/atoms/ViewAtom';\nimport { ZSView } from '../../ui';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nconst DEFAULT_BORDER_RADIUS = 24;\nconst BS_MAX_HEIGHT = Dimensions.get('window').height - 80;\n\ninterface Props extends ViewProps {\n marginBottomBS?: number;\n bottomSheetBackgroundColor?: string;\n bottomSheetPadding?: number;\n closeOffset?: number;\n contentsGestureEnable?: boolean;\n isHandleVisible?: boolean;\n bottomSheetMarginX?: number;\n isBottomRadius?: boolean;\n maxHeight?: number;\n isScrollView?: boolean;\n bottomSheetComponent: React.ReactNode;\n showsVerticalScrollIndicator: boolean;\n headerComponent?: React.ReactNode;\n}\n\nfunction BottomSheetOverlay(props: Props, ref: React.Ref<BottomSheetOverlayRef>) {\n const {\n marginBottomBS = 15,\n bottomSheetPadding = 20,\n bottomSheetBackgroundColor,\n closeOffset = Dimensions.get('window').height,\n contentsGestureEnable = true,\n isHandleVisible = true,\n bottomSheetMarginX = 10,\n isBottomRadius = true,\n isScrollView = true,\n maxHeight = BS_MAX_HEIGHT,\n bottomSheetComponent,\n showsVerticalScrollIndicator,\n headerComponent\n } = props;\n\n const {\n HANDLE_HEIGHT,\n bottomSheetVisible,\n bsAnimatedStyle,\n onGestureEvent,\n handleVisible,\n onTapEvent,\n openPosition,\n screenWidth,\n screenHeight,\n panGestureRef,\n listScrollPosition,\n bsModalBgStyle,\n backgroundPressHandler\n } = useBottomSheetOverlay({\n bottomSheetPadding,\n closeOffset,\n contentsGestureEnable,\n bottomSheetMarginX,\n isHandleVisible,\n });\n\n const { palette: { background } } = useTheme();\n const { bottom, top } = useSafeAreaInsets();\n\n const styles = useMemo(\n () => createStyles({ background }),\n [background]\n );\n\n useImperativeHandle(ref, () => ({\n handleVisible,\n }));\n\n return bottomSheetVisible && bottomSheetComponent ? (\n <Animated.View\n style={[styles.modalBg, bsModalBgStyle]}\n entering={FadeIn.duration(50)}\n exiting={FadeOut.duration(50)}\n onTouchEnd={backgroundPressHandler} // 외부 터치 시 시트 닫기\n >\n <GestureHandlerRootView style={styles.rootViewWrapper}>\n <GestureDetector gesture={onGestureEvent}>\n <Animated.View\n onTouchEnd={(e) => {\n e.stopPropagation();\n Keyboard.dismiss(); // 키보드 숨김\n }}\n style={[\n styles.sheet,\n {\n width: screenWidth,\n height: screenHeight,\n left: bottomSheetMarginX,\n right: bottomSheetMarginX,\n borderTopLeftRadius: DEFAULT_BORDER_RADIUS,\n borderTopRightRadius: DEFAULT_BORDER_RADIUS,\n borderBottomLeftRadius: isBottomRadius ? DEFAULT_BORDER_RADIUS : 0,\n borderBottomRightRadius: isBottomRadius ? DEFAULT_BORDER_RADIUS : 0,\n backgroundColor: bottomSheetBackgroundColor || background.base,\n },\n bsAnimatedStyle, // 애니메이션 스타일 적용\n ]}\n >\n {isHandleVisible && (\n <ZSView style={[styles.handleContainer, { height: HANDLE_HEIGHT }]}>\n <ViewAtom style={styles.handle} />\n </ZSView>\n )}\n\n <GestureDetector gesture={onTapEvent}>\n <ContentsComponent\n HANDLE_HEIGHT={HANDLE_HEIGHT}\n panGestureRef={panGestureRef}\n listScrollPosition={listScrollPosition}\n openPosition={openPosition}\n marginBottomBS={marginBottomBS}\n screenHeight={screenHeight}\n bottomSheetComponent={bottomSheetComponent}\n bottomSheetPadding={bottomSheetPadding}\n maxHeight={maxHeight - bottom - top - marginBottomBS - bottomSheetMarginX}\n isScrollView={isScrollView}\n showsVerticalScrollIndicator={showsVerticalScrollIndicator}\n headerComponent={headerComponent}\n paddingHorizontal={bottomSheetPadding}\n />\n </GestureDetector>\n </Animated.View>\n </GestureDetector>\n </GestureHandlerRootView>\n </Animated.View>\n ) : null;\n}\n\n\nconst createStyles = ({\n background,\n}: {\n background: ThemeBackground;\n}) =>\n StyleSheet.create({\n modalBg: {\n position: 'absolute',\n width: Dimensions.get('window').width,\n height: Dimensions.get('window').height,\n bottom: 0,\n },\n sheet: {\n position: 'absolute',\n zIndex: 9000,\n overflow: 'hidden',\n },\n handleContainer: {\n width: '100%',\n alignItems: 'center',\n paddingTop: 13,\n },\n handle: {\n backgroundColor: background.layer2,\n width: 50,\n height: 4,\n borderRadius: 2,\n },\n rootViewWrapper: {\n width: '100%',\n height: '100%',\n },\n });\n\nexport default forwardRef(BottomSheetOverlay);\n"]}
|
|
@@ -6,7 +6,7 @@ interface Props {
|
|
|
6
6
|
isHandleVisible: boolean;
|
|
7
7
|
bottomSheetMarginX: number;
|
|
8
8
|
}
|
|
9
|
-
declare function
|
|
9
|
+
declare function useBottomSheetOverlay({ bottomSheetPadding, closeOffset, contentsGestureEnable, bottomSheetMarginX, isHandleVisible, }: Props): {
|
|
10
10
|
HANDLE_HEIGHT: number;
|
|
11
11
|
bottomSheetVisible: boolean;
|
|
12
12
|
bsAnimatedStyle: {
|
|
@@ -39,5 +39,5 @@ declare function useBottomSheetNotify({ bottomSheetPadding, closeOffset, content
|
|
|
39
39
|
};
|
|
40
40
|
backgroundPressHandler: () => void;
|
|
41
41
|
};
|
|
42
|
-
export default
|
|
43
|
-
//# sourceMappingURL=
|
|
42
|
+
export default useBottomSheetOverlay;
|
|
43
|
+
//# sourceMappingURL=useBottomSheetOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBottomSheetOverlay.d.ts","sourceRoot":"","sources":["../../../../src/overlay/BottomSheetOverlay/model/useBottomSheetOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAoBpE,UAAU,KAAK;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,iBAAS,qBAAqB,CAAC,EAC7B,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,GAChB,EAAE,KAAK;;;;;;;;;;;;;;;;;;;4BAiJK,OAAO;;;;;;;;;;;;;EAsFnB;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -16,7 +16,7 @@ const timingConfig200 = {
|
|
|
16
16
|
duration: 200,
|
|
17
17
|
easing: Easing.inOut(Easing.quad),
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function useBottomSheetOverlay({ bottomSheetPadding, closeOffset, contentsGestureEnable, bottomSheetMarginX, isHandleVisible, }) {
|
|
20
20
|
const handleHeight = isHandleVisible ? HANDLE_HEIGHT : 0;
|
|
21
21
|
const { width: windowWidth } = useWindowDimensions();
|
|
22
22
|
const panGestureRef = useRef(Gesture.Pan());
|
|
@@ -218,5 +218,5 @@ function useBottomSheetNotify({ bottomSheetPadding, closeOffset, contentsGesture
|
|
|
218
218
|
backgroundPressHandler,
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
export default
|
|
222
|
-
//# sourceMappingURL=
|
|
221
|
+
export default useBottomSheetOverlay;
|
|
222
|
+
//# sourceMappingURL=useBottomSheetOverlay.js.map
|